Personalized Hotel Recommender using Sentiment Analysis
<iframe src="https://www.youtube.com/embed/0p735_bOaM0/" style="width:100%; height:500px;" ></iframe> # Dashboard Note: Please allow this webpage to access your location to show the nearest hotels.The dataset that we are using consists reviews of various hotels present in Europe. It contains features such as Hotel Address, Review Date, Average Score (Average of ratings for a single hotel), Hotel Name, Reviewer Nationality, Total Number of Reviews, Positive Review, Negative Review, Reviewer Score (raiting given to hotel by the customer), days since review.
Instead of displaying a generic hotel rating, our goal is to help the customer by making more individualized hotel suggestions that consider their preferences for different factors like pricing, cuisine, atmosphere, etc. In turn, this facilitates a quicker and more effective process for the customer to choose the best hotel depending on their preferences.
Additionally, some of the data samples were just given with the overall ratings rather than a descriptive comments. Since the project concentrates on the user preferences rather than quantitative review value, such data is replaced with an empty string.
Screenshots of both the original and modified data sets are provided below.
The Preprocessing step includes tokenization, tagging parts of speech, removing stop words, stemming, noun extraction and noun filtering. Tokenization mainly focuess on detecting words. Then the words get tags that determine their syntactic role (such as verb, adjective, etc.) in the sentence. The stop words like "a", "an", "the", "that", "of", "from" are deleted. Then the suffix and prefix of the words are deleted and the stem of the word is retained.
The stemming process helps to reduce all derivatives of a word, which are not semantically different, into a common concept. For example, if a document contains words like ‘‘eating’’ and ‘‘eaten’’, they are all considered as ‘‘eat’’. As we are looking for preferences of the user that are usually in the form of nouns, the words that have received the noun tag are extracted. Since the number of these nouns may be very large, unrelated nouns are filtered.
- Define the class as Negative, if the sentiment score is between -1 and -0.25
- Define the class as Neutral, if the sentiment score is between -0.25 and +0.25
- Define the class as Positive, if the sentiment score is between +0.25 and +1.
The confustion matrix for all the models are as follows:
Based on the confusion matrix above, Precision, Recall and F1 Score for all the three models are computed and and tabulated below:
Naive Bayes | Precision | Recall | F1 Score |
---|---|---|---|
Negative | 0.62 | 0.66 | 0.64 |
Neutral | 0.65 | 0.54 | 0.59 |
Positive | 0.70 | 0.78 | 0.74 |
Logistic Regression | Precision | Recall | F1 Score |
---|---|---|---|
Negative | 0.70 | 0.67 | 0.68 |
Neutral | 0.69 | 0.68 | 0.69 |
Positive | 0.81 | 0.84 | 0.82 |
Support Vector Machine | Precison | Recall | F1 Score |
---|---|---|---|
Negative | 0.65 | 0.71 | 0.68 |
Neutral | 0.68 | 0.65 | 0.66 |
Positive | 0.82 | 0.78 | 0.80 |
Based on the Precision, Recall and F1 Score calculated above, The metrics like Macro-average Precision, Weighted Average Precision, Macro Average Recall, Weighted Average Recall, Macro Average F-1 Score, Weighted Average F-1 Score and accuracy are computed and tabulated below.
Evaluation Metrics | Macro Average Precision | Weighted Average Precision | Macro Average Recall | Weighted Average Recall | Macro Average F-1 Score | Weighted Average F-1 Score | Accuracy |
---|---|---|---|---|---|---|---|
Naive Bayes | 0.66 | 0.65 | 0.66 | 0.66 | 0.65 | 0.65 | 0.65 |
Logistic Regression | 0.73 | 0.73 | 0.73 | 0.73 | 0.73 | 0.73 | 0.73 |
Support Vector Machine | 0.72 | 0.72 | 0.71 | 0.71 | 0.71 | 0.71 | 0.71 |
From the above metrics, it is observed that Logistic Regression performs the best in classifying the reviews into positive, negative and neutral followed by the Support Vector Machine and Naive Bayes.
Further, to complement the justification, Receiver Operating Characteristic (ROC) Curves for all the models were plotted.
From the ROC curves, it is justified that the logistic Regression performs better than the Support Vector Machine and Naive Bayes.
- Firstly, we create a noun vector from each review. Ex: [ ‘Food’, ‘Noodles’, ‘room’]
- After the noun vector is formed, we use the Spacy library to determine how similar each word is with other word in the vector. A matrix of size (words x words) with similarity values is generated.
- The Coorelation matrix for a single example is as shown below:
- The dendogram obtained from Hierarchial clustering is dissected into clusters.
- The threshold value to split the dendogram obtained in the previous step is decided based on the number of clusters required.
Model | Silhouette coefficient | Davies-Bouldin Index | Calinski - Harabasz Index |
---|---|---|---|
K-means | 0.43 | 0.705 | 850.62 |
GMM | 0.45 | 0.68 | 1050 |
- Sunil Ravilla - Supervised Learning, Dashboard
- Prasanth Bathala - Supervised Learning, Evaluation Metrics
- Nigam Katta - Unsupervised Learning, Evaluation Metrics
- Hemanth Sai Surya Kumar Tammana - Unsupervised Learning, Exploratory Data Analysis
- Sahaj Jha - Unsupervised Learning, Data Collection and Cleaning
[1] https://www.stratosjets.com/blog/online-travel-statistics/
[2] K. Takuma, J. Yamamoto, S. Kamei and S. Fujita, "A Hotel Recommendation System Based on Reviews: What Do You Attach Importance To?," 2016 Fourth International Symposium on Computing and Networking (CANDAR), 2016, pp. 710-712, doi: 10.1109/CANDAR.2016.0129.
[3] Abro, Sindhu, et al. "Aspect Based Sentimental Analysis of Hotel Reviews: A Comparative Study." Sukkur IBA Journal of Computing and Mathematical Sciences 4.1 (2020): 11-20.
[4] Schouten, Kim, and Flavius Frasincar. "Survey on aspect-level sentiment analysis." IEEE Transactions on Knowledge and Data Engineering 28.3 (2015): 813-830. Abro, Sindhu, et al. "Aspect Based Sentimental Analysis of Hotel Reviews: A Comparative Study." Sukkur IBA Journal of Computing and Mathematical Sciences 4.1 (2020): 11-20.
[5] Musto, Cataldo, et al. "A multi-criteria recommender system exploiting aspect-based sentiment analysis of users' reviews." Proceedings of the eleventh ACM conference on recommender systems. 2017.
[6] Pathuri, Siva Kumar, N. Anbazhagan, and G. Balaji Prakash. "Feature Based Sentimental Analysis for Prediction of Mobile Reviews Using Hybrid Bag-Boost algorithm." 2020 7th International Conference on Smart Structures and Systems (ICSSS). IEEE, 2020.