Git Product home page Git Product logo

dsre's Introduction

Official Code for "PARE: A Simple and Strong Baseline for Monolingual and MultilingualDistantly Supervised Relation Extraction"

Diagram representing our model

Please follow the following steps (one by one) to reproduce the results presented in our pre-print:

1. Environment Setup

  • Our codebase is tested on Python 3.6.13. We recommend creating a conda environment using the command given below.
conda create --name your_env_name python=3.6.13
  • Our codebase is tested on GPUs with cuda version >= 10.2. Please install all of the dependencies using the command given below in the topmost directory (which contains the requirements.txt file)
pip install -r requirements.txt

2. Downloading Datasets

  • We present results on four open-source datasets: NYT-10d, NYT-10m, Wiki-20m and DiS-ReX. To reproduce results on each of these datasets, we provide scripts in the "benchmark" folder to download them.
  • For downloading NYT-10d, use the following command inside the benchmark folder
sh download_nyt10.sh
  • For downloading NYT-10m, use the following command inside the benchmark folder
sh download_nyt10m.sh
  • For downloading Wiki-20m, use the following command inside the benchmark folder
sh download_wiki20m.sh
  • For downloading DiS-ReX, use the following command inside the benchmark folder
sh download_disrex.sh

3. Training and testing models

  • Training scripts are provided in the topmost directory for each of the four datasets. Once the training finishes, the best saved model would automatically be tested on the test set (returning AUC, Macro F1, Micro F1, and P@M)
  • To reproduce results on NYT-10d, run
sh train_nyt10d.sh
  • To reproduce results on NYT-10m, run
sh train_nyt10m.sh
  • To reproduce results on Wiki-20m, run
sh train_wiki20m.sh
  • To reproduce results on DiS-ReX, run
sh train_disrex.sh

4. Trained model checkpoint

link

5. P-R Curves

link

Cite

The codebase is a part of the work PARE: A Simple and Strong Baseline for Monolingual and Multilingual Distantly Supervised Relation Extraction. If you use or extend our work, please cite the following paper:

@inproceedings{rathore2022pare,
  title={PARE: A Simple and Strong Baseline for Monolingual and Multilingual Distantly Supervised Relation Extraction},
  author={Rathore, Vipul and Badola, Kartikeya and Singla, Parag and others},
  booktitle={Proceedings of the 60th Annual Meeting of the Association for Computational Linguistics (Volume 2: Short Papers)},
  pages={340--354},
  year={2022}
}

Acknowledgements

Our codebase is built upon OpenNRE's. For more details on the format of the dataset's used, we refer the user to their repository.

For more details on the DiS-ReX dataset, we refer the user to their pre-print as well as their repository.

dsre's People

Contributors

kartikeya-badola avatar rathorevipul28 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

dsre's Issues

paper

能否再详细解释下论文中的这句话: "Second, in principle, the model
may be able to relax a part of the at-least-one assumption. For example, if no sentence individually
expresses a relation, but if multiple facts in different sentences collectively predict the relation, our
model may be able to learn to extract that."

数据

您好,请问如果使用自己的数据集只有一种关系,即每对实体e1和e2之间只有一种关系r,该代码是否是适用的呢?

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.