Skip to main content

5 Best Paraphrase APIs

Paraphrasing

Paraphrasing, rephrasing, sentence rewriting, or word spinning are all terms referring to the same task of taking some input text and providing an alternative phrasing of that text.

For example, given the sentence, Hi, how are you?, a rephrasing system might suggest the following paraphrases:

1. Hello! I hope you're doing well.
2. Hi there -- how is your day going?
3. Greetings, how are you feeling today?
4. Hey! I'd be happy to know how you're doing.

The specific number of paraphrases will depend on the system and the user's request -- many systems can be run repeatedly to generate new paraphrases through a technique called sampling, which we'll describe briefly below.

Beyond simply generating an arbitrary number of different ways to phrase a certain sentence, it's easy to imagine additional capabilities for a paraphrasing system:

  • Tone: The user may desire that the rephrased sentence have some target tone, e.g. paraphrase this sentence so that it sounds friendlier. Sapling offers both a tone detection system as well as a system for rephrasing while specifying a target tone.
  • Formality: Make this sound more formal / professional. This is a common use case for business communication.
  • Length / readability: Make this piece of text shorter or simpler. Some summarization systems -- loosely speaking -- fall under the umbrella of paraphrasing systems.

Taking a step back, the goal of a paraphrasing system is simply to provide the user with ideas of how to best express a given statement. But how do we measure what is best in this case?

Evaluating paraphrase systems

When evaluating a paraphrasing system, there are two common criteria:

  1. Meaning preservation: Obviously if the meaning of the input text is significantly changed, the paraphrase is no good.
  2. Diversity: On the other hand, if the paraphrasing system simply spits out the same sentence as the input sentence, the system is also useless (even though meaning is perfectly preserved).

This is visualized in the chart below:

Example trade-off curve between meaning preservation and diversity
Example trade-off curve between meaning preservation and diversity.

There are other criteria that are not specific to paraphrasing systems -- latency / generation time, as just one example -- but the two above are a good starting point.

Going back to sampling: sometimes paraphrasing systems use language models where the user can adjust the temperature. This parameter is effectively a way to trade off meaning preservation and diversity, where lower temperatures result in more deterministic, similar outputs, while higher temperatures result in more diverse outputs. Without jumping into the technical details, unless you've gathered a decent evaluation dataset to adjust this knob, we recommend consulting with the authors of the paraphrasing system for their recommendations.

Application programming interfaces (APIs)

For those unfamiliar with APIs, we recommend reading the overview in our other comparison. In brief, the API exposes a set of web endpoints that take input texts / queries along with other criteria (such as the target tone, for example) and returns back a list of rephrases that (hopefully) match the criteria.

Software development kits (SDKs)

Currently, Sapling is unaware of a provider that offers a paraphrase SDK offering the UI components for displaying rephrase suggestions. Contact us if you'd like access to our system in development.

Building your own

Before we consider some of the providers of paraphrase systems, a common question is: why not just build your own? With the rise of LLMs, it's possible to create prompts for LLMs to generate rephrases of sentences in a given style.

While this is feasible, here are a few considerations for why you may wish to consider a pre-built, task-specific solution instead:

  1. Predictability: Depending on the LLM system, it may not generate the output in an always consistent, structured format where it is easy to extract the suggestions.
  2. Cost: Depending on the system, it may be cheaper to use a smaller, specialized model for the task.
  3. Prompt injection and backdoors: Because LLMs are so general, they are capable of performing rephrasing as well as other tasks when given the right prompt. This can pose security concerns for organizations, especially when the LLM may be capable of generating inappropriate content or has been trained on sensitive data, as prompt injection can result in undesired behavior.
  4. Data security and self-hosting: Cutting edge LLMs are generally offered through web-based APIs that require sending texts to remote servers. Depending on the application and data security requirements, it may not be possible to use a cloud service.
  5. Maintenance: Finally, while the backend maintenance overhead may not be significant when using a third-party LLM endpoint, the maintenance of the frontend system may require engineering time that is better spent elsewhere.

Providers

As of April 2024, here are some common paraphrasing tools that offer API access:

  • Sapling.ai: Sapling not only offers a paraphrasing API, but is also a fully-featured AI writing assistant with grammar and spell checking, autocomplete, suggested snippets, and more. Its paraphrase API offers options such as a target tone or formality.

  • AI21: AI21 offers the popular Wordtune application, available as a browser extension or as a website application. As part of the AI21 Studio that offers task-specific APIs, AI21 offers a paraphrasing API that also powers its Wordtune service. Styles include general, casual, formal, long, and short.

AI21

  • Neural Writer: Neural Writer offers a paraphrasing API through the RapidAPI platform. It claims to support 27 different languages. A corresponding browser extension is available along with a demo on its homepage. The paraphraser offers light, medium, and hard modes to adjust the amount of rephrasing performed.

Neural Writer

  • Paraphrasing Tool: Paraphrasing Tool offers a web interface and API with support for six different modes: word changer, fluency, advanced, creative, smarter, and shorten. It claims to support eight different languages.

Paraphrasing Tool

  • Formerly part of, but now notably absent from the list is QuillBot. Perhaps the company that popularized paraphrasing models, QuillBot offers paraphrasing, grammar checking, and other tools such as citation generation and plagiarism checking for students. It states very clearly in its help documentation, however, that it does not offer a paraphrasing API.

Comparison

ProviderMain BenefitsSelf-Hosting?Other Features
Sapling.aiAdvanced paraphrase model with upcoming SDK. Other easily integrated AI writing functionality.YesTarget tones for the rephrase model, on-prem option.
AI21Established task-specific model used to power Wordtune. LLM offering as well.NoPython and JavaScript client libraries.
Neural WriterParaphrasing model with adjustability of level of rephrasing desired.NoSupport for 27 languages.
Paraphrasing ToolSimilar to QuillBot in offering different paraphrase modes.NoSupport for 8 languages.
QuillBotNANANA

Conclusion

The landscape of tools that language models are enabling is rapidly evolving. Despite this, at present there are a small set of APIs that offer turnkey paraphrasing functionality. These make it straightforward to add AI-powered rephrase suggestions to your application. We review four (previously five) such options above, but obviously, we're biased: