Sentiment analysis
Sentiment analysis is the computational identification or classification of opinions, attitudes, or emotional and evaluative polarity expressed in text.
Starting Data Analytics with Generative AI and Python
Sentiment analysis is the computational analysis of text to determine expressed opinions, emotions, or evaluative polarity.
- How it is used
- Uses sentiment analysis to identify customer satisfaction and dissatisfaction in reviews and support business decisions.
- How deep it goes
- Explains keyword, lexicon, generative AI, and pretrained-model approaches with implementation and evaluation comparisons.
- Examples
- Examines Portuguese product reviews, including a mixed review, and compares methods on 500 non-empty reviews.
- What you can do after
- Apply it via a generative AI API or lexicon and evaluate classifications against review-score benchmarks.
Read how Starting Data Analytics with Generative AI and Python explains sentiment analysis →
Natural Language Processing in Action, Second Edition
Sentiment analysis is the computational determination of opinions, emotions, or evaluative attitudes expressed in text.
- How it is used
- Deploys sentiment analysis to extract emotional signals from customer feedback, filter harmful messages, and support conversational systems.
- How deep it goes
- Explains sentiment as token information and numerical output, while stopping short of detailed model or algorithm implementation.
- Examples
- Uses product reviews, open-ended customer comments, star ratings, junk mail, and troll messages as concrete applications.
- What you can do after
- Apply it via an NLP pipeline to convert large collections of feedback into emotional ratings and support message filtering.
Read how Natural Language Processing in Action, Second Edition explains sentiment analysis →
Learn AI Data Engineering
Sentiment analysis is the computational determination of opinions, emotions, or evaluative polarity expressed in language.
- How it is used
- Enriches news articles with pipeline-ready sentiment labels for downstream analytics and delivery.
- How deep it goes
- Works through prompting, response extraction, label normalization, DataFrame consolidation, logging, and known classification variability.
- Examples
- Uses live Tesla news, normalized three-way labels, numerical scores from -1 to 1, and sentiment aggregation exercises.
- What you can do after
- Apply it via the OpenAI Chat Completions API to enrich a Python DataFrame with logged, normalized sentiment labels.
Read how Learn AI Data Engineering explains sentiment analysis →
Data Without Labels
Sentiment classification is the assignment of text to categories representing expressed opinions, attitudes, or emotional polarity.
- How it is used
- Gauges customer satisfaction and pain points in review text when written opinions may diverge from star ratings.
- How deep it goes
- Walks through review collection, cleaning, polarity scoring, threshold labels, and plots; uses TextBlob rather than deriving or training a classifier.
- Examples
- Uses Amazon thermostat reviews, star-rating counts, TextBlob scores, satisfaction bands, and a ratings-versus-sentiment figure.
- What you can do after
- Apply it via TextBlob to score cleaned reviews, assign satisfaction labels, and compare their distribution with star ratings.
Grokking Machine Learning, Second Edition
The computational classification of text according to expressed opinions, attitudes, or emotional polarity.
- How it is used
- Uses text classification to predict whether reviews express positive or negative sentiment.
- How deep it goes
- Explains preprocessing, sparse word-count features, label encoding, classifier training, learned word weights, and probability predictions.
- Examples
- Uses IMDB movie reviews, positive-negative labels, word-count vectors, and predicted positive-class probabilities.
- What you can do after
- Build it with pandas and scikit-learn by vectorizing reviews, training logistic regression, and generating sentiment probabilities.
Read how Grokking Machine Learning, Second Edition explains sentiment analysis →
Grokking Machine Learning
The computational task of determining an expressed opinion or affective polarity in text.
- How it is used
- Frames sentiment analysis as classifying text into positive or negative categories.
- How deep it goes
- Demonstrates word-count features, logistic-classifier training, and inspection of learned coefficients.
- Examples
- Uses labeled IMDB movie reviews and learned coefficients for words such as “comfortable.”
- What you can do after
- Apply it via Turi Create to turn review text into word-count features and train a logistic classifier.
Read how Grokking Machine Learning explains sentiment analysis →
The Complete Obsolete Guide to Generative AI
Sentiment analysis is the computational classification of text according to expressed affective polarity such as positive, negative, or neutral.
- How it is used
- Measures large-scale opinion in reviews and social posts to surface consumer, public, and market sentiment.
- How deep it goes
- Explains polarity classification and preprocessing, then tests prompted GPT labels against pre-labeled posts without building a classifier from scratch.
- Examples
- Uses 1,000 pre-labeled X product-review posts, Python CSV processing, GPT-3/GPT-3.5 prompts, and prediction-frequency counts.
- What you can do after
- Apply it via GPT prompts to label consumer comments, compare outputs with known labels, and manually verify unreliable results.
Read how The Complete Obsolete Guide to Generative AI explains sentiment analysis →
First-Party Data Activation
The computational or analytical assessment of expressed attitudes and emotions in customer communications.
- How it is used
- Uses customer communications to support proactive service, product improvement, marketing insight, and message testing.
- How deep it goes
- Classifies sentiment as positive, negative, or neutral, then extends toward generative summaries and deeper insights without implementation detail.
- Examples
- Uses email, social media, reviews, support tickets, marketing messages, and artificial customer personas as analysis inputs.
- What you can do after
- Apply it via sentiment analysis tools to monitor satisfaction, prioritize concerns, improve products, and test marketing responses.
Read how First-Party Data Activation explains sentiment analysis →
Microsoft Azure in Action
Sentiment analysis is the computational determination of opinions, emotions, or attitudes expressed in text.
- How it is used
- Uses sentiment analysis to understand customer opinions in feedback and inform improvements to a bookseller’s offerings.
- How deep it goes
- Introduces the purpose through a customer-feedback scenario but provides no sentiment-analysis procedure or output.
- Examples
- Uses a bookseller’s customer feedback as the scenario for identifying opinions.
- What you can do after
- Evaluate/understand it as a way to learn what customers think before improving offerings.
Read how Microsoft Azure in Action explains sentiment analysis →
Snowflake Data Engineering
Sentiment classification assigns text to categorical sentiment labels such as negative, neutral, or positive.
- How it is used
- Classifies customer reviews so teams can prioritize specific feedback and monitor sentiment distribution over time.
- How deep it goes
- Defines score interpretation and SQL thresholding, but stops short of explaining the sentiment model’s internal operation.
- Examples
- Uses bakery delivery reviews and example phrases about excellent service, stale bagels, and an ordinary bakery visit.
- What you can do after
- Apply it via Snowflake Cortex and SQL to score reviews, assign classes, filter feedback, and track sentiment over time.
Read how Snowflake Data Engineering explains sentiment analysis →
Building Specialized AI Systems
Sentiment classification is the task of assigning text to categories representing evaluative polarity such as positive or negative.
- How it is used
- Deploys sentiment analysis to interpret customer feedback and improve product insights and customer-service routing.
- How deep it goes
- Explains domain adaptation through fine-tuning and mixed-emotion examples, without detailing model architecture or evaluation metrics.
- Examples
- Uses product reviews, support interactions, social-media mentions, and a mixed battery-life and camera-quality review.
- What you can do after
- Evaluate domain-specific sentiment and route nuanced customer feedback to appropriate product or service teams.
Read how Building Specialized AI Systems explains sentiment analysis →
Investing for Programmers
Sentiment analysis is a computational technique for determining attitudes, opinions, or emotional polarity expressed in text.
- How it is used
- Converts qualitative language into signals for comparing companies, monitoring reputation, and assessing nonfinancial risk.
- How deep it goes
- Connects sentiment analysis to transcripts, keywords, and risk judgments but stops short of explaining model mechanics or implementation.
- Examples
- Uses earnings-call transcripts, social-media posts, political speeches, legal-case coverage, and news sentiment.
- What you can do after
- Apply it to compare textual sentiment and investigate possible reputation or political risks while treating conclusions cautiously.
Read how Investing for Programmers explains sentiment analysis →
Software Testing with Generative AI
Sentiment analysis is the computational classification or scoring of text according to expressed sentiment or evaluative polarity.
- How it is used
- Evaluates whether fine-tuned model outputs align with expected outputs during inference testing.
- How deep it goes
- Explains automated comparison and score interpretation, then stops short of replacing manual human validation.
- Examples
- Uses held-out or new instruction-output data and compares each returned response with its expected response.
- What you can do after
- Diagnose tuning quality via sentiment scores, then select future fine-tuning or human-review steps.
Read how Software Testing with Generative AI explains sentiment analysis →
Spring AI in Action
Sentiment analysis is the computational classification of text according to expressed opinions or emotional polarity.
- How it is used
- Uses user sentiment to guide responses and smooth negative experiences in online and natural-language applications.
- How deep it goes
- Explains prompt design, data types, controller wiring, and endpoint results, but defers sentiment-model internals.
- Examples
- Evaluates increasingly contextual phrases about the end of the world, plus a positive lyric-like passage.
- What you can do after
- Build a Spring endpoint that returns sentiment polarity and an explanation for submitted text.
Hugging Face in Action
Sentiment analysis is the computational classification of text according to the expressed attitude or polarity, such as positive or negative sentiment.
- How it is used
- Applies pretrained text-classification models to detect positive or negative opinions in reviews and other paragraphs.
- How deep it goes
- Explains pipeline use, then descends through tokenization, attention masks, logits, class selection, and fine-tuning datasets.
- Examples
- Uses IMDb movie reviews, a positive movie sentence, and labeled Yelp restaurant and service reviews.
- What you can do after
- Builds a classifier with a pipeline, or operates a tokenizer and model directly to produce sentiment predictions.
Read how Hugging Face in Action explains sentiment analysis →
Also covered in
- Delivering Machine Learning Projects: From design to deployment
- Advanced Algorithms and Data Structures
- AI Agents and Applications
- LLMs in Production
- AI-Powered Search
- AI for Everyday IT
- Build AI-Enhanced Web Apps
- Data Pipelines with Apache Airflow, Second Edition
- Transfer Learning for Natural Language Processing
- Ensemble Methods for Machine Learning
- Transformers in Action
What to know first
- language modelA language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- natural language processingNatural language processing is the field of computing concerned with computational methods for analyzing, interpreting, transforming, and generating human language in text or speech.
- promptA prompt is text or other input supplied to an AI model to provide instructions, context, or other information that guides its response or generated output.
- machine learningMachine learning is a field of computational methods in which systems learn patterns or relationships from data to make predictions, decisions, or other outputs.
Related concepts
- classifierkind of · A classifier is a predictive model that assigns an input to one or more discrete classes or categories.
- language modeluses · A language model is a computational model that represents patterns in linguistic sequences to assign probabilities, predict, generate, or evaluate language.
- ChatGPTuses · ChatGPT is OpenAI’s conversational AI service, which lets users interact with generative AI models and related tools through natural-language prompts.
- fine-tuningused by · Fine-tuning is the continued training of a pretrained model on targeted data or objectives to adapt its parameters or behavior to a task, domain, or use.
- natural language processingkind of · Natural language processing is the field of computing concerned with computational methods for analyzing, interpreting, transforming, and generating human language in text or speech.
Questions about sentiment analysis
What is sentiment analysis?
Sentiment analysis is the computational identification or classification of opinions, attitudes, or emotional and evaluative polarity expressed in text.
Which Manning books explain sentiment analysis?
Starting Data Analytics with Generative AI and Python, Natural Language Processing in Action, Second Edition, Learn AI Data Engineering, Data Without Labels, Grokking Machine Learning, Second Edition, Grokking Machine Learning, The Complete Obsolete Guide to Generative AI, First-Party Data Activation and 7 more.
What should I know before learning sentiment analysis?
Manning books that teach sentiment analysis usually introduce language model, natural language processing, prompt and machine learning first.
What is sentiment analysis a kind of?
Sentiment analysis is a kind of classifier. A classifier is a predictive model that assigns an input to one or more discrete classes or categories.
What is sentiment analysis also called?
Sentiment analysis is also called sentiment classification.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.














