Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

image text in transcribed

image text in transcribed

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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems For Advanced Applications 18th International Conference Dasfaa 2013 Wuhan China April 22 25 2013 Proceedings Part 2 Lncs 7826

Authors: Weiyi Meng ,Ling Feng ,Stephane Bressan ,Werner Winiwarter ,Wei Song

2013th Edition

3642374492, 978-3642374494

More Books

Students also viewed these Databases questions

Question

a. What are S, F, and P?

Answered: 1 week ago

Question

What is the environment we are trying to create?

Answered: 1 week ago

Question

How can we visually describe our goals?

Answered: 1 week ago