Grammatical Error Corrections
Detects grammar, spelling, punctuation, and word choice errors in text, and suggests how to correct them.
This model is no longer supported. For better results, see Jamba 1.5.
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.
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).
Links
- Playground: Try it in the browser, with all the API parameters.
- API documentation: Learn how to use it via REST or our SDK.
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:
from ai21 import AI21Client
client = AI21Client(
# This is the default and can be omitted
api_key=os.environ.get("AI21_API_KEY"),
)
text = "jazzz is a great stile of music"
response = client.gec.create(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.start_index] + curr_correction.suggestion + corrected_text[curr_correction.end_index:]
And the fixed sentence:
print(corrected_text)
// Jazz is a great style of music
Updated about 1 month ago