Perspective Score Corrections
Use this if you already send corrections to Perspective and want to keep that workflow on Respectify. We will use them to improve (and are grateful for the contribution!)
Note that because this endpoint's purpose is to send something that requires us to read, analyse, and act on it for improving Respectify, including adjusting and measuring its behaviour in future, the data you send us via this endpoint is retained. This is unlike our other endpoints. Please be aware of this when sending feedback, and do so only if the data is something you are fine with us keeping. If you'd like an explicit policy for data retention for this endpoint, contact us.
This page covers the compatibility endpoint:
POST /v0.2/perspective-compat/suggestscore
This endpoint lets you submit corrections to a score after review.
What it does:
- accepts Perspective-style correction requests
- stores the feedback intentionally
- supports
summaryScore.value - accepts
spanScoresfor compatibility, while currently storing summary-score feedback rather than span-level corrections
Reference
See the Perspective-Compatible Suggestscore API Reference for the full request and response.
Response: PerspectiveSuggestCommentScoreResponse
This endpoint stores the feedback you send; that is the point of this correction API. If you are sending score corrections here, you are intentionally giving Respectify feedback to retain and use for improvement.
How Scores Work
This endpoint currently supports one score type:
PROBABILITY
That means a 0 to 1 score where higher numbers mean more of the requested attribute. For example, a higher TOXICITY score means the comment is more likely to be toxic.
For a fuller explanation of summaryScore, spanScores, and unsupported score types, see Perspective Score Types.
By Example
Basic Usage
- TypeScript
- Python
- PHP
- REST API
await client.perspective.suggestCommentScore({
comment: {
text: "You clearly did not read the article.",
},
attributeScores: {
TOXICITY: {
summaryScore: {
value: 0.2,
type: "PROBABILITY",
},
},
},
clientToken: "review-example-1",
});
- Blocking Client
- Async Client
client.perspective.suggest_comment_score(
{
"comment": {
"text": "You clearly did not read the article.",
},
"attributeScores": {
"TOXICITY": {
"summaryScore": {
"value": 0.2,
"type": "PROBABILITY",
}
}
},
"clientToken": "review-example-1",
}
)
await client.perspective.suggest_comment_score(
{
"comment": {
"text": "You clearly did not read the article.",
},
"attributeScores": {
"TOXICITY": {
"summaryScore": {
"value": 0.2,
"type": "PROBABILITY",
}
}
},
"clientToken": "review-example-1",
}
)
$client->perspective()->suggestCommentScore([
'comment' => [
'text' => 'You clearly did not read the article.',
],
'attributeScores' => [
'TOXICITY' => [
'summaryScore' => [
'value' => 0.2,
'type' => 'PROBABILITY',
],
],
],
'clientToken' => 'review-example-1',
]);
curl -X POST https://app.respectify.ai/v0.2/perspective-compat/suggestscore \
-H "Content-Type: application/json" \
-H "X-User-Email: your-email@example.com" \
-H "X-API-Key: your-api-key" \
-d '{
"comment": {
"text": "You clearly did not read the article."
},
"attributeScores": {
"TOXICITY": {
"summaryScore": {
"value": 0.2,
"type": "PROBABILITY"
}
}
},
"clientToken": "review-example-1"
}'
Notes
- This endpoint retains the feedback you send. That is the purpose of the endpoint.
- If you send
languages, Respectify preserves them in the compatibility flow. spanScoresare accepted for compatibility, but the stored correction is currently summary-score based.
With Language Context
If you already send languages with score corrections, Respectify preserves them in the compatibility flow:
- TypeScript
- Python
- PHP
- REST API
await client.perspective.suggestCommentScore({
comment: {
text: "No leiste el artículo.",
},
attributeScores: {
TOXICITY: {
summaryScore: {
value: 0.1,
type: "PROBABILITY",
},
},
},
languages: ["es"],
});
- Blocking Client
- Async Client
client.perspective.suggest_comment_score(
{
"comment": {
"text": "No leiste el artículo.",
},
"attributeScores": {
"TOXICITY": {
"summaryScore": {
"value": 0.1,
"type": "PROBABILITY",
}
}
},
"languages": ["es"],
}
)
await client.perspective.suggest_comment_score(
{
"comment": {
"text": "No leiste el artículo.",
},
"attributeScores": {
"TOXICITY": {
"summaryScore": {
"value": 0.1,
"type": "PROBABILITY",
}
}
},
"languages": ["es"],
}
)
$client->perspective()->suggestCommentScore([
'comment' => [
'text' => 'No leiste el artículo.',
],
'attributeScores' => [
'TOXICITY' => [
'summaryScore' => [
'value' => 0.1,
'type' => 'PROBABILITY',
],
],
],
'languages' => ['es'],
]);
curl -X POST https://app.respectify.ai/v0.2/perspective-compat/suggestscore \
-H "Content-Type: application/json" \
-H "X-User-Email: your-email@example.com" \
-H "X-API-Key: your-api-key" \
-d '{
"comment": {
"text": "No leiste el artículo."
},
"attributeScores": {
"TOXICITY": {
"summaryScore": {
"value": 0.1,
"type": "PROBABILITY"
}
}
},
"languages": ["es"]
}'