Giter Site home page Giter Site logo

tanhx99 / rsman Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fduyjx/rsman

0.0 0.0 0.0 478 KB

Source code for NAACL 2022 paper: Relation-Specific Attentions over Entity Mentions for Enhanced Document-Level Relation Extraction

License: MIT License

Python 100.00%

rsman's Introduction

RSMAN

Source code for NAACL 2022 paper: Relation-Specific Attentions over Entity Mentions for Enhanced Document-Level Relation Extraction

Introduction

This is the implementation of the RSMAN (Relation-Specific Mention Attention Network) with SSAN as the backbone model. RSMAN is easy to be plugged into other different backbone models to enhance them and here we take SSAN for example. Part of the code is borrowed from https://github.com/BenfengXu/SSAN, and we really appreciate it.

Requirements

  • python==3.6
  • pytorch==1.4.0
  • transformers==2.7.0

Dataset

  • DocRED
  • DWIE
  • Note that you should process DWIE to fit the same format as DocRED. Put the dataset into the directory ./data.

Train

Download pre-trained language models into the directory ./pretrained_lm and run:

python run.py

The evaluation on dev set will be run during training at each logging step, and the trained model corresponding to the best dev result will be saved into the directory ./checkpoints.

Test

To get the result on test set, run:

python run.py --do_train False --do_predict

Then a test result file in the official evaluation format will be saved as ./checkpoints/result.json. Compress and submit it to CodaLab to get the final test score.

We also provide our trained model and test result file, you can download them from here.

rsman's People

Contributors

fduyjx 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.