Git Product home page Git Product logo

ssr-pu's Introduction

SSR-PU

Code for EMNLP 2022 Main Conference paper A Unified Positive-Unlabeled Learning Framework for Document-Level Relation Extraction with Different Levels of Labeling.

Our code is modified based on ATLOP. Here we sincerely thanks for their excellent work.

Requirements

  • Python (tested on 3.6.7)
  • CUDA (tested on 11.0)
  • PyTorch (tested on 1.7.1)
  • Transformers (tested on 4.18.0)
  • numpy (tested on 1.19.5)
  • apex (tested on 0.1)
  • opt-einsum (tested on 3.3.0)
  • ujson
  • tqdm

Dataset

The DocRED dataset can be downloaded following the instructions at link.

The Re-DocRED dataset can be downloaded following the instructions at link.

The ChemDisGene dataset can be downloaded following the instructions at link.

SSR-PU
 |-- dataset
 |    |-- docred
 |    |    |-- train_annotated.json
 |    |    |-- train_distant.json
 |    |    |-- train_ext.json
 |    |    |-- train_revised.json
 |    |    |-- dev.json
 |    |    |-- dev_ext.json
 |    |    |-- dev_revised.json
 |    |    |-- test_revised.json
 |    |-- chemdisgene
 |    |    |-- train.json
 |    |    |-- valid.json
 |    |    |-- test.anno_all.json
 |-- meta
 |    |-- rel2id.json
 |    |-- relation_map.json

Training and Evaluation

DocRED

Train DocRED model with the following command:

>> sh scripts/run_bert.sh  # S-PU BERT
>> sh scripts/run_bert_rank.sh  # SSR-PU BERT
>> sh scripts/run_roberta.sh  # S-PU RoBERTa
>> sh scripts/run_roberta_rank.sh  # SSR-PU RoBERTa
>> sh scripts/run_bert_rank_full.sh  # SSR-PU BERT Fully supervised
>> sh scripts/run_roberta_rank_full.sh  # SSR-PU RoBERTa Fully supervised
>> sh scripts/run_bert_rank_ext.sh  # SSR-PU BERT Extremely unlabeled
>> sh scripts/run_roberta_rank_ext.sh  # SSR-PU RoBERTa Extremely unlabeled

ChemDisGene

Train ChemDisGene model with the following command:

>> sh scripts/run_bio.sh  # S-PU PubmedBERT
>> sh scripts/run_bio_rank.sh  # SSR-PU PubmedBERT

ssr-pu's People

Contributors

www-ye 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.