surfaceclassificationformality_llm
Classificationdimension · returns varchar

FORMALITY_LLM

LLM-backed formality detection (escape hatch for FORMALITY)

Per-row classifier — stable across GROUP BY.

classificationllmllm-escape-hatchtext

Syntax

FORMALITY_LLM({{ text }})
{{ text }} BY FORMALITY_LLM

Arguments

nametypedescription
textVARCHAR

About

LLM-backed escape hatch for formality detection. Use when the canonical zero-shot NLI path (FORMALITY) misclassifies — typically mixed-formality text, domain-specific formality norms, or subtle cases that need contextual judgment. For routine formality bucketing, prefer FORMALITY — it is 100-1000x faster and handles most cases correctly.

Examples

LLM escape hatch: formal letter

SELECT
  formality_llm (
    'Dear Sir or Madam, I am writing to inquire about...'
  )

Nearby rabbit holes

same domain
Climb back to The Looking Glass