Small copy and paste of first I/O from the project:
victor@r2d2:/clues$ ./clues
GRACE version 0.1 (on CLUES version 0.8)
<user says> What did Jack do
<Grace says> Sorry, I wasn't able to come up with an answer to that question.
<user says> Jack went to his closet and took out his new suit
Yes, I believe I understand!
<user says> What did Jack do
<Grace says> jack went to his closet and took out his new suit
<user says> What did Jefferson Davis Hogg do
<Grace says> Sorry, I wasn't able to come up with an answer to that question.
<user says> Jefferson davis hogg went to his closet and took out his new suit
Yes, I believe I understand!
<user says> what did jefferson davis hogg do
<Grace says> jefferson davis hogg went to his closet and took out his new suit
<user says>
*Note 1 - this very first sample I/O does not illustrate the power of the engine, since a very simple script with regular expressions could do this.
*Note 2 - the above is NOT using simple templates/pattern matching. Believe it or not, the bot has a complete understanding of what was said by first generating many parse trees… for *BOTH* the ‘fact’ *and* the question.
Among many parse trees, the chosen ‘fact’ parse tree Grace chose was:
pos = simple-sentence
subject.num-noun = 1
subject.noun.1.val = jack
num-predicate = 2
predicate.1.num-verb = 1
predicate.1.verb.1.val = went
predicate.1.verb.1.num-prep-phrase = 1
predicate.1.verb.1.prep-phrase.1.num-prep = 1
predicate.1.verb.1.prep-phrase.1.prep.1.val = to
predicate.1.verb.1.prep-phrase.1.num-noun = 1
predicate.1.verb.1.prep-phrase.1.noun.1.val = closet
predicate.1.verb.1.prep-phrase.1.noun.1.num-adjective = 1
predicate.1.verb.1.prep-phrase.1.noun.1.adjective.1.val = his
predicate.2.num-verb = 1
predicate.2.verb.1.val = took
predicate.2.verb.1.num-prep-phrase = 1
predicate.2.verb.1.prep-phrase.1.num-prep = 1
predicate.2.verb.1.prep-phrase.1.prep.1.val = out
predicate.2.verb.1.prep-phrase.1.num-noun = 1
predicate.2.verb.1.prep-phrase.1.noun.1.val = suit
predicate.2.verb.1.prep-phrase.1.noun.1.num-adjective = 2
predicate.2.verb.1.prep-phrase.1.noun.1.adjective.2.val = new
predicate.2.verb.1.prep-phrase.1.noun.1.adjective.1.val = his
predicate-list-type = and
Now, also for the question input, Grace also generates parse trees, and, again, using semantic inference, decides which parse tree the user really meant…
pos = simple-sentence
num-question = 1
question.1.val = what
subject.noun.1.val = jack
subject.num-noun = 1
predicate.1.num-verb = 1
predicate.1.verb.1.val = do
num-predicate = 1
predicate.1.verb.1.num-auxiliary-verb = 1
predicate.1.verb.1.auxiliary-verb.1.val = did
So with the “QPT” (question parse tree), Grace goes in and tries to find a “FTP” (fact parse tree) which can answer the question.
In the above, Grace matches the subject (subject.noun.1.val) in the FPT which is “jack”, with the subject mentioned in the QPT.
Since this is all done with FULL grammatical and semantic inference, and not by simple pattern matching, the system will evolve, and learn, to cope with extremely complex sentences and ambiguity.
For example, in the above, note that Grace knows there is one question, but we may ask : “Who or why did….” (in that case, num-question would be 2).
Next, I will be working on tests like:
“Jack went to his closet and took out his new suit because he was going to a dance given by his company”
and ask:
Where was jack going?
Did jack take out his new suit? why?
Where did jack go?
Did jack go to a dance?
Has jack ever been at a dance?
Stay tuned ! Much work ahead of me! !

RSS AI Zone




