Zum Inhalt springen
Agentic Workflowdocs
v0.8.2Kostenlos installieren

knoten / builtin / ai / aiagents

Sentiment Analysis

Analyze the sentiment of a text using a LLM, or on-device with a Local Classifier

KI ErweiterungWeb-App

Dieser Inhalt ist noch nicht in deiner Sprache verfügbar.

Label the tone of a text as positive, negative or neutral (or your own categories), with a chat model or on-device.

Sentiment Analysis reads Text and returns one label in sentiment. What you connect to Model decides how; there is no setting to switch:

  • A chat model (for example Chat OpenAI or Web LLM) is told to answer with only one of positive, negative, neutral, or one of your Custom categories, without explanation.
  • A Local Classifier runs in your browser: free, private and offline. A fixed-label sentiment model uses its own labels, mapped onto positive, negative and neutral (for example POSITIVE/NEGATIVE or 1 star to 5 stars). A zero-shot model scores your Custom categories word for word, or positive, negative, neutral when none are set. System message does not apply.

Older workflows saved with the former Engine setting on On-device and nothing connected to Model keep running their chosen on-device model. To change one, connect a Local Classifier.

  • Route negative reviews or support messages to a person, and the rest to an automatic reply.
  • Tag feedback by mood (angry, satisfied, confused) before saving it.
  • Screen customer messages privately, on-device, with a Local Classifier.

To sort text by topic rather than tone, use Text Classifier.

EinstellungTypWas es bewirkt
Text (erforderlich)Long textThe text to analyze the sentiment of.
Options GroupThe options for the node.
Options › Custom categories Long textComma-separated list of custom sentiment categories to use instead of positive/negative/neutral.
Options › System message Long textThe system message to use.

Fill Text with an expression such as {{ $input.text }}. Write Custom categories as a comma-separated list, for example angry, satisfied, confused. Keep them short and clearly different from each other.

  • Output

Each output item has these fields:

FieldTypWhat it holds
sentiment AnyThe sentiment label
score Number
scores Key-value pairs
predictions Any
Shape of an output item
{
"sentiment": null,
"score": 0,
"scores": {},
"predictions": null
}
  • With a chat model, you get only sentiment: the category the model answered.
  • With a Local Classifier, you also get score (the confidence of the top label, 0 to 1) and scores, every label with its score.
  • Older workflows on the former on-device engine return sentiment, score and predictions (the raw list of labels and scores).

Branch on the label with an IF or Switch node, using {{ $input.sentiment }}.

SlotAcceptsConnections
Model (erforderlich)chat model, local classifierOne node.

Connect a chat model, which holds its own API key, or a Local Classifier to run on-device. The Local Classifier needs an installed model: install one from its picker or the Local AI page.

  1. Get Selected Text reads a review you highlighted, with Output field name text.
  2. Sentiment Analysis with Text {{ $input.text }} and a Local Classifier on Model.
  3. IF checks that {{ $input.sentiment }} (String) is equal to negative.
  4. True goes to a Slack node that alerts your support channel.
  • “Connect a chat model or a Local Classifier to the Model port.” Nothing is connected to Model.
  • “Model not found”. The connected chat model node is not set up: open it and choose a model and its credential.
  • The label has extra words or a different capitalisation. Some chat models add text. Add a System message such as Answer in lowercase, one word., or use a stronger model.
  • “Model “…” isn’t available. Install it from Local AI.“ An older workflow on the former on-device engine uses a model that is not installed. Install it, or connect a Local Classifier.
Seite bearbeiten

Zuletzt aktualisiert:

Was this page useful?
Aria zu Sentiment Analysis fragen