+ Artificial Intelligence Lecture 1 ChatBots Prof. Oksana Pomorova Office Room C11 9 oksana.pomorova@wmii.uni.lodz.pl ChatBots ❖ A chatbot is programmed to work independently from a human operator. ❖ It can answer questions formulated to it in natural language and respond like a real person. It provides responses based on a combination of predefined scripts and machine learning applications. The most natural definition of a chatbot is – a developed a program that can have a discussion/conversation with a human . ❖ ChatBots Chatbots are a channel opening up for customers (and potentially employees) to interact with companies and/ or government organizations. ❖ Since only text is available for interacting with the user, the quality of the conversation is key. ❖ Timeline of Chatbots Timeline of Chatbots https://kavliwashere.com/chatbot-timeline-history/ https://roboticsbiz.com/a-brief-history-of-chatbots-timeline/ https://medium.com/@vivekpatil647/timeline-of-chatbots-f3baf14c05e6 Types of chatbots 1. Chatbots for entertainment and 2. Chatbots for business. There are two major types of chatbots: ❖ Chatbots for entertainment ❖ Microsoft’s bots Xiaoice and Tay have similar behavior ❖ Amazon’s Alexa, Apple Siri, or Microsoft’s Cortana…. . First chatbot-psychotherapist ELIZA was introduced in 1966 . ❖ Business chatbots Types of business chatbots 1. Support chatbot 2. Skills chatbot : s s s 3. Assistant chatbot Types of business chatbots 1. Support chatbots Support chatbots need to have personality, multi-turn capability, and context awareness. ❖ They should be able to walk a user through any major business processes, and answer a wide range of FAQ-type questions. ❖ You will want to have a short-tail and long-tail combo solution when building this type of chatbot. ❖ Support chatbots are built to master a single domain, like knowledge about a company. ❖ Types of business chatbots 2. Skills chatbots They should be able to follow commands quickly, so that your users can multitask while engaging with the bot. ❖ These chatbots do not need to worry too much about contextual awareness, as people will quickly learn what to say, and say it appropriately. ❖ When building a skills bot, it is important to focus on integration, especially when controlling a home or personalized objects. ❖ Keep integration simple so your users can interact with the bot without worrying about how to use. ❖ They have set commands that are intended to make life easier: “Turn on my living room lights,” for example. ❖ Skills chatbots are typically more single-turn-type bots that do not require a lot of contextual awareness. ❖ Types of business chatbots 3. Assistant chatbots ❖ Assistant chatbots need to be conversational and respond to just about anything, while being as entertaining as possible. Siri is a good example ❖ When building an assistant chatbot, it is important to make it as obvious as possible how the bot is trained. The range of questions a user might ask is large, so making sure you have adequate coverage is going to be the most difficult factor. Assistant chatbots are more or less a middle ground between the two bots (support and skills). They work best when they know a little bit about a variety of topics. . ❖ AIML Artificial Intelligence Markup Language is a simple scripting language and the open standard for writing chatbots. Intelligence Definition of intelligence 1a(1): the ability to learn or understand or to deal with new or trying situations : REASONalso : the skilled use of reason (2): the ability to apply knowledge to manipulate one's environment or to think abstractly as measured by objective criteria (such as tests) c: mental acuteness : SHREWDNESS bChristian Science : the basic eternal quality of divine Mind 2a: INFORMATION, NEWS b: information concerning an enemy or possible enemy or an area also : an agency engaged in obtaining such information 3: the act of understanding : COMPREHENSION 4: the ability to perform computer functions Intelligence From Wikipedia, the free encyclopedia Intelligence has been defined in many ways to include the capacity for logic, understanding, selfawareness, learning, emotional_knowledge, reasoning, planning, creativity, and problem solving. It can be more generally described as the ability to perceive or infer information, and to retain it as knowledge to be applied towards adaptive behaviors within an environment or context. Intelligence is most widely studied in humans but has also been observed in both non-human animals and in plants. Intelligence in machines is called artificial intelligence, which is commonly implemented in computer systems using programs. Artificial intelligence (AI), sometimes called machine intelligence, is intelligence demonstrated by machines, in contrast to the natural intelligence displayed by humans and other animals. In computer science AI research is defined as the study of "intelligent agents": any device that perceives its environment and takes actions that maximize its chance of successfully achieving its goals.[1] What does intelligence mean in context to Chatbots? We want the Chatbot to: • Recognize the intent of a sentence, ‘My bike is stolen’ relates to the intent ‘Bicycle stolen’; • Identify and allow for typographical errors ‘Byke’ is ‘Bike’ and even cope with language variants (the difference between US and UK English for example); • Detect the mood of the customer and provide related answers. “I DO NOT AGREE” is different than “I do not agree ;-)”; • Understand the line in the context of a conversation E.g. following the answer to a previous question such as “how do I do that?” • Realize that there is a difference between names and nouns – Jack London is a proper noun / name and does not imply ‘Jack based out of London; • If possible relate to previous conversations with me as an end-user or related customers Intelligence for Chatbots is supported by different capabilities such as: • A Chatbot’s response machine is the central engine where all information is brought together, • Natural Language Processing (NLP) for understanding the intent of a sentence, mood recognition, entity recognition (identifying the key nouns and verbs); • Context recognition of a conversation (with a state machine for predictive handling) to put a single line into a larger perspective. • Recognition has several degrees of complexity here. In the simplest form it is a classification problem, but in the hardest form it a more conventional NLP problem, grasping the semantics of something, including the meaning of verbs, nouns and parts-of-speech (POS); Intelligence for Chatbots is supported by different capabilities such as: • History analytics to provide context from previous conversations (with the same user or other users). This contains both conversations with the same user as well as pattern recognition based on previous conversations with all other users regarding the same topic – here is where most people associate AI; • CRM, and specifically all previous interactions with the customer, such as interactions via call centers, email, acquired products and complaints. Knowing the customer will definitely help in understanding the conversation and delivering right answers; • Event handling, events that are related to a conversation can intervene in the conversation. This can be a single event or multiple events combined together by Complex Event Processing for example a location update from the device the user using to conduct the chat, or correlating chat content across concurrent conversations for people in one area; Intelligence for Chatbots is supported by different capabilities such as: • The training model delivers the input for a supervised model, based on which the NLP is able to determine the intent (or meaning) of the sentence the customer delivers in the Chatbots. • Statistics, this is the most important capability used in the response machine, NLP and the historical analysis. We want to have: A roadmap towards Intelligence The above functionality is an ideal situation for the future When looking at the levels shown in the maturity model, what types of intelligence capabilities can be delivered with the different levels? . Every level comes with a degree of complexity in order to deliver the required intelligence. Level 1 . . . Chatbots with Level 1 intelligence support a low level of intelligence aimed at supporting basic conversations Often, these type of Chatbots are used in demos and can be used as wireframes for mimicking intelligence features. Similar to User Interface wireframes the implementation of the response system is based upon ‘hard wired’ logic The system can only understand predefined sentences that can be provided to the end-user as menu entries With the lowest level of complexity this level can be achieved in a short timeframe. Level 2 By including line-based and context intelligence level 2 in intelligence maturity is reached. This enables end-user to communicate via their own language. The response system tries to understand the intent of the lines and can relate the intent to the entire conversation that takes place with the end-user. The line based intelligence is supported by text analytical tooling. This delivers a model that allows several NLP-related techniques to relate a sentence to an intent. Sentences that cannot be related to an intent, could be used as new input for both training the model as well as making human adjustment to the model itself. Level 2 The complexity in a level 2 solution: • Find the right NLP tool or combination of tools. Different Open Source packages are available for NLP, such as Stanford NLP and Apache Open NLP, all with their specific capabilities. • Secondly train the model to understand the conversation in the best way. These training models can be industry specific, so building upon an already available industry specific training model will definitely improve the quality of the conversation. • Determine the context, what state model can support the conversation and what information should be stored during the conversation. Level 3 In order to reach level 3 intelligence, the response system needs to be enriched with information about the end-user included in the conversation (CRM) and historical analysis based upon previous conversations with the end-user, but also previous conversations with different users. Thus historical analysis can be divided into two categories, manual analysis and Machine Learning. Analytics data can be manually analyzed and fed into the training model. Or develop a machine learning module which continuously enhance and extend the training model. Level 3 The response system is fed with information from NLP, Content, History and CRM and determines, with growing confidence, the best answer towards the end-user. The Context part in this solution is extended to store all relevant information coming from disparate sources. Level 3 The complex part in this solution is the way the Chatbot response system combines all information from NLP, Context, Training models, CRM and History analytics is combined and processes this information into an answer with the highest likelihood. The choice for a statistical model, supporting the Chatbot response system, is crucial. The Chatbots Intelligence area Results: The Chatbot response system, responsible for determining the best answer related to the question the end-user entered, is dependent on multiple information sources and a high quality statistical model supported by data mining algorithms. Open Source tooling, industry models and statistical models are available but it is the choice for the right combination that makes a difference in the response quality. The Intelligence maturity model helps to manage the expectations of what can be expected from the Chatbot. https://www.capgemini.com/2017/05/chatting-with-the-chatbots-how-intelligence-makes-the/ https://www.pandorabots.com/mitsuku/ A four-time winner of the prestigious Loebner Prize Turing Test, Mitsuku is widely considered the world's best, most humanlike, conversational chatbot. She has been featured by the Wall Street Journal, BBC, Guardian, and Wired, and converses with millions of people monthly on channels like Messenger, Kik, and the web Via various third-party integrations and partners, Mitsuku is also available as a fully conversational character. The avatar runs on mobile and mobile AR, and live-streams autonomously onTwitch TV . . The Mitsuku codebase can be licensed, along with other modules, from Pandorabots and incorporated into other chatbot applications.