This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: Confidential and Proprietary Lesson #1: Talking with Socialbot and simple programming Socialbot is a artificial intelligence software program. In natural everyday language, it can do various intelligent functions such as: hear your name, recall your name, add two numbers, report the date, engage in a knock-knock joke, give you its name, infer your gender from your name, and so on. To use the program, launch "Socialbot.exe". A sample interaction: input: hello bot: hello there, nice to meet you input: what is my name bot: I don't know your name input: it is Dave bot: hello Dave, nice to meet you. Thank you for telling me your name input: no problem, what is your name bot: my name is Truman input: what is 2 plus 5 bot: The sum of 2 and 5 is 7. input: what is a horse bot: horse is a mount creature. horse is a fantasy object. go on. input: what month is it bot: It is Oct input: and what is my age bot: I don't know your age. I'm sorry, either I didn't understand you or you didn't tell me your age input: it is 33 bot: If you are 33 years old then you are a adult. Thank you for telling me your age input: goodbye bot: goodbye and hope to talk to you again When you exit the program, Socialbot quits and creates a data file called "history.txt" which contains all it learned about you. When you run the program again later, it uses this data file to continue the relationship with you. Socialbot's programming is organized into "cases". Each case keys to specific grammatical patterns. A grammar pattern is a single word, a phrase or something more complex (as we’ll see later). As you see in <pattern> below, each pattern is separated by a “|” (called a “pipe” symbol). If there is a match between the user's typed input and a grammar pattern then additional programming inside <code> is activated to remember, infer and/or reply to the user's input. A simple behavior: <case> <function> say hello </function> <pattern> hello|hi there|hey there|good morning|good evening|greetings </pattern> <code> $output = "hello there, nice to meet you"; $expression = "greeting"; </code> </case> This behavior’s <function> is to “say hello”. If the user types “hello” or “good morning” or any of the other words in <pattern> then Socialbot outputs what’s indicated in $output, which is “hello there, nice to meet you.” If the animation feature is active then the character will give the “greeting” gesture as indicated by $expression. An educated Socialbot has hundreds or thousands of cases. It tries each case from first to last. In theory, an input might trigger several outputs. But Socialbot only displays the first output triggered by your input and stops searching other cases....
View Full Document
- Spring '08
- Knock-knock joke, Socialbot, Copyright Dario Nardi