- Introduced by
- Bo Pang & Lillian Lee (opinion mining); applied to hotel reviews by Zheng Xiang and colleagues
- Year
- 2008
- Type
- Supervised/lexicon text-classification of review polarity and opinion
- Family
- Natural language processing / opinion mining
What does it do?
TripAdvisor review sentiment mining applies opinion mining and sentiment analysis to the reviews travellers post about hotels, restaurants and attractions on platforms such as TripAdvisor.
It follows the opinion-mining framework surveyed by Pang and Lee (2008) and uses lexicon-based or machine-learning classifiers to label text as positive, negative or neutral, turning free-text reviews into structured sentiment data. In hospitality, Xiang and colleagues (2015) used text analytics on hotel guest reviews to study guest experience and satisfaction. The aspect-level variant described below assigns sentiment to specific facets of a stay rather than only to the review as a whole.
The intuition behind the method
A popular hotel can collect thousands of reviews, and the star rating alone does not show whether guests are complaining about noise, rude staff or an uncomfortable bed. Sentiment mining reads the text at scale. The starting point is that word choice carries polarity: wording such as 'spotless' or 'friendly' points toward a positive opinion, while 'filthy' or 'rude' points toward a negative one. A classifier can learn these associations from a sentiment lexicon or from labelled reviews, then score unseen reviews automatically. Because one review can praise the location and criticise the service, the aspect-level variant scores each facet separately, which shows how a whole corpus feels and which parts of the stay drive that feeling.
History
Opinion mining and sentiment analysis developed in computational linguistics in the 2000s. Pang and Lee's 2008 survey, Opinion Mining and Sentiment Analysis, covers the techniques and the new challenges that sentiment-aware applications raise, and is widely cited as a reference. Xiang and colleagues applied big-data text analytics to hotel guest experience and satisfaction (International Journal of Hospitality Management, volume 44, 2015; the article appeared online in 2014), which is the hospitality application this entry reflects.
When to use it
Choose this method when you hold a large body of review text and need the tone of guest opinion quantified, for example to monitor reputation over time, compare properties or destinations, or find recurring complaints and praise. The aspect-level form suits questions about which facets of a stay drive satisfaction. Do not use it when the number of reviews is small enough to read and code directly, because manual coding will be more accurate. It is also a poor fit when the text is dominated by sarcasm, mixed languages or domain-specific wording that the chosen classifier has not been validated on, or when fake reviews make up a large share of the corpus. Results describe the opinions of people who chose to post, so they should be checked against human-coded samples and interpreted with reviewer self-selection in mind.
Limitations and considerations
- Star ratings used as training labels can diverge from the sentiment of the text, so a classifier trained on them may learn the rating rather than the opinion.
- The three-class scheme forces each text unit into one polarity; a review that praises one facet and criticises another is only represented correctly if the aspect step identifies both.
- The aspect-level step depends on the chosen aspect set and on linking each opinion to the right aspect; facets outside the set, such as food, are lost.
- Negation and sarcasm can reverse the polarity of a sentence, so lexicon methods that count individual words are most exposed to these errors.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Makes large review corpora, of the kind Xiang and colleagues (2015) analysed with text analytics, quantifiable without coding each review by hand.
- The three-label output (positive, negative, neutral) gives a compact measure that can be counted, trended and compared across properties.
- The aspect-level form yields one sentiment value per review per aspect, so a manager can tell whether a complaint concerns service, room or value rather than reading a single overall score.
- Because the scores come from the text itself, they can capture the reason behind a rating, which a star rating alone does not record.
Applications
- Classifying the polarity of online hotel, restaurant and attraction reviews at scale.
- Extracting aspect-level sentiment for facets such as room, service, location, value and cleanliness.
- Tracking a property's or destination's review sentiment over time for reputation monitoring.
- Comparing sentiment across properties on the same aspects.
- Flagging shifts in negative sentiment about a specific aspect as a possible early sign of service problems.
How it works
How it works
A corpus of reviews is collected and prepared for analysis. The text is tokenised, lowercased and cleaned of markup, and stopword removal or normalisation such as stemming or lemmatisation may follow. Sentiment analysis raises challenges beyond fact-based text analysis (Pang and Lee, 2008), and negation is a standard example, so preprocessing must be checked to keep sentiment-bearing words. Removing 'not' from 'not clean' would reverse the meaning of the review.
Formula
d_i \to \text{tokens } w_{i1},\dots,w_{iT};\ \text{clean, lowercase, remove stopwords, normalize}Each cleaned review is converted into a numerical representation. Two common choices are a tf-idf vector over the vocabulary, which keeps the sentiment-bearing words visible and easy to inspect, and a dense embedding of fixed length, which captures more context at the cost of interpretability. Both are standard text-classification practice. The representation determines what the classifier can exploit, so the choice should reflect the amount of data and how much the results need to be explained.
Formula
\mathbf{x}_i = (\mathrm{tf\text{-}idf}(w,d_i))_{w\in V}\ \text{or}\ \mathbf{x}_i=\text{embedding}(d_i)\in\mathbb{R}^kA classifier assigns one of three polarity labels, positive, negative or neutral, to each review or text unit. Lexicon-based scoring counts and weights sentiment words from a dictionary and needs no labelled data, whereas supervised models such as Naive Bayes, support vector machines or neural classifiers learn the mapping from labelled reviews. The predicted class is the one with the highest score. Naive Bayes and neural models give class probabilities directly; a support vector machine gives decision scores, which need calibration if probabilities are wanted. Star ratings are often used as labels because they are convenient, but they only approximate the sentiment expressed in the text.
Formula
\hat{y}_i = \arg\max_{c\in\{-,0,+\}} f_c(\mathbf{x}_i),\ \ f_c = \Pr(c\mid \mathbf{x}_i)\ \text{(NB, neural) or decision score (SVM)}Where a review expresses different opinions about different features, the method identifies the aspect each opinion refers to and assigns a sentiment to it. Aspect-level analysis is a general opinion-mining technique, and room, service, location, value and cleanliness are used here as an illustrative aspect set, not as a fixed standard. The aspect set should be defined from the corpus and the study question, because a fixed list can miss facets that guests discuss, such as food. The output is one sentiment value per review per aspect rather than a single overall score.
Formula
s_{i,a} = \text{sentiment}(d_i, a),\ a\in\{\text{room},\text{service},\text{location},\text{value},\text{cleanliness}\}The classifier is evaluated against human-labelled ground truth using precision, recall and the F1 score, as in the opinion-mining literature. The validation sample should be coded by at least two people, with inter-coder agreement reported, and should be large enough to estimate precision and recall for each class. Rating-derived labels are only a rough proxy. Validated outputs are then aggregated by property, period or aspect. Because the labels are categorical, a numeric coding must be stated before any mean is computed, for example +1 for positive, 0 for neutral and -1 for negative. The mean of these codes should be reported together with the share of reviews in each label, or the label proportions can be reported on their own.
Formula
F_1 = \dfrac{2PR}{P+R};\quad \bar{s}_{\text{hotel}} = \tfrac{1}{n}\textstyle\sum_i v(\hat{y}_i),\ \ v(+)=1,\ v(0)=0,\ v(-)=-1Common pitfalls
- Averaging the categorical polarity labels into a hotel score without first mapping them to numbers; state the coding (for example +1, 0, -1) and report label shares alongside the mean.
- Deleting negation words or punctuation during preprocessing, which can reverse the polarity of a review such as 'not clean'.
- Reporting only the overall polarity when the question concerns a specific facet, which hides whether a property's problems lie in service, value or cleanliness.
- Reporting accuracy alone rather than precision, recall and F1 against a human-coded sample, which leaves class-specific errors, such as misreading neutral reviews, hidden.
- Validating against a sample coded by a single person; use at least two coders and report their agreement.
Frequently asked questions
What is the difference between sentiment analysis and aspect-based sentiment analysis?
Document-level sentiment analysis assigns one overall polarity, positive, negative or neutral, to a whole review. Aspect-based sentiment analysis first identifies the aspects discussed, such as room, service, location, value and cleanliness, and assigns a sentiment to each, so one review can register praise for one facet and criticism of another. An overall score averages these differences away. Pang and Lee (2008) survey opinion mining, including the treatment of evaluative text, while Xiang and colleagues (2015) applied text analytics to hotel guest experience and satisfaction.
Should I use a lexicon-based or machine-learning approach?
Surveys of the field, including Pang and Lee (2008), cover both. Lexicon-based methods score text by counting and weighting sentiment-bearing words from a dictionary; they need no labelled training data and are transparent, but they can miss context and domain-specific usage. Supervised machine-learning methods, such as Naive Bayes or support vector machines, learn from labelled reviews, often using star ratings as labels. They can be more accurate on the domain they were trained on, but they require labelled data and are less transparent. The choice depends on the labelled data available, the accuracy required and how much the results need to be explained.
Related methods
Sources
Pang, B., & Lee, L. (2008). Opinion Mining and Sentiment Analysis. Foundations and Trends in Information Retrieval, 2(1-2), 1-135.
Open DOI referenceXiang, Z., Schwartz, Z., Gerdes, J. H., & Uysal, M. (2015). What can big data and text analytics tell us about hotel guest experience and satisfaction? International Journal of Hospitality Management, 44, 120-130.
Open DOI reference