Source-linked AI summary
Sentiment Analysis of Review Datasets Using Naive Bayes and K-NN Classifier
Lopamudra Dey, Sanjay Chakraborty, Anuraag Biswas, Beepa Bose, Sweta Tiwari
TL;DR
The paper addresses timely sentiment classification of web-based movie and hotel reviews, motivated by the usefulness of opinion information for analysis and services. It compares supervised Naïve Bayes and K-NN using accuracy, precision, and recall, finding that Naïve Bayes performs better on movie reviews while both methods achieve lower, similar accuracies on hotel reviews.
Problem
The paper examines how to classify increasing volumes of web-based opinions and reviews to identify sentiment polarity for analysis and service applications.
Method
The study compares supervised Naïve Bayes and K-NN classifiers on movie and hotel review datasets using accuracy, precision, and recall.
Results
Naïve Bayes achieved above 80% accuracies and outperformed K-NN on movie reviews, while hotel-review accuracies were much lower and similar for both classifiers.
Takeaways & Limitations
Naïve Bayes can be used successfully to analyse movie reviews within the evaluated sentiment-classification setting.
Abstract
from arXiv · showhide
The advent of Web 2.0 has led to an increase in the amount of sentimental content available in the Web. Such content is often found in social media web sites in the form of movie or product reviews, user comments, testimonials, messages in discussion forums etc. Timely discovery of the sentimental or opinionated web content has a number of advantages, the most important of all being monetization. Understanding of the sentiments of human masses towards different entities and products enables better services for contextual advertisements, recommendation systems and analysis of market trends. The focus of our project is sentiment focussed web crawling framework to facilitate the quick discovery of sentimental contents of movie reviews and hotel reviews and analysis of the same. We use statistical methods to capture elements of subjective style and the sentence polarity. The paper elaborately discusses two supervised machine learning algorithms: K-Nearest Neighbour(K-NN) and Naive Bayes and compares their overall accuracy, precisions as well as recall values. It was seen that in case of movie reviews Naive Bayes gave far better results than K-NN but for hotel reviews these algorithms gave lesser, almost same accuracies.
I. INTRODUCTION
Sentiment analysis mines subjective information from reviews and comments, identifying whether opinions are positive or negative. The paper motivates sentiment mining for tracking opinions, monitoring issues, and assessing market trends.
- Sentiment Analysis, also known as Opinion Mining, uses language and text-processing techniques to identify subjective information in reviews and comments.
- Sentiment polarity indicates whether a review is overall positive or negative.
- Sentiment mining can support product tracking, issue monitoring, competitor analysis, customer-trend assessment, and measuring public responses.
- The paper applies Naïve Bayes and K-Nearest Neighbour to calculate accuracy, precision, and recall for sentiment classification.
II. RELATED WORK
Prior sentiment-analysis research includes keyword-based classification, machine-learning methods, document- and sentence-level classification, and contextual polarity analysis.
- Keyword-based approaches classify sentiment using manually prepared or WordNet-derived indicators, especially sentiment-bearing adjectives.
- Other studies applied Naïve Bayes, support vector machines, and maximum entropy to sentiment analysis.
- Research also addressed document- and sentence-level classification across product, banking, movie, and travel reviews.
- A contextual-polarity approach first distinguishes neutral from polar expressions before disambiguating polarity and achieved results better than baseline.
II. PROPOSED WORK
The proposed work evaluates sentiment classification on movie and hotel reviews using Naïve Bayes, supported by probabilistic modeling, preprocessing, feature scoring, and a graphical process description.
- Data source and Data Set: The study uses separate movie-review and hotel-review datasets, including 5,000 positive and 5,000 negative reviews from each source.
- Sentiment Analysis Process: Figure 1 presents a graphical description of the sentiment-analysis process.
- Naïve Bayes Classifier: Naïve Bayes estimates category probabilities from word and category joint probabilities under a word-independence assumption.
- Naïve Bayes Classifier: The classifier receives a document and fixed class set, then outputs a predicted class.
- Pre-processing: Preprocessing separates positive and negative reviews, labels sentences, and assigns three-quarters of sentences to training and one-quarter to testing.
2) k-Nearest Neighbour Classifier
K-NN classifies reviews through instance-based, local learning: it retains training examples and assigns each query the majority class among its nearest neighbours.
- K-NN characteristics: K-NN is a non-parametric, lazy-learning method that defers computation until classification.
- Classification rule: A query is assigned the class most common among its k nearest training neighbours.
- Nearest Neighbour rule: The nearest-neighbour rule is the K-NN special case where K = 1 and classification uses the closest training sample.
- K-NN characteristics: K-NN does not assume a functional form, requiring instead a consistently calculable distance between instances.
- Pre-processing: The implementation preprocesses about 10,000 reviews and retains three-quarters of the sentences for training.
- Chi squared test: Chi-squared feature scoring builds word-frequency distributions and combines positive and negative information scores in a dictionary.
IV. EXPERIMENTAL RESULTS
The experiments evaluate sentiment classifiers using accuracy, positive and negative precision, and positive and negative recall. Results are presented across multiple test datasets and repeated experimental rounds.
- Accuracy, precision, and recall were used to evaluate opinion-mining performance.Accuracy measures overall performance, while precision and recall are reported separately for positive and negative reviews.
- The overall accuracies of the three algorithms were reported across 10 experimental rounds.
- Accuracy comparisons were presented for the test datasets using tables and diagrams.
- Positive-corpus precision, negative-corpus precision, positive-corpus recall, and negative-corpus recall were reported in separate comparisons.
V. CONCLUSION
The paper compares Naïve Bayes and KNN for sentiment classification of movie and hotel reviews using accuracy, precision, and recall. Naïve Bayes performs better on movie reviews, while both classifiers achieve similarly lower accuracies on hotel reviews.
- The study evaluates Naïve Bayes and KNN for movie- and hotel-review sentiment classification using accuracy, precision, and recall.
- Above 80% accuracies were obtained for movie reviews with Naïve Bayes outperforming KNN.
- Hotel-review accuracies were much lower, and both classifiers yielded similar results.
- The paper concludes that Naïve Bayes can be used successfully to analyze movie reviews.
VI. FUTURE WORK
Future work proposes evaluating additional sentiment-analysis methods and combining the strengths of existing algorithms for data forecasting.
- Future work will compare sentiment analysers such as random forest and Support Vector Machine.
- The authors also propose a new algorithm combining the benefits of both existing algorithms for effective data forecasting.