Skip to main content

CommentScore

Represents the comprehensive evaluation of a comment's quality and toxicity.

import type { CommentScore, LogicalFallacy, NegativeTonePhrase, ObjectionablePhrase } from "@respectify/client";

Fields

logical_fallacies

List of logical fallacies found

result.logical_fallacies: LogicalFallacy[]

objectionable_phrases

List of objectionable phrases found

result.objectionable_phrases: ObjectionablePhrase[]

negative_tone_phrases

List of phrases with negative tone

result.negative_tone_phrases: NegativeTonePhrase[]

appears_low_effort

Whether the comment appears to be low effort

result.appears_low_effort: boolean

overall_score

Overall quality score (1=poor, 5=excellent)

Constraints: ge=1, le=5

result.overall_score: number // 1-5

toxicity_score

Toxicity score (0.0=not toxic, 1.0=highly toxic)

Constraints: ge=0.0, le=1.0

result.toxicity_score: number // 0.0-1.0

toxicity_explanation

Educational explanation of toxicity issues found

result.toxicity_explanation: string

Sub-types

LogicalFallacy

Represents a logical fallacy identified in a comment.

FieldTypeDescription
fallacy_namestringThe name of the logical fallacy, e.g., 'straw man'
quoted_logical_fallacy_examplestringThe part of the comment that contains the logical fallacy
explanationstringExplanation of the fallacy and suggestions for improvement
suggested_rewritestringSuggested rewrite (only provided when comment appears good-faith; otherwise empty)

ObjectionablePhrase

Represents an objectionable phrase identified in a comment.

FieldTypeDescription
quoted_objectionable_phrasestringThe objectionable phrase found in the comment
explanationstringExplanation of why this phrase is objectionable
suggested_rewritestringSuggested rewrite (only provided when comment appears good-faith; otherwise empty)

NegativeTonePhrase

Represents a phrase with negative tone identified in a comment.

FieldTypeDescription
quoted_negative_tone_phrasestringThe phrase with negative tone
explanationstringExplanation of the negative tone
suggested_rewritestringSuggested rewrite (only provided when comment appears good-faith; otherwise empty)