Giter Club home page Giter Club logo

position-aware-tagging-for-aste's Introduction

[UPDATE] Please also check our recent paper Learning Span-Level Interactions for Aspect Sentiment Triplet Extraction (In ACL 2021)

Position-Aware-Tagging-for-ASTE

[EMNLP 2020] Position-Aware Tagging for Aspect Sentiment Triplet Extraction (In EMNLP 2020)

Task Description

Aspect Sentiment Triplet Extraction (ASTE) is the task of extracting the triplets of target entities, their associated sentiment, and opinion spans explaining the reason for the sentiment. This task is firstly proposed by (Peng et al., 2020) in the paper publised in AAAI 2020, Knowing What, How and Why: A Near Complete Solution for Aspect-based Sentiment Analysis (In AAAI 2020)

For Example:

Given the sentence:

The screen is very large and crystal clear with amazing colors and resolution .

The objective of the Aspect Sentiment Triplet Extraction (ASTE) task is to predict the triplets:

[('screen', 'large', 'Positive'), ('screen', 'clear', 'Positive'), ('colors', 'amazing', 'Positive'), ('resolution', 'amazing', 'Positive')]

where a triplet consists of (target, opinion, sentiment).

Requirement

conda create -n JET python=3.7 anaconda

conda install pytorch==1.4.0 torchvision==0.5.0 cudatoolkit=10.1 -c pytorch

Python 3.7.3

Pytorch 1.4

termcolor

networkx=2.6.3

matplotlib

PYEVALB

sentencepiece

Transformers

Bert-as-service

Running with GloVe

python jet_o.py  

By default, the model runs on 2014 laptop dataset with provided hyper-parameters (M=2) without BERT. Change line 20-27 for different datasets.

python jet_t.py  

By default, the model runs on 2015 reataurant dataset with provided hyper-parameters (M=2) without BERT. Change line 20-27 for different datasets.

Running with BERT

Please install bert-as-service before Start the BERT service:

bert-serving-start -pooling_layer -1 -model_dir uncased_L-12_H-768_A-12 -max_seq_len=NONE -num_worker=2 -port=8880 -pooling_strategy=NONE -cpu -show_tokens_to_client

Then,

python jet_o.py  

Change line 27 in the current file to True to runs on 2014 laptop dataset with provided hyper-parameters (M=2) with BERT. Change line 20-27 for different datasets.

python jet_t.py  

Change line 27 in the current file to True to runs on 2015 reataurant dataset with provided hyper-parameters (M=2) with BERT. Change line 20-27 for different datasets.

Task Lists

  • The current framwork only support BATCH_SIZE=1, more work need to be done to support batch calculation.

Related Repo

The code are created based on the StatNLP framework.

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.