bing spell check api not work in mode 'proof'

占帅 邵 1 Reputation point
2022-03-24T06:52:54.537+00:00
example_text = "I is a techer" 
endpoint = "https://api.bing.microsoft.com/v7.0/SpellCheck"

data = {'text': example_text}

params = {
    'mode':'proof',
    'text': example_text,
    'mkt': 'en-US',
    }

headers = {
    'Ocp-Apim-Subscription-Key': '<my key>',
    'BingAPIs-Market':'en-US',
    'Pragma': 'no-cache'
    }
response = requests.post(endpoint, headers=headers, params=params)

The result returned shows no errors. is should be am , techer should be teacher

Bing Spell Check
Bing Spell Check
A Bing service that detects and corrects spelling mistakes in your app.
29 questions
{count} votes

1 answer

Sort by: Most helpful
  1. romungi-MSFT 42,116 Reputation points Microsoft Employee
    2022-03-24T07:33:00.197+00:00

    @占帅 邵 Do you mean there is no response for above call i.e suggestions?

    I have run the same snippet and the following suggestions are shown:

    response.json()  
    {'_type': 'SpellCheck', 'flaggedTokens': [{'offset': 0, 'token': 'I', 'type': 'UnknownToken', 'suggestions': [{'suggestion': 'IT', 'score': 0.853576744443262}]}, {'offset': 7, 'token': 'techer', 'type': 'UnknownToken', 'suggestions': [{'suggestion': 'teacher', 'score': 0.853576744443262}]}]}  
    
    0 comments No comments