Giter Club home page Giter Club logo

prgc's Introduction

PRGC: Potential Relation and Global Correspondence Based Joint Relational Triple Extraction

This repository contains the source code and dataset for the paper: PRGC: Potential Relation and Global Correspondence Based Joint Relational Triple Extraction. Hengyi Zheng, Rui Wen, Xi Chen et al. ACL 2021.

Overview

image-20210622212609011

Requirements

The main requirements are:

  • python==3.7.9
  • pytorch==1.6.0
  • transformers==3.2.0
  • tqdm

Datasets

Or you can just download our preprocessed datasets.

Usage

1. Get pre-trained BERT model for PyTorch

Download BERT-Base-Cased which contains pytroch_model.bin, vocab.txt and config.json. Put these under ./pretrain_models.

2. Build Data

Put our preprocessed datasets under ./data.

3. Train

Just run the script in ./script by sh train.sh.

For example, to train the model for NYT* dataset, update the train.sh as:

python ../train.py \
--ex_index=1 \
--epoch_num=100 \
--device_id=0 \
--corpus_type=NYT-star \
--ensure_corres \
--ensure_rel

4. Evaluate

Just run the script in ./script by sh evaluate.sh.

For example, to train the model for NYT* dataset, update the evaluate.sh as:

python ../evaluate.py \
--ex_index=1 \
--device_id=0 \
--mode=test \
--corpus_type=NYT-star \
--ensure_corres \
--ensure_rel \
--corres_threshold=0.5 \
--rel_threshold=0.1

prgc's People

Contributors

hy-struggle 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.