An Augmented Transition Network in LambdaMOO


Background

This is an extremely experimental project, in fact I just coded it up over one weekend, so don't be surprised at the lack of depth or docuemenation. My attempt was to create a Augemented Transition Network parser for use by the tutor system. There are presently only 4 network strcutres. The Sentence, Question, Noun Phrase, and Verb Phrase. The parts of speech include Article, Verb, Noun, and Question Word.

First, an overall view. The New Parsing Tutor is my testbed for the ATN. If you say anything in the room, the tutor takes the sentence and parses it.

Sample Trace:
Player: say This is a sentence.
MOO: (Tutor)#1498:tell({"This", "is", "a", "sentence."})
MOO: (Grammar)#1486:parse("This is a sentence")
MOO: (Sentence)#1489:start(sentence object containing sentence, after this called sent_obj)
MOO: (Sentence)#1489:NounPhrase2(sent_obj)
MOO: (NounPhrase)#1493:start(sent_obj)
MOO: (NounPhrase)#1493:Article1(sent_obj) // Returns false, "This" is not an article
MOO: (NounPhrase)#1493:Noun2(sent_obj) //Also returns fail, "This" is not a noun
MOO Output (after returning to #1498:tell with fail): Invalid Sentence!

Parsing

As you can see from the trace, whenever execution goes into a parse network, the start verb on that object is called. See the graphic for a pictoral representation of the entire network.

To follow the example trace, start at the first bubble of the sentence network. the only arc coming out is the NounPhrase arc, so NounPhrase:start is called. Then go to the left-most bubble of the NounPhrase network. First go through the Article arc. Since that is a terminal, it is inside the NounPhrase object. Since that fails, go to the other arc which also fails, completing the invalid trace.

Important Objects

#1486 (Grammar)

The overall parser, includes the lexicon and the parsing function. Children of this function include the networks and any newly created sentences.

Important Properties

lexicon - lexicon of words the known by the parser. It is one big list with a list for each word in the lexicon.
The form of the words are:
{"word", "part of speech"}
Parts of speech include Noun, Question Word, Verb, and Article
TODO - Add entries for root word, number, and gender (for a deeper parser)
TODO - Add more parts of speech

Subject - The subject of the sentence.

Verb - The main verb of the sentence.

Question Word - The question word in the sentence

Sentence Location - The location in the sentence that the parser is at in the present sentence

Important Verbs

parse ( list words_to_parse)
Example call: #1486:parse({"This", "is", "the", "sentence", "to", "parse"})
Return value: {0 or 1, sentence_object}
The first value in the list is if the sentence parsed correctly or not, the second is a newly created child of grammar that stores the sentence structure. Be sure to delete this sentence in your function or you may have problems with space later on!

Known Bug - It fails to parse correctly if there is punctuation.

addWord ( word, type_of_speech )
Example call: #1486:addWord("Granite", "Noun")
Return value: None (Always add something)
TODO - Make sure that Noun and noun are the same type of speech
TODO - See lexicon (Add more lexicon entries)
TODO - More error checking
TODO - Make some front ends for the function (graphical and text)

All other verbs and properties in this objects were failed attempts, you can remove them at your leisure

#1489 (Sentence)

This stores the sentence network structure. For a graphical representation of all structures see this picture. Each arc represents a function in this object. (Same with VerbPhrase, and NounPhrase as well) To do more through checking for number and gender, change these functions.

#1490 (VerbPhrase)

#1491 (Question)

This object is around only for archival purposes, it is not being used by the present state of the ATN.

#1493 (NounPhrase)

#1498 (New Parsing Tutor)

This tutor is what I used to test the network parser. You can say things to it to see if it is a valid sentence in the grammar.

Important Verbs

tell
This is the overriding function of tell to send the sentence to the parser. It breaks apart any words used in say and responds if it is a valid sentence or not.

The long to do list:


Most of my information on Augmented Network Parsers came from Luger and Stubblefield's Artificial Intelligence Third Edition published in 1998, pgs 534-543. Also of interest are some Winter Quarter 1998 lecture notes from Georgia Tech's CS4344/7344 Natural Language Understanding by Computer taught by Kurt Eisett and Jen Holbrook. More NLP Links.

Return to the Geology Explorer Programming Nanual