question

20170082 avatar image
0 Votes"
20170082 asked romungi-MSFT commented

bing spell check api not work in mode 'proof'

 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

azure-bing-spellcheck
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@20170082 Did you get a chance to print the result and check if the response helped?

0 Votes 0 ·

1 Answer

romungi-MSFT avatar image
0 Votes"
romungi-MSFT answered

@20170082 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}]}]}


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.