7

I am trying to to use the Bing Spell Check API v5 but I'm running to to many issues.

When requesting to either spell or proof with the sentence below, it returns no flagged tokens.

This is a long sentance with some mistakes in here. Its supposed to be a question but i can’t think of a long question. maybe that means i don’t have something selious to ask?

{"_type": "SpellCheck", "flaggedTokens": []}

If I limit the request text to 128 characters it works though. I've tested this in Bing's API testing console it works.

I'm calling the API with what is advised for PHP (Http_Request2) with the POST variation. Also, I'm using a free subscription at the moment but will be upgrade if the application works. Otherwise it looks like I'll have to find another API, which is a shame.

I have tried requesting this many different ways to make sure it's not just my code. I've used cURL and the application PostMan but all return the same issue.

Any insight on why this is happening would be greatly appreciated as it's given me hours of confusion!

Paul T. Rawkeen
  • 3,994
  • 3
  • 35
  • 51
Sam
  • 111
  • 2

2 Answers2

0

Code works, text is unreliable, 128 is not the max size. No idea why the Bing api test processes your text without problems.

How to get to those conclusions? Copy your favorite implementation from here or use Postman(yes, it works). Using Post or Get does not matter for the text size.

Try it with the text "Bill Gatas", formatted with a %20 or +, it has the same result as the example. Confirming your code works.

Next try the following text, being more than 128 characters(162). And it should return a result.

%20is%20a%20long%20Bill%20Gatas%20.Bill%20Gatas%20.Bill%20Gatas%20.Bill%20Gatas%20.Bill%20Gatas%20.Bill%20Gatas%20.Bill%20Gatas%20.%20.Bill%20Gatas%20.%20.Bill%20

Anything over this has the blank result. (try adding Gatas to the end). Now the specification says the maximum is 1500 characters in the url, and "The combined length of the text string, preContextText, and postContextText may not exceed 10,000 characters." And as pointed out here, spell was designed for around 9 tokens.

So whatever the Bing test website is doing, it's probably some batch job. Or they got the proof implementation to work.

  • (Which I've tried, same result, no tokens)
  • (Also tried the whole thing again for v7, same result, no tokens)
0

Ok that’s not entirely true. With GET requests there is typically a limit imposed by the server. Most security configurations restrict query string length. If you have a large text string you should use a post request. https://app.pluralsight.com/library/courses/microsoft-azure-cognitive-services-bing-spell-check-api/table-of-contents

Mintey
  • 118
  • 11