Author
Topic: the ELIZA Project (Read 521 times)

me and my teacher finished understanding how ELIZA code works... it took us a few hours and we used vWatch debugger for that...so now i plan to modify ELIZA code - change her replies to certain keywords and add some more keywords with replies of there own...the main idea is to take ELIZA and make here more like A FRIEND that you can TALK to rather than a "psychologist" that you go to play a psychotherapy game

i've already changed some of the replies and added a keyword of my own ("problem") so now i give you the code to check and give me feedback on what to add or change in ELIZA replies and keywords...

i hope we can make ELIZA (maybe change her name?) a better and more friendly chatbot to chat with...:) ron77

okay :(after being awake all night long drinking cups of coffee and coding i give you an example of an ELIZA chatbot with completely different keywords and replies this is just a demo on how ELIZA can be changed to something else then a cold psychologist game... of course there are bugs in the replies that my drain brain can't find right now but this code works... let me know what you think and kindly write here your thoughts opinions feedback... and if you wish to help it will be much appreciated... together we can... make ELIZA better for the 21th century :)

When I overhauled ELIZA 4 years ago, I separated the "Data Script" part from the "Player" part and got rid of having to track and associate keywords indexs with reply indexes in even more DATA statements. That gets done with loading the Player with a script.

So ELIZA, the personality, that replies to certain keywords in "her" style became just one record or script of many you could load into the Player and chat with.

Basically you create a KeyWord Symbol and phrase prompt like:> Helloand then a list of < replies under it in the Data Script file.< Hey what's your problem?< Hi, nice to hear from you again.< Oh God, you again?

You could even do multiple Keywords with same set of replies:> Hello> Hi> Hey, what's up?< Hey what's your problem?< Hi, nice to hear from you again.< Oh God, you again?

When you tell the Player which Data Script file to play, it opens the file and loads the keywords in an array that also tracks the first and last reply index while loading the replies into another array.

Of course you still have challenge of reversing the I to You: "Conjugates" and using the * sections where Eliza takes something in clients last statement and mirrors it back along with her style reply. But separating the Script from the Player sures frees up your time from having to track all those indexes every time you want to change or add keywords and replies.

hello bplus! nice to hear from you and thank you for your suggestion...

so if i understand what your saying i should separate the data type to a data script - DO YOU MEAN LIKE HAVING A TEXT FILE WHICH IS $INCLUDE TO THE PROGRAM AND THAT IS USED BY THE "PLAYER" (ELIZA PROGRAM) AS A DATABASE? OR DATA SET OF SOME SORT??? I REMEMBER YOUR CHAT BOT THAT LEARNS WHAT TO REPLY BY THE USER THAT USES A TEXT FILE AS A DATABASE...IS THAT WHAT YOU MEAN? AND IF NOT CAN YOU GIVE ME SOME CODE EXAMPLE TO LEARN WHAT YOU MEAN?

Well apparently I read in the replies first until I hit a keyword(s) K: symbol, at which time I had a start index and stop index for the replies to store with the keyword(s).

G: was the greeting from the entityY: is how the entity referred to YouC: is how the enty referred to itselfS: were conjucate pairsR: reply one or many before the keywordK: keyword and you could have more than one associated to same set of repliesE: ? everything else, BS for when no keyword found? (I forgot, ...wait E stands for End of course!)

Ha! between Eliza and Player I worked on a mystic encounter with AZILE (Eliza backwards), apparently the first thing I started screwing with was the conjucates!? ? nope, I was adding more arrays:

I’ve worked, and helped others work, on various chat bots many times over the years. My primary advice for creating them is:

1) Understand the structure of a standard sentence.2) Utilize a large set of lists of words which correspond to the various structures.

If you can do those 2 things, you can make your bot however complex you want it to become.

For example, let’s say I type in a sentence like, “I like cheese,” for a bot to respond to.

Basic sentence structure gives us 3 things, based off:

Quote

noun — a person, place or thingpronoun — a word used in place of a nounverb — an action wordadjective/adverb — a describing wordpreposition — word used to show a relationconjunction — a joining wordinterjection — short word of emotiondeterminer — word used before a noun to show what the noun refers to ("Do you own any books?")

Pronoun — “I”.Verb — “like”.Noun — “cheese”.

Now, just run a suitable response based on one of those identified segments.

“What else do you (verb)?” — Replace “like” with “eat”, “throw”, “fart”, or any other verb, and the structured response still seems valid.

i'm trying to do a simple thing - instead of loading data from ELIZA code itself i've moved the data to a text file called "eliza data.txt" and i'm trying to load (open "eliza data.txt" for input as #1)and then i try to do the for loops of ELIZA to load the data from the text file to the arrays of the chatbot but i get an error "out of bound" or something... in short it doesn't work

Hi Ron, have you accounted for the gaps in eliza data . text. When you run the first for loop = x = 1 to N1, you will get the first 36 pieces of data from eliza data.text- the next loop you are expecting to begin at data item 37 but that has no text value and could throw off the count of loop controls.

so here is a 2nd version of ELIZA that uses text file "eliza data2.txt" as a basic database... later today i'll have a lesson with my teacher and i hope we will learn from bplus code example - THANK YOU BPLUS! :)