GithubHelp home page GithubHelp logo

mastercaojie / pban-pytorch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hiyouga/pban-pytorch

0.0 1.0 0.0 1.32 MB

A Position-aware Bidirectional Attention Network for Aspect-level Sentiment Analysis, PyTorch implementation.

License: MIT License

Python 100.00%

pban-pytorch's Introduction

PBAN-PyTorch

PyTorch implementation of Gu et al.'s COLING 2018 work.

LICENSE

Requirement

Dataset

Based on the restaurant and laptop dataset of SemEval-2014 Task 4.

Restaurant Dataset

Polarity #Positive #Negative #Neutral
Train 2164 807 637
Test 728 196 196

Laptop Dataset

Polarity #Positive #Negative #Neutral
Train 994 870 464
Test 341 128 169

Usage

Train the model:

python train.py --model_name pban --dataset restaurant

Show help message and exit:

python train.py -h

Implemented models

LSTM

Tang, Duyu, et al. "Effective LSTMs for Target-Dependent Sentiment Classification." Proceedings of COLING 2016, the 26th International Conference on Computational Linguistics: Technical Papers. 2016. [pdf]

lstm

ATAE-LSTM

Wang, Yequan, Minlie Huang, and Li Zhao. "Attention-based LSTM for aspect-level sentiment classification." Proceedings of the 2016 conference on empirical methods in natural language processing. 2016. [pdf]

atae_lstm

PBAN

Gu, Shuqin, et al. "A Position-aware Bidirectional Attention Network for Aspect-level Sentiment Analysis." Proceedings of the 27th International Conference on Computational Linguistics. 2018. [pdf]

pban

Performance

Restaurant Dataset

Three-class

Model In Paper This Code
LSTM 74.28 77.68
ATAE-LSTM 77.20 78.30
PBAN 81.16 80.89

Two-class

Model In Paper This Code
LSTM - -
ATAE-LSTM 90.90 90.26
PBAN 91.67 92.32

Laptop Dataset

Three-class

Model In Paper This Code
LSTM 66.45 71.00
ATAE-LSTM 68.70 71.32
PBAN 74.12 74.76

Two-class

Model In Paper This Code
LSTM - -
ATAE-LSTM 87.60 87.63
PBAN 87.81 87.42

Acknowledgements

  • Some of the code is borrowed from songyouwei.
  • Using this code means you have read and accepted the copyrights set by the dataset providers.

License

MIT

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.