GithubHelp home page GithubHelp logo

www-ye / p3m Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 8.29 MB

AAAI 2024: "A Positive-Unlabeled Metric Learning Framework for Document-Level Relation Extraction with Incomplete Labeling"

Python 93.76% Shell 6.24%

p3m's Introduction

P3M

Code for AAAI 2024 Conference paper [A Positive-Unlabeled Metric Learning Framework for Document-Level Relation Extraction with Incomplete Labeling].

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.

P3M
 |-- 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_p3m.sh  # P3M BERT
>> sh scripts/run_roberta_p3m.sh  # P3M RoBERTa
>> sh scripts/run_bert_p3m_ext.sh  # P3M BERT Extremely unlabeled
>> sh scripts/run_roberta_p3m_ext.sh  # P3M RoBERTa Extremely unlabeled
>> sh scripts/run_bert_p3m_full.sh  # P3M BERT Fully supervised
>> sh scripts/run_roberta_p3m_full.sh  # P3M RoBERTa Fully supervised

ChemDisGene

Train ChemDisGene model with the following command:

>> sh scripts/run_bio_p3m.sh  # P3M PubmedBERT

p3m's People

Contributors

www-ye avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

tonycsoka

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.