An Introduction to Chatbots

26
An Introduc+on to Chatbots by Nishil Shah and Kanishk Thareja Prepared as an assignment for CS410: Text InformaMon Systems in Spring 2016

Transcript of An Introduction to Chatbots

Page 1: An Introduction to Chatbots

Образецзаголовка

AnIntroduc+ontoChatbots

byNishilShahandKanishkThareja

PreparedasanassignmentforCS410:TextInformaMonSystemsinSpring2016

Page 2: An Introduction to Chatbots

ОбразецзаголовкаWhatareChatbots?[1]

•  ChatbotsarearMficiallyintelligentcomputersystemsthatconversewithhumansusingnaturallanguage

•  IniMallycreatedinthe1960stosimulatehumanconversaMonforthepurposeofentertainment

•  Today,chatbotsareabundantandoffersophisMcatedservices

Page 3: An Introduction to Chatbots

ОбразецзаголовкаELIZA[1]

•  Oneoftheearliestchatbotsystems•  DesignedtomirroraconversaMonbetweenapaMent(theuser)andapsychotherapist(thesystem)

•  Usesasimplekeywordmappingalgorithm–  Ifakeywordisfoundwiththeuser’sinput,anoutputsentenceisselectedbaseduponarulecorrelatedwiththatkeyword

–  Ifnokeywordisfound,ELIZAreturnsadefaultresponsesuchas“Pleasegoon.”or“Canyouelaborateonthat?”

Page 4: An Introduction to Chatbots

ОбразецзаголовкаELIZA[1]

•  Forinstance,iftheinputcontainstheword“sad”,ELIZAcanrespond,“What’sbotheringyou?”

•  BaseduponthenoMonthatifausermenMonsafeeling,ELIZAshouldengagethemintoopeningupaboutit

•  ELIZAdoesnotunderstandwhattheusersays•  Generatesaresponsefrompre-storedsentencesandsentencetemplates

Page 5: An Introduction to Chatbots

ОбразецзаголовкаCurrentApplica+onsofChatbots[1]

•  ChatbotshavemorepracMcalapplicaMonsduetoimprovementsindata/textminingandmachinelearningmethods

•  ThemainpurposeofcurrentchatbotsistoincreaseproducMvity

•  Commondomainsoftoday’schatbotsareinformaMonretrieval(quesMon-and-answersystems),personalassistance,ande-commerce

Page 6: An Introduction to Chatbots

ОбразецзаголовкаFacebookM

•  AchatbotservicecreatedbyFacebook

•  BetalaunchedonAugust27,2015•  FewusagesofFacebookMarefindingrestaurantopMonsandvacaMonsuggesMons

•  Builtrightintothemessenger;allowsuserstohaveeasyaccessinafamiliarUIsystem

Page 7: An Introduction to Chatbots

ОбразецзаголовкаSiri

•  ChatbotservicebyAppleoniOS•  UsesvoicerecogniMonandspeakstotheuser•  Sirihas3basicfuncMons–  TaskcompleMon:Canperformwebsearches,completetransacMons,makeacall,etc…

–  ConversaMonalintent:TakesintoaccountmulMplecontextssuchaslocaMonandMmetounderstandtheuser’ssituaMon

–  PersonalizaMon:Sirilearnsabouttheuserandtailorsresponsestoeachindividual

Page 8: An Introduction to Chatbots

ОбразецзаголовкаHowDoChatbotsWork?

•  NaturalLanguageProcessing•  DiscourseAnalysis•  OntologyLearning•  SentenceCompleMon

Page 9: An Introduction to Chatbots

ОбразецзаголовкаNaturalLanguageProcessing[2]

•  Textsystemsinterpretuserinputasa“bagofwords”,eachwordconsideredindependentoftheothers

•  Wordscanbefurthersegmentedbylabelingtheirpartsofspeech,tense,etc…

Page 10: An Introduction to Chatbots

ОбразецзаголовкаNaturalLanguageProcessing[2]

•  ContextuallydependentwordscanbefoundusingMarkovChains–  Inthesentence,“HowistheApplestockdoing?”,thekeywords“Apple”and“stock”areextracted

•  ProbabilisMclanguagemodelscanbeusedtoassignweighMngstowords

ThesetechniquesareusedingeneraltextinformaMonsystems.Let’sfocusontopicsspecifictochatbots.

Page 11: An Introduction to Chatbots

ОбразецзаголовкаNaturalLanguageProcessing[2]

•  Itisnotouenthatauser’sinputisindependentofanycontext

•  Thechatbotsystemmustmodelhowseparatetextlinkstogethertoformacoherentdiscourse

ChatbotsystemsmustrecognizethattheuserisreferringtothesamelocaMoninbothinstances.Weneeddiscourseanalysis!

Page 12: An Introduction to Chatbots

ОбразецзаголовкаDiscourseAnalysis[3]

•  DevelopingaraMonal,coherentdiscoursefrommulMpleuserinputs

•  IdenMfiesandevaluatespawernswithinaseriesoftexts

•  CreatesrelaMonshipsbetweensentencesandenMMes

•  3mainmodelstomodeldiscourse– AnalysisofsemanMcs– Analysisofstructure– AnalysisofintenMon

Page 13: An Introduction to Chatbots

ОбразецзаголовкаDiscourseAnalysisUsingSeman+cs[3]

•  TextisbrokendownintoprimiMveunitscalledelements(ex:enMMes,acMons)

•  Together,elementsbuildsemanMcformulas,whichrepresentthemeaningofEnglishwords

Formulafor“eat”:– Agentisanimate– Objectisedible– DirecMonistowardthehumanmouth

•  GivesrelaMonshipbetweenobjectsandacMons

Page 14: An Introduction to Chatbots

ОбразецзаголовкаOntologyLearningCreatesModels[4]

•  ChatbotsautomaMcallycreateontologies

•  AnontologyisamodelfordescribinganenMMesproperMesandrelaMonships

•  Inthisexample,thesystemunderstandsthattheuserlikesmovies

Page 15: An Introduction to Chatbots

ОбразецзаголовкаOntologyLearning[4]

•  Commoncomponentsofontologiesinclude:–  Individuals:instancesorobjects(thebasicor“groundlevel”objects)

–  Classes:sets,collecMons,concepts,classesinprogramming,kindsofthings

– Awributes:aspects,features,properMes,characterisMcs

–  RelaMons:waysinwhichclassesandindividualscaninteractwitheachother

•  Themoretheuserinteractswiththechatbot,thestrongertheontologiesitcancreate

Page 16: An Introduction to Chatbots

ОбразецзаголовкаGenera+ngAResponse[5]

•  Nowthatthechatbotsystemhasunderstoodtheuser’sinput,itmustgenerateanappropriateresponse

•  SimilartoinformaMonretrieval:ratherthanmatchingtheuser’s“query”toadocument,wearemappingtoonetotwosentences

•  Wetakeintoaccountcertainstopwordssuchas“you”,“I”,and“because”thatmaybeimportanttothesemanMcsofthesentence

•  ThesystemranksrelevantsentencesbasedonaprobabilisMcfuncMonandselectsthehighestone

Page 17: An Introduction to Chatbots

ОбразецзаголовкаSentenceGenera+on[5]

•  ChatbotsshouldkeepacopyoftheconversaMoninmemory

•  PreventsthechatbotfromrepeaMngthesameresponseiftheusersendsinthesameinputmulMpleMmes

•  Feedbackbasedupon– Relevanceofresponsetouserinput– SyntacMcalandsemanMccorrectness

Page 18: An Introduction to Chatbots

ОбразецзаголовкаSentenceGenera+on[5]

•  Whataboutsentencesthatarenotinthesystem’sdatabase?

•  OnemethodtosolvethisusesageneMcalgorithmtocrossoverexisMngsentencestoproduceanewresponse

•  Toimplementthis,wecanusetheconceptoflargestcommonpaRern

•  LCP(s,t)=(p1,p2,…,pn)wheren=1andp1=Ø OR

•  LCP(s,t)=(p1,p2,...,pn)whereforevery1≤i≤n,pi≠Øandsandtaresentences:–  s=s1p1s2p2…snpn–  T=t1p1t2p2...tnpn

Page 19: An Introduction to Chatbots

ОбразецзаголовкаSentenceGenera+on[5]

•  s★,t★=firstwordofeachsentence•  s\s★,t\t★=eachsentencewithoutthefirstwordAuerfindingtheLCP,wecandefinethecomplementvectorofeachsentence:•  Inds=(s1,s2,…,sn)•  Indt=(t1,t2,...,tn)

Page 20: An Introduction to Chatbots

ОбразецзаголовкаSentenceGenera+onExample[5]

