question

ShionneMatsuda-1725 avatar image
0 Votes"
ShionneMatsuda-1725 asked YutongTie-MSFT commented

Bing Spell Check doesn't catch obvious errors

I am testing out Bing Spell Check on sentences that make no sense like this one:

"A couple of other calendar 18 your work all over the body thank you on the. 18 your. Thank you what. On the calendar 18."

but the results come up with nothing flagged as being wrong. I am following this Python Quickstart guide exactly, minus changing the API key and example text:
https://docs.microsoft.com/en-us/bing/search-apis/bing-spell-check/quickstarts/rest/python

To make sure it's working, I put in a misspelled word and that gets flagged so I know it's just not catching the incorrect errors in the above text. I also set 'mode' to 'proof' so it should be catching most grammar errors.

Is there a different feature or parameter I'm supposed to be implementing so this works better?

azure-bing-spellcheck
· 9
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.

Hello,

Thanks for reaching out to us. Could you please verify are you in mode "proof"? The type of spelling and grammar checks to perform. The following are the possible case-sensitive values: proof — For document scenarios
Proof mode provides the most comprehensive checks, adding capitalization, basic punctuation, and other features to aid document creation, but it's available only in the en-US (English-United States), es-ES (Spanish-Spain), pt-BR (Portuguese-Brazil) markets. Note that Proof mode is a Beta in the Spanish and Portuguese markets. For all other markets, set the mode query parameter to Spell.
NOTE: If the length of query text exceeds 4096 characters, it will be truncated to 4096 characters before being processed.

0 Votes 0 ·

spell — For web search scenarios
Spell mode is more aggressive in order to return better search results. The Spell mode finds most spelling mistakes but doesn't find some of the grammar errors that Proof catches; for example, capitalization and repeated words.
NOTE: The text string is not checked for spelling mistakes if the string exceeds the following maximum lengths based on language code.
130 characters for en, de, es, fr, pl, pt, sv, ru, nl, nb, tr-tr, it, zh, and ko. 65 characters for all others.
Also, Because square brackets ( '[' and ']' ) may cause inconsistent results, you should remove them before checking the string for spelling mistakes.

Please let me know if the result stays same. Thanks.

Regards,
Yutong

0 Votes 0 ·

Hello,

Yes as mentioned in my original post, I am using proof mode since I am trying to find grammar errors, not spelling errors.

0 Votes 0 ·
YutongTie-MSFT avatar image YutongTie-MSFT ShionneMatsuda-1725 ·

@ShionneMatsuda-1725 Thanks for checking on your side. I am checking internally to see if there is something wrong in this function.


Regards,
Yutong

0 Votes 0 ·

Hi Yutong!

I wonder if there's any update on this issue. I'm also facing a similar problem with the Proof mode in en-US, even for very short inputs. Here's a code snippet I used:

import requests
import json

api_key = API_KEY
text = "We is good."
endpoint = "https://api.bing.microsoft.com/v7.0/spellcheck"

params = {
    'mkt':'en-US',
    'mode':'proof',
    'text' : text
    }
headers = {"Ocp-Apim-Subscription-Key": api_key}
response = requests.post(endpoint, headers=headers, params=params)
response.raise_for_status()
search_results = response.json()
print(search_results)

The printouts are:
{'_type': 'SpellCheck', 'flaggedTokens': []}

The obvious grammatical error of the word is was not caught at all. However, with the input We is good good., the Spell Check is able to catch the repeated good.

Am I missing something or is the function not working as expected internally?

0 Votes 0 ·

@ChenShenEn-3750 Hello, the reported issue should be fixed already. I am checking again for confirm. Thanks.


Regards,
Yutong

1 Vote 1 ·
Show more comments

0 Answers