microsoft / botframework-components

The repository for components built by Microsoft for the Azure Bot Framework.
https://aka.ms/botdocs
MIT License
113 stars 82 forks source link

Malfunctioning issue: CLU custom recognizer in Composer #1510

Closed srinath555 closed 1 year ago

srinath555 commented 1 year ago

Hi Team,

I'm working on Composer bot to integrate with CLU as custom Recognizer, So I've added CLU as a custom recognizer to Bot Framework Composer Bot referencing this doc (https://github.com/microsoft/botframework-components/tree/main/packages/Recognizers/ConversationLanguageUnderstanding/dotnet).

The CLU project is trained 2 intents called “MainMenu” and “Cancel” in English, Spanish and French and when tested in CLU Language Studio Portal the Score range is between 0-1 (ex. 0.58299) for any utterance. image

But when executed composer dialogs and user language is set to “ Spanish” or “French” for any utterance the recognizer should return the score in range of 0-1 but it is returning score like 58299387.0 instead of 0.58299387.

Below are example we tried for the utterance “end my flow“ in English and “terminar mi flujo” in Spanish. image

Apart from English for all languages I'm facing this issue, only for English it is returning the score between 0 – 1 which is as expected. image

Please help me to get it resolved, Thanks in advance!

ramfattah commented 1 year ago

Thanks @srinath555 for reporting this issue. I'm investigating.

RajaniJillaGit commented 1 year ago

Hi Team, Any update on the investigation ? Thank you.

More Insights in the attachment with the detailed logs. CLUComposerPackageObservations.docx

peterswimm commented 1 year ago

related: https://github.com/microsoft/BotFramework-Composer/issues/9579

ramfattah commented 1 year ago

Thanks for reporting this issue @srinath555,

I'm able to reproduce this issue with ConversationLanguageUnderstanding package installed and configured in Composer.

It appears after switching Composer to default language that's not English, the intent I got was 29669416.0. Whereas in Composer's English default language the intent score was between range of 0-1.

Sharing the steps to reproduce:

  1. In Language Studio, create a Conversational Language Understanding project with multiple languages enabled
  2. In the new CLU project, add Utterances in different languages in your intents
    • Cancel intent
      • French - mettre fin à mon flux
      • Spanish - terminar mi flujo
      • English - end my flow
    • MainMenu intent
      • French - afficher le menu principal
      • Spanish - mostrar menú principal
      • English - show main menu
  3. Train and deploy the model in Language Studio
  4. Create Empty Composer C# bot and install ConversationLanguageUnderstanding package
  5. Configure the CLU recognizer package in Composer dialog as mentioned in the following documentation
    • Example:
    • image
  6. In the CLU Recognizer dialog, add a trigger to handle the intent
    • Example:
    • image
  7. Test the intent score after switching to non English language such as Spanish image

# Screenshots:

Composer as Spanish default language: image

Composer as English default language: image

Language Studio Intent and Utterances: image

ramfattah commented 1 year ago

@srinath555, discussing internally for the next steps.

anishprasad01 commented 1 year ago

@srinath555,

I believe this to be caused by an error in parsing the confidence score in the SDK due to the different ways that fractional values are represented in different cultures. I've opened a PR to fix this, pending sufficient testing and verification.