Collections

Classify text

These models classify text by sentiment, topic, intent, or safety.

You can sort customer feedback, detect toxic content, route support messages, analyze reviews, or tag documents with custom labels.

The collection includes everything from lightweight sentiment models to advanced large language models that can read long passages, interpret nuance, and follow natural language instructions. Use them when you want reliable structure from unstructured text.

If you are specifically interested in detecting NSFW content, check out our Detect NSFW Content collection.

Recommended Models

Frequently asked questions

Frequently asked questions

Which models are the most accurate for text classification?

If you want the strongest overall accuracy and reasoning, use openai/gpt-5. It handles sentiment, topic, intent, moderation, and multi-step classification with high reliability.
If you want a second high-end option that excels at logic-heavy classification, use xai/grok-4. It is very good at subtle or ambiguous cases that require deeper context understanding.
For safety or policy driven classification, lucataco/gpt-oss-safeguard-20b is a strong alternative.

Which models offer the best balance of cost and performance?

For general purpose text classification at a reasonable cost, georgedavila/bart-large-mnli-classifier performs well because it uses zero shot NLI techniques.
If you want a lightweight option for sentiment tasks, curt-park/sentiment-analysis is inexpensive and very fast.

What should I use for sentiment analysis or brand monitoring?

For simple positive or negative sentiment tasks, curt-park/sentiment-analysis is the most direct model. It is fast, predictable, and well suited for large batches.
If you want sentiment plus explanation or nuanced emotional tone, openai/gpt-5 does well with few shot prompts.
If you want to mix sentiment with toxicity filtering, fofr/prompt-classifier can classify text for harmful content scores.

What should I use for topic classification or routing tasks?

For topic classification with flexible labels, georgedavila/bart-large-mnli-classifier is ideal because you can provide your own category list and it will rank them.
For topic routing where context is complex, xai/grok-4 works well because it understands long passages and subtle distinctions.
For policy governed topic routing, lucataco/gpt-oss-safeguard-20b lets you supply a written policy and returns labels according to your rules.

What should I use for classifying harmful or unsafe text?

For safety classification using custom rules, lucataco/gpt-oss-safeguard-20b is designed for policy driven safety labeling and returns structured rationales.
For toxicity scoring on a scale from zero to ten, fofr/prompt-classifier is a fine tuned Llama model built for identifying harmful or unsafe prompts.
For detecting safety violations using general reasoning, openai/gpt-5 can classify harmful or disallowed content with detailed explanations.

What is the difference between small fine tuned classifiers and large LLMs for text classification?

Small fine tuned models like curt-park/sentiment-analysis, georgedavila/bart-large-mnli-classifier, and fofr/prompt-classifier run quickly and cheaply but follow narrow tasks. They are ideal when you know your labels and want predictable output.
Large LLMs like openai/gpt-5 and xai/grok-4 can classify text using natural language instructions, support open ended labels, and explain their reasoning.
Policy based classification models like lucataco/gpt-oss-safeguard-20b sit between these extremes by offering structured safety classification without relying on closed systems.

What kinds of outputs do these models produce?

Small classification models such as curt-park/sentiment-analysis and georgedavila/bart-large-mnli-classifier usually return a label and sometimes a confidence score.
Moderation models such as fofr/prompt-classifier return a numeric toxicity score.
Large LLMs such as openai/gpt-5 or xai/grok-4 can return labels, explanations, or structured JSON depending on your prompt.
Policy based models such as lucataco/gpt-oss-safeguard-20b output both a label and a chain of reasoning.

How can I self host or publish my own text classifier on Replicate?

You can self host or publish your own classifier by building it with Cog and including a replicate.yaml file that defines inputs, outputs, prediction logic, and environment.
Models such as curt-park/sentiment-analysis and lucataco/gpt-oss-safeguard-20b demonstrate simple and complex setups.
Once you push the repository to Replicate, it runs on managed GPUs without extra configuration.

Can I use these models for commercial work?

Yes, as long as the license on each model page allows commercial use.
Open source models such as curt-park/sentiment-analysis, georgedavila/bart-large-mnli-classifier, and lucataco/gpt-oss-safeguard-20b can typically be used commercially.
Closed models such as openai/gpt-5 and xai/grok-4 have their own usage policies that you should review.

How do I run these models?

Upload or paste text into the model interface and choose any optional parameters.
For simple tasks like polarity detection, use curt-park/sentiment-analysis.
For flexible label sets, use georgedavila/bart-large-mnli-classifier.
For safety scoring, use fofr/prompt-classifier or lucataco/gpt-oss-safeguard-20b.
For complex or multi step classification, use openai/gpt-5 or xai/grok-4.

What should I know before running a job in this category?

Large LLMs such as openai/gpt-5 and xai/grok-4 cost more and take longer but give better reasoning.
Small models such as curt-park/sentiment-analysis and georgedavila/bart-large-mnli-classifier are faster and cheaper but have limited flexibility.
Safety models such as lucataco/gpt-oss-safeguard-20b can classify against your own custom policies.
Always check the model input format and consider testing a small batch first.

Any other tips for choosing between these models?

Use small specialized models such as curt-park/sentiment-analysis for narrow tasks where speed matters.
Use NLI based models such as georgedavila/bart-large-mnli-classifier for flexible zero shot label lists.
Use domain specific classifiers such as fofr/prompt-classifier for toxicity and prompt safety.
Use reasoning heavy LLMs such as openai/gpt-5 or xai/grok-4 when labels are ambiguous or when you need explanations.
Use policy driven safety models such as lucataco/gpt-oss-safeguard-20b when you must classify text according to internal rules or compliance requirements.