A sample pytorch Implementation of ACL 2021 research paper "Learning Span-Level Interactions for Aspect Sentiment Triplet Extraction".

Overview

Span-ASTE-Pytorch

Python 3.8 PyTorch 1.8.1 cuDNN 7.6.5

This repository is a pytorch version that implements Ali's ACL 2021 research paper Learning Span-Level Interactions for Aspect Sentiment Triplet Extraction .

Usage

  1. 🍉 Download dataset from here SemEval-Triplet-data, ASTE-Data-V2-EMNLP2020 is used in my repository
  2. 🥭 Download GloVe pre-trained word vectors,
  3. 🍑 Convert glove_input_file in GloVe format to word2vec format and write it to `word2vec_output_file
from gensim.scripts.glove2word2vec import glove2word2vec

glove2word2vec("path/to/dir/glove_input_file", "path/to/dir/word2vec_output_file")
  1. 🍓 train the span-aste model
python train.py --glove_word2vector vector_cache/w2v.txt \
          --dataset data/ASTE-Data-V2-EMNLP2020/15res/ \
          --output_path output/
  1. 🍇 test the span-aste model
python test.py --model_path  \
          --glove_word2vector corpus/w2v.txt \
          --dataset data/ASTE-Data-V2-EMNLP2020/15res/\
          -model `path/to/model/model.pkl`
You might also like...
Data and Code for ACL 2021 Paper
Data and Code for ACL 2021 Paper "Inter-GPS: Interpretable Geometry Problem Solving with Formal Language and Symbolic Reasoning"

Introduction Code and data for ACL 2021 Paper "Inter-GPS: Interpretable Geometry Problem Solving with Formal Language and Symbolic Reasoning". We cons

Code for ACL'2021 paper WARP 🌀 Word-level Adversarial ReProgramming
Code for ACL'2021 paper WARP 🌀 Word-level Adversarial ReProgramming

Code for ACL'2021 paper WARP 🌀 Word-level Adversarial ReProgramming. Outperforming `GPT-3` on SuperGLUE Few-Shot text classification.

FAIR's research platform for object detection research, implementing popular algorithms like Mask R-CNN and RetinaNet.
FAIR's research platform for object detection research, implementing popular algorithms like Mask R-CNN and RetinaNet.

Detectron is deprecated. Please see detectron2, a ground-up rewrite of Detectron in PyTorch. Detectron Detectron is Facebook AI Research's software sy

A modular framework for vision & language multimodal research from Facebook AI Research (FAIR)

MMF is a modular framework for vision and language multimodal research from Facebook AI Research. MMF contains reference implementations of state-of-t

The official implementation for ACL 2021 "Challenges in Information Seeking QA: Unanswerable Questions and Paragraph Retrieval".

Code for "Challenges in Information Seeking QA: Unanswerable Questions and Paragraph Retrieval" (ACL 2021, Long) This is the repository for baseline m

The GitHub repository for the paper: “Time Series is a Special Sequence: Forecasting with Sample Convolution and Interaction“.

SCINet This is the original PyTorch implementation of the following work: Time Series is a Special Sequence: Forecasting with Sample Convolution and I

[NAACL & ACL 2021] SapBERT: Self-alignment pretraining for BERT.
[NAACL & ACL 2021] SapBERT: Self-alignment pretraining for BERT.

SapBERT: Self-alignment pretraining for BERT This repo holds code for the SapBERT model presented in our NAACL 2021 paper: Self-Alignment Pretraining

PIGLeT: Language Grounding Through Neuro-Symbolic Interaction in a 3D World [ACL 2021]

piglet PIGLeT: Language Grounding Through Neuro-Symbolic Interaction in a 3D World [ACL 2021] This repo contains code and data for PIGLeT. If you like

Comments
  • About the results

    About the results

    For this dataset 15res, the bilstm version(your code) i got the best f1 in the eval is 0.6382,the paper is 0.6426, and the bert version i got the best f1 in the eval is 0.6564, the paper is 0.7075. I can't get close to the results of the paper, can you give me some suggestions? Thank you very much!

    opened by codewen77 7
  • Questions about the BERT version of span-aste.

    Questions about the BERT version of span-aste.

    Thank you very much for your open source pytorch version of span-aste network code. I replaced the encoder of LSTM version span-aste with BERT. However, the accuracy, recall and F1 score during training and verification are all 0, and I could not find the error. Do you have a plan to develop the BERT version span-aste? Or could you tell me the way to change the model to BERT encoder?

    opened by zlyoung 2
  • 请问大家可以稍微帮我解释一下这段代码的含义吗,我不太理解,谢谢

    请问大家可以稍微帮我解释一下这段代码的含义吗,我不太理解,谢谢

    self.bucket_bins = [0, 1, 2, 3, 4, 5, 7, 8, 15, 16, 31, 32, 63, 64]
    self.span_width_embedding = nn.Embedding(len(self.bucket_bins), span_width_embedding_dim)

    def bucket_embedding(self, width, device): em = [ix for ix, v in enumerate(self.bucket_bins) if width >= v][0] return self.span_width_embedding(torch.LongTensor([em]).to(device))

    model.py文件下的bucket_embedding函数,应当是对于Span的长度feature进行编码的。但是em得到的数值难道不是永远是0吗,这样也没有用到长度特征呀。我想知道bucket_embedding到底是要实现什么功能,谢谢各位。

    opened by tongzeliang 1
Owner
来自丹麦的天籁
nlper
来自丹麦的天籁
PyTorch implementation for ACL 2021 paper "Maria: A Visual Experience Powered Conversational Agent".

Maria: A Visual Experience Powered Conversational Agent This repository is the Pytorch implementation of our paper "Maria: A Visual Experience Powered

Jokie 22 Dec 12, 2022
Official PyTorch Implementation of SSMix (Findings of ACL 2021)

SSMix: Saliency-based Span Mixup for Text Classification (Findings of ACL 2021) Official PyTorch Implementation of SSMix | Paper Abstract Data augment

Clova AI Research 52 Dec 27, 2022
Code release for the ICML 2021 paper "PixelTransformer: Sample Conditioned Signal Generation".

PixelTransformer Code release for the ICML 2021 paper "PixelTransformer: Sample Conditioned Signal Generation". Project Page Installation Please insta

Shubham Tulsiani 24 Dec 17, 2022
Code for our ACL 2021 paper - ConSERT: A Contrastive Framework for Self-Supervised Sentence Representation Transfer

ConSERT Code for our ACL 2021 paper - ConSERT: A Contrastive Framework for Self-Supervised Sentence Representation Transfer Requirements torch==1.6.0

Yan Yuanmeng 478 Dec 25, 2022
Codes for ACL-IJCNLP 2021 Paper "Zero-shot Fact Verification by Claim Generation"

Zero-shot-Fact-Verification-by-Claim-Generation This repository contains code and models for the paper: Zero-shot Fact Verification by Claim Generatio

Liangming Pan 47 Jan 1, 2023
Code for our paper "SimCLS: A Simple Framework for Contrastive Learning of Abstractive Summarization", ACL 2021

SimCLS Code for our paper: "SimCLS: A Simple Framework for Contrastive Learning of Abstractive Summarization", ACL 2021 1. How to Install Requirements

Yixin Liu 150 Dec 12, 2022
Code and data of the ACL 2021 paper: Few-Shot Text Ranking with Meta Adapted Synthetic Weak Supervision

MetaAdaptRank This repository provides the implementation of meta-learning to reweight synthetic weak supervision data described in the paper Few-Shot

THUNLP 5 Jun 16, 2022
Code for our ACL 2021 paper "One2Set: Generating Diverse Keyphrases as a Set"

One2Set This repository contains the code for our ACL 2021 paper “One2Set: Generating Diverse Keyphrases as a Set”. Our implementation is built on the

Jiacheng Ye 63 Jan 5, 2023
code associated with ACL 2021 DExperts paper

DExperts Hi! This repository contains code for the paper DExperts: Decoding-Time Controlled Text Generation with Experts and Anti-Experts to appear at

Alisa Liu 68 Dec 15, 2022
The source codes for ACL 2021 paper 'BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data'

BoB: BERT Over BERT for Training Persona-based Dialogue Models from Limited Personalized Data This repository provides the implementation details for

null 124 Dec 27, 2022