Comment Scoring
Evaluate a comment's quality and contribution to the conversation.
What it evaluates:
- Overall 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
Reference
See the Comment Scoring API Reference for method signatures and parameters.
Response: CommentScore
By Example
Basic Usage
- Python
- PHP
- REST API
- Blocking Client
- Async Client
result = client.evaluate_comment(
"Your argument is completely stupid and you clearly know nothing.",
article_id
)
print(f"Overall Score: {result.overall_score}/5")
print(f"Toxicity: {result.toxicity_score:.2f}")
print(f"Low Effort: {result.appears_low_effort}")
# 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.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"Overall Score: {result.overall_score}/5")
print(f"Toxicity: {result.toxicity_score:.2f}")
print(f"Low Effort: {result.appears_low_effort}")
# 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.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 "Overall Score: " . $result->overallScore . "/5\n";
echo "Toxicity: " . number_format($result->toxicityScore, 2) . "\n";
echo "Low Effort: " . ($result->appearsLowEffort ? '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->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();
Try it out live →
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."
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..."
}
],
"objectionable_phrases": [
{
"quoted_objectionable_phrase": "completely stupid",
"explanation": "This phrase is dismissive and insulting..."
}
],
"negative_tone_phrases": [],
"appears_low_effort": false,
"overall_score": 1,
"toxicity_score": 0.78,
"toxicity_explanation": "High toxicity due to personal attacks and dismissive language."
}
With Reply Context
When a comment is replying to another comment, provide that context:
- Python
- PHP
- REST API
- 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
);
Try it out live →
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."
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:
- 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.