Grammatical Error Corrections
Detects grammar, spelling, punctuation, and word choice errors in text, and suggests how to correct them.

Our /gec
API gives you access to our top-of-the-line GEC engine. It was specifically developed for this, and it has been fine-tuned accordingly. By integrating this Wordtune API into your writing platform, you can provide your users with the confidence to write without the need to worry about grammar. This is also the engine behind Wordtune - our award winning writing assistant, so you know it's pretty awesome.
Don’t just take our word for it, give it a go! 💫
Whether you're an NLP enthusiast or have no prior knowledge, this API is for you. There are many clever mechanisms under the hood, but you don't have to understand them (if you don't want to). As a task-specific API, you can easily integrate it into your systems and get top-notch gramatical error corrections in a matter of minutes, with no prompt engineering required. Additionally, since it's optimized for this purpose, it's significantly more efficient than building it from scratch, and an order of magnitude cheaper.
You simply need to send some text to the API, and it will return a list of every grammar error, including its location and suggestions for corrections and the type of the error (to indicate to users why it should be fixed).
Features
Fix every grammar error
Allow your users to write with flawless grammar, including tenses, verb additions, changing the order, and everything else you forgot since English high school lessons. No more wondering if it's who or whom.
Before | After |
---|---|
I'm is going | I'm going |
I'm going go | I'm going to go |
I was in the there | I was there |
Find all the missing words
It difficult read a sentence like this, isn't it? The GEC API will make it easier for you to do this.
Before | After |
---|---|
This soup very tasty | This soup is very tasty |
Punctuation: Punctuation, Punctuation!
Give your users peace of mind without having to worry about double whitespaces, incorrect punctuation, and answering the most annoying question - do I need a hyphen here?
Before | After |
---|---|
Are you going to be there! | Are you going to be there? |
Hi you | Hi, |
Take the spelling bee by storm
A spell check, but so much more: Capitalizing, changing words that sound the same but spelled differently, and fixing errors caused by typos.
Before | After |
---|---|
I'm not aloud to go | I'm not allowed to go |
i think i tough i saw you tryt | i think i thought i saw you try |
Let it god | Let it go |
Avoid repetition of repetitive word repetitions
Do you know the song "I will will always love you"? How about “I will always love you you”? Doesn’t have the same ring, does it? With GEC API you can make sure you’ll always have a hit.
Before | After |
---|---|
Gimme Gimme Gimme a man after midnight | Gimme a man after midnight |
Communicate the right message without using any wrong words
Did you ever use words with similar sounds or spellings? GEC API makes sure you want won't!
Before | After |
---|---|
At times, my job can be quite monogamous | At times, my job can be quite monotonous |
Examples
Imagine that you want to integrate the GEC API into your writing platform. To illustrate how you would do it, here is an example:
import ai21
ai21.api_key = 'YOUR_API_KEY'
text = "jazzz is a great stile of music"
response = ai21.GEC.execute(text=text)
// Use the corrections to fix the sentence
corrected_text = text
corrections = response["corrections"]
for curr_correction in reversed(corrections):
corrected_text = corrected_text[:curr_correction["startIndex"]] + curr_correction['suggestion'] + corrected_text[curr_correction["endIndex"]:]
And the fixed sentence:
print(corrected_text)
// Jazz is a great style of music
Updated 2 months ago