Skip to content

Repository files navigation

Booking Sentiment Analysis

This Flask app takes as input a user comment and decides if it is positive or not.

We used as reference French comments on the reservation site, Booking.com.

booking_website

We scraped more than 50k comments, fetching elements such as client name, accomodation, comments and ratings. You can use the machine-learning/scrap.py file in order to scrap one query results or several ones in parallel with multiprocessing.

booking_commentaire

Preprocessing

We clean the data in the machine-learning/processing.ipynb. Common steps such as removing null values, dealing with missing or inconsistent data have been applied before doing more NLP-like steps. Not having enough computing power compelled us to reduce the dataset to 10 000 comments (5000 positive / 5000 negative). With a reduced dataset, we managed to tokenize, lemmatize and stem the comments.

Modeling

We created a pipeline which enabled us to compare the combination between several feature transformations and models. Ensembling methods yield better results so we eventually used one of them for the Flask app.

Flask Application

Booking Sentiment Analysis App

Installation of the Flask application with Docker

Get Docker image on Docker Hub

docker pull nohossat1/booking-sentiment-analysis
docker run -it -p 5000:5000 --name booking-app nohossat1/booking-sentiment-analysis:latest

The app will run on this URL : 0.0.0.0:5000

Installation of the project with GitHub

git clone https://github.com/Nohossat/Comments-sentiment-analysis
cd Comments-sentiment-analysis
python -m venv venv/
source venv/bin/activate # Mac
source venv/Scripts/activate # Windows
pip install -r requirements.txt

# run scrap app on Booking.com
python machine_learning/scrap.py

# generate models 
python machine_learning/modeling.py

# run app on local machine
export FLASK_APP=hotel_app
export FLASK_ENV=development
flask run

Team

Nohossat
Valerie
Williams

About

Creation of a sentiment analysis app based on Booking comments

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages