Beta Distribution Guided Aspect-aware Graph for Aspect Category Sentiment Analysis with Affective Knowledge. Proceedings of EMNLP 2021

Overview

AAGCN-ACSA

EMNLP 2021

Introduction

This repository was used in our paper:

Beta Distribution Guided Aspect-aware Graph for Aspect Category Sentiment Analysis with Affective Knowledge
Bin Liang*, Hang Su*, Rongdi Yin, Lin Gui, Min Yang, Qin Zhao, Xiaoqi Yu, and Ruifeng Xu. Proceedings of EMNLP 2021

Please cite our paper and kindly give a star for this repository if you use this code.

Requirements

  • Python 3.6
  • PyTorch 1.0.0
  • SpaCy 2.0.18
  • numpy 1.15.4

Usage

  • Install SpaCy package and language models with
pip install spacy

and

python -m spacy download en
  • Generate aspect-focused graph with
python generate_graph_for_aspect.py
  • Generate inter-aspect graph with
python generate_position_con_graph.py

Training

  • Train with command, optional arguments could be found in train.py & train_bert.py

  • Run intergcn: ./run_intergcn.sh

  • Run afgcn: ./run_afgcn.sh

  • Run intergcn_bert: ./run_intergcn_bert.sh

  • Run afgcn_bert: ./run_afgcn_bert.sh

Citation

The BibTex of the citation is as follow:


You might also like...
VampiresVsWerewolves - Our Implementation of a MiniMax algorithm with alpha beta pruning in the context of an in-class competition

VampiresVsWerewolves Our Implementation of a MiniMax algorithm with alpha beta pruning in the context of an in-class competition. Our Algorithm finish

Simple, Pythonic, text processing--Sentiment analysis, part-of-speech tagging, noun phrase extraction, translation, and more.

TextBlob: Simplified Text Processing Homepage: https://textblob.readthedocs.io/ TextBlob is a Python (2 and 3) library for processing textual data. It

Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.

Summarization, translation, Q&A, text generation and more at blazing speed using a T5 version implemented in ONNX. This package is still in alpha stag

Simple, Pythonic, text processing--Sentiment analysis, part-of-speech tagging, noun phrase extraction, translation, and more.

TextBlob: Simplified Text Processing Homepage: https://textblob.readthedocs.io/ TextBlob is a Python (2 and 3) library for processing textual data. It

Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.
Summarization, translation, sentiment-analysis, text-generation and more at blazing speed using a T5 version implemented in ONNX.

Summarization, translation, Q&A, text generation and more at blazing speed using a T5 version implemented in ONNX. This package is still in alpha stag

pysentimiento: A Python toolkit for Sentiment Analysis and Social NLP tasks

A Python multilingual toolkit for Sentiment Analysis and Social NLP tasks

Perform sentiment analysis and keyword extraction on Craigslist listings

craiglist-helper synopsis Perform sentiment analysis and keyword extraction on Craigslist listings Background I love Craigslist. I've found most of my

A combination of autoregressors and autoencoders using XLNet for sentiment analysis

A combination of autoregressors and autoencoders using XLNet for sentiment analysis Abstract In this paper sentiment analysis has been performed in or

Sentiment Analysis Project using Count Vectorizer and TF-IDF Vectorizer

Sentiment Analysis Project This project contains two sentiment analysis programs for Hotel Reviews using a Hotel Reviews dataset from Datafiniti. The

