Skip to main content

Vulavula Analyse

Sentiment Analysis

POST https://vulavula-services.lelapa.ai/api/v1/sentiment_analysis/process.

The Sentiment endpoint analyzes the provided text and returns the emotional tone as positive, negative, or neutral. Each request can handle up to 2,000 tokens, with a recommended limit of 180 tokens for optimal performance.

BODY PARAMS

encoded_text string required.
This parameter represents the text input that will be analyzed for named entities. It is required for the endpoint to function properly. The encoded_text should be provided as a string and contains the text to be processed by the Sentiment model.

HEADERS

X-CLIENT-TOKEN string required.
Represents the authentication token required for accessing the API. This header ensures that only authorized clients can make requests to the endpoint.

EXAMPLES

pdm add vulavula
from vulavula import VulavulaClient
client = VulavulaClient("<INSERT_TOKEN>")

sentiment_result = client.get_sentiments({'encoded_text': 'am happy. i am sad. hello!'})
print(sentiment_result)

RESPONSES

🟢 200 OK
The request was successful. Below is an example response body
{
"Id": "a9529bd6-35c9-406b-ae01-f7c9cd95cf54",
"Sentiments": [
{
"text": "am happy",
"sentiment": [
{
"label": "positive",
"score": 0.9991829991340637
}
]
},
{
"text": " i am sad",
"sentiment": [
{
"label": "negative",
"score": 0.960746169090271
}
]
},
{
"text": " hello",
"sentiment": [
{
"label": "neutral",
"score": 0.8527688384056091
}
]
}
]
}

RESPONSE BODY PARAMS

Object
Sentiments string required.
Sentences seperated by (. and !) and returned as a list of sentiments
sentiment obj required.
Object with the response analysed for each of the sentences
text string required.
Contains text which makes up each of the sentences
label string required.
Indicates the sentiment returned by the Model for each sentence
score number required.
Model confidence that the answer is of that specific Sentiment
🔴 400 Bad Request
The request was malformed or contained invalid data
🟠 401 Unauthorized
The client token is missing or invalid.
🔴 500 Internal Server Error
An unexpected error occurred on the server.