U-M CIS 577 - An introduction to Chatterbots, Natural Language Processing

Unformatted text preview:

Using ElizabethObtaining the SoftwareRunning the SoftwarePlaying AroundThe Illustrative ConversationThe Script EditorThe First Illustrative ScriptSimple Message TypesThe Main Processing CycleInput/Output TransformationsKeyword TransformationsSimple Keywords and ResponsesKeywords with SubstitutionPattern MatchingEmpty PatternsMatching the Ends of the TextCapitalisation and TransformationsSlide 18Modularising Your ScriptDynamic CommandsMemorising and Recalling PhrasesReturning to a Previous TopicIndex CodesMemorising Pronoun ReferencesUsing Multiple MemoriesSlide 26Timing of Dynamic Commands (i)Timing of Dynamic Commands (ii)Using Null Memories to Keep TrackChanging MoodConditional CommandsMore on Dynamic CommandsExamples of Deletion CommandsIndex Codes and Keyword SetsCommands Within CommandsSyntactic AnalysisA Testbed: Simple TransformationsOur Starting Point: Active Declarative SentencesSome Types of Transformation (1): Active to Passive(2): Yes/No Questions(3): Tag QuestionsPhrase Structure Grammar (1)Phrase Structure Grammar (2)Phrase Structure Grammar (3)Phrase Structure Rules in ElizabethSlide 46Slide 471Using Eli zabethAn introduction to Chatterbots,Natural Language ProcessingPeter Millican, University of Leeds2Obtaining the Software-The Elizabeth software can be downloaded from the Elizabeth home page at:http://www.etext.leeds.ac.uk/elizabeth/-For links to other chatterbot systems (as well as to Elizabeth), see http://www.simonlaven.com/3Running the Software-The main system file is called:Elizabeth.exe-To run it, simply identify this file within Windows Explorer, and double-click.-Make sure that the help files:Elizabeth.hlp and Elizabeth.cntare in that same directory (it’s also a good idea if the other system files, mostly illustrative scripts, are there too).-Click on Elizabeth’s Help menu to view the contents of the help file.4Playing Around-Elizabeth’s behaviour is based on a ‘Script’ file.-Initially, Elizabeth should start up with a Script which shows the ‘Welcome’ message:HELLO, I'M ELIZABETH. WHAT WOULD YOU LIKE TO TALK ABOUT?If this doesn’t happen for any reason, try locating and loading the script file Elizabeth.txt using ‘Load script file and start’ from the File menu.-To familiarise yourself with Elizabeth, just play around a bit, typing input sentences, clicking on ‘Enter’, and seeing what happens. Note that the conversation is recorded in the ‘Dialogue’ tab.5The Illustrative Conversation-Take a look at the section ‘Illustrative Script and Conversation’ in the Elizabeth help file. Try typing inputs similar in style to what are shown in the part of that section headed ‘The Conversation’, e.g. type in sentences containing words or phrases such as:‘mum’ or ‘dad’‘I think …’‘… is younger than …’‘I like …ing’-While doing this, look at the ‘Trace’ tab (just right of the ‘Dialogue’ tab): this shows how your input is being processed to produce the system’s replies.6The Script Editor-From Elizabeth’s File menu, select ‘Transfer script into Script Editor’ – this will start up the Script Editor with the current script file loaded in.-Now make a change to the ‘Welcome’ message (appears after ‘W’ in the second line of the Script); then from the Editor’s File menu, select ‘Restart Elizabeth after saving’ – this will save your change, and restart Elizabeth using this edited script file (with its new ‘Welcome’ message).-Note that the two File menus give various options for switching between Elizabeth and the Editor.7The First Illustrative Script-Try to work out how the Script that you see within the Editor is determining Elizabeth’s conversational behaviour – if any of it seems puzzling, refer to the help section ‘Illustrative Script and Conversation’.-Try playing around with the Script (like you did already with the ‘Welcome’ message), and see what effect this has on Elizabeth’s conversation.-Carry on doing this as we now explore Elizabeth’s data tables as shown in the various system ‘tabs’. Most of this data comes directly from the Script file.8Simple Message Types-The ‘Welcome/Quit’ tab shows Welcome and Quitting messages – one of each is selected respectively to start the conversation, and to end it (when the user selects ‘Exit’ from the File menu).-The ‘Void’ tab shows Void Input messages – one of these is selected in response to any ‘null’ input.-‘No-keyword’ shows No-Keyword messages – for use when no ‘keyword’ is identified in the input.-If there are more than one of any of these kinds of messages, the selection is random, except that the same message won’t be chosen twice in succession.9The Main Processing CycleReceive user’s input as the ‘active text’Input TransformationsApply any input transformsKeyword TransformationsSearch for a keyword; if one is found, replace the active text with a response from the corresponding set; if not, replace it with a no-keyword responseOutput TransformationsApply any output transformsOutput the new ‘active text’10Input/Output Transformations-Input transformations are applied to the initial input; their main use is to standardise words that you want to be treated similarly, e.g.I mum => motherif you want ‘mum’ to be changed to ‘mother’.-Output transformations are applied to the final output; often their main use is to change first-person to second-person and vice-versa, e.g.O i am => YOU ARE-Make sure you capitalise these as illustrated above.11Keyword Transformations-Keywords and responses are grouped into sets, so order them in your script file accordingly (set 1 keys, then set 1 responses, then set 2 keys … etc). Generally it’s best to capitalise keys and responses.-Unlike Input and Output Transformations, only one Keyword Transformation is applied each time.-Note how pattern matching and substitution are used within the keywords and responses in the Illustrative Script, and their effect as you ‘play’.-See the help on ‘The Input/Keyword/Output/Final Transformation Process’ and ‘Pattern Matching’.12Simple Keywords and Responses-The following script commands create a simple keyword/response set with two keywords and three responses:-When ‘mother’ or ‘father’ is found in the active text, one of the responses will be chosen (randomly, but avoiding immediate repetition if possible).K MOTHERK FATHER R TELL ME MORE ABOUT YOUR


View Full Document

U-M CIS 577 - An introduction to Chatterbots, Natural Language Processing

Download An introduction to Chatterbots, Natural Language Processing
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view An introduction to Chatterbots, Natural Language Processing and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view An introduction to Chatterbots, Natural Language Processing 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?