Social Media And Global Computing ChatBots
What’s a ChatBot? - Using keyword searches to trigger responses ● An automated conversational program - Using keyword searches to trigger responses - From the Simple to the Complicated Send and Receive Algorithms - The Turing Test
Simple ChatBot Algorithm 1. Begin with a statement to set the context: "Hello! Can you guess my favorite movie?" 2. If the response is: "western" OR "comedy" OR "animation" OR "love" Then reply with "Nope." 3. If the response is: "scifi" OR "action" OR "adventure" Then reply with Yep, that’s the genre.“ 4. If the response is: "neo" OR "morpheus" OR "trinity" OR "agent" Then reply with "Yep. That’s right."
Simple ChatBot Algorithm 5. If the response is: "mr" AND "smith" Then reply with "Yep. He’s in it." 6. If the response is: "science" AND "fiction" Then reply with "Yep, that’s the genre." 7. If the response is: "matrix" Then reply with "You got it! Congratulations!" 8. If response is anything else, then reply with ONE of the following: "Oh come on, you can do better than that!" "You’re getting closer!" "That's a strange thing to say?" "Can you rephrase that?"
Simple ChatBot Implementation chat.welcomeMessage("Hello! Can you guess my favorite movie?"); chat.keyResponseAny("Nope.","western","comedy","animation","love"); chat.keyResponseAny("Yep, that’s the genre.","scifi","action","adventure"); chat.keyResponseAny("Yep. That’s right.","neo","morpheus","trinity","agent"); chat.keyResponseAll("Yep. He’s in it.","mr","smith"); chat.keyResponseAll("Yep, that’s the genre.","science","fiction"); chat.keyResponseAll("You got it! Congratulations!","matrix"); chat.noMatchMessage("Oh come on, you can do better than that!"); chat.noMatchMessage("You’re getting closer!"); chat.noMatchMessage("That's a strange thing to say?"); chat.noMatchMessage("Can you rephrase that?");
A ChatBot Session -> The Chatbot said: Hello World! Can you guess my favorite movie? -> The User said: Is it a western? -> The Chatbot said: Nope. -> The User said: Is it a comedy? -> The Chatbot said: Nope. -> The User said: Is it a scifi movie? -> The Chatbot said: Yep, that's the genre. -> The User said: Is it Star Trek? -> The Chatbot said: Oh come on, you can do better than that! -> The User said: 2001? -> The Chatbot said: You’re getting closer! -> The User said: Blade Runner -> The Chatbot said: That's a strange thing to say? -> The User said: Is Morpheus in it? -> The Chatbot said: Yep. That's right. -> The User said: Is it the Matrix? -> The Chatbot said: You got it! Congratulations!