Documentazione Binary Sentiment
Descrizione
Questa API permette di ottenere il sentiment di una frase di input utilizzando il modello DistilBERT. Il modello è stato pre-addestrato su un dataset di recensioni di film (SST-2) ed è in grado di fornire in output una valutazione binaria del sentiment (positivo o negativo) della frase di input.
Endpoint
https://intelligenzaartificialeitalia.net/_functions/sentiment
Parametri
-
text: testo di input, la cui lunghezza massima è di 512 token.
Risposte
-
200 OK: la richiesta ha avuto successo e viene restituito il sentiment in formato JSON.
-
400 Bad Request: la richiesta non è valida, ad esempio se il parametro text non è presente nella richiesta.
-
500 Internal Server Error: errore interno del server.
Esempi
perl
GET https://intelligenzaartificialeitalia.net/_functions/sentiment?text=I%20love%20you%20my%20friend
json
{ "sentiment": "positive" }
Emotion Sentiment API Documentation
This API is used to get the emotional sentiment of a given text using the j-hartmann/emotion-english-distilroberta-base model.
Endpoint
The endpoint for this API is: https://intelligenzaartificialeitalia.net/_functions/emotion
Request Method
This API only accepts GET requests.
Query Parameters
The following query parameter is required:
-
text: The text for which you want to get the emotion sentiment.
Response
The response of the API will be a JSON object with the following fields:
-
emotions: An object containing the different emotions and their corresponding scores. The emotions include anger, joy, love, sadness, surprise, and fear.
Example
To get the emotion sentiment of the text "I love you my friend", send a GET request to the following endpoint:
perl
https://intelligenzaartificialeitalia.net/_functions/emotion?text=I%20love%20you%20my%20friend
The response of the API will be a JSON object with the following structure:
json
{ "emotions": { "anger": 0.007, "joy": 0.903, "love": 0.906, "sadness": 0.034, "surprise": 0.026, "fear": 0.012 } }