This Bert base model is a fine-tuned version of BERT, developed by NLP Town. This model is specifically trained for sentiment analysis across six languages: English, Dutch, German, French, Spanish, and Italian. It predicts the sentiment of a review on a scale of 1 to 5 stars.
The Sentiment Analysis API endpoint allows you to analyze your text sentiment.
Sentiment Analysis on text involves analyzing the words, phrases, and sentence structures used in the text data to determine the underlying sentiment, which can be positive, negative, neutral, etc. The Sentiment Analysis model can classify the text data based on predefined sentiment categories.
AI Endpoints makes it easy, with ready-to-use inference APIs. Discover how to use them:
This Sentiment Analysis API is based on an Open-Source model: nlptown/bert-base-multilingual-uncased-sentiment. It takes text as input and returns the text's feelings and the corresponding probability.
Model configuration:
Warning:
Note that this model predicts the sentiment of the input text as a number of stars:
- 1 ⭐ is very negative
- 5 ⭐⭐⭐⭐⭐ is very positive
The Sentiment Analysis endpoint offers you an optimized way to analyze the feeling of a text. Learn how to use them with the following example:
First install the requests library:
pip install requests
Next, export your access token to the OVH_AI_ENDPOINTS_ACCESS_TOKEN environment variable:
export OVH_AI_ENDPOINTS_ACCESS_TOKEN=<your-access-token>
If you do not have an access token key yet, follow the instructions in the AI Endpoints – Getting Started.
Finally, run the following Python code:
import os
import requests
url = "https://bert-base-multilingual-uncased-sentiment.endpoints.kepler.ai.cloud.ovh.net/api/text2sentiments"
text = "This AI Endpoint is really useful for classifying a text's feelings from 1 to 5 stars."
headers = {
"Content-Type": "application/json",
"Authorization": f"Bearer {os.getenv('OVH_AI_ENDPOINTS_ACCESS_TOKEN')}",
}
response = requests.post(url, data=text, headers=headers)
if response.status_code == 200:
# Handle response
response_data = response.json()
print(response_data)
else:
print("Error:", response.status_code, response.text)
When using AI Endpoints, the following rate limits apply:
If you exceed this limit, a 429 error code will be returned.
If you require higher usage, please get in touch with us to discuss increasing your rate limits.
For a broader overview of AI Endpoints, explore the full AI Endpoints Documentation.
Reach out to our support team or join the OVHcloud Discord #ai-endpoints channel to share your questions, feedback, and suggestions for improving the service, to the team and the community.
New to AI Endpoints? This guide walks you through everything you need to get an access token, call AI models, and integrate AI APIs into your apps with ease.
Start TutorialExplore what AI Endpoints can do. This guide breaks down current features, future roadmap items, and the platform's core capabilities so you know exactly what to expect.
Start TutorialRunning into issues? This guide helps you solve common problems on AI Endpoints, from error codes to unexpected responses. Get quick answers, clear fixes, and helpful tips to keep your projects running smoothly.
Start TutorialLearn how to use Structured Output with OVHcloud AI Endpoints.
Start TutorialLearn how to use Function Calling with OVHcloud AI Endpoints.
Start TutorialLearn how to use OVHcloud AI Endpoints Virtual Models.
Start TutorialUnlock emotional insights from text using AI! This tutorial shows you how to build a Java-based sentiment analyzer with Quarkus and the powerful GoEmotions model.
Start TutorialLearn how to use Structured Output with Java, LangChain4j and OVHcloud AI Endpoints.
Start TutorialLearn how to use Function Calling with Java, LangChain4j and OVHcloud AI Endpoints.
Start TutorialLearn how to use Model Context Protocol (MCP) with Java, LangChain4j and OVHcloud AI Endpoints.
Start Tutorial