Comments
  • Why not transformers instead of pytorch_pretrained_bert

    Why not transformers instead of pytorch_pretrained_bert

    If I use transformers instead of pytorch_pretrained_bert, there are something error:

    # aagcn_bert.py#56
    # encoder_layer, pooled_output = self.bert(
    #     text_bert_indices, token_type_ids=bert_segments_ids, output_all_encoded_layers=False)
     output = self.bert(
                text_bert_indices, token_type_ids=bert_segments_ids, return_dict=False)
     text_out = output[0]
    

    And the error is:

    Traceback (most recent call last):
      File "train_bert.py", line 338, in <module>
        main()
      File "train_bert.py", line 333, in main
        ins.run()
      File "train_bert.py", line 186, in run
        best_model_path = self._train(
      File "train_bert.py", line 106, in _train
        outputs = self.model(inputs)
      File "/home/liuwei1/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
        result = self.forward(*input, **kwargs)
      File "/home/liuwei1/AAGCN-ACSA/models/aagcn_bert.py", line 61, in forward
        x = F.relu(self.gc1(text_out, e_adj))
      File "/home/liuwei1/miniconda3/lib/python3.8/site-packages/torch/nn/modules/module.py", line 727, in _call_impl
        result = self.forward(*input, **kwargs)
      File "/home/liuwei1/AAGCN-ACSA/models/aagcn_bert.py", line 25, in forward
        hidden = torch.matmul(text, self.weight)
    RuntimeError: mat1 dim 1 must match mat2 dim 0
    

    Looking forward to your help, thanks

    opened by shenjing023 3
  • Could  you please   provide your dataset from the paper

    Could you please provide your dataset from the paper"结合金融领域情感词典和注意力机制的细粒度情感分析"

    I am a graduate student ,I am very interested in your work in sentiment analysis,can you provide your dataset for us,Thank you very much, my email is [email protected]

    opened by CMM915915 1
  • how does Beta distribution work in your paper?

    how does Beta distribution work in your paper?

    In section 3.2 and 3.3, you mention the Beta distribution and the edge weight of each word pair of the aspect-aware graph. However, I think the paramters in Equation (2) are not clear. Meanwhile, I found there is a PMI function in your code, rather than the beta distibution function. Could you give me more details ? Thanks.

    opened by HaoTyut 4
Owner
Akuchi
Akuchi
C.J. Hutto 2.8k Feb 18, 2021
Code for Findings of ACL 2022 Paper "Sentiment Word Aware Multimodal Refinement for Multimodal Sentiment Analysis with ASR Errors"

SWRM Code for Findings of ACL 2022 Paper "Sentiment Word Aware Multimodal Refinement for Multimodal Sentiment Analysis with ASR Errors" Clone Clone th

null 14 Jan 3, 2023
Twitter-Sentiment-Analysis - Twitter sentiment analysis for india's top online retailers(2019 to 2022)

Twitter-Sentiment-Analysis Twitter sentiment analysis for india's top online retailers(2019 to 2022) Project Overview : Sentiment Analysis helps us to

Balaji R 1 Jan 1, 2022
Implementation of paper Does syntax matter? A strong baseline for Aspect-based Sentiment Analysis with RoBERTa.

RoBERTaABSA This repo contains the code for NAACL 2021 paper titled Does syntax matter? A strong baseline for Aspect-based Sentiment Analysis with RoB

null 106 Nov 28, 2022
A paper list for aspect based sentiment analysis.

Aspect-Based-Sentiment-Analysis A paper list for aspect based sentiment analysis. Survey [IEEE-TAC-20]: Issues and Challenges of Aspect-based Sentimen

jiangqn 419 Dec 20, 2022
MRC approach for Aspect-based Sentiment Analysis (ABSA)

B-MRC MRC approach for Aspect-based Sentiment Analysis (ABSA) Paper: Bidirectional Machine Reading Comprehension for Aspect Sentiment Triplet Extracti

Phuc Phan 1 Apr 5, 2022
Code for EMNLP'21 paper "Types of Out-of-Distribution Texts and How to Detect Them"

Code for EMNLP'21 paper "Types of Out-of-Distribution Texts and How to Detect Them"

Udit Arora 19 Oct 28, 2022
Code for the paper in Findings of EMNLP 2021: "EfficientBERT: Progressively Searching Multilayer Perceptron via Warm-up Knowledge Distillation".

This repository contains the code for the paper in Findings of EMNLP 2021: "EfficientBERT: Progressively Searching Multilayer Perceptron via Warm-up Knowledge Distillation".

Chenhe Dong 28 Nov 10, 2022
EMNLP'2021: Can Language Models be Biomedical Knowledge Bases?

BioLAMA BioLAMA is biomedical factual knowledge triples for probing biomedical LMs. The triples are collected and pre-processed from three sources: CT

DMIS Laboratory - Korea University 41 Nov 18, 2022
Code for Findings at EMNLP 2021 paper: "Learn Continually, Generalize Rapidly: Lifelong Knowledge Accumulation for Few-shot Learning"

Learn Continually, Generalize Rapidly: Lifelong Knowledge Accumulation for Few-shot Learning This repo is for Findings at EMNLP 2021 paper: Learn Cont

INK Lab @ USC 6 Sep 2, 2022