# What is text classification with AI?

> Text classification is sorting text into set labels, like repair, maintenance or emergency. How to do it with an AI prompt, with a real HVAC form example.

Source: https://learn.ynteractive.com/content/glossary/text-classification · Updated 2026-10-01 · Free from Stepthrough (https://learn.ynteractive.com)

[Prompting](https://learn.ynteractive.com/content/glossary#topic-prompting) · [AI glossary](https://learn.ynteractive.com/content/glossary)

Updated October 1, 2026 · By [Robert Breen](https://learn.ynteractive.com/content/about)

Text classification is sorting a piece of text into one of a fixed set of labels, for example sorting a service request into Repair, Maintenance, Install or Emergency, or a lead into Hot, Warm or Nurture. With AI, you describe the labels in a prompt and the model picks one for each item.

## Why it matters for a small business

Sorting is one of the most useful jobs AI does for a small business, because the label decides what happens next: who gets the job, how fast someone calls back, which email the customer receives. Done by hand, it waits until someone reads the inbox. Done by an AI step in a workflow, it happens the moment the form is submitted.

It used to require training a custom model on thousands of labeled examples. Now a clear prompt with well-defined labels gets good results for everyday business categories. The work shifts to defining the labels precisely, especially the edge cases that matter most.

## In a real lesson: Build an AI Service Request Form for Your HVAC Company

In [Build an AI Service Request Form for Your HVAC Company](https://learn.ynteractive.com/content/hvac-service-request-form-ai-lovable-n8n), homeowners fill in a Lovable form for Cedar Ridge Heating & Air (a made-up company) with Name, Email, What do you need? and Phone. The form posts to an n8n webhook, and the AI Agent's prompt template passes along the request text with `{{ $json.body.request }}`.

The system message does the classifying: sort each request into one job type, Repair, Maintenance, Install or Emergency. Then it defines the label that matters most: no heat, no cooling in extreme heat, or water leaking from the system counts as Emergency. The agent saves the lead to Google Sheets and emails a confirmation that names the job type.

The [demo request form lesson](https://learn.ynteractive.com/content/ai-demo-request-form-lead-qualification) uses the same pattern with different labels: Hot means 5 or more staff and wants to switch within a month, Warm means a clear need but no timeline, Nurture means just looking, and each label triggers a different next step in the email.

[Try this lesson free](https://learn.ynteractive.com/modules/lovable-n8n-hvac) or [read the step-by-step guide](https://learn.ynteractive.com/content/hvac-service-request-form-ai-lovable-n8n).

## Common confusions

### Classification vs extraction

Classification picks one label from a list you define. [Data extraction](https://learn.ynteractive.com/content/glossary/data-extraction) pulls specific values (a date, a total) out of the text. Many workflows do both: extract the details, then classify the request.

### Classification vs triage

[Triage](https://learn.ynteractive.com/content/glossary/ai-triage) is the business process of deciding urgency and routing. Classification is the AI step that often powers it, by assigning the priority or category label.

## Tips

- Define every label in one plain sentence, and spell out the edge cases that are costly to miss.
- Add a fallback label (like Needs Review) for anything that doesn't fit.
- Test with borderline requests, not just obvious ones, before you trust the labels.

## Related terms

[Triage](https://learn.ynteractive.com/content/glossary/ai-triage) · [Lead qualification](https://learn.ynteractive.com/content/glossary/lead-qualification) · [Sentiment analysis](https://learn.ynteractive.com/content/glossary/sentiment-analysis) · [Data extraction](https://learn.ynteractive.com/content/glossary/data-extraction) · [AI Agent node](https://learn.ynteractive.com/content/glossary/ai-agent-node)

## Where you use it: free lessons

- [Build an AI Service Request Form for Your HVAC Company](https://learn.ynteractive.com/content/hvac-service-request-form-ai-lovable-n8n) (Lovable and n8n, 15 min)
- [Build an AI Demo Request Form That Qualifies Leads](https://learn.ynteractive.com/content/ai-demo-request-form-lead-qualification) (Lovable and n8n, 15 min)
- [Build an AI Maintenance and IT Request Form](https://learn.ynteractive.com/content/ai-maintenance-it-request-form-lovable-n8n) (Lovable and n8n, 15 min)

## Prompt templates that use it

[Emergency service request triage prompt](https://learn.ynteractive.com/content/prompts/emergency-request-triage-prompt) · [Expense categorization prompt](https://learn.ynteractive.com/content/prompts/expense-categorization-prompt) · [FAQ from customer emails prompt](https://learn.ynteractive.com/content/prompts/faq-from-customer-emails-prompt) · [Lead qualification prompt](https://learn.ynteractive.com/content/prompts/lead-qualification-prompt)

## Frequently asked questions

**How many categories can AI classify into?**

There's no fixed limit, but a short list of clearly different labels works best. If two labels are easy to confuse, merge them or define the difference.

**Can AI classification make mistakes?**

Yes, especially on vague or unusual messages. That's why safety-critical labels like Emergency deserve explicit rules and a person checking the results.

[All AI glossary terms, A to Z](https://learn.ynteractive.com/content/glossary) · [Free prompt templates](https://learn.ynteractive.com/content/prompts)
