Dialogflow CX - Transition to page using sentiment analysis score

Viewed 99

Does anyone know if it’s possible to transition to a different page solely off of a sentiment analysis score ($request.sentiment.score) of the end-user’s response?

I basically want the agent to ask the end-user a question and then have the agent route the user to a page strictly using the sentiment analysis score of the user’s response and nothing more


What I tried so far:

Through the Dialogflow-CX simulator, I am trying to transition to a different page using the conditional statement $request.sentiment.score <= 0 in the route, however the agent does not transition to the next page and cannot match my input to the strictly conditional route (it just jumps to the sys.no-match-default event handler)

Here is a screenshot of the route I have set up:

enter image description here

As you can see, the route has no intents other than a conditional trigger that has $request.sentiment.score <= 0 as the parameter.

I simply want the agent to direct the end-user to the next page whenever it detects a message with a negative sentiment score. The next screenshot shows that the agent detects that the sentiment score is negative, however the agent does not transition to the next page.

enter image description here

Does anyone know what I seem to be doing wrong?

1 Answers

In your project, it seems you have not selected intent that's why unable to go to the next page.You can follow the below steps in Dialogflow CX Console for your requirement :

1 If you need to go to the bad_service page, then we need to give some negative words as you can see in the image below. enter image description here

2 In this, if $request.sentiment.score is less than zero then only the condition will satisfy. For example , if we give some negative words like bad service then $request.sentiment.score score is less than zero then will go to bad_service page. enter image description here

3 Now select the page.

enter image description here

Example of working:

1 Positive Query Score:

enter image description here

Here the Query Score is 0.8 greater than zero,so the condition is not satisfied.

2 Negative Query Score:

enter image description here

Here the Query Score is -0.9 so we reached the bad_services page.

EDIT #1

You can transition to the page using the sentiment analysis score:

Step1: Add new sys.no-match-default event handler by clicking the + symbol near to Event handlers:

enter image description here

Step2: Select sys.no-match-default from the drop down button under Event and apply the condition to trigger in your case ( $request.sentiment.score <= 0).

enter image description here

Step3: Select the page you want , in your case the Negative Sentiment page.

enter image description here

Step 4: Add another sys.no-match-default event handler and select that.

enter image description here

Step 5: Apply the condition ( $request.sentiment.score >= 0) to trigger the positive not trained phrases .

enter image description here

Example:

enter image description here

Here I added two no-match-default event handlers,if the world is negative then we will come to a negative sentiment page from any page and the same for positive words.

Negative sentiment score:

enter image description here

Related