Skip to main content

Analyse de Sentiment

Analyzes the sentiment of a text and returns a classification (positive, negative, neutral) with a confidence score.

Parameters

ParameterTypeRequiredVariableDescription
inputdynamic valueYesYesText to analyze for sentiment. Accepts a variable or free text.
aspectBasedbooleanNoNoEnable aspect-based sentiment analysis (e.g. quality, price, service). (Default: false)
aspectsarrayNoNoList of aspects to analyze individually (requires aspectBased enabled).
includeEmotionsbooleanNoNoInclude emotion detection (joy, anger, surprise, etc.) in the analysis. (Default: false)
languagetextNoNoLanguage of the text to analyze (ISO 639-1 code). Helps the model better understand the content.
model.providertextNoNoLanguage model provider (e.g. openai, anthropic).
model.modeltextNoNoModel identifier to use (e.g. gpt-4o-mini).
parameters.temperaturenumberNoNoModel creativity. Low value recommended for analysis. (Default: 0.3, min 0, max 2)
parameters.maxTokensnumberNoNoMaximum number of tokens in the analysis response. (Default: 2048, min 1, max 128000)
outputVariabletextNoNoOutput variable name containing the sentiment analysis result.

Parameters marked Variable = Yes accept the {{blockName.field}} syntax.

Output

Output variable : sentimentResult

{
"sentiment": "...",
"score": 0,
"confidence": 0
}

Example

Analyze the sentiment of customer feedback.

Input :

{"text": "Le service client a ete excellent et rapide."}

Output :

{"sentiment": "positive", "score": 0.92, "confidence": 0.95}
Tip

{{sentimentResult.sentiment}} returns "positive", "negative", or "neutral". {{sentimentResult.score}} is a number between -1 (very negative) and 1 (very positive).