Skip to content

Instantly share code, notes, and snippets.

@treethought
Created October 13, 2017 00:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save treethought/b662fdb4a59ee59910ab3169420a0a46 to your computer and use it in GitHub Desktop.
Save treethought/b662fdb4a59ee59910ab3169420a0a46 to your computer and use it in GitHub Desktop.

Are events being used most effectively

The EventState classes are being used to trigger other intents, which then set dialogue checkpoints and perform logic. This divides the bot experience into sensible components (Report Items, Show Items, Gathering Info about an Item, etc). However, it also requires that each step/state of these components be completed in a specific order.

While I appreciate the serparation of logic and the EventStates' purpose of starting the next segmnet of dialogue, I feel that it may be overly complex and redundant, without providing potential advantages. We could simply use the EventState phrases for the targeted Intent itself, which accomplishes the same triggering.

With the following Events, "Phrases", and Intents to report a found phone

Instead of:

intention_start -> intention (no "User Says Phrases")

Which begins either report or show dialogues:

  • intention-report ("I want to report") -> type_start
  • intention-showlostitem ("see lost items") -> showitem_start

And

type_start -> type (no "User Says Phrases")

Which begins the item type dialogue

  • type-extract ("phone, passport,...")
  •  -> `phone_start` -> **phone-question** (_"No User Says_)
    

We could do

report_start/"I want to Report" -> report -> type_start

type_start/"Item is a passport" -> type-extract -> id_start

or

showitem_start/"see lost items" -> showlostitems -> showitems_describe/showitems_recent

or

This more streamlined approach would also allow the user to directly trigger a certain state of dialogue with out walking through the steps required to branch into that state.

And by combining the EventStates and their triggered Intents into one single Intent, we can also have certain states on conversation be directly accessible if given the required parameters SO instead of:

user: report item
bot: Describe/take photo
user: its a phone
bot: ok what type of phone (iphone/android)
user: android
bot: where did you find it?
user: pool
bot: would you like to use today's date?

The user could get the same result with:

user: i found an android phone by the pool
bot: ok did you find it today?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment