My chatbot

I have an unusual chatbot that I’ve been working on for ages. I think that it’s approach is an improvement over AIML. I’d like to briefly explain how it works and see what you guys think.

This chatbot has a simple understanding of sentence structure and individual words. There are 2 main text files that hold most of this information, one for nouns and the other for the rest of the sentence that I call a template.

Here’s an example. I’ll leave out the details. Bob types “I am tired”. “am” is changed to “is” and a matching template is found:

* is *, handle_attribute_statement,1, 3

That template refers to a statement that assigns an attribute of some kind to something or someone, in this case Bob. A suitable function is called using the first and third word of the sentence as parameters. In that function, “tired” is looked up and is found to be a state:

tired > class: state

That information that Bob typed is added to the database using the following line:

#2 > state: tired

The #2 refers to Bob since the bot has previously assigned him an ID number.

Some time later the bot can ask “are you still tired?

If you would like to look at the files, they can be found here:

https://github.com/micro222/chatbot

The template file is templates2.txt. The noun file, or main database is general.txt

John

submitted by /u/micro222
[link] [comments]


Posted

in

by

Tags: