Generang Chat Bots from Web API...

18
1 SwaggerBot Genera.ng Chat Bots from Web API Specifica.ons Mandana Vaziri, Louis Mandel, Avi Shinnar, Jerome Simeon, Mar.n Hirzel IBM T. J. Watson Research Center Onward’17

Transcript of Generang Chat Bots from Web API...

Page 1: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

1

SwaggerBot

Genera.ngChatBotsfromWebAPISpecifica.ons

MandanaVaziri,LouisMandel,AviShinnar,

JeromeSimeon,Mar.nHirzel

IBMT.J.WatsonResearchCenter

Onward’17

Page 2: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

2

ProblemStatement•  Chatbotsarebecomingubiquitous–  Providecustomercarebyphoneoronline–  Industries:banking,healthcare,telecom,retail,…–  Theycanqueryresourcesandtakeac.onsviaWebAPIs

•  Chatbotsaredifficulttomaintainandmodify–  Requiretradi.onalsoTwareandmachinelearningskills•  NaturalLanguageUnderstanding(NLU)

–  Rapidlychangingbusinessneedsrequiresmodifica.ons

•  Objec.ve–  Generatechatbotsautoma.cally–  FocusonIBMWatsonConversa.onService–  GeneratechatbotsfromWebAPIspecifica.ons

Hello!

Page 3: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

3

FromWebAPIstoChatBots•  GeneratechatbotsfromwebAPIs–  StartfromaSwaggerspecifica.on–  Generateachatbotthatcan:•  HelptheusernavigateanAPI•  Makecallsconversa.onally

–  Examples:Human:Pleasetranslatethetext`lavie`totargetlanguage`en`Bot:`Life`

Human:WhatistheweatherinNYC?Bot:`windy`

42!

Page 4: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

4

I come from… … Swagger???

Swagger

•  StandardforspecifyingWebAPIs–  BasedonJSON–  Specifiesendpoints,opera.ons,parameters–  Hasdescrip.onsandsummaries

•  EcosystemoftoolsgeneratedfromSwagger–  APIdocumenta.on–  UIinterface,tryme–  ClientSoTwareDevelopmentKits(SDKs)–  Serverstubs–  Automatedtests->Swaggerbotaddschatbotstothisecosystem

Page 5: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

5

Challenges

•  Swaggerisinsufficient–  Missingdocumenta.on–  Inaccurate–  Missinglogicalrela.onships–  Needmul.pleAPIcallstomakeonecall–  Needtopassoutputofonecalltoanother–  APImayneedspecializa.onforanend-user’sneeds

•  Example:Transla.onfromFrenchtoEnglish,notjustanylanguage

•  Needtuningtogenerateausefulbot–  Howcanweallowthespecifica.ontobetunedbyabotdesigner?

Help!

Page 6: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

6

Your words just changed my code!

Approach

•  Generatedbotallowsliveprogramming–  Indialogtuning:botdesignercantunebotbyconversa.on–  Analogy:Spreadsheetinterface•  End-userinteractswiththetable•  Advancedusercancreatescriptsandmakethenavailable

–  Botdesignercancreatehigher-levelac.ons•  Inaconversa.onalmanner•  Makethemavailabletoend-userinthesameinterface

Page 7: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

7

Example:WatsonLanguageTranslator

Page 8: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

8

Page 9: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

9

It’s a red ball!

Page 10: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

10

Page 11: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

11

Features•  APIExplora.onandcalling–  Abilitytowalkuserthroughparameters–  Swaggerextensiontospecifyrela.onbetweenparameters•  Example:

–  translateneedsoneof{model_id}or{source,target}

–  Swaggerextensionforcallchaining•  Example:

–  Obtainingsourcelanguagewhenmissingduringtranslate

–  Swaggerextensionfordatashaping•  UsingJsonpathtospecifyhowtheoutputofacallshouldbeshaped

Page 12: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

12

Features

•  Directcalls–  Allparametersgivenconversa.onallyinafewlines–  UseWCSframestohelpfilloutmissingparameters

•  Parameterscanbeprovidedinanyorder–  Backgroundcontextkeptfromonecalltothenext–  Abilitytosetfieldsindependentlyofcalls

•  Tuningmode–  Abilitytonameac.onsandaddsynonyms–  Swaggerupdated

Page 13: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

13

WatsonConversa.onService(WCS)

Page 14: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

14

WCSWorkspace

•  Intentsanden..es–  Intentscaptureverbsorac.ons–  En..escapturenounsorobjects–  TheirpresencedetectedbyNLU

•  Dialog–  Finitestatemachinedefiningthelogicandflowofchat–  Eachstateisacondi.onal

• Whenanintentoren.tyisdetected,thenstatecanbeupdated

You cannot reduce me to an FSM!

Page 15: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

15

WCSWorkspaceUI

Page 16: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

16

SwaggerBotPrototype•  CompileSwaggertoaworkspaceandapp

–  Endpointsbecomeintents–  Opera.onsandparametersbecomeen..es–  Namesusedforclassifiertrainingdata–  Descrip.onsandsummariesusedforhelpdialog

•  Supportfortuningandliveprogramming–  Ac.oncrea.on

•  Newintentsaddedtounderlyingworkspace–  SynonymsaddedtoenrichNLUclassifier–  Workspaceuploadedwithoutstoppingthechatbot

•  Casestudies–  OnavarietyofAPIs–  Automa.callydownloadedandcompiled~1070APIsfromAPIGuru.

Page 17: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

17

FutureWork

•  Conversa.onaldatashaping–  PassingJsondatabetweencalls– Manipula.ngJsonviaconversa.on

•  Serverlessimplementa.on–  BasedonIBMFunc.ons–  Func.onsac.onsforpre/postprocessingsteps–  Noneedforaserverfortheapp

This talk is almost over!

Page 18: Generang Chat Bots from Web API Specificaonshirzels.com/martin/papers/onward17-swaggerbot-talk.pdf · • Chat bots are becoming ubiquitous – Provide customer care by phone or

18

Conclusion•  Swaggerbotisaconversa.onalprogramminglanguage–  Easiertousethancurl–  Fuzzysyntax,butrequiresprecisionforpassingparameters

•  Whattools/conceptsfromPLSEcanbereusedhere?

Thank you!