GithubHelp home page GithubHelp logo

xashru / metasre Goto Github PK

View Code? Open in Web Editor NEW

This project forked from thu-bpm/metasre

1.0 1.0 0.0 1.33 MB

The source code of paper "Semi-supervised Relation Extraction via Incremental Meta Self-Training"

Python 82.83% Perl 17.17%

metasre's Introduction

Semi-supervised Relation Extraction via Incremental Meta Self-Training

This project provides tools for "Semi-supervised Relation Extraction via Incremental Meta Self-Training."

Details about SRE are in the paper and the implementation is based on the PyTorch library.

Quick Links

Installation

For training, a GPU is recommended to accelerate the training speed.

PyTroch

The code is based on PyTorch 1.2. You can find tutorials here.

Dependencies

The code is written in Python 3.5. Its dependencies are summarized in the file requirements.txt.

torch==1.2.0 numpy==1.18.3 scikit_learn==0.21.3 transformers==2.5.1

You can install these dependencies like this:

pip3 install -r requirements.txt

Usage

  • Run the full model on SemEval dataset with default hyperparameter settings

python3 src/train.py

Data

Format

Each dataset is a folder under the ./data folder:

./data
└── SemEval
    ├── train_sentence.json
    ├── train_label_id.json
    ├── dev_sentence.json
    ├── dev_label_id.json
    ├── test_sentence.json
    └── test_label_id.json

Download

  • SemEval: SemEval 2010 Task 8 data (included in data/SemEval)
  • TACRED: The TAC Relation Extraction Dataset (download)

Then use the scripts from data/data_prepare.py to further preprocess the data. For SemEval, the script split the original training data into two sets. For TACRED, the script first perform some preprocessing to ensure the same format as SemEval.

Acknowledgements

https://github.com/huggingface/transformers

https://github.com/INK-USC/DualRE

Contact

If you have any problem about our code, feel free to contact: [email protected]

metasre's People

Contributors

xashru avatar

Stargazers

 avatar

Watchers

 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.