Comment Scoring
Evaluate a comment's quality and contribution to the conversation.
What it evaluates:
- Comment health (1-5 overall score): Quality and the worst problem found, combined; see Comment Health
- Quality (1-5 score): How well the comment engages and contributes
- Toxicity level (0-1 score)
- Low effort detection: e.g., "me too", "first"
- Logical fallacies (ad hominem, straw man, etc.): With educational feedback
- Objectionable phrases (rude, offensive language): Quoted examples with explanations
- Negative tone (unconstructive communication patterns): Focused on the quality of communication, not the views themselves
Each finding has a severity (1 minor, 2 clear, 3 severe, 4 extreme), and each objectionable or negative tone phrase has a category such as insult or profanity.
Judged under your site's tolerances: with each request you choose how much of each kind of problem your site accepts, and the lowest quality it accepts. Each of these comment health items gets a score from 1 to 5 in health_items, with the minimum its level accepts; findings your levels accept are removed; and exceeds_tolerance tells you whether the comment is beyond what your site accepts. Decide what to do with a comment on exceeds_tolerance, not on toxicity_score or overall_score alone. See Comment Health.
First-pass screening: every comment is screened first. A comment the screen is confident has no problem is answered without the full assessment, with empty finding lists and an empty toxicity_explanation; anything flagged or uncertain gets the full assessment, with explanations and suggested rewrites. See First-Pass Screening.
Reference
See the Comment Scoring API Reference for method signatures and parameters.
Response: CommentScore
By Example
Basic Usage
- TypeScript
- Python
- PHP
- REST API
const result = await client.evaluateComment(
"Your argument is completely stupid and you clearly know nothing.",
articleId
);
console.log(`Comment health: ${result.overall_score}/5`);
console.log(`Quality: ${result.health_items?.quality?.score}/5`);
console.log(`Toxicity: ${result.toxicity_score.toFixed(2)}`);
console.log(`Low Effort: ${result.appears_low_effort}`);
console.log(`Exceeds tolerance: ${result.exceeds_tolerance}`);
// Detailed feedback
for (const fallacy of result.logical_fallacies) {
console.log(`\nLogical Fallacy: ${fallacy.fallacy_name}`);
console.log(`Example: ${fallacy.quoted_logical_fallacy_example}`);
console.log(`Suggestion: ${fallacy.explanation}`);
}
for (const phrase of result.objectionable_phrases) {
console.log(`\nObjectionable (${phrase.category}, severity ${phrase.severity}): ${phrase.quoted_objectionable_phrase}`);
console.log(`Why: ${phrase.explanation}`);
}
for (const tone of result.negative_tone_phrases) {
console.log(`\nNegative Tone: ${tone.quoted_negative_tone_phrase}`);
console.log(`Why: ${tone.explanation}`);
}
- Blocking Client
- Async Client
result = client.evaluate_comment(
"Your argument is completely stupid and you clearly know nothing.",
article_id
)
print(f"Comment health: {result.overall_score}/5")
print(f"Quality: {result.health_items['quality'].score}/5")
print(f"Toxicity: {result.toxicity_score:.2f}")
print(f"Low Effort: {result.appears_low_effort}")
print(f"Exceeds tolerance: {result.exceeds_tolerance}")
# Detailed feedback
for fallacy in result.logical_fallacies:
print(f"\nLogical Fallacy: {fallacy.fallacy_name}")
print(f"Example: {fallacy.quoted_logical_fallacy_example}")
print(f"Suggestion: {fallacy.explanation}")
for phrase in result.objectionable_phrases:
print(f"\nObjectionable ({phrase.category.value}, severity {phrase.severity}): {phrase.quoted_objectionable_phrase}")
print(f"Why: {phrase.explanation}")
for tone in result.negative_tone_phrases:
print(f"\nNegative Tone: {tone.quoted_negative_tone_phrase}")
print(f"Why: {tone.explanation}")
result = await client.evaluate_comment(
"Your argument is completely stupid and you clearly know nothing.",
article_id
)
print(f"Comment health: {result.overall_score}/5")
print(f"Quality: {result.health_items['quality'].score}/5")
print(f"Toxicity: {result.toxicity_score:.2f}")
print(f"Low Effort: {result.appears_low_effort}")
print(f"Exceeds tolerance: {result.exceeds_tolerance}")
# Detailed feedback
for fallacy in result.logical_fallacies:
print(f"\nLogical Fallacy: {fallacy.fallacy_name}")
print(f"Example: {fallacy.quoted_logical_fallacy_example}")
print(f"Suggestion: {fallacy.explanation}")
for phrase in result.objectionable_phrases:
print(f"\nObjectionable ({phrase.category.value}, severity {phrase.severity}): {phrase.quoted_objectionable_phrase}")
print(f"Why: {phrase.explanation}")
for tone in result.negative_tone_phrases:
print(f"\nNegative Tone: {tone.quoted_negative_tone_phrase}")
print(f"Why: {tone.explanation}")
$client->evaluateComment(
$articleId,
"Your argument is completely stupid and you clearly know nothing."
)->then(function ($result) {
echo "Comment health: " . $result->overallScore . "/5\n";
echo "Toxicity: " . number_format($result->toxicityScore, 2) . "\n";
echo "Low Effort: " . ($result->appearsLowEffort ? 'Yes' : 'No') . "\n";
echo "Exceeds tolerance: " . ($result->exceedsTolerance ? 'Yes' : 'No') . "\n";
foreach ($result->logicalFallacies as $fallacy) {
echo "\nLogical Fallacy: " . $fallacy->fallacyName . "\n";
echo "Example: " . $fallacy->quotedLogicalFallacyExample . "\n";
echo "Suggestion: " . $fallacy->explanation . "\n";
}
foreach ($result->objectionablePhrases as $phrase) {
echo "\nObjectionable (" . $phrase->category . ", severity " . $phrase->severity . "): "
. $phrase->quotedObjectionablePhrase . "\n";
echo "Why: " . $phrase->explanation . "\n";
}
foreach ($result->negativeTonePhrases as $tone) {
echo "\nNegative Tone: " . $tone->quotedNegativeTonePhrase . "\n";
echo "Why: " . $tone->explanation . "\n";
}
});
$client->run();
curl -X POST https://app.respectify.ai/v0.2/commentscore \
-H "X-User-Email: your@email.com" \
-H "X-API-Key: your-api-key" \
-d "article_context_id=550e8400-e29b-41d4-a716-446655440000" \
-d "comment=Your argument is completely stupid and you clearly know nothing."
A form-encoded request is judged with every comment health item at standard. To set tolerances, send JSON instead.
Response:
{
"logical_fallacies": [
{
"fallacy_name": "Ad Hominem",
"quoted_logical_fallacy_example": "you clearly know nothing",
"explanation": "This attacks the person rather than addressing their argument...",
"suggested_rewrite": "",
"severity": 2
}
],
"objectionable_phrases": [
{
"quoted_objectionable_phrase": "completely stupid",
"explanation": "This phrase is dismissive and insulting...",
"suggested_rewrite": "",
"category": "insult",
"severity": 2
}
],
"negative_tone_phrases": [],
"appears_low_effort": false,
"overall_score": 2,
"toxicity_score": 0.78,
"toxicity_explanation": "High toxicity due to personal attacks and dismissive language.",
"exceeds_tolerance": true,
"health_score": 1.73,
"health_items": {
"threat": { "score": 5, "minimum": 5, "is_acceptable": true },
"identity_attack": { "score": 5, "minimum": 5, "is_acceptable": true },
"sexual_content": { "score": 5, "minimum": 5, "is_acceptable": true },
"harassment": { "score": 5, "minimum": 5, "is_acceptable": true },
"insult": { "score": 3, "minimum": 4, "is_acceptable": false },
"profanity": { "score": 5, "minimum": 4, "is_acceptable": true },
"dismissive_tone": { "score": 5, "minimum": 4, "is_acceptable": true },
"logical_fallacy": { "score": 3, "minimum": 4, "is_acceptable": false },
"low_effort": { "score": 5, "minimum": 4, "is_acceptable": true },
"quality": { "score": 1, "minimum": 3, "is_acceptable": false }
},
"tolerances": {
"threat": "standard",
"identity_attack": "standard",
"sexual_content": "standard",
"harassment": "standard",
"insult": "standard",
"profanity": "standard",
"dismissive_tone": "standard",
"logical_fallacy": "standard",
"low_effort": "standard",
"quality": "standard"
}
}
With Reply Context
When a comment is replying to another comment, provide that context:
- TypeScript
- Python
- PHP
- REST API
const result = await client.evaluateComment(
"I disagree with your point about type safety.",
articleId,
"Type hints are unnecessary overhead in Python."
);
- Blocking Client
- Async Client
result = client.evaluate_comment(
"I disagree with your point about type safety.",
article_id,
reply_to_comment="Type hints are unnecessary overhead in Python."
)
result = await client.evaluate_comment(
"I disagree with your point about type safety.",
article_id,
reply_to_comment="Type hints are unnecessary overhead in Python."
)
$client->evaluateComment(
$articleId,
"I disagree with your point about type safety.",
"Type hints are unnecessary overhead in Python." // reply context
);
curl -X POST https://app.respectify.ai/v0.2/commentscore \
-H "X-User-Email: your@email.com" \
-H "X-API-Key: your-api-key" \
-d "article_context_id=550e8400-e29b-41d4-a716-446655440000" \
-d "comment=I disagree with your point about type safety." \
-d "reply_to_comment=Type hints are unnecessary overhead in Python."
With Tolerances
Every comment score is judged under the comment health levels you send with the request in tolerances (ModerationTolerances in Python and PHP, a plain object in TypeScript, or a tolerances object in a JSON request). Any item you leave out is standard; nothing is saved on your API key. The items are the nine problem categories and quality, and the levels are off, permissive, relaxed, standard, strict and zero_tolerance. See Setting Tolerances for examples in each language.
Using the Feedback
Respectify is designed to educate and encourage better discussion, not to censor. Respectify encourages friendly (genuine, well-intentioned) disagreement and healthy sharing of different opinions and views. The focus is on the quality of the reply communicating those views, not the views themselves.
We recommend using this not to censor but to educate and encourage better discussion:
- Use
exceeds_toleranceto decide whether a comment needs attention. It reflects your site's tolerances;toxicity_scoredoes not, and is never adjusted for them.health_itemsshows which items fell short. - Show users the identified issues before they post.
- Provide educational feedback: Explain logical fallacies and tone problems.
- Give them the opportunity to edit and try again.
- Allow multiple attempts: Even very low scored comments can be learning opportunities.
- Track improvement: Over time, users will proactively write better comments.
The idea is to guide and educate, helping users improve their discussion skills through feedback.