Java lab for Introduction to Object Oriented Programming
Learn about ELIZALinks to an external site., an early natural language processing computer program created from 1964 to 1966 at the MIT Artificial Intelligence Laboratory. You can try out ELIZA hereLinks to an external site..
Brainstorm how you could create a program like ELIZA using the knowledge you currently have of Java. Even though simple, you will realize how complex natural language processing is and will appreciate ELIZA even more. Think about simple interactions strategies like: using a word from the previous sentence in the next sentence (ELIZA does that too). Prompting the user with word choices also makes it easier, for example:
You program: How are you feeling today? Options: sad, happy, tired or anxious User: tired Your program: Why are you tired?
- Create a name for your therapist. It may be your name, a combination of yours and your partner's name or something else
- Have a welcome method that will print an introduction message on the screen
- Create at least 5 pre-defined sentences in an array of sentences, so you can loop through the sentences as you engage with the user
- In main, have a loop that will iterate until the user wants to quit talking to the therapist. Pick a word to end the dialog, such as "Goodbye"
- Use a word from a sentence entered by the user in a follow-up question at least twice in the dialog. Have fun!
Follow naming convention for variables and methods, and recommended indentation.
- Methods should be indented 4 spaces from class declaration
- Statements inside methods should be indented 4 spaces from method header
- Document your program following Javadoc format
- Include a header at the beginning of your program that has:
- description of the program
- group#
- your names as @author
- date (@since)
- Describe each one of the methods, including @param and @return
- What to submit:
- Your source code .java
- A screenshot of the documentation generated by javadoc
- A screenshot of the dialog you will have while testing your program
- Only one partner needs to submit. If you resubmit your program, make sure to include the whole package. Even if you need to upload a new version of the
- .java only, make sure to upload everything again. It is a whole new submission!