Extracting Latent Beliefs and Using Epistemic Reasoning to Tailor a Chatbot
Total Page:16
File Type:pdf, Size:1020Kb
Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence (IJCAI-18) Extracting Latent Beliefs and using Epistemic Reasoning to Tailor a Chatbot Amit Sangroya, C. Anantaram, Pratik Saini, Mrinal Rawat TCS Innovation Labs, Tata Consultancy Services Limited, Gurgaon, India (amit.sangroya, c.anantaram, pratik.saini, rawat.mrinal)@tcs.com Abstract helps to understand the customer’s latent emotional beliefs while giving the complaint. Our model then evaluates the be- During dialog with a customer for addressing liefs to tailor the dialog and make it consistent with the set his/her complaint the chatbot may pose questions or of beliefs of the customer. This process then helps drive the observations based on its underlying model. Some- conversation in a meaningful way. times the questions or observations posed may not be relevant given the nature of complaint and the 2 Proposed Framework current set of beliefs that the customer holds. In this paper we present a framework to build conversa- A customer’s complaint description is usually a set of com- tion system that addresses customer complaints in plex natural language sentences describing the problem faced a meaningful manner using domain understanding, by the customer. Sometimes such descriptions contain back- opinion analysis and epistemic reasoning 1. Extrac- ground information, other superfluous information and may tion of latent beliefs assists in performing epistemic also have customer emotions embedded in it. We first cate- reasoning to maintain a meaningful conversation gorize the customer complaint description into a set of cate- with the customer. gories and then extract relevant information. It is then eval- uated by a hand-crafted knowledge base to assert facts about the probable beliefs held by the human agent in the complaint. 1 Introduction We assume that we have a hand-crafted complaint- Dialog based interaction between a customer and a bot may management finite-state-machine (FSM) to carry out the di- become tedious and irrelevant if the system’s beliefs are not alog with the customer. The FSM operates on slots that are consistent with the set of beliefs of the customer. Beliefs are filled by extracting information from the complaint and sub- cognitive representational states that represent the presumed sequent interaction. The probable beliefs of the customer that context of the conversation perceived by each agent. In other were asserted as facts, and the category of the complaint are words, the presumed context that each agent has should match then evaluated by the epistemic rules encoded in a knowl- with the evolving context of the dialog for a meaningful con- edge base for the domain. The rules make assertions about versation to take place. For example, if a chatbot fails to the states in the FSM that need to be skipped and the states understand the customer’s emotional situation and responds that need to be evaluated in order to be consistent with the mechanically with an irritated customer, then the chatbot may beliefs of the customer. The subsequent dialog is carried out fail to achieve its primary objective. and the next set of beliefs are then asserted. The cycle then Traditional dialog systems are specialized for a do- continues. Algorithm 1 presents the overall process. [ main Henderson et al., 2014; Serban et al., ; Weston, 2016; 2.1 Categorizing the Human Interactions Williams et al., 2016; Young et al., 2013] and rely on slot-filling driven by a knowledge base and a finite-state As we discussed, a customer’s initial description of his/her model [Lemon et al., 2006; Wang and Lemon, 2013]. Deep complaint may be a verbose set of natural language learning based dialog systems [Miller et al., 2016] use mem- sentences. Since descriptions about the same type of ory networks to learn the underlying dialog structure and complaint can be vastly different across customers, we carry out goal-oriented dialog. Another approach is to build use machine-learning ways to categorize the initial com- a system with a complex set of hand-crafted rules that may plaint made by a customer. Recurrent neural networks address some specific instances. Both approaches may be (RNNs) have been widely studied and used for various impractical in many real-world domains. In this paper, we machine learning tasks which involve sequence model- propose a methodology that uses a combination of machine- ing, especially when the input and output have variable learning mechanisms and domain specific knowledge extrac- lengths. For example, in the domain of car-complaints tion to understand the severity of customer’s complaint. This we use RNN to classify customer complaints into six categories such as Transmission Problems, Gear 1https://youtu.be/vTJCoZltiGs Problems, Windows-Windshield Problems, 5853 Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence (IJCAI-18) Algorithm 1 Algorithm for Tailoring Chatbot using Latent ”car(not-running)”. The Information Extractor also Beliefs and Epistemic Reasoning fills slots in a Frame relevant for the category that has been Require: Complaints dataset D determined. Require: ML1model of complaint classes 2.3 Extracting Latent Beliefs C ;C ;C ;;;;C 1 2 3 n Once the facts from the complaints are asserted, a hand- Require: ML2model of opinions O1;O2;O3;;;Om Require: BELIEFS rulebase consisting of latent belief rules crafted belief knowledge base evaluates the facts, the slot Require: EPISTEMIC rulebase consisting of epistemic values together with the category of the complaint, and as- rules serts the probable beliefs held by the human agent in the Require: FSM for dialog complaint. For example, in a car-complaints domain, given for all complaints c do the initial customer complaint “Drove vehicle out of town. While on highway vehicle engine just quit. Made an emer- Classify Compliant using ML1model ( engine, transmission etc.) gency stop because car lost power. While on side of the road Extract facts (information) using Compliant and Class vehicle would not start! Vehicle was towed in.”, beliefs such Car was working before Engine not C as “B1) B2) i working now B3) Cannot use car” can be asserted. Extract customer opinions using ML2modelOm (neg, strongneg etc.) 2.4 Evaluating the Epistemic Rules Using Information Extraction, Domain Knowledge, BE- The probable beliefs and the facts extracted trigger the epis- LIEFS rulebase, assert facts F i temic rules. For example in the car complaints domain rules for all states s of FSM do i such as “R1) Belief (Car was working before) Using Domain Ontology and Nearest Neighborhood and Category(Complete Engine Failure) approach, update w i => Knows-Agent (Car does not start now), Find Latent Beliefs using complaint class C and facts i Knows-Agent (Engine does not crank), Using facts F and EPISTEMIC rulebase, fill slots of i Knows-Agent (Engine is dead)” asserts facts Dialog manager Frames about the current epistemic state of the agent. update weight wi of state si using Latent Beleifs and Epistemic Reasoning 2.5 Tailoring the Dialog end for The facts asserted by the epistemic rules help tailor the while consumer complaint not addressed do dialog. For the above example we have the tailoring as Ensure: Meaningful dialog states follows: “ A1) Skip car starting FSM states, Using threshold and weights, build meaningful states A2) Skip engine cranking FSM states, A3) of FSM (ask states, skip states) Enquire when the engine stopped working, end while A4) Enquire noise and other signs that end for occurred when the car stopped working, A5) Enquire on the state of the battery, Engine failure Problems, Wheels-Hubs A6) Enquire when the servicing was done Problems and AC-Heater Problems. A complaint last”. This makes the dialog more relevant for the such as: Slowly the noise from my wheel bearings grew customer and his/her belief set. and grew and is now unbearable is a customer complaint 2.6 Bot’s Response and Further Dialog that belongs to the category of wheel problems. The categorization helps in further information extraction and The Bot then asks relevant questions to the customer. The belief processing. customer response is ”yes/no” type or a set of new sen- tences. If the response is a new set of sentences then the 2.2 Extracting Facts from Complaints fact-extraction and belief revision followed by epistemic rules We parse a complaint description through Dependency evaluation is repeated. parsers (such as Stanford-CoreNLP, GATE, MITIE etc.) and extract triples from the description by focusing on the de- 3 Results and Discussion pendencies identified among nouns and verbs [Cunningham In our experiments we consider 61,252 complaints about car et al., 2011; Stanford, 2011]. For example, for a descrip- faults from http://www.carcomplaints.com/. We tion ”my car just died on me”, triples such as (my-car, consider complaints across six categories. The test accuracy just-died-on, me) are extracted. of complaint categorization with Vanilla LSTM (Long Short Once the triples are extracted, we use a hand-crafted Term Memory) was 68.47%. The beliefs and epistemic rules fact-assertion rulebase to assert facts implied by the triples. helped tailor the dialog to the customer expectations. In this This is done by evaluating the triples in the context of a work, we demonstrate the overall architecture where we use car ontology, synonym-and-slang dictionary, information- RNN based classification of customer complaints as an input extraction patterns that are relevant for the category of the to the epistemic rule engine. Our approach is generic and can complaint, and by triggering the fact-assertion rules. For be applied easily in any other domains such as complaints instance, the fact asserted for the above example would be about hardware/software issues etc. 5854 Proceedings of the Twenty-Seventh International Joint Conference on Artificial Intelligence (IJCAI-18) References [Cunningham et al., 2011] Hamish Cunningham, Diana Maynard, Kalina Bontcheva, Valentin Tablan, Niraj Aswani, Ian Roberts, Genevieve Gorrell, Adam Funk, Angus Roberts, Danica Damljanovic, Thomas Heitz, Mark A.