Giter Site home page Giter Site logo

dvianna / tripadvisorreviews2023 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 5.49 MB

Exploring topic modeling techniques, sentiment analysis, and classification algorithms using the Kaggle dataset "Tripadvisor Reviews 2023"

Jupyter Notebook 100.00%
bertopic classification sentence-transformers sentimentanalysis svm topicmodeling

tripadvisorreviews2023's Introduction

Kaggle - Tripadvisor Reviews 2023

In progress....

The Tripadvisor Reviews 2023 Dataset

The data can be downloaded from (file New_Delhi_reviews.csv): https://www.kaggle.com/datasets/arnabchaki/tripadvisor-reviews-2023

The dataset is composed of reviews and ratings. Ratings can assumes values from 1 to 5, with 5 being the most positive rating.

Topic Modeling

The first experiment, file topicmodeling.ipynb, uses topic modeling to cluster semantically similar reviews, Then, we go ahead and analyze some topics according with the reviews' ratings.

For example, for topic 211, we have most positive words:

Worldcloud - Topic 211

By plotting the ratings we can see that all reviews were positive, with ratings been either 5 or 4.

Ratings - Topic 211

Looking at topic 198, we see mostly negative words (cockroaches):

Worldcloud - Topic 198

By plotting the ratings, we can see that even though some clients mention seeing cockroaches, they still consider the experience positive, while others give very low ratings.

Ratings - Topic 198

Sentiment Analysis

The second experiment, file sentimentanalysis.ipynb, uses the language model bloomz-560m to rate reviews as positive, neutral, or negatives (sentiment analysis).

[{'generated_text': 'Given the sentence delimited by triple backticks {go there . dont miss the chance. the food and service was great. just a bit expensive. ,my bill , alone was 100 $ ( no alcohol included)} Would you rate the previous review as positive, neutral or negative? positive'}]

Classification

The third experiment, file classifier.ipynb, combines sentence-transformer and SVM to perform multi-class classification.

The original dataset was split (stratified) in 80%/20% for train and test.

The confusion matrix resulted after running SVM on the 20% test set:

Confusion Matrix - Imbalanced Dataset

Using SMOTE, an over sampling technique, to improve the performance of the minority classes:

Confusion Matrix - SMOTE

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.