Welcome to the Text Classification API documentation. This section provides detailed information about our text classification capabilities, including how to integrate the API into your applications and the various parameters available.
Overview
Text classification is a fundamental task in natural language processing (NLP), which involves assigning a text to one or more categories based on its content. Our Text Classification API allows you to classify text into predefined categories, enabling you to gain insights and make data-driven decisions.
Features
- Pre-trained Models: Our API leverages state-of-the-art pre-trained models that have been trained on a diverse range of text data.
- Custom Categories: You can easily define and add custom categories to the API, tailoring it to your specific needs.
- Scalable: The API is designed to handle large volumes of text data, ensuring fast and accurate classification.
Usage
To use the Text Classification API, you need to send a GET request to the following endpoint:
GET /api/v1/text-classification
Parameters
text
: The input text to be classified. This parameter is required.categories
: A comma-separated list of categories to classify the text into. This parameter is optional.language
: The language of the input text. This parameter is optional and defaults to English.
Example Request
GET /api/v1/text-classification?text=This is a sample text&categories=positive,negative
Response
The API will return a JSON response containing the classification results:
{
"text": "This is a sample text",
"categories": [
{
"category": "positive",
"score": 0.95
},
{
"category": "negative",
"score": 0.05
}
]
}
Additional Resources
For more information about the Text Classification API, please refer to the following resources: