Back to Prompt Library

Content Classification

A classification prompt for consistent labels, confidence notes, and stable taxonomy-based routing.

Reviewed: 2026-03-18

Use this when you want the model to assign one or more labels to text using a fixed taxonomy and predictable output rules.

Prompt Template

Classify the input into the taxonomy below.

Taxonomy:
{taxonomy}

Rules:
- Pick the single best label unless multi-label is explicitly allowed.
- If confidence is low, say so.
- Base the answer only on the text provided.
- Do not add commentary outside the required format.

Output format:
{
  "label": "<best_label>",
  "confidence": "<high|medium|low>",
  "reason": "<one sentence>"
}

Input:
{text}

Customize the variables before using the template in production workflows.

Best for

  • Routing support tickets or feedback
  • Classifying articles or user-generated content
  • Detecting intent before an automation step

Expected output

  • Fixed taxonomy
  • Strict JSON output
  • Confidence estimate
  • Short reasoning sentence

Variables to customize

taxonomy

Allowed labels

Example: billing, bug, feature_request, account_access

text

Content to classify

Example: A support request or content excerpt

Optimization tips

  • Provide an explicit label set instead of asking for open-ended categorization.
  • Use JSON output if the result feeds a workflow.
  • Add examples if two labels are easy to confuse.

Example use case

Classify a message asking for a refund after duplicate billing.

Expected result

The model returns a billing label, a confidence level, and a one-line rationale in JSON.

References