Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Emora STDM: A Versatile Framework for Innovativ...

Emora STDM: A Versatile Framework for Innovative Dialogue System Development

Emory NLP

July 08, 2021
Tweet

More Decks by Emory NLP

Other Decks in Technology

Transcript

  1. • Developing dialogue systems is a lot of work! •

    Specifications often can’t be found in data • Handcrafting is inevitable • Dialogue development frameworks streamline development ◦ Commercially-oriented, e.g. Google DialogFlow ◦ Update rule-driven, e.g. PyOpenDial (Jang et al 2019), PyDial (Ultes et al 2017) ◦ Custom languages, e.g. AIML, ChatScript 2 Introduction
  2. • Python package for dialogue system development • Simple systems

    developed by novices in minutes or hours • High customizability for complex interactions • Seamless integration of pattern matching, trained models, and custom logic • Two fully-interoperable approaches: a. State machine (rapid development) b. Information state* (complex interactions) 3 Emora State Transition Dialogue Manager * Larsson and Traum (2000)
  3. 4 State Machine Based Dialogue Management How are you? Hello!

    Hi! I am well. How are you? a b c d So did you have a good weekend? ⬛ System transition ⬛ User transition
  4. 'Hello!': { 'How are you?': { 'I am well. How

    are you?': {...} }, 'Hi!': { 'So did you have a good weekend?': {...} } } 5 State Machine Based Dialogue Management How are you? Hello! Hi! I am well. How are you? a b c d So did you have a good weekend? ⬛ System transition ⬛ User transition
  5. • Regex for natural language • Compiles into regular expression

    • Embed function calls ◦ Query databases ◦ Invoke neural models ◦ Custom processing 6 Natural Language Expression (Natex) Syntax Example Disjunction {like, love, adore} Conjunction <went to, yesterday> Sequence [when, skiing, cold] Negation - {always, usually, mostly} Capture $pet={dog, cat, fish} Function Call #NER(person, location)
  6. [i {like, love} $X=#POS(verb)] “I can swim, but I like

    running more” 8 Natex Compilation (Function Definition)
  7. [i {like, love} $X=#POS(verb)] “I can swim, but I like

    running more” class PartOfSpeech(Macro): def run(input, vars, args): return {token for token in input if part_of_speech(token) in args} {can, swim, like, running} 9 Natex Compilation (Function Definition)
  8. [i {like, love} $X=#POS(verb)] “I can swim, but I like

    running more” class PartOfSpeech(Macro): def run(input, vars, args): return {token for token in input if part_of_speech(token) in args} {can, swim, like, running} [i {like,love} $X={can,swim,like,running}] 10 Natex Compilation (Function Definition)
  9. Personally, I {like, love} $genre={action, horror} movies. “Personally, I like

    action movies.” ($genre=”action”) “Personally, I love horror movies.” ($genre=”horror”) 12 Natex for Natural Language Generation
  10. 13 State Machine Based Dialogue Management U 2 :[I, $ENT=#ONT

    (entertainment)] S 1 :Have you seen any movies lately? U 3 :[$MOVIE=#MDB()] S 3 :Sorry, I didn’t catch that. Have you seen any good movies? U 1 :ERROR S 2 :I’ve been watching a lot of $GENRE={action, horror, drama} movies {lately, recently} U 6 :#SENTIMENT(positive) [$GENRE] U 5 :ERROR U 4 :[{have, did} you {seen, watch} $MOVIE=#MDB()] S 5 :$MOVIE is one of my favorites! S 4 :What’s your favorite $ENT? S 6 :What is your favorite movie? a c b e f d g h S 7 :Why do you like $GENRE? ⬛ System transition ⬛ User transition
  11. • State machine-based dialogue is rigid • Update rules flexibly

    modify dialogue state and response • Update rule table is a list of conditional if...then… rules • Precondition is a Natex matching against the user input • Postcondition is a Natex using NLG compiler • All rules are applied before state machine transitions 14 Update Rules
  12. 15 Update Rules Example User: “My wife loves that movie”

    Precondition Postcondition #IF($is_adult) “Do you have kids?” (2.0) [{movie, movies}] #GOTO(state_x) [my {husband, wife}] #SET($married=True) #IF(married=True) #SET($is_adult=True) #REWRITE( dont -> do not) None
  13. 16 Update Rules Example User: “My wife loves that movie”

    Precondition Postcondition #IF($is_adult) “Do you have kids?” (2.0) [{movie, movies}] #GOTO(state_x) [my {husband, wife}] #SET($married=True) #IF(married=True) #SET($is_adult=True) #REWRITE( dont -> do not) None
  14. 17 Update Rules Example User: “My wife loves that movie”

    Precondition Postcondition #IF($is_adult) “Do you have kids?” (2.0) [{movie, movies}] #GOTO(state_x) [my {husband, wife}] #SET($married=True) #IF(married=True) #SET($is_adult=True) #REWRITE( dont -> do not) None
  15. 18 Update Rules Example User: “My wife loves that movie”

    Precondition Postcondition #IF($is_adult) “Do you have kids?” (2.0) [{movie, movies}] #GOTO(state_x) [my {husband, wife}] #SET($married=True) #IF(married=True) #SET($is_adult=True) #REWRITE( dont -> do not) None
  16. 19 Update Rules Example User: “My wife loves that movie”

    System: “Do you have kids?” Precondition Postcondition #IF($is_adult) “Do you have kids?” (2.0) [{movie, movies}] #GOTO(state_x) [my {husband, wife}] #SET($married=True) #IF(married=True) #SET($is_adult=True) #REWRITE( dont -> do not) None
  17. 20 Summary Precondition Postcondition [{hi, hello, hey}] “Hi. So, have

    you seen any good movies?” (2.0) [$movie =#MDB(movie)] $focus=$movie #IF(movie!=None) “Was $movie good?” (0.9)
  18. https://github.com/emora-chat/emora_stdm References Y. Jang, J. Lee, J. Park, K. Lee,

    P. Lison, and K. Kim. 2019. PyOpenDial: A Python-based Domain-Independent Toolkit for Developing Spoken Dialogue Systems with Probabilistic Rules. In Proceedings of EMNLP System Demonstrations. S. Larsson and D. R. Traum. 2000. Information state and dialogue management in the TRINDI dialogue move engine toolkit. NLE, 6(3 & 4):323-340. S. Ultes, Rojas B., Lina M., P. Su, D. Vandyke, D. Kim, I. Casanueva, P. Budzianowski, N. Mrksic, T. Wen, M. Gasic, and S. Young. 2017. Pydial: A multi-domain statistical dialogue system toolkit. In Proceedings of ACL System Demonstrations. 21 Thank You!
  19. [i {like, love} $activity=#POS(verb)] “I can swim, but I like

    running more” [i {like, love} $activity=#POS(verb)] [i (like|love) $activity=#POS(verb)] 23 Natex Compilation
  20. [i {like, love} $activity=#POS(verb)] “I can swim, but I like

    running more” [i {like, love} $activity=#POS(verb)] [i (like|love) $activity=#POS(verb)] [i (like|love) $activity=(can|swim|like|running)] 24 Natex Compilation
  21. [i {like, love} $activity=#POS(verb)] “I can swim, but I like

    running more” [i {like, love} $activity=#POS(verb)] [i (like|love) $activity=#POS(verb)] [i (like|love) $activity=(can|swim|like|running)] [i (like|love) (?P<activity>(can|swim|like|running))] 25 Natex Compilation
  22. [i {like, love} $activity=#POS(verb)] “I can swim, but I like

    running more” [i {like, love} $activity=#POS(verb)] [i (like|love) $activity=#POS(verb)] [i (like|love) $activity=(can|swim|like|running)] [i (like|love) (?P<activity>(can|swim|like|running))] .*?i.*?(like|love).*?(?P<activity>(can|swim|like|running)).*? 26 Natex Compilation
  23. [i {like, love} $activity=#POS(verb)] “I can swim, but I like

    running more” [i {like, love} $activity=#POS(verb)] [i (like|love) $activity=#POS(verb)] [i (like|love) $activity=(can|swim|like|running)] [i (like|love) (?P<activity>(can|swim|like|running))] .*?i.*?(like|love).*?(?P<activity>(can|swim|like|running)).*? Match with $activity set to “running”! 27 Natex Compilation
  24. Personally, I {like, love} $genre={action, horror} movies. Personally, I like

    $genre={action, horror} movies. 29 Natex for Natural Language Generation
  25. Personally, I {like, love} $genre={action, horror} movies. Personally, I like

    $genre={action, horror} movies. Personally, I like $genre=action movies. 30 Natex for Natural Language Generation
  26. Personally, I {like, love} $genre={action, horror} movies. Personally, I like

    $genre={action, horror} movies. Personally, I like $genre=action movies. Personally, I like action movies. ($genre=”action”) 31 Natex for Natural Language Generation