-
Notifications
You must be signed in to change notification settings - Fork 0
Tutorial
In KorraAI you create a "model" that incorporates everything the bot can do. This includes the phrases the bot will use, when the phrases will be used, after what time or due to what circumstances the behavior will change.
In KorraAI these are 5 things to create or modify:
-
Choose categories of interactions
-
For each category provide items
-
Build a probabilistic distribution over the categories
-
Adjust cognitive distributions provided by KorraAI
-
Choose probabilistic variables that correspond to concepts from your domain and set dependencies (also called causality) between them
-
Encode changes of behavior based on the user's responses or the time that has passed
It is recommended to start with the model already provided called Joi. If you just want to have a feel of how it works you can modify the existing phrases or add phrases to the existing categories. Phrases are the sentences the bot will use and they are also generalized as "items", where an item can be non-verbal interaction. For example you can add sport recommendations (items) in the category "Suggestions" - > "SuggestGoToGym". The following applies to 1,2 and 3.
Currently encoded categories:
MakeSuggestion Say a joke, suggest a movie to watch, play a song
AskUncertanFactQuestion Ex. "Are you tired?" , how much tired can vary
AskPureFactQuestionAboutUser Ex. "How old are you?", an exact fact about the user
SharePureFactInfoAboutBot Ex. "I am 30 years old", an exact fact about the bot
ChangeVisualAppearance Changing clothes from time to time.
ExpressingMentalState Ex. "I am definitely in a good mood today!", how much happy can vary
Next you can modify the probabilities of each category:
MakeSuggestion 50.3% ##################################################
AskUncertanFactQuestion 1.06% #
AskPureFactQuestionAboutUser 45.5% #############################################
SharePureFactInfoAboutBot 0%
ChangeVisualAppearance 1.59% #
ExpressingMentalState 1.59% #
The above shows that in this model we favor 'MakeSuggestion' and 'AskPureFactQuestionAboutUser' with the later asking the user questions such as: age, name, location, etc. The suggestions category has subcategories:
TellJoke 44.7% ############################################
SuggestListenToSong 32.6% ################################
GoOut 4.1% ####
SuggestToWatchMovie 9.31% #########
SuggestGoToGym 9.31% #########
From each category we sample "interactions". Interactions are pre-sampled, although we could sample just one before using it. We encoded a distribution, so it should matter if we sampled 100, 1000 or 1, we should get the same proportions in the end. Pre-sampling also helps to verify that we really got the distribution we wanted and that can be verified even at run-time. Pre-sampling also helps with debugging. The final result is a list of interactions ready to executed in the conversation with the user. The CompanionLog.txt contains all this information. Also a statistics is added saying how many items were assigned to each cateogory:
|SuggestGoToGym: 8
|AskPureFactQuestionAboutUser: 0
|SuggestListenToSong: 37
|ExpressingMentalState: 3
|TellJoke_missing: 33
|**SuggestToWatchMovie_missing: 4**
|AskUncertanFactQuestion: 2
|ChangeVisualAppearance: 1
|GoOut: 2
|**SuggestGoToGym_missing: 2**
If we sample for too many items then there might not be enough. These are showed as "Category__missing". This is a problem, but not in the case where we know that will re-sample again soon with a change in the probabilities that will result in no missing items.