Coder Social home page Coder Social logo

nlp-proj-1's Introduction

SCPRG

Source code for Findings of ACL 2023 paper: Enhancing Document-level Event Argument Extraction with Contextual Clues and Role Relevance.

Our code is based on TSAR (A Two-Stream AMR-enhanced Model for Document-level Event Argument Extraction) here and thanks for their implement.

๐Ÿ”ฅ Introduction

Document-level event argument extraction poses new challenges of long input and cross-sentence inference compared to its sentence-level counterpart. However, most prior works focus on capturing the relations between candidate arguments and the event trigger in each event, ignoring two crucial points: a) non-argument contextual clue information; b) the relevance among argument roles. In this paper, we propose a SCPRG (Span-trigger-based Contextual Pooling and latent Role Guidance) model, which contains two novel and effective modules for the above problem. The Span-Trigger-based Contextual Pooling (STCP) adaptively selects and aggregates the information of non-argument clue words based on the context attention weights of specific argument-trigger pairs from pre-trained model. The Role-based Latent Information Guidance (RLIG) module constructs latent role representations, makes them interact through role-interactive encoding to capture semantic relevance, and merges them into candidate arguments. Both STCP and RLIG introduce no more than 1% new parameters compared with the base model and can be easily applied to other event extraction models, which are compact and transplantable. Experiments on two public datasets show that our SCPRG outperforms previous state-of-the-art methods, with 1.13 F1 and 2.64 F1 improvements on RAMS and WikiEvents respectively. Further analyses illustrate the interpretability of our model. You can refer to our paper for more details.

๐Ÿš€ How to use our code?

1. Dependencies

  • pytorch==1.9.0
  • transformers==4.8.1
  • datasets==1.8.0
  • tqdm==4.49.0
  • spacy==3.2.4
  • opt_einsum
  • wandb

For the usage of spacy, the following command could be helpful.

>> pip install https://github.com/explosion/spacy-models/releases/download en_core_web_sm-3.2.0/en_core_web_sm-3.2.0.tar.gz

2. Data Preprocessing

You can first download the datasets and some scripts here. You only need to unzip the data.zip.

Then Go to data/wikievents folder and run the following command, which is used to transfer the data formats.

>> python transfer.py

3. Training and Evaluation

The training scripts are provided.

>> bash run_rams_base.sh
>> bash run_rams_large.sh
>> bash run_wikievents_base.sh
>> bash run_wikievents_large.sh

You can change the settings in the corresponding scripts.

And you can evaluate the model by the following scripts.

>> bash evaluate_rams.sh
>> bash evaluate_wikievent.sh

You can download our best model checkpoint here.

If you have any questions, pls contact us via [email protected]. Thanks!

๐ŸŒ Citation

If you use this work or code, please kindly cite the following paper:

@inproceedings{liu2023enhancing,
  title={Enhancing Document-level Event Argument Extraction with Contextual Clues and Role Relevance},
  author={Liu, Wanlong and Cheng, Shaohuan and Zeng, Dingyi and Hong, Qu},
  booktitle={Findings of the Association for Computational Linguistics: ACL 2023},
  pages={12908--12922},
  year={2023}
}

nlp-proj-1's People

Watchers

Sanjeevkumar Sharma 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.