<?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>OpenCog Brainwave &#187; chatbot</title>
	<atom:link href="http://blog.opencog.org/tag/chatbot/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.opencog.org</link>
	<description>The latest developments in building an open-source mind</description>
	<lastBuildDate>Thu, 04 Aug 2011 02:45:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Sentence Patterns</title>
		<link>http://blog.opencog.org/2009/09/08/sentence-patterns/</link>
		<comments>http://blog.opencog.org/2009/09/08/sentence-patterns/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 14:54:23 +0000</pubDate>
		<dc:creator>Linas Vepstas</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Introduction]]></category>
		<category><![CDATA[Theory]]></category>
		<category><![CDATA[chatbot]]></category>
		<category><![CDATA[IRC]]></category>
		<category><![CDATA[NLP]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[question answering]]></category>
		<category><![CDATA[RelEx]]></category>

		<guid isPermaLink="false">http://opencog.wordpress.com/?p=139</guid>
		<description><![CDATA[I've recently resumed work on the question-answering chatbot, and am trying to get it to comprehend a broader range of questions and statements.   The "big idea" is to create a number of "sentence patterns" that the pattern matcher can ...]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently resumed work on the question-answering chatbot, and am trying to get it to comprehend a broader range of questions and statements.   The &#8220;big idea&#8221; is to create a number of &#8220;sentence patterns&#8221; that the pattern matcher can recognize and respond to.  The reason this is a &#8220;big&#8221; idea is because I am trying to avoid anything algorothmic or procedural &#8212; everything is to be done by specifying OpenCog hypergraphs, and NOT by writing C++ code, or <a href="http://www.gnu.org/software/guile/guile.html">scheme</a> code (or python code&#8230;etc). The reason for working entirely with patterns and hypergraphs, rather than with C++ or scheme, is because this puts the &#8220;knowledge&#8221; of the system into a form that AI routines can manipulate it: learning algos can learn new hypergraphs; statistical algos can gather usage information on which hypergraphs get triggered, and so on.  This is all easer said than done: although I&#8217;ve eliminated a fair amount of question-answering code previously written in C++, I&#8217;ve also had to write some new scheme code. Bummer. <img src='http://blog.opencog.org/wp-includes/images/smilies/icon_sad.gif' alt=':-(' class='wp-smiley' /> </p>
<p>Patten matching is now used through-out all of the OpenCog NLP pipeline, although not in a unified manner. The <a href="http://www.abisource.com/projects/link-grammar/">Link Grammar parser</a> uses patterns (called &#8220;disjuncts&#8221;) to determine how the words in a sentence can link to one-another, thus &#8220;parsing&#8221;, or pulling the grammatical structure out of a sentence (<a href="http://www.cs.cmu.edu/afs/cs.cmu.edu/project/link/pub/www/papers/ps/tr91-196.pdf">this paper</a> provides an excellent overview). The <a href="http://opencog.org/wiki/RelEx">RelEx dependency relation extractor</a> applies patterns on the link-grammar output  to extract syntactic relations. For example, the sentence &#8220;John threw a rock&#8221; becomes</p>
<blockquote><p>_obj(throw, ball)<br />
_subj(throw, John)</p></blockquote>
<p>after RelEx gets done with it. And now, there are a dozen patterns inside of OpenCog that can pick out certain kinds of questions and statements from RelEx output, and pattern-match questions to find answers to them.</p>
<p>For example, the new OpenCog patterns convert &#8220;The capital of France is Paris&#8221; into</p>
<blockquote><p>capital_of(France, Paris)</p></blockquote>
<p>and similarly, &#8220;What is the capital of France?&#8221; into</p>
<blockquote><p>capital_of(France,what)</p></blockquote>
<p>Treating &#8220;what&#8221; as a variable, there is yet another pattern that matches up the form of the question to the form of the answer, thus deducing that &#8220;what&#8221; must be &#8220;Paris&#8221;.</p>
<p>Somewhat harder is using patterns to distinguish similar from dis-similar concepts, so that sentences like &#8220;John threw a green ball&#8221; aren&#8217;t used as answers to questions such as &#8220;Did John throw a red ball?&#8221;: the word &#8220;ball&#8221; with modifier &#8220;green&#8221; has to be detected as a different entity than the word &#8220;ball&#8221; with modifier &#8220;red&#8221;: these are two different entities (called &#8220;semes&#8221; in the code).  In fact, out of laziness, I&#8217;ve punted on this one: the promotion of word-instances to &#8220;semes&#8221; is done by code, rather than by pattern matching. But soon, I hope, this will change. In the meanwhile, the <a href="http://buildbot.opencog.org/doxygen/d7/d41/opencog_2nlp_2seme_2README-source.html">README file</a> provides a more detailed discussion.</p>
<p>Here are some patterns that work these days:</p>
<blockquote><p>&lt;me&gt;         John threw a green ball.<br />
&lt;me&gt;         Fred threw a red ball<br />
&lt;me&gt;         Mary threw a blue rock<br />
&lt;me&gt;         who threw a ball?<br />
&lt;cogita-bot&gt; Syntax pattern match found: Fred John<br />
&lt;me&gt;         who threw a red ball?<br />
&lt;cogita-bot&gt; Syntax pattern match found: Fred</p>
<p>&lt;me&gt;         Did Fred throw a ball?<br />
&lt;cogita-bot&gt; Truth query determined &#8220;yes&#8221;: throw</p>
<p>&lt;me&gt;         Did Fred throw a red ball?<br />
&lt;cogita-bot&gt; Truth query determined &#8220;yes&#8221;: throw</p>
<p>&lt;me&gt;         The color of the book is red.<br />
&lt;me&gt;         What is the color of the book?<br />
&lt;cogita-bot&gt; Triples abstraction found: red</p>
<p>&lt;me&gt;         the cat sat on the mat<br />
&lt;me&gt;         what did the cat sit on?<br />
&lt;cogita-bot&gt; Triples abstraction found: mat</p></blockquote>
<p>And here are some that don&#8217;t yet work: &#8220;Did Fred throw a green ball?&#8221; &#8212; gets no reply, because the system can&#8217;t find an answer, and doesn&#8217;t make the common-sense leap of &#8220;can&#8217;t find answer-&gt; answer must be no&#8221;.  Another common-sense problem is illustrated by: &#8220;Did Fred throw a round ball?&#8221; &#8212; the system doesn&#8217;t know that balls are round, and simply assumes that a &#8220;round ball&#8221; is some special kind of &#8220;ball&#8221;.  Oh well. There&#8217;s work to be done.</p>
<p>You can try out the chatbot yourself (when its up, and not broken!) on the IRC chat channel #opencog on the freenode.net chat servers.</p>
<p>&#8211; Linas Vepstas</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.opencog.org/?flattrss_redirect&amp;id=139&amp;md5=291d34897fe55a736594b581aaa5a47f" title="Flattr" target="_blank"><img src="http://blog.opencog.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.opencog.org/2009/09/08/sentence-patterns/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>proto-chatbot at last!</title>
		<link>http://blog.opencog.org/2009/04/28/proto-chatbot-at-last/</link>
		<comments>http://blog.opencog.org/2009/04/28/proto-chatbot-at-last/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 02:22:07 +0000</pubDate>
		<dc:creator>Linas Vepstas</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Meta]]></category>
		<category><![CDATA[Theory]]></category>
		<category><![CDATA[chatbot]]></category>
		<category><![CDATA[ConceptNet]]></category>
		<category><![CDATA[link-grammar]]></category>
		<category><![CDATA[NLP]]></category>
		<category><![CDATA[RelEx]]></category>

		<guid isPermaLink="false">http://brainwave.opencog.org/?p=114</guid>
		<description><![CDATA[A prototype chatbot demonstrates the OpenCog NLP pipeline by parsing simple statements and answering simple questions. <a href="http://blog.opencog.org/2009/04/28/proto-chatbot-at-last/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Hands-on tutorials are planned for the next month or so; we&#8217;ve already had a few on PLN, and my turn is coming up, for the opencog NLP pipeline. So I thought I&#8217;d wire up a cute demo for the occasion: a rough, crude IRC chatbot, &#8220;La Cogita&#8221;. It can answer simple questions about straightforward statements.  Nothing fancy &#8230; it doesn&#8217;t do any reasoning <strong><em>at all</em></strong> &#8230; but it can work off of the basic syntactic structure of English sentences to find answers. Thus, for example:</p>
<p><tt><br />
&lt;linas&gt; Mary ate a mango<br />
&lt;cogita-bot&gt; Hello linas, parsing ...<br />
&lt;cogita-bot&gt; linas, you made a statement: Mary ate a mango<br />
&lt;linas&gt; what did Mary eat?<br />
&lt;cogita-bot&gt; Hello linas, parsing ...<br />
&lt;cogita-bot&gt; linas, you asked a question: what did Mary eat?<br />
&lt;cogita-bot&gt; The answer to your question is: mango<br />
</tt></p>
<p>Its meant to be a demo of the basic NLP pipeline within OpenCog. It takes input text, runs it throught the <a href="http://www.abisource.com/projects/link-grammar/">Link Grammar</a> + <a href="http://opencog.org/wiki/RelEx">RelEx</a> parser, imports the results into the OpenCog atomspace, sucks in a small common-sense database, and waits for questions to be posed.  The common-sense database is derived from MIT&#8217;s <a href="http://conceptnet.media.mit.edu/">ConceptNet (OpenMind/CommonSense project)</a>, and so one can have interactions like the following:</p>
<p><tt><br />
&lt;linas&gt; cogita-bot: what is a saxophone?<br />
&lt;cogita-bot&gt; Hello linas, parsing ...<br />
&lt;cogita-bot&gt; linas, you asked a question:  what is a saxophone?<br />
&lt;cogita-bot&gt; No answer was found to your question.<br />
&lt;linas&gt; hmm<br />
&lt;linas&gt; cogita-bot: what is an instrument?<br />
&lt;cogita-bot&gt; Hello linas, parsing ...<br />
&lt;cogita-bot&gt; linas, you asked a question:  what is an instrument?<br />
&lt;cogita-bot&gt; The answer to your question is: woodwind r bass harmonica An_Oboe Oboe megaphone saxophone chronometer drum scale ukulele cymbal instrument<br />
&lt;linas&gt; Heh. Complete with assorted linguistic garbage <img src='http://blog.opencog.org/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /><br />
</tt></p>
<p>You get the idea. Don&#8217;t ask it anything more complicated than the above examples: it will fail to find any answer. Again, <em><strong>it does no reasoning at all. Its as thick as a brick</strong></em>. You can test-drive it at the #opencog channel on the freenode.net IRC network.  Assuming its not down for development.</p>
<p>Next up: wire in <a href="https://launchpad.net/nlgen">NLGen for natural-language output</a>, and start taking baby steps in actual reasoning. Anyway, I&#8217;m pretty excited, as this means that a lot of the basic bits&amp;pieces are working, and I can now dive into the deep end, and start working on the hard stuff.</p>
<p>&#8211; Linas Vepstas</p>
<p class="wp-flattr-button"></p> <p><a href="http://blog.opencog.org/?flattrss_redirect&amp;id=114&amp;md5=cffcebe95319beea22d00071f0b5efea" title="Flattr" target="_blank"><img src="http://blog.opencog.org/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded>
			<wfw:commentRss>http://blog.opencog.org/2009/04/28/proto-chatbot-at-last/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

