# Sentiment analysis

> Sentiment analysis is the automatic detection of the attitude in a piece of text, usually positive, negative or neutral, used to sort reviews, support tickets, survey answers and social mentions at a scale no team could read by hand.

Also called: opinion mining, tone detection, emotion analysis, customer sentiment. Category: Models and training. Source: https://aibuildindex.com/glossary/sentiment-analysis

## In the index

- Natural language processing: median $3,000, middle half $500 to $9,440, 1,428 priced briefs (https://aibuildindex.com/skills/natural-language-processing)
- Customer support chatbot: median $2,000, middle half $300 to $5,300, 1,344 priced briefs (https://aibuildindex.com/cost/support-chatbot)

Sentiment analysis reads text and judges how the writer feels about something. Applied to thousands of reviews, tickets or survey comments, it shows which products draw complaints, which support conversations are going badly, and whether opinion is shifting week to week. For a business buyer it is a way to turn unstructured feedback into a number someone can track.

## How it works

At heart it is a [classification](https://aibuildindex.com/glossary/classification) task: each piece of text receives a label such as positive, negative or neutral, sometimes with a score. Older approaches counted positive and negative words. Trained [natural language processing](https://aibuildindex.com/glossary/natural-language-processing) models do better with phrasing and negation. Today many builds simply ask a [large language model](https://aibuildindex.com/glossary/large-language-model) to label each item, often returning [structured output](https://aibuildindex.com/glossary/structured-output) so the result drops straight into a spreadsheet or dashboard.

The more useful version is aspect-based sentiment, which ties feeling to a topic. "Delivery was quick but the box was crushed" is positive about speed and negative about packaging. A typical build pulls new reviews each night, tags each one by aspect and sentiment, flags strongly negative ones to a support channel, and updates a weekly chart.

## What it means for cost

The model call is a minor cost. The effort lies in making the labels trustworthy and useful:

- **Definitions.** Teams must agree what counts as negative. Is a polite cancellation request negative? Agreeing a short labelling guide early avoids rework.
- **Evaluation.** A few hundred items labelled by people give a baseline to measure the system against. See [evals](https://aibuildindex.com/glossary/evals).
- **Sources and languages.** Each new data source needs a connector, and each language needs its own checks.
- **Volume.** Running a language model over millions of short texts adds up; a smaller trained model can be cheaper at high volume.

Ask a builder how they will measure accuracy on your own data and how sarcasm, mixed opinions and other languages will be handled.

## When it is the wrong tool

If the decision depends on what the customer wants rather than how they feel, such as routing a ticket to billing or returns, intent classification is the better fit. Sentiment works best as a signal alongside other labels, not as the only one.

## Common questions

### How accurate is sentiment analysis?

It varies with the text and the definitions used. Short, plain reviews are easy; sarcasm, industry jargon and mixed opinions are hard even for people, who often disagree with each other. Measure it on a labelled sample of your own data rather than relying on a general claim.

### Can sentiment analysis work on calls?

Yes, once the audio has been transcribed with speech-to-text. Some tools also analyse tone of voice, but most business builds work from the transcript.

## Related terms

- [Natural language processing (NLP)](https://aibuildindex.com/glossary/natural-language-processing): Natural language processing is the field of computing that lets software read, interpret and produce human language, covering tasks such as classification, translation, summarisation, entity extraction and question answering.
- [Classification](https://aibuildindex.com/glossary/classification): Classification is a machine learning task in which a model assigns each input, such as an email, image, transaction or document, to one of a set of predefined categories, for example spam or not spam, or which team should handle it.
- [Large language model (LLM)](https://aibuildindex.com/glossary/large-language-model): A large language model is an AI model trained on very large amounts of text to predict the next word, which lets it write, summarise, translate, classify and answer questions in natural language.
- [Evals (AI evaluation)](https://aibuildindex.com/glossary/evals): Evals are structured tests that measure how well an AI system performs on a fixed set of realistic inputs, scoring its outputs so that changes to prompts, models or data can be judged by evidence rather than impression.
- [Structured output](https://aibuildindex.com/glossary/structured-output): Structured output is a way of making an AI model return its answer in a fixed, machine-readable format, typically JSON matching a defined schema, so that other software can use the result without guessing at free text.
