Creation of a chatbot
For our hands on portion of our project we created a program that was similar to the chatbot ELIZA.
ELIZA was one of the first chatbots that acted as a psychotherapist and would convey conversation with a person.
This program was often mistaken for being a human being, and we want to try and recapture the essence of this by creating a chatbot in which says "intelligent" responses that would be similar to a humans. (Good to note that ELIZA and this program do NOT pass the Turing Text because a person does not have the idea that it could be a program before talking to it and that is essential if a person is to be contemplating whether or not it is a human being, here they would have no reason to believe it is otherwise at the beginning)
We created this program all from scratch with just general insight after looking at other chatbots and how we may formulate a chatbot that would seem like a human. We used the concept of Rogarian therapy in our situation also
that would in some cases restate a person's sentence to get them to convey more ideas.
We used simple logic that looked for keywords in a sentence and according to those followed a series of steps. If it does not find a keyword in the sentence, it then generates a somewhat intelligent question or response to at least
say something. Our program also would look for a keyword of a type of animal and if it didn't find another other sort
of keyword besides that an animal, it would open up a text
file that contained random responses about that animal
as well as the number of responses. It takes the number of responses and then chooses at random which response
it will prompt to the user.
Here is an example of a text document used:
Our program utilizes this and has a series of 27 text files with a random number of responses.
This approach in using text files will allow a programmer to actually add to ELIZA's knowledge about certain aspects
of an animal, or add other animals and things to a program that can be accessed through fstream calls. This will allow ELIZA to actually add to her knowledge and we even made a function that would allow a person to add other text
files, or animals to her knowledge and even add to pre-existing text files. Along with this ELIZA will store your username that you use and actually remember your name and whether or not she has rememberd you.
Along with this type of call, our other function calls utilize the rand function which will give a different response every once in awhile if a user were to type it in again. Therefore if you ask ELIZA if she likes an animal and then ask if she likes another animal or that same one again, she can decide at that moment ( rand() ) whether or not she does and
it will change from time
to time (like real people). ELIZA also knows animal sounds, random things about animals like said before, watches to see if you are being nice or mean in your responses to her, and can keep a generally
intelligent conversation going.
The program will then continue to run until a person says goodbye, quit, or another keyword showing that the user
is done talking with ELIZA.
In our approach, we didn't have to worry about dealing with "I", "you", "me", and other subject words because ELIZA doesn't use that part of a sentence, calls a text file that already has a preset response, and usually uses "you" or "I" in the correct format if asking a question or stating something that it feels. We did have to do a swap in which we switched out what a person would say and inputted the correct subject words, but this was only utilized in our "is"
and "are" function calls that would manipulate the sentence to ask "Why is it" or "Why are" and then the rest of the person's inputted sentence.
Here are some conversation examples (Click to make larger):
Conversation 1: Click to enlarge Conversation 2: Click to enlarge
Conversation 3: Click to enlarge
Downloadable ZIP File
> ELIZA.zip
We hope that you enjoy playing with our program and have fun adding to ELIZA's knowledge. A read me file is inside
along with the EXE to run the program. Enjoy.
> Top
|