Giter Site home page Giter Site logo

shenghaowang / absa-for-restaurant-reviews Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 327 KB

POC implementation of aspect based sentiment analysis using multi-task learning

Home Page: https://shenghaowang.github.io/multi-task-learning-a-sentiment-analysis-example/

License: MIT License

Python 100.00%
deep-learning nlp sentiment-analysis text-classification

absa-for-restaurant-reviews's Introduction

Aspect Based Sentiment Analysis (ABSA) for Restaurant Reviews

This is a proof-of-concept implementation of aspect based sentiment analysis using multi-task learning. The model architecture was taken from Eram Munawwar's blog post.

ABSA network diagram

The prototype neural network model was trained on ~3000 restaurant reviews with polarity labels over 5 different aspects. The model achieved a test accuracy of 0.7434 compared against the majority baseline of 0.6410. The accuracy of different aspects is reported as follows.

Aspect Baseline accuracy ABSA accuracy
food 0.7225 0.7823
service 0.5872 0.8430
price 0.6145 0.7590
ambience 0.6441 0.7542
anecdotes/miscellaneous 0.5427 0.5897
Overall 0.6410 0.7434

Installation

Python >3.8 is required.

virtualenv absa_env
source absa_env/bin/activate
pip install -r requirements.txt
python -m spacy download en_core_web_md

Commands

python src/make_reviews.py will process the restaurant review data and export it into parquet format.

python src/train.py will train a multi-task neural network model for sentiment analysis.

python src/evaluate.py will make prediction for the test data and compute the accuracy for different aspects.

python src/debug_dataset.py can be used for debugging the process of datasets creation.

python src/debug_model.py can be used for debugging the network architecture.

Source data

References

absa-for-restaurant-reviews's People

Contributors

shenghaowang avatar

Watchers

 avatar

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.