No longer supported
With our Grammatical Error Corrections (GEC) endpoint, you can tap into our advanced GEC engine, purpose-built and expertly tuned for this task.
Using the GEC endpoint is straightforward: simply send the text to the API and receive a list of every grammar error, complete with its location and suggested corrections.
Using a quote from Winnie the Pooh as an example, imagine that we've inserted it into the text parameter but made some mistakes:
{
"text": "It is is more fun to talk with someone who doesnt use long, difikolt words but rather short, easy words like, ‘What about lunch"
}
The GEC API can identify and suggest corrections for these errors.
Following is the expected response:
{
"id": "e6360a99-701b-813b-7296-f08057918320",
"corrections": [
{
"suggestion": "It is",
"startIndex": 0,
"endIndex": 8,
"originalText": "It is is",
"correctionType": "Word Repetition"
},
{
"suggestion": "doesn't",
"startIndex": 43,
"endIndex": 49,
"originalText": "doesnt",
"correctionType": "Grammar"
},
{
"suggestion": "difficult",
"startIndex": 60,
"endIndex": 68,
"originalText": "difikolt",
"correctionType": "Spelling"
},
{
"suggestion": "lunch?",
"startIndex": 122,
"endIndex": 127,
"originalText": "lunch",
"correctionType": "Punctuation"
}
]
}
As you can see, the response includes 4 corrections to mistakes found in the given text - Each correction is returned as an object with the following fields:
suggestion
: the suggested correction.
startIndex
: the index at which the correction process starts within the provided text.
endIndex
: the index at which the correction process ends within the provided text.
originalText
: the text where the mistake was identified.
correctionType
: a required field that specifies the type of correction suggested by the GEC API.
The possible types of correction are Grammar
, Missing Word
, Punctuation
, Spelling
, Word Repetition
, and Wrong Word
.