Summarize this article with:
In today’s data-driven world, making sense of large volumes of text is essential—whether you're organizing user feedback, tagging support tickets, or filtering content. That’s where custom text classification comes in. It allows you to automatically assign categories or labels to text based on patterns you define.
In this tutorial, you’ll learn how to build a simple yet powerful custom text classification system using JavaScript.
What is Custom Text Classification?

Custom text classification is the process of automatically assigning predefined labels to text data based on user-defined categories. Unlike generic classification models, it’s tailored to specific needs by training on a small set of example texts provided by the user. These examples guide the system to recognize patterns and apply the correct labels to new, unseen text.
In essence, it allows you to:
- Define your own categories (e.g., "Positive", "Negative", "Neutral" or "Invoice", "Contract", "Email").
- Provide a few labeled examples for each category.
- Use these examples to train a model that can generalize and classify similar texts accordingly.
It's especially useful when off-the-shelf classifiers don’t fit your context or when you're working with domain-specific language.
How to Categorize Text Content With Custom Classes
Get Access to Eden AI API
1. Sign up: You first need to sign up on Eden AI and obtain your API key. This key will give you access to a wide range of AI services including Custom Text Classification.

2. Access Text Processing: Once logged in, head to the Text section of the platform to access the available tools.
3. Choose Custom Text Classification: Click on the Custom Text Classification feature.
Install Required Python Module
To make HTTP requests, make sure you have the requests library installed:
Prepare the Code
Here’s a complete Python example using Eden AI’s /text/custom_classification endpoint:
Explanation of Code Sections
- labels: The target categories you want to classify texts into.
- texts: The list of new texts to classify.
- examples: Labeled training examples to help guide the model’s predictions.
- providers: You can specify one or more providers (e.g., "openai").
This is zero-training classification, powered by large language models and guided by your custom examples.
Example Output
Here’s an example of what the API might return:
Output Field Breakdown:
- label: The predicted class.
- confidence: The model’s confidence score.
- status: Indicates whether the request was successful.
Benefits of using Custom Text Classification API with Eden AI
Using Custom Text Classification with Eden AI API is quick and easy.
.gif)
Save time and cost
We offer a unified API for all providers: simple and standard to use, with a quick switch between providers and an access to the specific features of each provider.
Easy to integrate
Eden AI ensures a unified JSON output format across all providers through its standardization efforts. The response elements are also harmonized using Eden AI’s advanced matching algorithms.
Customization
Eden AI allows you to integrate a third-party platform, with the ability to quickly develop connectors. This enables you to take your Document Translation requests further by customizing them with specific parameters, check out our documentation.
Conclusion
Custom text classification is now easier than ever with Eden AI. With just a few lines of Python, you can classify text with real-world accuracy using trusted AI providers. Whether you're filtering emails or tagging feedback, Eden AI offers a simple and scalable solution that grows with your needs.
Ready to build your own classifier? Get started on Eden AI.

.jpg)

.avif)
.avif)