TinyModels

How to Build a Custom Text Classifier in 5 Minutes

Step-by-step guide to building your first custom text classifier with TinyModels. No machine learning experience required. Go from idea to API endpoint in minutes.

How to Build a Custom Text Classifier in 5 Minutes

What You'll Learn

Build a classifier by describing what you need in plain English
AI generates training data automatically
Watch your model train in real-time
Get a production-ready API endpoint instantly
No ML expertise or infrastructure required

What You'll Build

By the end of this guide, you'll have:

  1. A custom text classifier trained on your specific categories
  2. A REST API endpoint for real-time classification
  3. The ability to classify text at scale

Total time: ~5 minutes

Step 1: Start a New Classifier

Go to TinyModels and click "New Classifier" or just start typing what you want to build.

Example Prompt

"I want to classify customer feedback into: feature request, bug report, praise, and complaint"

TinyModels understands natural language. Describe your classification task like you would to a colleague.

Step 2: Refine Your Categories

TinyModels will confirm your labels and may suggest refinements:

I'll create a classifier with these 4 categories:
- feature_request: Suggestions for new features or improvements
- bug_report: Reports of something not working correctly
- praise: Positive feedback and compliments
- complaint: Expressions of dissatisfaction

Does this look right? I can adjust the definitions or add/remove categories.

Review and confirm, or ask for changes:

"Add a category for 'question' - when someone is asking how to do something"

Step 3: Generate Training Data

Once your categories are set, TinyModels generates diverse training examples:

Generating training data for 5 categories...

Preview:

feature_request: "It would be great if you could add dark mode"
bug_report: "The app crashes every time I try to upload a photo"
praise: "Absolutely love this product! Best purchase I've made"
complaint: "Been waiting 3 weeks for support to respond. Unacceptable."
question: "How do I change my password?"

Generating 200 examples per category...

Customizing Generated Data

You can guide the generation:

"Make the examples sound more like B2B software feedback, not consumer products"

Or:

"Include examples with typos and informal language"

Step 4: Review Training Data

Before training, you'll see a preview of the generated dataset:

TextLabel
"Would love to see Slack integration"feature_request
"Getting a 500 error on the dashboard"bug_report
"Your team is amazing, solved my issue in minutes"praise
......

You can:

  • Approve all and proceed to training
  • Edit individual examples if something's mislabeled
  • Regenerate specific categories
  • Upload your own CSV to supplement or replace generated data

Step 5: Train Your Model

Click "Train Model" and watch the progress:

Training started...

Epoch 1/10 - Loss: 2.34 - Accuracy: 45%
Epoch 2/10 - Loss: 1.87 - Accuracy: 62%
Epoch 3/10 - Loss: 1.23 - Accuracy: 78%
...
Epoch 10/10 - Loss: 0.31 - Accuracy: 94%

Training complete!
Final accuracy: 94.2%

The loss curve shows your model learning. Accuracy should climb and loss should drop.

Step 6: Test Your Classifier

Try it immediately in the interface:

Input: "Is there any way to export data to Excel?"

Output: The classifier returns "feature_request" with 87% confidence, along with scores for all other categories.

Test edge cases:

  • Very short inputs
  • Inputs that could fit multiple categories
  • Inputs outside your expected domain

Step 7: Get Your API Endpoint

Your classifier is now live. You'll receive:

  • Endpoint: https://api.morphllm.com/predict
  • API Key: A unique key starting with tm_live_

Make POST requests with your model name and text. The API returns the predicted label and confidence score.

What's Next?

Improve Accuracy

If your classifier makes mistakes:

  1. Collect examples it got wrong
  2. Add them to your training data with correct labels
  3. Retrain the model

Batch Processing

Classify many items at once by sending an array of texts to the batch endpoint. Process thousands of items in a single request.

Integration

Connect your classifier to:

  • Customer support systems (Zendesk, Intercom)
  • CRM platforms (Salesforce, HubSpot)
  • Data pipelines (webhooks, Zapier, Make)
  • Internal tools (Slack bots, dashboards)

Troubleshooting

Low Accuracy

  • Add more training examples
  • Make label definitions clearer
  • Check for overlapping categories

Slow Predictions

  • Batch multiple texts in one request
  • Use async processing for non-real-time needs

Unexpected Classifications

  • Test with examples similar to what you'll see in production
  • The model learns from training data—if something's missing, add it

Build Your Classifier Now

Ready to start? Create your first classifier in minutes. No ML experience required.

Frequently Asked Questions

Ready to Transform Your Document Workflow?

Let AI help you review, edit, and transform Word documents in seconds.

No credit card required • Free trial available