•  s=Chatbotscansimplifymanytasksforyou•  t=Icanfinishmanyassignmentsforschooltoday•  LCP(s,t)=(can,many,for)•  Inds=(Chatbots,simplify,tasks,you)•  Indt=(I,finish,assignments,schooltoday)Assumewerandomlydecidetoswapgenes2and3:•  Child1=Chatbotscanfinishmanyassignmentsforyou•  Child2=IcansimplifymanytasksforschooltodayItispossiblythatageneratedsentenceisnotsyntacMcallyorsemanMcallycorrect.

Page 21: An Introduction to Chatbots

ОбразецзаголовкаEvalua+ngAChatbot’sPerformance[6]

•  Evaluatedbasedonsimilaritytofluent,humanconversaMon

•  Turingtest–  JudgeschatwithmulMplechatbotsandscorethemintheirabilitytosimulateahuman’snaturallanguage

•  However,“naturalness”issubjecMve•  ImportanttotakeintoaccountquanMtaMvedatatomeasureefficiency

Page 22: An Introduction to Chatbots

ОбразецзаголовкаEvalua+onMetrics[6]

•  QuanMtaMve–  Timetodevelopresponse–  Time/numberofinteracMonstocompleteuser’stask–  Numberofre-prompts–  Numberofirrelevantsystemresponses

•  QualitaMve–  Naturalness–  Clarity–  Friendliness–  UsersaMsfacMon

Page 23: An Introduction to Chatbots

ОбразецзаголовкаLimita+onstoChatbots

•  ChatbotsrequireahighcomputaMonalcomplexitytofuncMonefficiently

•  LanguageshavemulMpledialectsandvaryingsentencestructuresthatmakeitdifficultforchatbotstoproperlyunderstandtheuser

•  ChatbotshavedifficultyansweringabstractquesMons

•  Chatbotscannoteasilyrecognizehumorandsarcasm

Page 24: An Introduction to Chatbots

ОбразецзаголовкаTheFutureofChatbots

•  Thepopularityofchatbotsisrapidlyrising•  BusinessesinvariousindustriesarestarMngto

implementchatbotstomaketheirservicesmoreseamlessfortheuser

•  UsersratherhaveaconversaMonthanclickbuwonsandfilloutforms

•  Theywillbeusedtosimplifyonlineprocesses:everythingfromsimulaMngcustomerservicerepresentaMvestohelpingyouorderfood

•  NochatbothasuncontroversiallypassedtheTuringtestyet

Page 25: An Introduction to Chatbots

ОбразецзаголовкаDeepLearning:TheFuture

•  DeepLearningisabranchofmachinelearningbasedonasetofalgorithmsthatawempttomodelhigh-levelabstracMonsindatabyusingmulMpleprocessinglayers

ModelsofDeepLearning•  Retrieval-basedmodels(easier)

–  UsearepositoryofpredefinedresponsesandsomekindofheurisMctopickanappropriateresponsebasedontheinputandcontext

–  TheheurisMccouldbeassimpleasarule-basedexpressionmatch,orascomplexasanensembleofmachinelearningclassifiers

–  Don’tgenerateanynewtext,theyjustpickaresponsefromafixedset•  Genera+vemodels(harder)

–  Don’trelyonpre-definedresponses–  Generatenewresponsesfromscratch–  BasedonmachinetranslaMontechniques;insteadoftranslaMngfromonelanguage

toanother,we“translate”fromaninputtoanoutput

Page 26: An Introduction to Chatbots

ОбразецзаголовкаCita+ons

[1]:Chatbots:AretheyReallyUseful?hwp://media.dwds.de/jlcl/2007_Heu1/Bayan_Abu-Shawar_and_Eric_Atwell.pdf[2]:NaturalLanguageProcessingforInforma=onRetrieval:the=meisripe(again)hwps://www.ischool.utexas.edu/~ml/papers/lease-pikm07.pdf[3]:Approachestonaturallanguagediscourseprocessinghwp://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.461.5136&rep=rep1&type=pdf[4]:ASurveyofOntologyLearningProcedureshwp://up.informaMk.rwth-aachen.de/PublicaMons/CEUR-WS/Vol-427/paper2.pdf[5]:Evolu=onarySentenceBuildingforChaGerbotshwp://www.cs.iusb.edu/~danav/papers/dv_evchat.pdf[6]:TowardsaMethodForEvalua=ngNaturalnessinConversa=onalDialogSystemshwps://pdfs.semanMcscholar.org/6cf7/3d4998383938b3a6d12acb89a11e8a84a77b.pdf