<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>mitcho.com &#187; natural syntax</title>
	<atom:link href="http://mitcho.com/blog/tag/natural-syntax/feed/" rel="self" type="application/rss+xml" />
	<link>http://mitcho.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 02:04:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>Exploring Command Chaining in Ubiquity: Part 2</title>
		<link>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/</link>
		<comments>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 23:14:07 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[Chinese]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Japanese language]]></category>
		<category><![CDATA[Mandarin]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[natural syntax]]></category>
		<category><![CDATA[serial verb construction]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2799</guid>
		<description><![CDATA[Introduction I recently have begun giving serious thought to what command chaining might look like in Ubiquity and the various considerations which must be made to make it happen. The &#8220;command chaining,&#8221; or &#8220;piping,&#8221; described here always involves (at least) two verbs acting sequentially on a passed target—that is, the first command performs some action [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/link/ubiquity-in-italian/' rel='bookmark' title='Ubiquity in Italian'>Ubiquity in Italian</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>

<p>I recently have begun giving serious thought to what <strong>command chaining</strong> might look like in Ubiquity and the various considerations which must be made to make it happen. The &#8220;command chaining,&#8221; or &#8220;piping,&#8221; described here always involves (at least) two verbs acting sequentially on a passed target—that is, the first command performs some action or lookup and the second command acts on the first command&#8217;s output.</p>

<p>A few days ago I penned some initial <a href="http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/">technical considerations regarding command chaining</a>. In this post I&#8217;ll be point out some linguistic considerations involved in supporting a <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural syntax</a> for chaining.</p>

<p><span id="more-2799"></span></p>

<h3>Simple syntaxes: sequential vs embedding strategies</h3>

<p>When it comes to creating a natural language interface, there&#8217;s always a decision to make between requiring a certain kind of input, or working a little harder to understand the user&#8217;s natural input. From an implementation point of view, adopting certain programmatic conventions is of course simpler and to this end, there have been a couple different &#8220;unnatural&#8221; command chaining syntaxes suggested. While these both go against Ubiquity&#8217;s basic tenet of <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural syntax</a> — that is, to not introduce rules which contradict the user&#8217;s natural language — which gives Ubiquity its strengths of usability and memorability, I&#8217;ll entertain them here as they illustrate two different structural relationships that we will want to consider.</p>

<p><a href='http://www.threadless.com/product/543/This_is_not_a_Pipe?streetteam=mitcho'><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/not-pipe.gif" alt="not-pipe.gif" border="0" width="480" height="329" /></a></p>

<p>The first suggestion is to adopt the <a href="http://en.wikipedia.org/wiki/Pipeline_(Unix)">shell pipe</a> (|), which would lead to input such as</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ubiquity" style="font-family:monospace;">translate hello to Spanish | email to Jono</pre></td></tr></table></div>


<p>While this itself is pretty unnatural unless you speak shell, note that this syntax is similar to the more natural &#8220;, and&#8221; syntax, yielding <code>translate hello to Spanish, and email to Jono</code>, which we will consider below. I&#8217;ll refer to this strategy as the <strong>sequential</strong> strategy.</p>

<p>Another <a href="http://www.croczilla.com/blog/16">very interesting proposal</a> by Alex Fritze is to embed each subordinate computation into an argument position, marked by parentheses. This could also be parsed relatively straightforwardly by writing a noun type which first checks for parentheses and then runs the content of the argument through another <a href="http://ubiquity.mozilla.com/trac/ticket/532">ParseQuery</a>.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
</pre></td><td class="code"><pre class="ubiquity" style="font-family:monospace;">email (translate hello to Spanish) to Jono</pre></td></tr></table></div>


<p>I&#8217;ll refer to this pattern as the <strong>embedding</strong> strategy.</p>

<h3>Sequential and embedding strategies in natural language</h3>

<p>What&#8217;s interesting about the two proposals above is that both strategies are seen in natural language. The sequential strategy could correspond to the following linguistic phenomena:</p>

<ol>
<li><a href="http://en.wikipedia.org/wiki/coordination (linguistics)">coordination</a>: a non-hierarchical joining of two or more <a href="http://en.wikipedia.org/wiki/clauses (linguistics)">clauses</a>, often marked by a <a href="http://en.wikipedia.org/wiki/conjunction">conjunction</a>. Here&#8217;s an example from English:

<ul>
<li>&#8220;[I made a sandwich] and [you will eat it]&#8221; where [] represent clause boundaries. Here, &#8220;and&#8221; is the conjunction.</li>
</ul></li>
<li><a href="http://en.wikipedia.org/wiki/serial verb construction">serial verb</a> and <a href="http://en.wikipedia.org/wiki/converb">converb</a> constructions: a joining of multiple verbs or verb phrases within a single clause, with shared subject and tense/aspect values, with no particular conjugation or delimiter between them. Such constructions are common in many African and east Asian languages. Here are two examples:<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup><br/></li>
</ol>

<ul><li>A converbal construction in Japanese:<br/>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
4
5
</pre></td><td class="code"><pre class="ja" style="font-family:monospace;">僕は     サンドイッチを 作って     食べる
boku-wa sandiʔchi-o  tsuku-ʔte tabe-ru
I-TOP   sandwich-ACC make-CON  eat</pre></td></tr></table></div>


<br/>&#8220;I (will) make a sandwich and eat [it].&#8221; (Here, `TOP` = topic, `ACC` = accusative, `CON` = converbal ending)[^3]</li>
<li>A serial verb construction in Mandarin Chinese:<br/>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>6
7
8
</pre></td><td class="code"><pre class="zh" style="font-family:monospace;">我 作   三明治      吃
wǒ zùo  sānmíngzhì chī
I  make sandwich   eat</pre></td></tr></table></div>


<br/>&#8220;I (will) make a sandwich and eat [it]&#8221; or &#8220;I (will) make a sandwich [in order to] eat [it].&#8221;</li></ul>

<p><br/>Note that in both the converb and serial verb construction, the second verb (eat) takes shares its object (sandwich) with the first verb and there is no need for a pronoun such as &#8220;it&#8221; to introduce that argument as it is with coordination, above.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>

<p>The embedding strategy is observed in natural language as well, in the form of the following phenomena:</p>

<ol>
<li><a href="http://en.wikipedia.org/wiki/embedded clauses">embedded clauses</a>: a sentence is itself the argument of another verb. Example:<br/></li>
</ol>

<ul><li>&#8220;John says [he likes sandwiches].&#8221;</li></ul>

<p><br/>Embedded clauses, however, clearly have no relation to command chaining and does not require our attention.
2. <a href="http://en.wikipedia.org/wiki/relative clauses">relative clauses</a>: a partial sentence<sup id="fnref:5"><a href="#fn:5" rel="footnote">3</a></sup> is attached to a noun in order to describe it or distinguish it from other possible referents. Example:</p>

<ul><li>&#8220;You ate the sandwich that I made&#8221; where &#8220;sandwich&#8221; is called the &#8220;head&#8221; of the relative clause, and &#8220;I made&#8221; is what I here call the &#8220;partial sentence&#8221; (see footnote). The &#8220;relative clause&#8221; is used here to distinguish &#8220;the sandwich that I made&#8221; from other sandwiches.</li></ul>

<h3>The natural syntax of chaining</h3>

<p>So <strong>which strategy is used in complex natural language commands:</strong> the sequential strategy or the embedding strategy? Both the sequential strategy and embedding strategy can be involved with commands:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9
10
</pre></td><td class="code"><pre class="en" style="font-family:monospace;">[Make a sandwich] and [eat it]!
Eat (the sandwich that I made)!</pre></td></tr></table></div>


<p>These two commands do not mean the same thing, though, and only (9) is the kind of command we would want to give Ubiquity. The problem with relative clauses, as in (10), is that it <em><a href="http://en.wikipedia.org/wiki/presupposition">presupposes</a> the existence of the sandwich in the context</em>. If we both know you just made a sandwich, saying (10) is perfectly appropriate, but out of the blue it doesn&#8217;t make sense. For this reason, <strong>only the sequential strategy is used in the natural syntax of chaining.</strong></p>

<h3>Parsing the sequential strategy</h3>

<p>In natural language, unlike the initial simple proposals laid out above, there is often no clear delimiter marking the boundary between the two parts in a sequential relation (e.g. examples (3) and (6) above, particularly given that neither Japanese and Chinese normally break words with spaces). <strong>How would we parse a sequential string of commands?</strong></p>

<p>Let&#8217;s assume for our purposes here that we can identify find all verbs within the input string.<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> Parsing a sequential strategy string is not particularly difficult if we can also assume that the verb in any particular language is either always verb-initial or always verb-final. Let&#8217;s look at both cases:</p>

<ul>
<li>Always verb-initial: Mandarin Chinese:<br/></li>
</ul>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
12
13
</pre></td><td class="code"><pre class="zh" style="font-family:monospace;">翻譯       hello 到  西班牙語   送    給  Juanito
fānyì     hello dào xībānyáyǔ sòng gěi Juanito
translate hello to  Spanish   send to  Juanito</pre></td></tr></table></div>


<p><br/>
&#8220;Translate hello to Spanish [and] send [it] to Juanito&#8221;
  1. find every possible verb:<br/><strong>翻譯</strong>hello到西班牙語<strong>送</strong>給Juanito
  2. as every verb marks the beginning of a sentence, we now have our two commands: &#8220;<strong>翻譯</strong>hello到西班牙語&#8221; (translate hello to Spanish) and &#8220;<strong>送</strong>給Juanito&#8221; (send to Juanito).
* Always verb-final: Japanese<br/></p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>14
15
16
</pre></td><td class="code"><pre class="ja" style="font-family:monospace;">helloを スペイン語に 訳して Juanitoに 送って
hello-o supeingo-ni yakus-ite Juanito-ni oku-ʔte
hello-ACC Spanish-DAT translate-CON Juanito-DAT send-CON</pre></td></tr></table></div>


<p><br/>
&#8220;Translate hello to Spanish [and] send [it] to Juanito&#8221;
  1. find every possible verb:<br/>helloをスペイン語に<strong>訳して</strong>Juanitoに<strong>送って</strong>
  2. as every verb marks the end of a sentence, we now have our two commands: &#8220;helloをスペイン語に<strong>訳して</strong>&#8221; (translate hello to Spanish) and &#8220;Juanitoに<strong>送って</strong>&#8221; (send to Juanito).</p>

<p>For languages where there is a clear conjunction between the two commands, such as English &#8220;and&#8221;, we can also use that conjunction as a delimiter as well. We then simply execute the first command and then execute the second with the first command&#8217;s output in its interpolation context. This way the output of the first command will be picked up both by an overt pronoun such as &#8220;it&#8221; in the second command and without it, such as in the Chinese and Japanese examples above.<sup id="fnref:6"><a href="#fn:6" rel="footnote">5</a></sup></p>

<p>The only potential problem with this approach is in the case of languages where some commands are verb-initial while others are verb-final. I note that such languages do exist in a previous blog post, <a href="http://mitcho.com/blog/observation/wheres-the-verb/">Where&#8217;s The Verb</a>. In these languages, commands can be expressed by more than one verb form (such as infinitive, imperative, subjunctive, etc.) and some of those verb forms are sentence-initial while others are sentence-final. Here&#8217;s one such example from German:</p>

<p>&#8220;search hello with google&#8221; (German)
1. Infinitive: hello mit google suchen
2. Imperative: suche hello mit google</p>

<p>Here the verb for &#8220;search&#8221; is &#8220;suchen&#8221; (infinitive) or &#8220;suche&#8221; (imperative). I know that this same type of phenomena occurs in other Germanic languages such as Dutch with infinitive and imperative and also other languages such as Modern Greek with infinitive and subjunctive forms. <strong>If you are a speaker of one of these lanuages (German, Dutch, Greek, etc.) I would love to know whether you can chain verb-final and verb-initial commands together.</strong></p>

<h3>Conclusion</h3>

<p>In this blog post I examined command chaining in natural language, focusing on data from English, Mandarin Chinese, and Japanese, which exhibit three linguistically different approaches to chaining. What we found is that the sequential strategy—that of listing the commands one by one, in order of execution—is what is used in natural languages, rather than any sort of embedding. This fact, combined with the fact that our parser can recognize every available verb, offers a simple approach to doing a naive parse of natural command chains in most languages, even without explicit delimiters.</p>

<p>In a final installation of this series on &#8220;exploring command chaining,&#8221; I hope to consider how the Ubiquity interface itself could present command chains and aid in its input.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>The distinction between serial verb and converb constructions (as well as other forms of complex predication) hinge on structural distinctions which are not of importance for our purposes.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Some people (<a href="http://www.jstor.org/stable/4178644">Baker 1989</a> and others), in fact, list this object sharing as a necessary part of the notion of a &#8220;serial verb construction.&#8221;&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:5">
<p>&#8220;Partial sentence&#8221; is used in a descriptive sense here to reflect that the relative clause, such as &#8220;I made&#8221; in the example given cannot stand as its own sentence, as the verb&#8217;s argument is clearly missing. This type of pattern is also seen in questions (&#8220;What did [you make]?&#8221;) and topicalization (&#8220;That sandwich, [I made].&#8221;) and is a great focus of theoretical linguistics research. See <a href="http://en.wikipedia.org/wiki/wh-movement">wh-movement</a> on wikipedia for more examples and information on theoretical approaches to such constructions.&#160;<a href="#fnref:5" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:4">
<p>We don&#8217;t do this right now as there hasn&#8217;t been a use for it—right now <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2">Parser 2</a> simply looks for known verbs at the beginning and end of the input. The parser does build a nice regular expression to find known verbs, however, so finding verbs input-medially would also be easy to do, though.&#160;<a href="#fnref:4" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:6">
<p>Note that even though the linguistic relation between the two commands is non-hierarchical, we interpret the sentences to mean &#8220;translate hello to Spanish and <em>then</em> email it to Juanito&#8221;, rather than &#8220;translate hello to Spanish and email it (hello) to Juanito <em>at the same time</em>.&#8221; This observed universal property that, ceteris paribus, the linear speech order of verbs reflects the conceptual order of events is known as the Temporal Iconicity Condition (<a href="http://www.jstor.org/pss/416696">Li 1993</a> and others).&#160;<a href="#fnref:6" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/link/ubiquity-in-italian/' rel='bookmark' title='Ubiquity in Italian'>Ubiquity in Italian</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Hit List: Better Software Through Less UI</title>
		<link>http://mitcho.com/blog/link/the-hit-list-better-software-through-less-ui/</link>
		<comments>http://mitcho.com/blog/link/the-hit-list-better-software-through-less-ui/#comments</comments>
		<pubDate>Wed, 25 Mar 2009 12:48:32 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[link]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[natural syntax]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[thought process]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1658</guid>
		<description><![CDATA[The Hit List is a to-do list app for Mac OS X with a beautiful interface and some nice features. Creator Andy Kim&#8217;s latest blog post (Better Software Through Less UI) is excellent reading for the Ubiquity community. He describes the thought process behind the design of a new clean and &#8220;frictionless&#8221; interface for specifying [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/' rel='bookmark' title='How natural should a natural interface be?'>How natural should a natural interface be?</a></li>
<li><a href='http://mitcho.com/blog/projects/friendlier-command-feed-subscription/' rel='bookmark' title='Friendlier command feed subscription'>Friendlier command feed subscription</a></li>
<li><a href='http://mitcho.com/blog/projects/user-aided-disambiguation-a-demo/' rel='bookmark' title='User-Aided Disambiguation: a demo'>User-Aided Disambiguation: a demo</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.potionfactory.com/thehitlist/">The Hit List</a> is a to-do list app for Mac OS X with a beautiful interface and some nice features. Creator Andy Kim&#8217;s latest blog post (<a href="http://www.potionfactory.com/blog/2009/03/10/better-software-through-less-ui">Better Software Through Less UI</a>) is excellent reading for the Ubiquity community. He describes the thought process behind the design of a new clean and &#8220;frictionless&#8221; interface for specifying how tasks are repeated. After throwing out the regular combinations and templates of different input widgets, <em>his solution was to implement a partial natural language input interface:</em></p>

<p><img src="http://www.potionfactory.com/files/blog/2009/03/repeating_task_1.png"/></p>

<blockquote>
  <p>There is no myriad of buttons and fields to choose from. All the user has to do is directly type in what he wants.</p>
</blockquote>

<p>Here are a couple other choice quotes which will ring true for the Ubiquity users and internationalization folks in the audience:</p>

<blockquote>
  <p>For this to work without driving the user mad, the natural language parser has to be near perfect. The last thing I want is for this to come out smelling like AppleScript.</p>
</blockquote>

<p><span></span></p>

<blockquote>
  <p><strong>Problems</strong><br/>This design isn&#8217;t perfect as it has two glaring problems. One is that the user has no easy way of discovering how complex the recurrence rules can be. This isn&#8217;t such a huge problem, but a way to solve this is to include a help button to show example rules or to include an accompanying iCal style UI to let the user setup the recurrence rule in a more typical fashion. I didn&#8217;t include these in the initial implementation though because I wanted to see how users would react to this kind of UI.<br/>Another problem is localization. Even if I write parsers for a few more popular languages, it won&#8217;t accommodate the rest of the users in the world. Again, the solution is an accompanying traditional UI, but for now, I&#8217;m leaving it the way it is until I get some feedback.</p>
</blockquote>

<p>There&#8217;s a trend in the wind, my friends: the incorporation of near-natural language for more <a href="http://humanized.com/weblog/2006/06/01/why_humane_is_a_better_word_than_usable/">humane</a> interfaces.</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/' rel='bookmark' title='How natural should a natural interface be?'>How natural should a natural interface be?</a></li>
<li><a href='http://mitcho.com/blog/projects/friendlier-command-feed-subscription/' rel='bookmark' title='Friendlier command feed subscription'>Friendlier command feed subscription</a></li>
<li><a href='http://mitcho.com/blog/projects/user-aided-disambiguation-a-demo/' rel='bookmark' title='User-Aided Disambiguation: a demo'>User-Aided Disambiguation: a demo</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/link/the-hit-list-better-software-through-less-ui/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>User-Aided Disambiguation: a demo</title>
		<link>http://mitcho.com/blog/projects/user-aided-disambiguation-a-demo/</link>
		<comments>http://mitcho.com/blog/projects/user-aided-disambiguation-a-demo/#comments</comments>
		<pubDate>Sat, 14 Mar 2009 06:08:24 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[ambiguity]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[Japanese language]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[natural syntax]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1572</guid>
		<description><![CDATA[A few weeks ago I made some visual mockups of how Ubiquity could look and act in Japanese. Part of this proposal was what I called &#8220;particle identification&#8221;: that is, immediate in-line identification of delimiters of arguments, which can be overridden by the user: The inspiration for this idea came from Aza&#8217;s blog post &#8220;Solving [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/' rel='bookmark' title='How natural should a natural interface be?'>How natural should a natural interface be?</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-in-firefox-japanese/' rel='bookmark' title='Ubiquity in Firefox: Focus on Japanese'>Ubiquity in Firefox: Focus on Japanese</a></li>
<li><a href='http://mitcho.com/blog/projects/friendlier-command-feed-subscription/' rel='bookmark' title='Friendlier command feed subscription'>Friendlier command feed subscription</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A few weeks ago I made some visual mockups of <a href="http://mitcho.com/blog/projects/ubiquity-in-firefox-japanese/">how Ubiquity could look and act in Japanese</a>. Part of this proposal was what I called &#8220;particle identification&#8221;: that is, immediate in-line identification of delimiters of arguments, which can be overridden by the user:</p>

<p><center><img src='http://mitcho.com/blog/wp-content/uploads/2009/02/particle-id.png'/></center></p>

<p>The inspiration for this idea came from Aza&#8217;s blog post <a href="http://www.azarask.in/blog/post/solving-the-it-problem/">&#8220;Solving the &#8216;it&#8217; problem&#8221;</a> which advocates for this type of quick feedback to the user in cases of ambiguity. Such a method would help both the user better understand what is being interpreted by the system, as well as offer an opportunity for the user to correct improper parses. I just tried mocking up such an input box using <a href="http://jquery.com">jQuery</a>.</p>

<h3>➔ <a href='http://mitcho.com/code/ubiquity/ambiguity-demo/'>Try the User-Aided Disambiguation Demo</a></h3>

<p>If you have any bugfixes to submit or want to play around with your own copy, the demo code is <a href="http://bitbucket.org/mitcho/ubiquity-parser-tng/">up on BitBucket</a>. ^^ Let me know what you think!</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/' rel='bookmark' title='How natural should a natural interface be?'>How natural should a natural interface be?</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-in-firefox-japanese/' rel='bookmark' title='Ubiquity in Firefox: Focus on Japanese'>Ubiquity in Firefox: Focus on Japanese</a></li>
<li><a href='http://mitcho.com/blog/projects/friendlier-command-feed-subscription/' rel='bookmark' title='Friendlier command feed subscription'>Friendlier command feed subscription</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/user-aided-disambiguation-a-demo/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>How natural should a natural interface be?</title>
		<link>http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/</link>
		<comments>http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 11:00:14 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[language]]></category>
		<category><![CDATA[Mozilla]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[natural syntax]]></category>
		<category><![CDATA[tasks]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=1382</guid>
		<description><![CDATA[I&#8217;m very happy to announce that, starting today, I will be working full-time on Ubiquity, a Mozilla Labs experiment to connect the web with language. I&#8217;ll be heading up research on different linguistic issues of import to a linguistic user interface and blogging about these topics here. If you&#8217;re interested, please subscribe to my blog&#8217;s [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/yarpp-3-templates/' rel='bookmark' title='Using Templates with YARPP 3'>Using Templates with YARPP 3</a></li>
<li><a href='http://mitcho.com/blog/observation/testing-googles-language-detection/' rel='bookmark' title='Testing Google&#8217;s Language Detection'>Testing Google&#8217;s Language Detection</a></li>
<li><a href='http://mitcho.com/blog/observation/%e5%8f%8e%e9%9b%86-vs-%e5%9b%9e%e5%8f%8e-and-better-word-meanings-through-usage/' rel='bookmark' title='回収 vs. 収集 and Better Word Meanings Through Usage'>回収 vs. 収集 and Better Word Meanings Through Usage</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><em>I&#8217;m very happy to announce that, starting today, I will be working full-time on <a href="http://ubiquity.mozilla.com">Ubiquity</a>, a <a href="http://labs.mozilla.com">Mozilla Labs</a> experiment to connect the web with language. I&#8217;ll be heading up research on different linguistic issues of import to a linguistic user interface and blogging about these topics here. If you&#8217;re interested, please subscribe to <a href="http://mitcho.com/blog/feed/blog-only/">my blog&#8217;s RSS feed</a> or <a href="http://mitcho.com/blog/tag/ubiquity/feed/">the RSS feed for only Ubiquity-related items</a>. Commenting is encouraged! ^^</em></p>

<p>Every day, more users are trying out Ubiquity, the Mozilla Labs experiment that lets users accomplish common Internet tasks faster through a natural language interface. As we live more and more of our lives on the web, there is a huge appeal to—and need for—a faster way to access and mashup our information.</p>

<p>But what exactly do we mean by a &#8220;natural language interface&#8221;? Is it just another programming language with lots of English keywords? Should the final goal be a computer that understands everything we tell it?</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/02/ubiqhal2.jpg" alt="Ubiquity is not HAL" title="I'm sorry Dave, I'm afraid I can't do that." width="650" height="220" /></p>

<p>As we think about the future directions and possibilities of Ubiquity, we need to go back to our roots and understand the project&#8217;s motivations. With that in mind, here are some initial thoughts on the advantages of a natural language interface. The ultimate goal here is to refine the notion of natural language interface and to come up with a set of principles that we can follow in pushing Ubiquity further, into other languages and beyond.</p>

<p><span id="more-1382"></span></p>

<h3>Why language?</h3>

<p>In his <a href="http://doi.acm.org/10.1145/1330526.1330535">2008 article in interactions</a>, <a href="http://azarask.in">Aza</a> describes a clear need for modern UI to move beyond monolithic do-everything apps into efficient, granular commands that can be connected to accomplish tasks. Hierarchical menus with an application&#8217;s every possible function are great for discoverability, but slow and inefficient as they grow. Aza advocates for the use of a familiar subset of natural language to this end. In his own words,</p>

<blockquote>
  <p>Words can capture abstractions that pictures cannot because language has an immense amount of descriptive and differentiating power. Abstract thoughts are exactly represented by the words that give them names. It is this power that comes to the rescue in specifying functionality.</p>
</blockquote>

<p>In other words, language gives us the descriptive power to succinctly and creatively express our will, far faster than a series of menus, and with more freedom than a series of shortcuts or gestures. In addition, by tapping into the lexicon of our every day language, we make a direct attack on the learnability problem.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<h3>The natural syntax test</h3>

<p>The ability to string different commands together is not a novel one—indeed, this is what more traditional command lines and programming languages offer. However, these technologies present a huge barrier to the layperson, even for languages with many keywords from English or English-like syntax.</p>

<p>Programming languages can be such teases in this way. Often the first bits of code in a language look remarkably similar to natural language (<a href="http://en.wikipedia.org/wiki/Python">Python</a>):</p>


<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">&quot;Hello World&quot;</span></pre></div></div>


<p>&#8230;but the young coder is quickly disappointed:</p>


<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #008000;">map</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> x: x<span style="color: #66cc66;">*</span><span style="color: #ff4500;">2</span>, <span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span>,<span style="color: #ff4500;">2</span>,<span style="color: #ff4500;">3</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span></pre></div></div>


<p><a href="http://en.wikipedia.org/wiki/AppleScript">AppleScript</a> is a language which tries to take this idea further and, indeed, sometimes AppleScript code constitutes readable English.</p>


<div class="wp_syntax"><div class="code"><pre class="applescript" style="font-family:monospace;"><span style="color: #0066ff;">print</span> pages <span style="color: #000000;">1</span> <span style="color: #ff0033;">thru</span> <span style="color: #000000;">5</span> <span style="color: #ff0033; font-weight: bold;">of</span> <span style="color: #0066ff;">document</span> <span style="color: #000000;">2</span></pre></div></div>


<p>Dig a little deeper, though, and AppleScript also fails the &#8220;natural syntax&#8221; test. In fact, it can be argued that a language that <em>looks</em> like a natural language but differs in some important details can be even more difficult to use than one that is completely novel. Bill Cook, one of the original developers of <a href="http://en.wikipedia.org/wiki/AppleScript">AppleScript</a>, makes this point in <a href="http://www.cs.utexas.edu/~wcook/Drafts/2006/ashopl.pdf">his history of AppleScript</a>: &#8220;in hindsight, it is not clear whether it is easier for novice users to work with a scripting language that resembles natural language, with all its special cases and idiosyncrasies.&#8221;</p>

<p><strong>If the interface&#8217;s syntax is too restrictive or, worse, conflicts with a user&#8217;s natural intuitions about their natural language, it immediately fails to be &#8220;natural&#8221;, no matter how similar the keywords or grammar is.</strong><sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>

<h3>Towards a natural (and forgiving) syntax</h3>

<p>Aza similarly laments the relegation of text-based interfaces to the higher echelons of geekdom in his 2008 paper: &#8220;if commands were memorable, and their syntax <em>forgiving</em>, perhaps we wouldn&#8217;t be so scared to reconsider these interface paradigms.&#8221;</p>

<p>The key word &#8220;forgiving&#8221; above (emphasis mine) is two-ways ambiguous, both of which we want a natural language interface to be:</p>

<ol>
<li><em>Forgiving</em> as in &#8220;not difficult to learn and remember&#8221;: the syntax must be easy and natural for the user, encouraging experimentation and intuitive application;</li>
<li><em>Forgiving</em> as in &#8220;not correcting or prescriptive&#8221;: the system should try its darndest to accept the user&#8217;s input, even if it&#8217;s not the most &#8220;well-formed.&#8221;</li>
</ol>

<p>From an implementation point of view, (2) above can also be an advantage. There are many grammatical restrictions in natural language which, as long as the command is unambiguous, Ubiquity need not enforce on the user. Take, for example, the two statements:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="ubiquity" style="font-family:monospace;">print two copy
print two copies</pre></td></tr></table></div>


<p>I feel that Ubiquity should execute both of these statements with equal ease. The numeral &#8220;two&#8221; makes the user&#8217;s intent very clear, even though the plural of &#8220;copy&#8221; should indeed be &#8220;copies.&#8221; It need not be the job of the interface to decide whether a sentence is &#8220;correct English.&#8221; By assuming that the user is trying to communicate a valid and possible task, rather than throwing up an error, the system will be more flexible and more forgiving in the inevitable case of human error. <strong>The ultimate goal should be to help the user accomplish their task.</strong></p>

<h3>Conclusion</h3>

<p>By developing a language interface which truly <em>feels</em> natural to the user, we can successfully bring the power of text-based interfaces to the masses. I feel the key to this &#8220;natural-ness&#8221; is a less restrictive and in fact <em>forgiving</em> syntax. While this goal akin to <a href="http://en.wikipedia.org/wiki/natural language programming">natural language programming</a> may be daunting from an implementation angle, and it may indeed prove impossible, as long as the goal is to execute simple imperative commands, the scope of the target syntactic structures is limited.</p>

<p>Ubiquity as it stands is many different things for many people. The natural language guidelines above may feel too restrictive to many current developers for whom Ubiquity is simply a convenient new way to extend Firefox.<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> This discussion also seems orthogonal to the <a href="http://www.azarask.in/blog/post/can-ubiquity-be-used-only-with-the-mouse/">mouse-based Ubiquity experiments</a>. <strong>As users and developers, how do you feel about the potential benefits and downsides of these natural syntax guidelines?</strong> In the coming days I&#8217;ll look at some concrete examples of what this &#8220;forgiving&#8221; syntax would demand of Ubiquity.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>The learnability problem of a linguistic interface, particularly in light of the usability vs. discoverability paradigm, is a topic for a future post. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> &#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>It&#8217;s important to note that the &#8220;restrictions&#8221; I&#8217;m concerned with here are syntactic ones, not lexical ones. That is, if either of the Ubiquity commands below fail because we don&#8217;t have a &#8220;pass&#8221; verb, that&#8217;s fine. But if Ubiquity can only allow one string but not the other, that&#8217;s a syntactic restriction which goes against our English intuition.


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="ubiquity" style="font-family:monospace;">pass Jono the ball
pass the ball to Jono</pre></td></tr></table></div>




I&#8217;ll cover this in a future post.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>In fact, I myself am also guilty of this&#8230; my <a href="http://mitcho.com/code/select/">select command</a> for SQL queries clearly does not encourage a natural language-compatible syntax.&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/yarpp-3-templates/' rel='bookmark' title='Using Templates with YARPP 3'>Using Templates with YARPP 3</a></li>
<li><a href='http://mitcho.com/blog/observation/testing-googles-language-detection/' rel='bookmark' title='Testing Google&#8217;s Language Detection'>Testing Google&#8217;s Language Detection</a></li>
<li><a href='http://mitcho.com/blog/observation/%e5%8f%8e%e9%9b%86-vs-%e5%9b%9e%e5%8f%8e-and-better-word-meanings-through-usage/' rel='bookmark' title='回収 vs. 収集 and Better Word Meanings Through Usage'>回収 vs. 収集 and Better Word Meanings Through Usage</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
	</channel>
</rss>

