Sentiment analysis

POST /nlu/v1/agents/{agent_id}/processing/sentiment_analysis

Analyze the sentiment expressed in the user’s sentences in a conversation using a fixed model

Sample input

{
  "text": "Quero retirar R$10 da poupança"
}

Sample Response

{
  "input_text": "Quero retirar R$10 da poupança",
  "global_sentiment": {
    "polarity": "neutral",
    "score": 0.9853106737136841
  },
  "metadata": {
    "pipeline": "pt-br/sentiment-1.0",
    "worker_id": "d6bfa9e6-4738-4a0d-a167-c416ced30e73",
    "transation_id": "c6b51d25-e0c2-4a6d-8746-d7373edcb550",
    "response_time": 0.09931516647338867
  }
}
Parameters
  • agent_id – Agent ID

Status Codes
Response JSON Object
  • input_text (string) – Sentence sent.

  • sentiment (Dict[GlobalSentiment]) – Sentiment detected.

  • metadata (Dict[Metadata]) – Metadatas.

Global Sentiment Object

Response JSON Object
  • polarity (string) – Sentiment polarity (negative, neutral, positive).

  • score (float) – Confidence score (0.0 - 1.0).

Metadata Object

Response JSON Object
  • pipeline (string) – Type of pipeline used.

  • response_time (string) – Analysis time.