Rephrase
The paraphrase and rephrase endpoints offer paraphrasing for particular styles. Given an input sentence, the endpoint returns output sentences that preserve meaning but use alternative phrasings or styles.
Note that while the paraphrases/rephrases retain the same general meaning, they vary in how much they differ from the input sentence. Put another way, while the syntax and terminology of the input may change, the semantics should be preserved.
Paraphrase POST
The paraphrase endpoint provides alternative phrasings of an input text while preserving meaning and intent. An example input might be: "How are you?" with the output paraphrases, "How's it going?", "What's up?", and "How are you doing?".
https://api.sapling.ai/api/v1/paraphrase
HTTP method: POST
Request Parameters
key: String
32-character API key
text: String
Input query to paraphrase.
diversity: Float [Coming soon]
Ranges from 0 to 1. 0 means to not encourage diversity beyond the usual sampling. 1 means to make the outputs as diverse as possible (while still preserving semantics).
num_results: Integer [Coming soon]
Number of results to return. The minimum is 1. The maximum will depend on other settings, but is generally around 8.
Contact us if you need additional results. Additional results will incur additional costs.
Response Parameters
results: JSON, array of paraphrases. Sample structure:
{
"results": [
"I'll be there soon.",
"Be there in a bit.",
"Alright, see you soon."
]
}
Rephrase POST
In addition to the paraphrase endpoint, the rephrase endpoint also offers a few style transformations:
- Informal to Formal: Given a casual/informal input text, generate a more formal/professional output. You can test the endpoint here.
- Passive to Active: Generate sentence in active voice given sentence in passive voice. You can test the endpoint here.
- Long to Short: This is offered by Sapling's summarize endpoint.
- Split: Given a long sentence, split it into two sentences. You can test the endpoint here.
https://api.sapling.ai/api/v1/rephrase
HTTP method: POST
Request Parameters
key: String
32-character API key
text: String
Input query to rephrase.
mapping String
The model to use. Available models include informal_to_formal
, passive_to_active
, active_to_passive
, and sentence_split
.
diversity: Float [Coming soon]
Ranges from 0 to 1. 0 means to not encourage diversity beyond the usual sampling. 1 means to make the outputs as diverse as possible (while still preserving semantics).
num_results: Integer [Coming soon]
Number of results to return. The minimum is 1. The maximum will depend on other settings, but is generally around 8.
Contact us if you need additional results. Additional results will incur additional costs.
Response Parameters
results: JSON, array of rephrases. Sample structure:
{
"results": [
"I'll be there soon.",
"Be there in a bit.",
"Alright, see you soon."
]
}