Quarantine Chat Bot: Sentiment Analysis

Yesterday, I started talking about how I built a chat bot to talk to my parents during this quarantine. We got started by setting up the environment, provisioning the bot, editing the greeting messages, and adding our first question.

Now, we are going to add a few more brains into the operation!

I wanted the bot to be able to respond correctly to free form text input. The goal was to receive a piece of information, determine the sentiment, then respond accordingly.

Power Virtual Agent Free Form Text Capture
First we get a response from the user, pass it to Power Automate, and then decide how we want to act on it.

After capturing the response you can add a new step to Call an Action which will give you the option to Create a Flow. This new Flow (in Power Automate) will be created with the steps needed to receive the value from your bot and send any necessary information back.

Power Virtual Agents Call an Action
When adding a new step you can choose to Call an Action and Create a new Flow.

Within the Flow, it is relatively simple to do sentiment analysis because the model is already built out with AI Builder. There is no need to build a new model or call cognitive services, just use the AI Builder connector.

Power Virtual Agents checks and returns sentiment
Here we are bringing in the text as an input. This is fed into the SentimentAnalysis model of AI Builder then we return the sentiment found to Power Virtual Agents.

Now that we have the sentiment, we can just write the appropriate message to respond to that sentiment.

That’s enough for today. Next up we work with dates!

One thought on “Quarantine Chat Bot: Sentiment Analysis

Leave a Reply