This repository contains code used for span-based joint NER and relation extraction.
I refer to the following models and repos:
Generalizing Natural Language Analysis through Span-relation Representations (ACL2020). paper github
Entity, Relation, and Event Extraction with Contextualized Span Representations (ACL 2019). paper github
AllenNLP. github
torch==1.5.1
transformers==2.11.0
5 datasets are preprocessed and included in this repository.
Dataset | Task code | Dir | Source |
---|---|---|---|
Wet Lab Protocols | wlp | data/wlp | link |
SciERC | scierc | data/scierc | link |
NYT24 | nyt24 | data/nyt24 | link |
NYT29 | nyt29 | data/nyt29 | link |
WebNLG | webnlg | data/webnlg | link |
Train and evaluate model with default configure.
python train_demo.py --dataset scierc
Dataset | NER (F1) | Relation (F1) |
---|---|---|
Wet Lab Protocols | 81.5 | 66.26 |
SciERC | 67.27 | 41.77 |
NYT24 | 94.4 | 77.48 |
NYT29 | 89.19 | 62.53 |
WebNLG | 94.45 | 77.5 |
E-mail: [email protected]