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

Features

Speak with great fluency

Let your users express themselves more fluently, phrasing the same message in a natural way.

BeforeAfter
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.

BeforeAfter
Good sleepFull night's sleep
I ate a good pizzaI ate a tasty/delicious/yummy pizza

Enrich the text with variety

Allow your users to avoid multiple repetitions of the same multiple words.

BeforeAfter
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.

BeforeAfter
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.

BeforeAfter
We will arrive home in a period of five daysWe 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.