Text Improvements
Provides rewrite recommendations for improving the fluency, clarity and style of the input text.
This model is no longer supported. For better results, see Jamba 1.5.
This API scans a piece of text to see if it can be improved. The different models behind it check for fluency, clarity, and vocabulary. In the event that it finds areas that need improvement (and only if it finds them), it will return a list of suggestions (with locations).
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
Speak with great fluency
Let your users express themselves more fluently, phrasing the same message in a natural way.
Before | After |
---|---|
Affiliated with the profession of project management, I have ameliorated myself with a different set of hard skills as well as soft skills. | Being involved in the profession of project management, I have developed a different set of hard skills as well as soft skills. |
Feature description: specificity
Make it easier for users to be more precise by recommending a more specific word to use within the context.
Before | After |
---|---|
Good sleep | Full night's sleep |
I ate a good pizza | I ate a tasty/delicious/yummy pizza |
Enrich the text with variety
Allow your users to avoid multiple repetitions of the same multiple words.
Before | After |
---|---|
Positive energy balance means that you consume more energy than you burn. With the right types of foods this could mean muscle gain, with the wrong types it could mean fat gain. | Positive energy balance means that you consume more energy than you burn. With the right types of foods this could mean muscle gain, with the wrong types it could result in fat gain. |
Write simple with short sentences
Advise your users how to avoid long and convoluted sentences by splitting them into short sentences.
Before | After |
---|---|
In addition, it is essential to build trust in their relationships, so they can start having efficient communications, so it will allow them to give feedback and call their peers on their performance without the fear of interpersonal conflicts. | In addition, it is essential to build trust in their relationships, so they can start having efficient communications. This will allow them to give feedback and call their peers on their performance without the fear of interpersonal conflicts. |
Conciseness
Make it easier for your users to be concise.
Before | After |
---|---|
We will arrive home in a period of five days | We will arrive home in five days |
Examples
Imagine that you want to integrate the Text Improvements API into your writing platform where you perform the improvements automatically. To illustrate how you would do it, here is an example:
from ai21 import AI21Client
from ai21.models import ImprovementType
client = AI21Client(
# This is the default and can be omitted
api_key=os.environ.get("AI21_API_KEY"),
)
response = client.improvements.create(
text="Affiliated with the profession of project management, I have ameliorated myself with a different set of hard skills as well as soft skills.",
types=[ImprovementType.FLUENCY],
)
// Use the improvements suggestions to fix the sentence
improved_text = text
improvements = response.improvements
for curr_improvement in reversed(improvements):
improved_text = improved_text[:curr_improvement.start_index] + curr_improvement.suggestions[0] + improved_text[curr_improvement.end_index:]
And the fixed sentence:
print(improved_text)
// As a member of the profession of project management, I have acquired a different set of technical skills as well as soft skills.
Updated 10 days ago