Opinion Mining on Hotel
CSE-4250: PROJECT AND THESIS-I
Md. Rafeedul Bar Chowdhury ID:11.02.04.088
Zahidul Haque ID:11.02.04.086
Mahmud Hossain ID:11.02.04.082
Soumik Das Bibon ID:11.02.04.003
MIR TAFSEER NAYEEM
Lecturer, Dept. of Computer Science & Engineering
Ahsanullah University Of Science & Technology
What is Opinion?
Opinions are thoughts influencing decision making.
• Which schools should I apply to?
• Which professor to work for?
• Whom should I vote for?
• Which hotel should I book?
Whom shall I ask for opinions?
Friends and relatives
Blogs (google blogs, livejournal)
E-commerce sites (amazon, ebay)
Review sites (CNET, PC Magazine)
Discussion forums (forums.craigslist.org,
Have enough opinions!
Now that I have got enough opinions, I can take decisions…
Is it really enough?
…Having opinions is not enough
Searching for reviews is quite difficult
Searching for opinions is not as convenient as
general web search
Huge amounts of information available on one topic
Difficult and quite impossible to analyze
each and every review separately
Expression of reviews are different in many ways
“overall, this hotel is my first choice at Cox’s Bazar…”
“the facilities are good but the service isn’t so…”
“best in Cox’s Bazar by quality and value”
What is Opinion Mining?
Computational study of opinions, sentiments and emotions expressed in text.
Detects the contextual polarity of text
(positive or, neutral or, negative)
Derives the opinion, or the attitude of
an opinion holder.
Its about finding out what people think…
Topic of our research
Mining traveler experiences/reviews expressed on services provided by hotels in
Our research domain
We are mining reviews from the travelling guide, “TripAdvisor”
We are starting our work from the district
that attracts tourists the most which is Cox’s Bazar
Primarily we are mining reviews of travelers
visiting various hotels in this tourist gathering area
1) Searching panel for hotels, situated on different locations/areas
e.g. Search Cox’s Bazar, Bangladesh, Asia for Long Beach Hotel
2) Panel for booking hotels based on prices
3) Searching Panel for a sorted list of hotels
based on particular preferences
e.g. types of hotel, most rated hotels etc.
1) Hotel rating in stars(out of 5) based on type of reviews (positive or, negative)
given by travelers
e.g. Rating: 4.5 out of 5 stars; 95 Reviews
2) Position of the hotel among other hotels in an area
depending on positive feedbacks from the travelers
e.g. No.1 of 24 hotels in Cox’s Bazar
3) Special services provided by the hotel
e.g. Free parking, Free breakfast etc.
Reviewers of TripAdvisor
Reviewers of TripAdvisor(Cont.)
1) Name and residence of the reviewing traveler
e.g. MUHassan, Dhaka City, Bangladesh
2) Information about the profile of the reviewer on “TripAdvisor” site
e.g. Top Contributor, 50 Reviews, 19 helpful votes etc.
3) Rating provided by the reviewer and the time of the review
e.g. 5 out of 5 stars, Reviwed 12,June,2015 etc.
4) The review of the traveler in a large opinioned paragraph
5) Voting panel for other users to vote a review if it is helpful or not!
Reviewers of TripAdvisor(Cont.)
Reviewers of TripAdvisor(Cont.)
1) All the reviews provided by a certain reviewer on the site
2) Feedback given by a hotel manager upon reviewing of a traveler
Problem domain of our research
Integrity of the reviews can not be ensured
Due to competition among the hotels high
possibility of false reviews
Amount of reviews highly varies which
sometimes results in inaccurate ratings of hotels
Solution to these problems…
Only the reviews given by verified travelers
will be prioritized first
e.g. Top Contributor, Contributor etc.
For the rating system to work there has to be
at least 10 or more reviews
Goal of our research
Rating the hotels according to reviews based on potential opinion holders
Finding out the hotels which impacts the most upon the traveling tax
Mining each individual reviews then summarizing them
according to polarity to get accurate opinion about a hotel
Works we have done so far…
Primarily we have parsed data from popular hotels in Cox’s Bazar
We have mined and stored data of 15 hotels initially
This data will work as our data set to further our research
which contains reviews and reviewers information
We have collected another data set from National Board of Revenue(NBR)
about the revenue on traveling tax
Tools for Parsing data
The language we used for parsing data,
We used a library for extracting data from HTML and XML files,
-beautifulsoup (vers. 4)
Code for parsing data(Cont.)
1) ‘head’ : this variable stores headline of the reviews
2) ‘date’ : time when the review was given
3) ‘member_info’ : name and residence of the reviewer
4) ‘member_badge’ : Information about reviewers profile
e.g. Top Contributor, 50 Reviews etc.
5) ‘mngr_com’ : Feedbacks on reviews from hotel managers
6) ‘review’ : The whole review will be stored in this variable
Data set created from the parsed data
Data set on traveling tax
This is our data set which will be used to calculate
the impact of hotels on traveling tax
It contains data on collected revenue from the tourism sector
till fiscal year ’13 - ’14 to ’14 - ’15
Why Prioritize Opinions?
Opinion prioritizing is a must in order to distinguish mature and professional
reviewers opinion from an amateur reviewers opinion.
A professionals point of view and interest will definitely make a difference in
case of ranking a hotel.
There will always be some integrity/accuracy issues when it comes to
opinions as someone stating a feature as satisfactory while other will state
otherwise ( Whose opinion to choose? )
In TripAdvisor, there is already a priority rating system available for the
1. Reviewer: (3 – 5) reviews
2. Senior Reviewer: (6 – 10) reviews
3. Contributor: (11 – 20) reviews
4. Senior Contributor: (21 – 49) reviews
5. Top Contributor: (50+) reviews
For the prioritizing purpose, we gave a potential opinion holders value for
each class of reviewers.
1. Reviewer: 2
2. Senior Reviewer: 4
3. Contributor: 5
4. Senior Contributor: 7
5. Top Contributor: 10
This value indicates which reviewer gets more priority than others.
Opinion Subjectivity is categorizing reviews as positive, negative or objective.
Methods we are using for calculating opinion subjectivity:
-Semi Supervised Learning Approach
-Naive Bayes Method
It is a lexical resource that is open publically for opinion mining
It scores every word in the database as positive(+) negative(-) or
Semi Supervised Learning Approach
In the beginning synsets is labeled manually.
i.e SentiWordNet in our case
Labeling will be expanded by machine learning approach.
i.e we are using Naive Bayes Method
This process is efficient and helps avoiding labeling errors.
Naive Bayes Method
This method is used to predict the values of words that are not in the
database or synsets.
The main formula is:
P(c) = Probability of Unlabeled data(c)
P(d) = Probability of Labeled data(d)
The formula we will use for ranking hotel is:
Z = 𝑖=1
(Potential Opinion Holders Value × Opinions Subjectivity)
Z is the deciding value for an individual hotel, which will place it in the
appropriate position in the ranks.
Hotel 1: Long Beach Hotel Hotel 2: Resort Labiba Bilash
Potential Opinion Holders value: 7 Potential Opinion Holders Value: 2
Opinion Subjectivity: +15.7 Opinion Subjectivity: +12.3
For, Hotel 1: Z = 7 * (+15.7) For, Hotel 2: Z = 2 * (+12.3)
= 109.9 = 24.6
So, Hotel 1 will be ranked above Hotel 2.
(assuming there is only one review in each hotels)
 B. Liu, “Sentiment Analysis and Subjectivity.” A Chapter in Handbook of
Natural Language Processing, 2nd Edition, 2010.
 Kavita Ganesan , Hyun Duk kim, “Opinion Mining-A Short Tutorial”.
 Bo Pang, Lillian Lee, and Shivakumar Vaithyanathan, “Thumbs up?
sentiment classification using machine learning techniques” 2002.