Skip to main content

Dogwhistle Detection

Identify coded language that appears innocuous but carries hidden harmful meanings.

What it detects:

  • Coded language: Terms with hidden meanings to specific groups
  • Subtlety level: How hidden the messaging is
  • Harm potential: Risk level of the detected content
  • Categories: Types of dogwhistles detected

Reference​

See the Dogwhistle Detection API Reference for method signatures and parameters.

Response: DogwhistleResult

By Example​

Basic Usage​

const result = await client.checkDogwhistle(
"This comment to analyze for coded language",
articleId
);

console.log(`Detected: ${result.detection.dogwhistles_detected}`);
console.log(`Confidence: ${result.detection.confidence.toFixed(2)}`);
console.log(`Reasoning: ${result.detection.reasoning}`);

if (result.details) {
console.log(`Terms: ${result.details.dogwhistle_terms}`);
console.log(`Categories: ${result.details.categories}`);
console.log(`Subtlety: ${result.details.subtlety_level.toFixed(2)}`);
console.log(`Harm potential: ${result.details.harm_potential.toFixed(2)}`);
}

First-Pass Screening​

Every comment is classified first by a fast first-pass screen. A comment the screen is confident contains no coded language is answered without the full assessment: dogwhistles_detected is false, reasoning is empty, and there are no details. Because a missed dogwhistle is the worst mistake this check can make, the screen clears only comments it is very sure about; anything else gets the full assessment, with reasoning and details.

With Custom Detection​

Provide context for better detection:

const result = await client.checkDogwhistle(
"Comment text here",
articleId,
["topic-area-1", "topic-area-2"],
["known-coded-phrase", "another-term"]
);