microsoft / Cognitive-LUIS-Windows

Windows (.Net) SDK for the Microsoft Language Understanding Intelligent Service API, part of Congitive Services
www.microsoft.com/cognitive-services/en-us/language-understanding-intelligent-service-luis
Other
134 stars 78 forks source link

how to use bing spell checker in luis? #18

Closed Masssluis closed 6 years ago

Masssluis commented 7 years ago

I am using LUIS and as in the documentation i have enabled spell checker and added the key. i have got the key after registering in cognitive services of bing spell checker. @msftdata @msftgits capture1

JPThorne commented 7 years ago

As I understand it that should be good enough. Have you tried testing it with some misspelled utterances?

Masssluis commented 7 years ago

same issue with me also , i have also done the same , but it does not seems to be working

JPThorne commented 7 years ago

Perhaps worth mentioning - I noticed it only really kicks in on longer utterances. Single misspelled words don't get auto-corrected. But with a longer sentence that contains misspelled words then the auto-correct works.

alokraj68 commented 7 years ago

@JPThorne would be great if you could give an example occurrence.

JPThorne commented 7 years ago

@alokraj68

Here's an example of a long utterance with the corrected, altered, query returned by querying the endpoint of our published app with the spellchecker option enabled:


  "alteredQuery": "what is the price of the core income fund"

versus: 
"query": "fundz"```

This is a misspelling of funds. 
alokraj68 commented 7 years ago

@JPThorne Can you show me your JSON? because it's still not clear to me. Bing spell checker not working for me until now.

JPThorne commented 7 years ago

Ok well, so the following JSON is what we get when querying our endpoint:

https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/[APP_KEY]?subscription-key=[SUB_KEY]&timezoneOffset=0.0&verbose=true&spellCheck=true&q=waht is the pirce of hte core income funnd

{
  "query": "waht is the pirce of hte core income funnd",
  "alteredQuery": "what is the price of the core income fund",
  "topScoringIntent": {
    "intent": "SelectSomething",
    "score": 0.9951398
  },
  "intents": [
    {
      "intent": "SelectSomething",
      "score": 0.9951398
    },
    {
      "intent": "RequestMoreInfo",
      "score": 0.181434
    },
    {
      "intent": "None",
      "score": 0.0122905066
    },
    {
      "intent": "WantToInvest",
      "score": 0.01046673
    },
    {
      "intent": "NavigateBack",
      "score": 0.005361713
    },
    {
      "intent": "AskAboutFunds",
      "score": 0.00461486634
    },
    {
      "intent": "UserThanks",
      "score": 0.00215001684
    },
    {
      "intent": "BotGuide",
      "score": 0.00154411
    },
    {
      "intent": "AskGeneralInfo",
      "score": 0.00100062718
    },
    {
      "intent": "RequestInvestForms",
      "score": 0.0009928506
    },
    {
      "intent": "LiveAgent",
      "score": 0.0007549511
    },
    {
      "intent": "Help",
      "score": 0.000373806863
    },
    {
      "intent": "UserGreeting",
      "score": 0.000263332739
    },
    {
      "intent": "ChangeUserType",
      "score": 4.443935E-05
    },
    {
      "intent": "RequestGenericApplicationForm",
      "score": 9.46233847E-09
    }
  ],
  "entities": [
    {
      "entity": "core income fund",
      "type": "Funds::Income Fund",
      "startIndex": 25,
      "endIndex": 40,
      "score": 0.9156845
    }
  ]
}

and

https://westus.api.cognitive.microsoft.com/luis/v2.0/apps/[APP_KEY]?subscription-key=[SUB_KEY]&timezoneOffset=0.0&verbose=true&spellCheck=true&q=fundz

{
  "query": "fundz",
  "topScoringIntent": {
    "intent": "AskAboutFunds",
    "score": 0.9760697
  },
  "intents": [
    {
      "intent": "AskAboutFunds",
      "score": 0.9760697
    },
    {
      "intent": "UserGreeting",
      "score": 0.8276377
    },
    {
      "intent": "None",
      "score": 0.105462894
    },
    {
      "intent": "Help",
      "score": 0.09007339
    },
    {
      "intent": "UserThanks",
      "score": 0.08986076
    },
    {
      "intent": "NavigateBack",
      "score": 0.06338278
    },
    {
      "intent": "RequestMoreInfo",
      "score": 0.0197438281
    },
    {
      "intent": "SelectSomething",
      "score": 0.008263543
    },
    {
      "intent": "AskGeneralInfo",
      "score": 0.00778624741
    },
    {
      "intent": "RequestInvestForms",
      "score": 0.00186299626
    },
    {
      "intent": "LiveAgent",
      "score": 0.00126411289
    },
    {
      "intent": "BotGuide",
      "score": 0.000818056869
    },
    {
      "intent": "WantToInvest",
      "score": 0.000526722
    },
    {
      "intent": "ChangeUserType",
      "score": 0.000232829567
    },
    {
      "intent": "RequestGenericApplicationForm",
      "score": 3.6368603E-14
    }
  ],
  "entities": []
}
alokraj68 commented 7 years ago

@JPThorne Tried same query and got this

{
  "query": "waht is the pirce of hte core income funnd",
  "topScoringIntent": {
    "intent": "getPredictions",
    "score": 0.9421084
  },
  "intents": [
    {
      "intent": "getPredictions",
      "score": 0.9421084
    },
    {
      "intent": "None",
      "score": 0.07524864
    }
  ],
  "entities": [

  ]
}

Did not get any altered query :(

JPThorne commented 7 years ago

Hmm okay, did you enable spell-check when publishing your app? Did you purchase a Cognitive Services LUIS key in Azure and assign it to your app?

image

alokraj68 commented 7 years ago

@JPThorne Did both, should I enable bing spell checker by adding external key?

JPThorne commented 7 years ago

Yes I think you would need to do that.

image

yescay commented 7 years ago

The bing spell check API is a different API and in order to utilize it in LUIS intent, the following steps are required.

  1. Set up External Key association Get a Bing Spell API key from the cognitive services
  2. Add it to the External Key association.
  3. In the LUIS intent publishing screen, Select the 'Enable Bing spell checker'
  4. When submitting the intent, if there is a spelling mistake, the LUIS intent will return a 'alteredQuery' element in JSON and also the original 'Query'

Trust it helps.

dileepkantapop commented 7 years ago

@JPThorne We had followed all these steps, but facing the issue with the spell checker option in LUIS, As i am checked it and published. When i see again its showing as unchecked. I had purchased Bing spell check key too.

https://github.com/gunthercox/ChatterBot/issues/922#issuecomment-321768404

rawatsudhir commented 7 years ago

Check here and I am sure it will help #51

ligadata-ibrahim commented 5 years ago

any idea how to set a parameter for bing spell check in the LUIS URL?