The classical CHAT80 natural language system

The CHAT80 system has been developed in the 70s and 80s by Fernando C.N. Pereira and David H.D. Warren. It implements a natural language question answering system that answers questions about the world: countries, cities, rivers, etc. It does so by parsing the question, translate the parse to a Prolog query and run this against its database.

This version is derived from the original via Quintus Prolog after some compatibility modifications for SWI-Prolog and adding a module header that allows using it safely together with other applications.

The code is definitely dated. Still, it provides a nice example using Prolog for parsing, assigning meaning and querying.

Legal

The copyright is as far as we know with the original authors and made available under a classical academic use license. See LICENSE in the prolog/chat80 directory. The content of that file was copied from the Python NLTK data package that includes the chat80 files.

Prolog files

pack.plShow source
prolog/chat80.plShow source
chat_answer/2Find answers for the Query.Source
chat_example/3True when Nr is the (integer) id of the tokenized Sentence and Correct is the correct answer.Source
chat_optimize/2Optimize a query.Source
chat_parse/2Perform the parsing phase of CHAT80.Source
chat_print_tree/1Print an NLP parse tree.Source
chat_process/2Process Question using chat80, resulting in Answer.Source
chat_semantics/2Translate the NLP parse tree into a Prolog query.Source
rtest_chats/1Run the test suite Times times silently.
test_chat/0Run default demo suite, showing timing and warn if the answer is incorrect.
prolog/chat80/aggreg.plShow source
prolog/chat80/border.plShow source
prolog/chat80/chat.plShow source
prolog/chat80/chatops.plShow source
prolog/chat80/chattop.plShow source
prolog/chat80/cities.plShow source
prolog/chat80/clotab.plShow source
prolog/chat80/contai.plShow source
prolog/chat80/countr.plShow source
prolog/chat80/ndtabl.plShow source
prolog/chat80/newdic.plShow source
prolog/chat80/newg.plShow source
prolog/chat80/ptree.plShow source
prolog/chat80/qplan.plShow source
prolog/chat80/readin.plShow source
prolog/chat80/rivers.plShow source
prolog/chat80/scopes.plShow source
prolog/chat80/slots.plShow source
prolog/chat80/talkr.plShow source
prolog/chat80/templa.plShow source
prolog/chat80/world0.plShow source
prolog/chat80/xgrun.plShow source