surfaceclassificationformality
Classificationdimension · returns varchar

FORMALITY

Detect formality level for grouping (zero-shot NLI)

Per-row classifier — stable across GROUP BY.

classificationnlispecialist-zootext

Syntax

FORMALITY({{ text }})
{{ text }} BY FORMALITY

Arguments

nametypedescription
textVARCHAR

About

Dimension operator that buckets text by formality level. Useful for communication style analysis and segmenting mixed-tone corpora. Backend: specialist zoo zero-shot NLI (deberta-v3-large-zeroshot-v2.0) via /classify. Labels are a fixed closed set: very_formal / formal / neutral / informal / very_informal selected by running the text against NLI hypothesis templates and picking the top entailment. The model can only assign from this closed set — no hallucinated buckets. For LLM-style assessment with nuanced rules around legal vs academic vs business formality, use FORMALITY_LLM — see formality_dimension_llm.cascade.yaml.

Examples

Formal letter detected

SELECT
  formality (
    'Dear Sir or Madam, I am writing to inquire about the status of my application...'
  )

Informal chat detected

SELECT
  formality ('hey whats up dude lol')

Nearby rabbit holes

same domain
Climb back to The Looking Glass