Write an Eliza program in Python3. The program should be called eliza.py, and it should run from the command line with no arguments.
Your program should engage in a dialogue with the user, with your program Eliza playing the role of a psychotherapist. Your program should be able carry out "word spotting", that is it should recognize certain key words and respond simply based on that word being present in the input. It should also be able to transform certain simple sentence forms from statements (from the user) into questions (that Eliza will ask). Also, try to personalize the dialogue by asking and using the user's name.
Here's the start of an example dialogue...
eliza.py
-> [eliza] Hi, I'm a psychotherapist. What is your name?
=> [user] My name is Bridget.
-> [eliza] Hi Bridget. How can I help you today?
=> [Bridget] I want to rule the world.
-> [eliza] Bridget, why do you want to rule the world? [transform statement into ?]
=> [Bridget] I don't know, I think I crave power.
-> [eliza] Why don't you tell me more about your cravings. [word spot "crave" and respond.]
=> [Bridget] ...
Your program should be robust. If the user inputs gibberish or a very complicated question, Eliza should respond in some plausible way (I didn't quite understand, can you say that another way, etc.)
This program should rely heavily on the use of regular expressions, so please make sure to review some introductory material in Python, or some other source before attempting this program.
Eliza examples:
- start emacs and run "M-x doctor"
- eliza on the web
- another eliza on the web
Specification Write an Eliza program in Python3. The program should be called eliza.py, and it should run from the command line with no arguments. Your program should engage in a dialogue with the user, with your program Eliza playing the role of a psychotherapist. Your program should be able carry out "word spotting", that is it should recognize certain key words and respond simply based on that word being present in the input. It should also be able to transform certain simple sentence forms from statements (from the user) into questions (that Eliza will ask). Also, try to personalize the dialogue by asking and using the user's name. Here's the start of an example dialogue... eliza.py -> [eliza] Hi, I'm a psychotherapist. What is your name? => [user] My name is Bridget. -> [eliza] Hi Bridget. How can I help you today? => [Bridget] I want to rule the world. -> [eliza] Bridget, why do you want to rule the world? [transform statement into ?] [Bridget] I don't know, I think I crave power. -> [eliza] Why don't you tell me more about your cravings. [word spot "crave" and respond.] => [Bridget] ... Your program should be robust. If the user inputs gibberish or a very complicated question, Eliza should respond in some plausible way (I didn't quite understand, can you say that another way, etc.) This program should rely heavily on the use of regular expressions, so please make sure to review some introductory material in Python, or some other source before attempting this program. Eliza examples: start emacs and run "M-x doctor" eliza on the web another eliza on the web Programming Assignment Grading Rubric Assignment Name : Was the program designed and implemented individually* without consulting any sources beyond those referred to in class or on the class web page? If any code from these sources has been used, was it properly attributed? (YES or NO) If NO, the score will be 0, and overall course grade reduced 10%. **REMINDER** There should be no discussion of the problem or your solution with anyone except the instructor until after the assignment deadline. Does the program run without errors AND produce output in the form required by the assignment*? (YES or NO) If NO, the score will be 0 and no further conditions checked. *A program that only produces diagnostic output or output not relevant to the assignment will receive a NO. If YES, the program will be graded on the following 5 conditions: 1) Overall comment at start of program - a clear and concise introduction that has three components: 1) describe the problem to be solved well enough so that someone not familiar with our class could understand, 2) give actual examples of program input and output, along with usage instructions, and 3) describe the algorithm you have used to solve the problem, specified in a stepwise or point by point fashion. Your introduction should also include identifying information your name, date, etc.) 2 points max. 2) Detailed comments throughout code that fully explain details of algorithm. Implementation must work as described and solve problem correctly to get credit for detailed comments. 3 points max. 3) Correct results automatically produced by running the program as specified in the assignment 5 points max. Other comments may be found on the back - please turn over to check. Specification Write an Eliza program in Python3. The program should be called eliza.py, and it should run from the command line with no arguments. Your program should engage in a dialogue with the user, with your program Eliza playing the role of a psychotherapist. Your program should be able carry out "word spotting", that is it should recognize certain key words and respond simply based on that word being present in the input. It should also be able to transform certain simple sentence forms from statements (from the user) into questions (that Eliza will ask). Also, try to personalize the dialogue by asking and using the user's name. Here's the start of an example dialogue... eliza.py -> [eliza] Hi, I'm a psychotherapist. What is your name? => [user] My name is Bridget. -> [eliza] Hi Bridget. How can I help you today? => [Bridget] I want to rule the world. -> [eliza] Bridget, why do you want to rule the world? [transform statement into ?] [Bridget] I don't know, I think I crave power. -> [eliza] Why don't you tell me more about your cravings. [word spot "crave" and respond.] => [Bridget] ... Your program should be robust. If the user inputs gibberish or a very complicated question, Eliza should respond in some plausible way (I didn't quite understand, can you say that another way, etc.) This program should rely heavily on the use of regular expressions, so please make sure to review some introductory material in Python, or some other source before attempting this program. Eliza examples: start emacs and run "M-x doctor" eliza on the web another eliza on the web Programming Assignment Grading Rubric Assignment Name : Was the program designed and implemented individually* without consulting any sources beyond those referred to in class or on the class web page? If any code from these sources has been used, was it properly attributed? (YES or NO) If NO, the score will be 0, and overall course grade reduced 10%. **REMINDER** There should be no discussion of the problem or your solution with anyone except the instructor until after the assignment deadline. Does the program run without errors AND produce output in the form required by the assignment*? (YES or NO) If NO, the score will be 0 and no further conditions checked. *A program that only produces diagnostic output or output not relevant to the assignment will receive a NO. If YES, the program will be graded on the following 5 conditions: 1) Overall comment at start of program - a clear and concise introduction that has three components: 1) describe the problem to be solved well enough so that someone not familiar with our class could understand, 2) give actual examples of program input and output, along with usage instructions, and 3) describe the algorithm you have used to solve the problem, specified in a stepwise or point by point fashion. Your introduction should also include identifying information your name, date, etc.) 2 points max. 2) Detailed comments throughout code that fully explain details of algorithm. Implementation must work as described and solve problem correctly to get credit for detailed comments. 3 points max. 3) Correct results automatically produced by running the program as specified in the assignment 5 points max. Other comments may be found on the back - please turn over to check