Alternate Intents not returned in DialogFlow CX - detectIntent API

643 views
Skip to first unread message

Sylvin Amelia

unread,
Oct 6, 2020, 4:10:45 AM10/6/20
to Dialogflow CX Edition users
Hi,

I am trying to replicate a scenario where "alternate matched intent" returns other intents that have a close match/close confidence score. But the API always returns 1 intent with the highest confidence score and skips all other intents, is there any way to make it function similar to ES version?

Steps followed - Created Intent1 with utterance "Check balance" and created Intent2 with "test balance". And in test window if I type "Balance" it always returns only "Intent2" 

"Alternative Matched Intents": [
      {
        "Id": "84383366-215f-40a3-9ba6-464238f0c2aa",
        "Score": 0.5985087752342224,
        "DisplayName": "Intent2",
        "Type": "NLU",
        "Active": true
      }
    ]

Joaquim Suazo

unread,
Oct 9, 2020, 8:42:05 PM10/9/20
to Dialogflow CX Edition users
Hello,

I experience the same behavior as you. Also, I tried the same with DialogFlow Essentials and I get the same intent2 only.

I achieved retrieving all the intents with any score using the client libraries but not using the Console UI test window. Dialogflow CX is currently in beta release and I think this could be not implemented yet.

Can you point me how did you get the other intent values in the ES version? using the test window?

Marianne Lerin

unread,
Oct 22, 2020, 1:01:48 AM10/22/20
to Dialogflow CX Edition users

Hi Sylvia,

The "Alternative Matched Intents" field helps you to debug the intents that are matched by user utterance in current flow model, which would also contain the matched intent itself. 

Moreover, these intents are only the intents that are referenced in the flow (e.g. used by transition route in the flow page) which are picked up by the flow model. 

Note that intents which are not referenced in the flow will not be included in the “Alternative Matched Intents” field.

Here are some sample scenarios where we can use the "Alternative Matched Intents" field for debugging purposes:

Example 1:

Screen Shot 2020-10-22 at 12.53.59 PM.png

If you have Intent-1 and Intent-2, which both contain the training phrase "hello" and they are both referenced in the current flow (see image above - Intent-1 was referenced in the Intent1 page and Intent-2 was referenced in the Intent2 page). When the user says "hello" on the start page, Intent-1 will be triggered and both Intent-1 and Intent-2 will be included in the "Alternative Matched Intents" field. Note that the agent is still matching the user utterance to Intent-2 and it is the configuration of the pages/transitions (i.e. the state model) that is resulting in Intent-1 being triggered.

Result: 

Screen Shot 2020-10-22 at 12.55.33 PM.png


Example 2:

Screen Shot 2020-10-22 at 12.57.35 PM.png

If you have Intent-3, which has the training phrase "check balance" and it is referenced in the lower level of your current flow. When the user says "check balance" on the start page, NO INTENT will be matched since based on the current flow, you have to go through Intent-1 and Intent-2 first before Intent-3 could be matched (see image above - Intent-3 was referenced in the Intent3 page). However, Intent-3 will also be included in the "Alternative Matched Intents" field since it is referenced in the current flow.

Result:

Screen Shot 2020-10-22 at 12.58.53 PM.png

Moreover, as you can see in the Results above, there is an “Active” field that indicates whether the intent is active or not (the value is true if it’s active and false if it’s not). Basically, Active intents are the intents that are in the current scope. For example, if the user is currently on "Intent1" page, then only the intents in the current flow's (START_PAGE’s) transition route or the current page's (Intent1’s) transition route or transition route group are considered as active intents. See https://cloud.google.com/dialogflow/cx/docs/concept/handler#scope for more details.

Reply all
Reply to author
Forward
0 new messages