<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Accelerated Text - Medium]]></title>
        <description><![CDATA[Tables, charts, pictures are all useful in understanding our data but often we need a description — a story to tell us what are we looking at. Accelerated Text is a natural language generation tool which allows you to define data descriptions and then generates multiple versions - Medium]]></description>
        <link>https://medium.com/accelerated-text?source=rss----6423a1dcf8f8---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Accelerated Text - Medium</title>
            <link>https://medium.com/accelerated-text?source=rss----6423a1dcf8f8---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 04:31:47 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/accelerated-text" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The precise ambiguity of talking about numbers]]></title>
            <link>https://medium.com/accelerated-text/the-precise-ambiguity-of-talking-about-numbers-e47f77190b39?source=rss----6423a1dcf8f8---4</link>
            <guid isPermaLink="false">https://medium.com/p/e47f77190b39</guid>
            <category><![CDATA[naturallanguagegeneration]]></category>
            <category><![CDATA[nlg]]></category>
            <category><![CDATA[open-source]]></category>
            <dc:creator><![CDATA[Žygimantas Medelis]]></dc:creator>
            <pubDate>Tue, 07 Jul 2020 13:41:23 GMT</pubDate>
            <atom:updated>2021-09-07T05:50:41.759Z</atom:updated>
            <content:encoded><![CDATA[<p>We talk numbers a lot. Numerical information is used to describe facts, identify opportunities, measure performance, and forecast the future. As with all the language things, we barely pay attention to the feats we are pulling off when doing them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3HVQPycaxecwgCBQ" /><figcaption>Photo by <a href="https://unsplash.com/@markusspiske?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Markus Spiske</a> on <a href="https://unsplash.com/?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Often, when we communicate a numerical fact, we do not report a precise number. We say things like: “almost all” instead of 98.3%, “over a 100” instead of 103, “under an hour” instead of 56 minutes. What is remarkable is that we deploy this imprecision with remarkable accuracy.</p><p>My goal here is to unpack this unnoticed complexity in the way we communicate with numbers. Thus, showing what it takes for a natural language generation system — like the <a href="https://github.com/tokenmill/accelerated-text">Accelerated Text</a> open-source data to text platform we are building — to be able to express numeric information adequately.</p><p>What we do when we talk numbers is a generalization and pruning out the information which is not relevant. We make numbers seemingly ambiguous. By introducing this numeric ambiguity, we signal to our readers what is important. Take two examples:</p><ol><li>The PAP is a slick political machine, its share of the popular vote has never dipped below 60%. Last time around, in 2015, it won almost 70% of the popular vote.</li><li>Florida reported 122,960 Covid-19 cases on Friday, up 7.8% from a day earlier, compared with an average increase of 4.1% in the previous seven days.</li></ol><p>In the first example, the reporter is rightly signaling that it is irrelevant if PAP won 69.5% or 67.14% of the votes. In this context, it truly does not matter. Suppose the reporter had used the precise number. In that case, we’d think this is important and try to figure out why shifting our attention from the vital fact that PAP is a slick political machine consistently winning elections by a lot to some irrelevant factoid. The second example uses precise numbers because there every number counts. The pandemic is followed closely, and there is a huge difference between “almost 8%” and “7.8%”. However, news articles would rarely use higher precision numbers like 7.822%. Those belong in an article published in the scientific journal.</p><p>Thus we deploy this numeric vagueness with high precision and context sensitivity.</p><p>Let’s unpack what happens when we say “almost 70%”. While the actual number coming from the vote-counting is 67.9%. Successful communication has to inform, not mislead or confuse. <a href="https://en.wikipedia.org/wiki/Paul_Grice">Paul Grice</a> formulated a series of maxims defining what it takes for our utterances to be meaningful. <a href="https://en.wikipedia.org/wiki/Cooperative_principle#Maxim_of_quantity">One of the maxims</a> says that we should only provide as much information as needed. Any excess in the provided information has a possible negative impact on our message being understood as intended.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WJ6e0fHr_KmMO89B" /></figure><p>Therefore, when we say “almost 70%,” we are following Gricean maxim. The precise percentage of votes won is the information we do not need. 70% does not depart from the truth with “almost” added for good measure. It could even be argued that “almost” is not needed because any round percentages, be it 10% or 70%, are anyways perceived as approximated. In our particular example of landslide election results, we are allowed to apply even more coarse-grained approximations talking in thirds and halves, allowing me to truthfully state that over two-thirds of the electorate voted for PAP.</p><p>Generalization is another tool we employ to make ourselves as informative as possible. Generalization helps us to group the facts into representative clusters. We do not have to deal with individual data points but with fewer distinct groups of those data points through generalization. This way, someone at the receiving end of our message does not have to do the labor of analyzing and grouping the provided information. Thus when reporting on the weather outside, I could say “hot” — no matter the actual temperature as long as it is within fuzzy bounds of temperatures starting at 29C and ending somewhere at 35C. The same goes for the example with election results. It does not matter what is the precise number in the vicinity of 70%. What matters is that the result over two-thirds of the vote represents a landslide victory.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wxt-ypqt5uK7dFXl" /></figure><p>Even though we have the numbers, it might look like we’d be in a better position to provide exact values and allow the other party to use it as they see fit. It is not the right way we convey numerical information. That is if we do not seek to confuse and misinform the other party. The two elements discussed above: The Gricean “no less, no more” rule and the generalization principle, allow us to convey numerical information where we trade precision for increased clarity of our message. We also do not force extra labor on our audience by making them figure out what cluster of relevant values a given number belongs to.</p><p>When constructing such numeric messages, one does a couple of things. First, given the actual number — a data point — choose which value to provide in the message. A conversion from actual value to a given value has to be performed. The crux of the decision here is the granularity or the scale of generalization. Are we counting at increments of 10, thus ending up with a given value of 70%? Or generalization at the level of thirds is good enough, and we are good to go with two-thirds. Once this generalization step is done, one has to hedge that number. Hedges are words describing the relation between actual and a given value. These are our “under,” “over,” “around” words.</p><p>In addition to those two steps, we sometimes apply the third maneuver. Converting some numbers to their non-numeric expressions — favorite words: “third,” “half,” “all,” “dozen.” We do all the steps effortlessly. We want to embed it into our message with a high sensitivity to the context and the desired meaning. When this process of numeric approximation production needs to be automated in the natural language generation system, what comes effortlessly for us proves to be a task of high complexity for the machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*YL_ur7xN8a4fjUdF" /><figcaption>Photo by <a href="https://unsplash.com/@revolt?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">REVOLT</a> on <a href="https://unsplash.com/s/photos/typewriter?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>A system automatically generating numerical approximations would need to work with the following concepts:</p><p><em>Actual Value — </em>a number that needs to be approximated. Like the precise vote count result — 68.83%.</p><p><em>Given Value</em> — a number that gets reported as 70%.</p><p><em>Generalization scale — </em>to be used for approximation. This scale splits the range of the numbers used in a given domain into groups which are represented by a single digit. Those generalization scales will differ from domain to domain. For example:</p><ul><li>When we deal with percentages, a generalization scale might be steps of 10% so that whatever is the actual percentage we report around 10, 20, …, 100 percent.</li><li>When dealing with money rounding to available denominations could be a way to go: $1, $2, $5, $10,…, $100.</li><li>In other cases, we might want to adopt the “one quarter” generalization step and snap our actual value to “a quarter”, “a half”, “two-thirds”, and “all”.</li></ul><p><em>Hedge — </em>a common use word describing the relation between <em>actual</em> and <em>given</em> values. <em>Actual Value</em> of 9.5 is below the <em>Given Value</em> of 10. <em>Actual Value</em> of 101 is over a <em>Given Value</em> of 100.</p><p><em>Favorite Number — </em>to express some common language names for certain numbers. A 0.25 is a favorite number in that, that it has the name — a quarter.</p><p>The above concepts can be easily addressed with a bit of software engineering. The challenge, though, lies in choices. Which generalization scope to use? Am I good to report a 7.8% increase in disease cases, or is it 7.81%? Maybe “close to 8%” will do a better job of conveying the message. That hedge word — why “close”? “Around” might be just as good.</p><p>Those decisions are on an altogether different plane of complexity compared to constructing the necessary building blocks of the numerical approximations. We have built and <a href="https://github.com/tokenmill/numberwords">open-sourced a library</a> to help in constructing messages containing numerical information. The challenge of addressing the context-sensitive choice of generalization and hedge word selection remains to be addressed.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e47f77190b39" width="1" height="1" alt=""><hr><p><a href="https://medium.com/accelerated-text/the-precise-ambiguity-of-talking-about-numbers-e47f77190b39">The precise ambiguity of talking about numbers</a> was originally published in <a href="https://medium.com/accelerated-text">Accelerated Text</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[No Code — a perfect fit for Natural Language Generation]]></title>
            <link>https://medium.com/accelerated-text/no-code-a-perfect-fit-for-natural-language-generation-bbe3027d22ed?source=rss----6423a1dcf8f8---4</link>
            <guid isPermaLink="false">https://medium.com/p/bbe3027d22ed</guid>
            <category><![CDATA[text-generation]]></category>
            <category><![CDATA[nlg]]></category>
            <category><![CDATA[naturallanguagegeneration]]></category>
            <category><![CDATA[no-code]]></category>
            <dc:creator><![CDATA[Žygimantas Medelis]]></dc:creator>
            <pubDate>Tue, 12 May 2020 07:55:11 GMT</pubDate>
            <atom:updated>2020-05-12T08:06:09.746Z</atom:updated>
            <content:encoded><![CDATA[<h3>No Code — a perfect fit for Natural Language Generation</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xGrSy_O64T2S_dh4" /><figcaption>Harley 647, Piscis Magnus</figcaption></figure><p>Natural Language Generation is an exciting technology with applications in chat-bots, story generation, and data descriptions to name a few. Types of industries where automation of the text production is needed are just as broad: virtual assistants, newsrooms, e-commerce, finance. The need is everywhere, where some kind of data has to be communicated to a human being. The consumers of the text introduce yet another dimension across which the nuances of the text generation multiply. One type of text is needed for a subject matter expert. Completely the other for someone who only has to be informed about the event.</p><p>It might look like the task of building a fully automated text generation system that could successfully navigate its way towards an informative and meaningful text is as difficult as finding some of the <a href="https://hitchhikers.fandom.com/wiki/Babel_Fish">oddest things in the universe</a>. Yet a useful NLG system should not strive to remove the human author from the generation process altogether. No one is better than some of us at building the narrative structure: the idea and progression of what needs to be communicated. Thus a good NLG system should provide instruments for the author to construct the structure of the narrative, and let the machine realize it by choosing concrete words and how they fit into multiple versions of the sentence.</p><h3>Colorless green ideas sleep furiously</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ebblnSipI5mWNPkxhfiXfg.jpeg" /><figcaption>Photo by Daniel Giannone on Unsplash</figcaption></figure><p>Different applications, domains, readers all of this requires that a writing machine — be it me or, someone silicon-based — adopts matching communication goals and ways to express those goals. Let us say we have a task to automatically generate text describing weather conditions:</p><p><em>temperature</em>: -2C, <em>humidity</em>: 40%, <em>pressure</em>: 996 mHg, <em>wind</em>: 3 m/s.</p><p>Within this, seemingly simple context, we have endless possible variations in descriptive text. A few takes on possible expressions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/849/1*PGADo2BwJxgR30SRvrGJrg.png" /></figure><p>Given this rich variety in ways to produce the text, what kind of abstractions and algorithms will have to find their way into the natural language generator which produces both syntactically correct and meaningful text?</p><h3>What does the wooden floor have in common with the wind?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*saS2qmxJ1D0WJkAsdGXT2g.jpeg" /><figcaption>Photo by Markus Spiske on Unsplash</figcaption></figure><p>To start with domain knowledge and understanding have to be represented in a fully functional NLG system. What is a “strong wind”? In a maritime context, it might be in the range of 10 to 12 m/s. While in the context of construction site this range would be better described as a “severe wind”. Let’s take a very different example — we want to describe flooring in one of the real estate objects on sale. The data says that the kitchen floor has tile flooring and the first floor has wooden flooring. The first one is “durable” while the second might be “cozy” material. Therefore in order to generate text we have to understand the nuances of the relevant area of application.</p><p>Furthermore, what if the flooring on both floors is wooden? A real estate agent will probably not lose a customer if she writes: “Ground floor has a cozy wooden floor and the first floor has the cozy wooden floor”, but it is odd. “Wooden flooring throughout the house” conveys the important information much more efficiently. But that means that somewhere in the text production system there has to be a reasoner which understands that “ground floor” plus “first floor” combines into all the floors there are in the house.</p><p>Then there is more. Should the ship captain see the sentence about temperature first, or is it the wind speed which is more important? The choice might even be dynamic. Is the crew at the end of it’s shift? Is the ship now at the approach to the port and critical information must be made prominent?<br>Or take a brochure about the hotel for the would-be traveler. When generating text for it, should we mention kids’ attractions first? What if a reader of our holiday proposal has no kids? The best strategy, in this case, would be to mention the pub with a welcome drink first.</p><p>And there is <a href="https://en.wikipedia.org/wiki/Natural-language_generation">more</a> and <a href="https://github.com/tokenmill/awesome-nlg">more</a>.</p><h3>No Code NLG as Augmented Writing</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sR6uB9xja-fQ6FMN" /><figcaption>Detail of a Tree of Knowledge after Diderot &amp; d’Alembert’s Encyclopédie</figcaption></figure><p>Deploying an text generation system should not be seen as having the goal of completely removing the human authorship. It is not even desirable, the questions of validity and responsibility for the expressed facts will not have good answers where every step in the text production was not touched by subject matter expert.</p><p>A note before proceeding. Within the current state of various Artificial Intelligence solutions, human operators are often placed in the loop to address issues with the reliability of AI results, and or complement shortages of the quality of available data. That “human in the loop” design is here to address shortcomings in AI deployments. In the context of text generation, keeping the author in the process of text generation is done not out of necessity to plug the gaps in the capabilities of the technology. It is the desired design.</p><p>The Natural Language Generation system should be seen more as an Augmented Writing platform. Where the author, instead of worrying about how to construct individual sentences, is working on the script of sorts (a document plan would be another term for this) defining the high-level elements of the message to be expressed. The NLG machinery behind the writer uses the story building blocks provided by the author to generate actual text.</p><p>The NLG solution in this design breaks into two parts. One, acting behind the scenes (will not be discussed here), is responsible for the realization of the text given all the input data from the augmented writer. The other is the author facing component which provides the user with the elements to construct the document plan for the to be generated text.</p><p>Following this line of thinking about text generation, the author facing document planning part of the NLG system becomes a <a href="https://medium.com/fibery/no-code-revolution-why-now-2f2bd914cb05">No Code</a> platform.</p><h3>The elements of NLG No Code</h3><p>No Code or much code but the platform must provide effective abstractions and tools to get the job done. The three augmented writing instruments, described in this section, provide a powerful and sufficient inventory for crafting a script for text production.</p><p>The central instrument in the No Code NLG toolset must be something that allows the construction of the text’s intended meaning. It is the backbone of the script. What concepts and what relations between them the text must convey? What relationships dictate the internal logic of the story? This is the area of the semantic representation. One of the available languages to talk about this is <a href="https://amr.isi.edu/">Abstract Meaning Representation</a>. As an illustration of how it works, a sentence from <a href="https://amr.isi.edu/download/amr-bank-struct-v1.6.txt">AMR Little Price corpus</a></p><blockquote>In the book it said: “Boa constrictors swallow their prey whole, without chewing it.”</blockquote><p>can be represented in a graph like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*sMDJjXe3YU90nQJlFjxhsA.png" /></figure><p>Then to deliver key terms where they have to be delivered we need to have control over the domain dictionary. There are precise terms to describe “wind” where it is critical for the safety of operations. It’s not just any “strong wind” with whatever synonyms for “strong” we can find in the Webster Dictionary.</p><p>Last but not least, the domain business rules have to be embedded somewhere within the document plan. A combination of the weather condition values will guide the types of messages to be generated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*k2NbrHb8HrX_QenbabxDDQ.png" /></figure><p>Surely other elements would be needed as well but those three allow the author to fully define a document plan which could react to the different incoming data points and produce adaptive text. The same document plan would generate text for different weather conditions and for different stakeholders in the shipping business.</p><p>NLG is a difficult technology requiring expertise in very different fields: from grammar to knowledge representation, to business rules, to domain knowledge. With No Code approach, all of that complexity can be tamed, if not completely hidden. The author working in such an Augmented Writing environment gets:</p><ol><li>Full control over the text production process.</li></ol><p>2. Gains capacity to adopt to broad range of the business requirements.</p><p>3. Most importantly can reliably generate text which precisely matches input data.</p><p>I am part of the team that are building Accelerated Text a No Code data to text the Natural Language Generation platform. You can find more information on our website <a href="https://www.acceleratedtext.com/">https://www.acceleratedtext.com/</a></p><p>The exciting part is that it is open source and you can run it yourself <a href="https://github.com/tokenmill/accelerated-text">https://github.com/tokenmill/accelerated-text</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bbe3027d22ed" width="1" height="1" alt=""><hr><p><a href="https://medium.com/accelerated-text/no-code-a-perfect-fit-for-natural-language-generation-bbe3027d22ed">No Code — a perfect fit for Natural Language Generation</a> was originally published in <a href="https://medium.com/accelerated-text">Accelerated Text</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AcceleratedText: A short guide]]></title>
            <link>https://medium.com/accelerated-text/acceleratedtext-a-short-guide-d6363a50de6a?source=rss----6423a1dcf8f8---4</link>
            <guid isPermaLink="false">https://medium.com/p/d6363a50de6a</guid>
            <category><![CDATA[text-generation]]></category>
            <category><![CDATA[nlg]]></category>
            <category><![CDATA[visual-programming]]></category>
            <category><![CDATA[no-code]]></category>
            <dc:creator><![CDATA[Šarūnas Navickas]]></dc:creator>
            <pubDate>Mon, 20 Apr 2020 08:11:26 GMT</pubDate>
            <atom:updated>2020-04-20T12:35:20.208Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article I want to introduce, that good ol’ templates are not the only option. Product itself is under intense development, many things can change along the way, but the core principle will remain the same — ability to visually define structure of text, and have machine build fluent text for you.</p><h3>Intro</h3><p>AcceleratedText — <a href="https://github.com/tokenmill/accelerated-text">https://github.com/tokenmill/accelerated-text</a> is an OpenSource tool which allows to generate text.</p><p>We define how text is to be generated in what we call a Document Plan:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/487/1*IbrwdRoKIx_j4TkQ2ff-2Q.png" /><figcaption>DocumentPlan of Restaurants</figcaption></figure><p>DocumentPlan creates a structure and custom data is usually filled from CSV (while there’s an option for direct API call with raw data)</p><h3>What are benefits versus templates?</h3><p>Templates have static structure, the only modifications can be done by changes in parameters or synonyms. If you build multiple of texts (eg. product descriptions for shop), they will end up looking identical.</p><p>AcceleratedText uses AMR (Abstract Meaning Representation) blocks. Depending on the context and AMR itself, it can have multiple representations. Having multiple AMRs in single description, creates even more variation.</p><p>In general, it is quite easy to get around 20 of unique sentences for single description. On top of that, end result is modified by our Machine Learning model, introducing even more cases.</p><p>But the most vital difference — all of this can be done in <strong>multiple of languages</strong></p><h3>Abstract Meaning Representation</h3><p>Since it is the driving force behind all AcceleratedText, lets dive a bit deeper into it.</p><p>You can read more about AMR in this specification: <a href="https://github.com/amrisi/amr-guidelines/blob/master/amr.md">https://github.com/amrisi/amr-guidelines/blob/master/amr.md</a></p><h4>Our implementation</h4><p>We took following key points as our base:</p><ul><li>AMR captures “who is doing what to whom” in a sentence</li><li>AMR is abstract, it may represent any number of natural language sentences</li></ul><p>In essence, it says <strong><em>what</em></strong> to write, not <strong><em>how</em></strong> to write.</p><p>In reality this is easier said than done, a common approach is just to have several variations representing same meaning, but having different grammatical structure.</p><p>More detailed overview and key differences in our approach can be found in Project Wiki: <a href="https://github.com/tokenmill/accelerated-text/wiki/Abstract-Meaning-Representations">https://github.com/tokenmill/accelerated-text/wiki/Abstract-Meaning-Representations</a></p><h3>Example — restaurant description</h3><p>For this example, I will be using restaurants data set, which is a part of BLEU (Bilingual Evaluation Understudy) score.</p><p>We want to create sentences like these:</p><ul><li>There is a place in the city centre, Alimentum, that is not family-friendly.</li><li>In the city centre there is a family-friendly place called Alimentum.</li><li>Located in riverside area, Alimentum restaurant is a place to bring the whole family.</li><li>If you want to take the children for a meal then try Alimentum they provide a child friendly service in their riverside setting .</li><li>Near the riverside is a kids friendly eatery called Alimentum. There is a Burger King close to it as well.</li></ul><p>Only several variables are given: restaurant name, family friendly (True or False) and location. Output needs to be expressed like sentences above.</p><h4>Main components</h4><p>Full solution consists of three components:</p><ul><li><strong>DGL</strong>— Domain Grammar Library. A very low level grammatical structure, which is compiled into concrete grammar. These are best to be left out for developers.</li><li><strong>AMR </strong>— Abstract Meaning Representation blocks. These are built using logic and grammatical patterns block</li><li><strong>Document Plan</strong> — a high level document structure, which is build using logic and AMR blocks</li></ul><p>In the most cases, user cares only about Document Plan, most of AMR and DGL blocks are already premade. For this example, we will create custom AMR blocks and build a Document Plan, will ignore DGL blocks for now.</p><p>To make it a bit clearer, we will do this example in two iterations.</p><ul><li>In first iteration using nothing but preexisting AMRs</li><li>In second — design those AMRs ourselves</li></ul><h4>1st Iteration</h4><p>Lets start with simple “Alimentum is(not) family-friendly”</p><p>First, we need to select a proper AMR:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/630/1*9Ja48Y8xPs8CJDqzl0iWqA.png" /><figcaption>Concept-Net</figcaption></figure><p>This set of AMRs is called ConceptNet (refer to <a href="https://github.com/tokenmill/accelerated-text/wiki/ConceptNet">https://github.com/tokenmill/accelerated-text/wiki/ConceptNet</a> for more information). In short, these are very low-level AMRs which (at least in theory) can cover most of possible meanings. They are not very pleasant to work with, usually it is assumed that custom AMRs will be created for specific domain (eg. Restaurants), but should get job done.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*isi08CSERU1Vanwtt-wmSw.png" /><figcaption>FamilyFriendly Segment</figcaption></figure><p>We’ve chosen “is-a” AMR. Green blocks are data (comes from CSV, or some other external sources), gray block is called “quote”, simply put — a hardcoded string. This is certainly not ideal, preferred way is dictionary item, however it will do it’s job at the moment.</p><p>Additional thing to note is “(polarity)”. Arguments between braces are optional. Polarity gives either positive (by default), or negative meaning. In this case “familyFriendly” is a boolean (true, false, 0, 1, T, F values are accepted as booleans) and can switch meaning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/632/1*aGTLFZKtDi6dHOwrHZ_6mQ.png" /><figcaption>Results</figcaption></figure><p>Voilà — we have our first result! Currently it is only in English and only single variantion.</p><p>Now we can talk about location. The most basic way would look like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*H6q1QecOM_qdglHOyIFy2A.png" /><figcaption>DocumentPlan with FamilyFriendly and Location Nodes</figcaption></figure><p>And we get the result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*EmTkLYNsoMcW4W_EfIPM9w.png" /></figure><p>We got two short sentences. Now we can add some variation. In this case, there’s no difference when to talk about family friendlyness, and when about location, because these sentences are independent. This can expressed by adding list element “in random order”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/379/1*twKM-Um2lhgSyDqq61hmqg.png" /><figcaption>DocumentPlan with randomized sequence</figcaption></figure><p>And now we generate two variants:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/1*TyJqBICiKiBJHoi7QL9onQ.png" /></figure><p>Going through data rows, we see that sometimes location needs to be specified as in relation with some other location</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/1*7Y5WlEcoarcBuxDtgJkkvw.png" /><figcaption>Data row from CSV</figcaption></figure><p>Some times we have value inside “near”, usually we don’t. Simple way is to branch these cases and use different AMRs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/341/1*la3srGmJ7Cl0PM2LGlZobg.png" /><figcaption>DocumentPlan with logical branching</figcaption></figure><p><strong><em>Note</em></strong>: if data field is not boolean, it can still be used as such. Empty — meaning <em>false</em>, having any kind of value makes it <em>true</em>.</p><p>We made the condition, if data field “near” has data — use “located-near” AMR, if it doesn’t — stay with “at-location”</p><p>Results with a row having “near”:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/449/1*jzYIgedazzGy6BvTE98JdQ.png" /></figure><p>At this point we’re generating text, but it‘s not ideal. First of all, it should be “near <strong>the</strong> Burger King”, and second, full sentence should look like “It is located in the city center near the Burger King”.</p><h4>2nd Iteration: crafting AMRs</h4><p>Again, we will start with “Alimentum is a family-friendly”, but with a little twist. There’s no use of having new AMR which does exactly what old ConceptNet was capable of.</p><p>Looking further at data set, we can see examples like these:</p><ul><li>Alimentum is not a family-friendly <em>place</em></li><li>Alimentum is not a family-friendly <em>arena</em></li><li>this is not a family-friendly <em>venue</em></li></ul><p>Digging deeper, we see, that sometimes we have item “eatType” filled which specifies type of restaurant (eg. Coffee Shop, Restaurant etc) and it should be used instead of those generic “<em>venue</em>”, “<em>place</em>”.</p><p>We can implement all of this inside AMR itself, hiding complexity from other users.</p><p>Lets start by looking at existing AMR, will use “is-a” as an example:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/347/1*HiiUFh8p6OaycMrVWLM2YQ.png" /><figcaption>is-a AMR</figcaption></figure><p>First of all, “N -&gt; a N” — this is <strong>DGL</strong>, it operates on low level grammatical structure. This one says, that it takes <em>Noun</em> and adds another <em>Noun</em>.</p><p>Second, note those red blocks. These are variables (hence “variable” at the end of block). What’s important, that if they are not implemented internally, they will be rendered as sockets in Document Plan. That’s how we get those “Subject” and “Attribute”.</p><p>Ok, now we’re going back to our original intention. We start with defining those generic values for describing place:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*u7NVt7ASPiQ6i_soE_BY0g.png" /><figcaption>AMR with variable attached</figcaption></figure><p>Blue blocks means dictionary item (hence Dict.: in front of), “_1_N” part is a bit more complicated. Number specifies <em>sense, </em>in short — same word can have different meanings depending on context, different number means different meaning. And the “N” at the end specifies part of speech.</p><p>Usually we will have:</p><ul><li>N: noun</li><li>V: verb</li><li>A: adverb</li></ul><p>Going further, we basically copy-paste “is-a” AMR, but add some bells and whistles. It can be a bit overwhelming, but don’t be afraid</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*XQ2TIR8G6i7aYGXbxLACGg.png" /><figcaption>FamilyFriendly AMR</figcaption></figure><p>First part looks identical, in second part we use “mkN” with two positions instead of single. First position is used to give plain string “family friendly”, and second position is either:</p><ul><li>“eatType” value from data if it is set</li><li>random item from “places” variable</li></ul><p>Our document plan now looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/425/1*VlhR5uGyCfZzcs4XTZQ1EA.png" /><figcaption>DocumentPlan with FamilyFriendly AMR</figcaption></figure><p>And we get far more results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*HBMxGbjtggAGul2k2xaKUg.png" /></figure><p>Another part is Location AMR</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*1eD80m1an_XnQflTa1m1Wg.png" /><figcaption>Location AMR</figcaption></figure><p>Essentially, this is a combination between “at-location” and “located-near”. It always do “at-location” part, and if “(near)” is given, it does “located-near” part.</p><p>Final Document Plan is a lot cleaner and nicer to look at</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/418/1*lWWz8QHEjTEDE-XKDY_Tfg.png" /><figcaption>Final DocumentPlan</figcaption></figure><p>Our results, while still not perfect, looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*8BmdtDdVGKYTPsRXidvjJg.png" /></figure><h3>Conclusion</h3><p>Using same techniques, more variations of text can be created, which is always good.</p><p>The big topic I haven’t touched is translations. For this we do need to create proper Dictionary Items instead of quotes (those gray blocks). At the moment this step is not possible via User Interface, manual edition of config file is required.</p><p>Don’t want to bother you with these details, though when these kind of problems are fixed, output looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/370/1*yE0IQat5DW_FvZXmKx4P9Q.png" /></figure><p>(Not quite sure if this is correct translation, but at least GoogleTranslate approves it 🙂)</p><p>Building initial Document Plan is more complicated that doing a simple template, but efforts starts bearing fruits when you want have more text variations and even different languages.</p><p>At the moment, these AMRs are still short sentences. With next release, they will be able to join into single fluent sentence automatically. That’s the good part about this approach — user cares only about telling <strong><em>what</em></strong> to say using blocks, and under the hood, backend can be improved to figure out better ways to make sentences.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d6363a50de6a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/accelerated-text/acceleratedtext-a-short-guide-d6363a50de6a">AcceleratedText: A short guide</a> was originally published in <a href="https://medium.com/accelerated-text">Accelerated Text</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>