Detect sentiment
At some point in the interaction, you might care more about the user's emotions rather than the exact content. For such situations, we offer you tools to analyze the sentiment.
Imagine you would like to branch the flow based on what memories the user has of their hometown. More specifically, you don't care about what the memories are precisely about. You would just like to continue the "positive" flow if they have positive memories, the "sad" flow if they have negative memories, or the "neutral" flow if they don't have any particularly strong negative or positive memories. For this purpose, you can use sentiment analysis.
Sentiment analysis is available in πΊπΈ English, π¨πΏ Czech, π©πͺ German, and πͺπΈ Spanish dialogues
Sentiment analysis classifies text into three categories: positive, neutral, and negative. We can use those categories to branch the dialogue flow.
"I loved the city in which I grew up" and "I like you" have a positive sentiment.
"Prague is the capital of Czechia" and "I do sports" have a neutral sentiment.
"I hated the street" and "I don't enjoy loud music" have a negative sentiment.
Sentiment snippet
The easiest way to employ sentiment analysis is by using the predefined Sentiment snippet. Drag&drop it from the snippet palette into your dialogue.
Code in the user input node
If you want to work with the source code to customize the decision, you can proceed from the following code (in the UserInput node).
Don't forget to modify the names of the transitions according to the transitions in your model.
Last updated