Computer Science 271
Spring 2004
Computer Understanding of Human Language

Instructor: Martha O'Kennon
Palenske 305
Phone 0300 or e-mail mokennon@albion.edu
Office Hours: MWF 1:10-2:00 (tentatively)

Text:  Notes by the instructor.  

Prerequisites: The only prerequisite for this course is some experience in programming in a high-level language, such as BASIC or Pascal, and some familiarity with at least one foreign language, such as might be learned in two years of a high school language or one year of college language.

Format: Lecture, Lab, and Discussion.

In this course, you will learn Prolog, a logic-based programming language that is particularly useful for writing language applications. To inspire you to get good at Prolog, you will write the most awesome text adventure game ever (game topics from past classes include spy games, spaceship cameraderie, wandering around Albion College searching for a pot of gold).  All that is needed is your imagination. This game will also familiarize you with simple commands written in English and "understood" by the computer in the sense that if, for example, you say "get the rock" and then do an "inventory" you will find that you have the rock. You will also learn how to build really interesting things into your game, in the sense that you can invent new commands by describing to the computer what they mean.

We will move on to study how more complex sentences in English can be parsed (diagrammed) into their basic parts and the relationship among the parts. We will also discuss how the knowledge base (a list of known facts) can be accessed to disambiguate sentences like "the cat hit the dog with the rock" (Who has the rock? The cat or the dog?)...

Since my favorite area of research is automated translation, we will also discuss how to write simple translation programs, using some of the parsing routines we will develop as above, and learn how best to arrange the dictionary so that it will be useful for our work. Everyone will write a simple translator from English to the other language of their choice.

Etiquette. Sorry to say, I have found it necessary to incorporate a few rules to keep the class running smoothly.
Please do not chat with your neighbor, read the paper, sleep, or let your watch or cell phone ring during a lecture, or in any other way diminish the learning experience of others. You might read the student handbook on the subject of disruptive behavior. I reserve the right to ask you to leave for the day and/or go visit the student affairs office, and that day will count as an unexcused absence. Exceptions include when you are asked to discuss problems in group work. 
I don't mind if you bring a drink to class.  I personally can't survive without a cup of coffee.  Just don't spill it, and wipe it up if you do!

I shouldn't have to say this, but I will.  If you are ill and contagious (sneezing and coughing and/or feverish), it is only polite that you will do yourself and the rest of us a favor and stay away.  I will try to help you by email or phone until you are well enough to come to class.  You can still submit your work by email.  Such absences will not count against your attendance.  

Your grade will be based on two in-class tests, various weekly goals, a complete adventure game, a small parser, and a translator.  The tests are tentatively set for Monday, February 2 and Monday, March 1, each worth approximately 15 points.  The weekly goals are each worth about 10 points (more for some than others).  Some of these goals will be presentations and some will be stages of projects.  The final project, your translator, will be considered as a final exam, and will be due that day. The adventure game and the translator will each be worth 25 points. The parser will be worth 20 points.  There may be unannounced quizzes and short homework projects for variable credit. Attendance every day is mandatory, especially important as there is no outside textbook.  Unexcused absences in excess of three may mean a loss of up to 3 percentage points each. Here is how the final number grade corresponds to the final percentage grade.
Please note that the grade of 4.0 is reserved for students who have, in the words of the Academic Catalog, "independently sought out and used additional related materials, demonstrating the ability to discover new data, to develop new insights, and to bring them to bear on the work at hand." I will point out interesting sidelines along the way, but if you find something related that interests you, check it out with me and I will probably ok it.

Grade   Percentage

4.0         94% or above, with some extra effort
3.7         88-93%
3.3         84-87%
3.0         80-83%
2.7         78-79%
2.3         74-77%
2.0         70-73%
1.7         68-69%
1.3         64-67%
1.0         60-63%

Tentative Timetable:

Week 1 (January 12): Introduction to the Prolog Programming Language;   basic built-in predicates; facts and rules; syntax of a Prolog program; backtracking;

Week 2 (January 21) - Last Day to Drop/Add is January 20 - Prolog: Using a Database to   reflect the state of the world;  Recursion and linked lists; Writing predicates using lists; Begin work on Adventure Game; Friday, January 23, your game map and description of the goal should be turned in for feedback (I will be able to tell you whether it is feasible before that); the map should be complete and the description of how the game will work should be fairly complete (maybe you don't want to tell me all the surprises!)

Week 3 (January 26) -  Tuesday, Jan. 27 - last day to register for Credit/No credit - Using fail to mimic iteration; Comparing use of fail and recursion;  By Friday, January 30, a simple version of your game with at least two "rooms" should be working (so that you can test moving from one room to the other);

Week 4 (February 2) - Monday, February 2 - Test #1 on basic Prolog structures; Using Prolog to create a meta-game;  teaching the computer the meaning of new commands;
By Friday, February 6, your game should have all the rooms fleshed out and most of the story implemented;

Week 5 (February 9) - More on teaching the computer new commands; Friday, February 13, you will beta-test each other's games; Your critique of another's game will be graded for helpfulness and how deeply you have tested it.

Week 6 (February 16) - Grammar of English; picking a subset of English to parse; Meaning of syntactic parsing; Using Prolog to parse; Friday, February 20, your final game version is due.  It must be working with no unexpected crashes;  It must have at least 15 well-developed rooms.

Week 7 (February 23) - More on parsing using syntax; By Friday, February 27, you should be able to parse sentences with noun phrases (with number), verbphrases (in present, past and future, with number agreement), adjectives, and prepositional phrases.

Week 8 (March 1 ) - Monday, March 1 - Test #2 on Prolog and parsing - Designing the knowledge base; Parsing using context; Resolving some ambiguities by checking with the database of known facts; Midterm grades due;

Spring break runs from Friday, March 5 at 5:00 pm to Sunday, March 14;

Week 9 (March 15) - More on Parsing using context.  Friday, March 19, your parser should be able to disambiguate "the cat chased the dog with the cake" depending on the state of the world;

Week 10 (March 22) - Intro to translation; Comparing properties of English and the target language; Translation of noun phrases; By Friday, March 26, you should have picked the target language for your translator, and begun to design your lexicon.

Week 11 (March 29) - Translation of noun phrases; Introduction to translation of verb phrases; By Friday April 2, your translator should be able to translate "the big man ran", "the little cats ran" with agreement of number and correct endings or prefixes.

Week 12 (April 5) - (Verb) Tense, aspect, transitive or not? (Noun) Possessives, Demonstratives; Questions; By Wednesday, April 7, your translator should be able to translate "my little cats ran", "this red dog will speak", "your dog ate my cat", "the cat is red", "do you love me?", "did your cat eat my dog?" with correct endings, prefixes, and word order.

Week 13 (April 12) - (Verb) Voice (passive, etc); Relative clauses; More on questions;By Friday, April 16, your translator should be able to translate "the cat that ate the dog is dead", "did you see the cat that ate the dog?", "where is the bathroom?", "where did you go?", "whom did you see", "who saw the cat?".

Week 14 (April 19) - Causatives and other verb modulators; Each person should by now have a list of constructs that are difficult to translate; We will spend a couple of days in which you present the grammar of your target language to the class, and demonstrate your translator so far;  The presentations will be graded on clarity and understanding;

Week 15 (April 26) - Last week of classes; Unicodes for web work involving languages with non-Roman characters;  The final version of your translator will be due the day of the final (Saturday, May 1 at 7 pm), and will be counted as your take-home final.