Back to guide/Education & Learning

Text Classification

Explicit category list, single-label constraint, and format instruction ('just the category name') eliminate ambiguity. The model does not need examples when the task and output format are crystal clear.

zero-shot-promptingcategoriestext
Edit View
Prompt
Classify the following text into exactly one of these categories: {{categories}}

Text: "{{text}}"

Rules:
- Choose only one category
- If the text could fit multiple categories, choose the most dominant one
- Respond with just the category name, nothing else

Category:

Variables to customize

{{categories}}{{text}}

Why this prompt works

Explicit category list, single-label constraint, and format instruction ('just the category name') eliminate ambiguity. The model does not need examples when the task and output format are crystal clear.

Save this prompt to your library

Organize, version, and access your best prompts across ChatGPT, Claude, and Cursor.