CommentScore
Represents the comprehensive evaluation of a comment's quality and toxicity.
- Python
- PHP
- JSON
from respectify.schemas import CommentScore, LogicalFallacy, NegativeTonePhrase, ObjectionablePhrase
use Respectify\Schemas\CommentScore;
use Respectify\Schemas\LogicalFallacy;
use Respectify\Schemas\NegativeTonePhrase;
use Respectify\Schemas\ObjectionablePhrase;
Types are returned as JSON objects in API responses.
Fields
logical_fallacies
List of logical fallacies found
- Python
- PHP
- JSON
result.logical_fallacies: List[LogicalFallacy]
$result->logicalFallacies: LogicalFallacy[]
"logical_fallacies": [{
"fallacy_name": "string",
"quoted_logical_fallacy_example": "string",
"explanation": "string",
"suggested_rewrite": "string"
}, ...]
Each element is a LogicalFallacy object.
objectionable_phrases
List of objectionable phrases found
- Python
- PHP
- JSON
result.objectionable_phrases: List[ObjectionablePhrase]
$result->objectionablePhrases: ObjectionablePhrase[]
"objectionable_phrases": [{
"quoted_objectionable_phrase": "string",
"explanation": "string",
"suggested_rewrite": "string"
}, ...]
Each element is a ObjectionablePhrase object.
negative_tone_phrases
List of phrases with negative tone
- Python
- PHP
- JSON
result.negative_tone_phrases: List[NegativeTonePhrase]
$result->negativeTonePhrases: NegativeTonePhrase[]
"negative_tone_phrases": [{
"quoted_negative_tone_phrase": "string",
"explanation": "string",
"suggested_rewrite": "string"
}, ...]
Each element is a NegativeTonePhrase object.
appears_low_effort
Whether the comment appears to be low effort
- Python
- PHP
- JSON
result.appears_low_effort: bool
$result->appearsLowEffort: bool
"appears_low_effort": true
overall_score
Overall quality score (1=poor, 5=excellent)
Constraints: ge=1, le=5
- Python
- PHP
- JSON
result.overall_score: int # 1-5
$result->overallScore: int
"overall_score": 1
toxicity_score
Toxicity score (0.0=not toxic, 1.0=highly toxic)
Constraints: ge=0.0, le=1.0
- Python
- PHP
- JSON
result.toxicity_score: float # 0.0-1.0
$result->toxicityScore: float
"toxicity_score": 0.5
toxicity_explanation
Educational explanation of toxicity issues found
- Python
- PHP
- JSON
result.toxicity_explanation: str
$result->toxicityExplanation: string
"toxicity_explanation": "string"
Sub-types
LogicalFallacy
Represents a logical fallacy identified in a comment.
- Python
- PHP
- JSON
| Field | Type | Description |
|---|---|---|
fallacy_name | str | The name of the logical fallacy, e.g., 'straw man' |
quoted_logical_fallacy_example | str | The part of the comment that contains the logical fallacy |
explanation | str | Explanation of the fallacy and suggestions for improvement |
suggested_rewrite | str | Suggested rewrite (only provided when comment appears good-faith; otherwise empty) |
| Field | Type | Description |
|---|---|---|
fallacyName | string | The name of the logical fallacy, e.g., 'straw man' |
quotedLogicalFallacyExample | string | The part of the comment that contains the logical fallacy |
explanation | string | Explanation of the fallacy and suggestions for improvement |
suggestedRewrite | string | Suggested rewrite (only provided when comment appears good-faith; otherwise empty) |
{
"fallacy_name": "string",
"quoted_logical_fallacy_example": "string",
"explanation": "string",
"suggested_rewrite": "string"
}
ObjectionablePhrase
Represents an objectionable phrase identified in a comment.
- Python
- PHP
- JSON
| Field | Type | Description |
|---|---|---|
quoted_objectionable_phrase | str | The objectionable phrase found in the comment |
explanation | str | Explanation of why this phrase is objectionable |
suggested_rewrite | str | Suggested rewrite (only provided when comment appears good-faith; otherwise empty) |
| Field | Type | Description |
|---|---|---|
quotedObjectionablePhrase | string | The objectionable phrase found in the comment |
explanation | string | Explanation of why this phrase is objectionable |
suggestedRewrite | string | Suggested rewrite (only provided when comment appears good-faith; otherwise empty) |
{
"quoted_objectionable_phrase": "string",
"explanation": "string",
"suggested_rewrite": "string"
}
NegativeTonePhrase
Represents a phrase with negative tone identified in a comment.
- Python
- PHP
- JSON
| Field | Type | Description |
|---|---|---|
quoted_negative_tone_phrase | str | The phrase with negative tone |
explanation | str | Explanation of the negative tone |
suggested_rewrite | str | Suggested rewrite (only provided when comment appears good-faith; otherwise empty) |
| Field | Type | Description |
|---|---|---|
quotedNegativeTonePhrase | string | The phrase with negative tone |
explanation | string | Explanation of the negative tone |
suggestedRewrite | string | Suggested rewrite (only provided when comment appears good-faith; otherwise empty) |
{
"quoted_negative_tone_phrase": "string",
"explanation": "string",
"suggested_rewrite": "string"
}