Skip to main content

Quality Score

The quality endpoint computes a quality score for a given text. The score is based on how "surprising" a given text is given text that the model has been trained on.

If a text is highly surprising, that often indicates it contains errors or is a low-quality text. Hence high surprisal corresponds to lower scores. If a text is not surprising to the model, then it will have a higher score.

Because the surprisal factor is based on text the model has been trained on, fine-tuning can often greatly improve performance.

Note that this score tends to measure quality of syntax and grammaticality and is not intended to evaluate factors such as the originality of a text.

Quality POST

Request Parameters

https://api.sapling.ai/api/v1/quality

HTTP method: POST

The Quality API POST endpoint takes JSON parameters documented below:

key: String
32-character API key.

text: String
Text to compute quality score for.

Response Parameters

A score from 1 to 5 will be returned, with 1 being the lowest score (low quality) and 5 being the highest score (high quality).

Note that partial sentences such as I will go to will have a high score as the model assumes that the sequence has not yet been completed. On the other hand, I will go to. (including the period) will have a low score.

The Quality POST endpoint returns JSON of the following format:

{
"score": 3.582865401473105,
}