GithubHelp home page GithubHelp logo

mrlkj / jointer Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yubowen-ph/jointer

0.0 0.0 0.0 13.49 MB

Release for ECAI 2020 paper "Joint Extraction of Entities and Relations Based on a Novel Decomposition Strategy"

Shell 0.37% Python 99.63%

jointer's Introduction

Joint Extraction of Entities and Relations Based on a Novel Decomposition Strategy

This code is for ECAI 2020 paper "Joint Extraction of Entities and Relations Based on a Novel Decomposition Strategy", in which we first decompose the joint extraction task into two interrelated subtasks, namely HE extraction and TER extraction. The former subtask is to distinguish all head-entities that may be involved with target relations, and the latter is to identify corresponding tail-entities and relations for each extracted head-entity. Next, these two subtasks are further deconstructed into several sequence labeling problems based on our proposed span-based tagging scheme, which are conveniently solved by a hierarchical boundary tagger and a multi-span decoding algorithm. Experimental results show that our method outperforms previous work by 5.2%, 5.9% and 21.5% (F1 score), achieving a new state-of-the-art on three public datasets as follows: Main results on three benchmark datasets

You can find the paper here

See below for an overview of the model architecture:

ETL-Span Architecture

Requirements

Our model was trained on GPU GeForce 2080 RTX Ti.

  • Python 3 (tested on 3.6.8)

  • PyTorch (tested on 1.0.1)

  • CUDA (tested on 9.0.176)

  • unzip, wget (for downloading only)

Preparation

The pre-processed JSON files of NYT-multi and WebNLG have been put under the directory dataset/NYT-multi/data and dataset/WebNLG/data, respectively.

First, download and unzip GloVe vectors:

chmod +x download.sh; ./download.sh

Then prepare vocabulary, initial word vectors and tagging scheme of NYT-multi with:

python prepare_data.py --data_dir dataset/NYT-multi/data --vocab_dir dataset/NYT-multi/vocab

Similar operation can also be applied to the WebNLG dataset.

Training

To train the model on the NYT-multi dataset, run:

python train.py --data_dir dataset/NYT-multi/data --vocab_dir dataset/NYT-multi/vocab --id multi 

Model checkpoints, logs and the output file of dev setwill be saved to ./saved_models/multi.

For details on the use of other parameters, please refer to train.py.

Evaluation

After training, our pretrained model is saved under the dir saved_models/multi. To run evaluation on the test set, run:

python eval.py saved_models/multi --data_dir dataset/NYT-multi/data --dataset test

This will use the best_model.pt file by default. Use --model checkpoint_epoch_10.pt to specify a model checkpoint file.

Related Repo

Codes are adapted from the repo of Position-aware Attention and Supervised Data Improve Slot Filling. We obtained the original datasets of NYT-multi and WebNLG from Extracting Relational Facts by an End-to-End Neural Model with Copy Mechanism, and pre-processed them with StanfordCoreNLP.

Citation

@inproceedings{yu2020jointer,
 author = {Yu, Bowen and Zhang, Zhenyu and Shu, Xiaobo and Wang, Yubin and Liu, Tingwen and Wang, Bin and Li, Sujian},
 booktitle = {Proc. of ECAI},
 title = {Joint Extraction of Entities and Relations Based on a Novel Decomposition Strategy},
 year = {2020}
}

jointer's People

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.