cs472: project3a From dialogue to planning. Due the Wednesday before dead week <=== hard deadline. ---------------------------------------------- What to do: 1) Hand in a zip file containing all working lisp and sample out files of all tasks. proj3a/XX/make.lisp ; what i load to start your system proj3a/XX/src/ ; your code prog3a/XX/src/eliza-new.lisp; proj3a/XX/doc/task1.txt ; sample output from task 1 proj3a/XX/doc/task2.txt ; sample output from task 2 proj3a/XX/doc/task3.txt ; sample output from task 3 proj3a/XX/doc/task4.txt ; sample output from task 4 proj3a/XX/doc/task5.txt ; sample output from task 5 proj3a/XX/doc/task6.txt ; sample output from task 6 Be warned- these tasks will not take equal time. Each task i+1 should take more time than all the tasks 1..i put together. 2) Attend a code walk through (same rules as before- i need to get your code running and I will quiz each member of the group about any part of the code) --------------------------------------------- Task 0: setup Create a directory "proj3a/XX" for the project containing make.lisp and add http://menzies.us/csx72/src/week9/eliza-new.lisp. Modify use-rules (in eliza-new) so that the used rules is an optional parameter that defaults to *rules* --------------------------------------------- Task1 (easy): *bride-groom* Emulate the dialogue of the blushing bride or grinning groom planning their ritualized socially sanctioned exchange of DNA. No matter what you talk about, bring the dialogue around to their forth coming wedding. Encode this as eliza rules *bride-groom* --------------------------------------------- Task2 (easy): *wedding-planner* As above but encode the dialogue for a diplomatic wedding planner who asks leading questions to guess things like the client's religious, dietary, financial, and other preferences. Store that in *wedding-planner*. To design the wedding planner, find all the choice points in your current grammar and ask yourself the question "what user preferences would bias the selection of which parts of these choices?". Find ways to determine those preferences using the fewest questions. --------------------------------------------- Task 3 (not too hard): planner and bride/groom Get the rules of task1/task2 to talk backwards and forwards to each other. If you do this right, you should be able to generate thousands of lines of dialogue in a few seconds. --------------------------------------------- Task 4: *feature-extraction* Code a third rule set of eliza rules called *feature-extraction* that does not return sentences. Instead, it searches the dialogue of task3 for sets of "features" (1 world symbols) describing the wedding; e.g. "cheap-skate" or "catholic". To design this set of features, find all the choice points in your current grammar and ask yourself the question "what conjunction of symbols would be enough to select for those choices". Find ways to determine those presences using the fewest questions. --------------------------------------------- Task 5: adjust the grammar Change our rules so that they contain (1) a head (2) a body and (3) a new part containing tests for combinations of features. Adjust the rule interpreter such that the "rewrites" function not only tests for a particular head, but also checks combinations of features. Hint: you'll need to change your rules from (head -> body) to (head if features then body) which means you'll need to change these selectors: (defun rule-lhs (rule) "The left hand side of a rule." (first rule)) (defun rule-rhs (rule) "The right hand side of a rule." (rest (rest rule))) Regarding the "features" part of the code, here something that will test for a set of features (I have not debugged this, but you can get the general idea) (defun true-p (test features) (cond ((null test) t) ((consp test) (true-p1 test features)) (t (member test features)))) (defun true-p1 (test features) (let* ((kind (pop test)) (one (pop test)) (others test)) (case kind (and (and (true-p one features) (true-p others features))) (or (or (true-p one features) (true-p others features))) (not (or (not (true-p one features)) (not (true-p others features))))) (t (print saywhat) nil))) With the above you can now write a rule (diet IF (and (not jewish) (not vegetarian)) THEN pork) --------------------------------------------- Task 6: put it all together. Get the planner and the bride/groom talking. Apply the feature extraction to yield sets of features. Flatten the features into one big list. The call the grammar with that list of features. If do all this correctly, then after some dialogue the generated rules will build weddings particular to the user preferences. In your demo script for this, show samples of the generated wedding plans with and without feature extraction. The features plans should be much more focused