Skip to main content

Relevance

Evaluates the relevance of a comment to the article it's a comment on, plus checks for topics the site admin does not want discussed. This is intended to help keep conversations relevant or on-topic, plus to allow site admins to disallow conversation on specific topics. (Our use case here is how legitimate-sounding comments with dog whistles or what-abouts can simply be disallowed.) As well as a boolean yes/no evaluation, there is a confidence score for both these evaluations between 0-1.

Header Parameters
X-User-Email email REQUIRED

Account email address, for authentication

X-API-Key string REQUIRED

API key owned by the user (email), for authentication

Request Body REQUIRED
article_context_id uuid REQUIRED

UUID that identifies the article context.

comment string REQUIRED

The comment text to evaluate for relevance.

banned_topics string[]

Optional list of banned topics to check against.

Responses
200

Successful response - returns JSON result from relevance evaluation.

Schema OPTIONAL
on_topic object

Holds data about the on-topic (relevance) assessment.

reasoning string

Short explanation of why this comment was or was not regarded as on-topic.

on_topic boolean

Indicates if the comment is considered on-topic. True if it is; false if it is not on-topic / relevant.

confidence number

Confidence score (0-1) for the on-topic evaluation.

banned_topics object

Holds data about the off-topic (banned topics) assessment.

reasoning string

Short explanation of why the comment was assessed as, or not, being about topics that are off-topic.

banned_topics string[]

List of off-topic topics detected.

quantity_on_banned_topics number

A score representing the extent of the off-topic content in the comment: 0-1, where 0.5 is that about half the comment was about a topic that was flagged.

confidence number

Confidence score (0-1) for the off-topic evaluation.

400

Bad Request - Missing or invalid parameters.

401

Unauthorized - Missing or incorrect authentication.