Implementation of the papers Joint entity recognition and relation extraction as a multi-head selection problem and Adversarial training for multi-context joint entity and relation extraction.
Given a sequence of tokens (i.e., sentence), (i) give the entity tag of each word (e.g., NER) and (ii) the relations between the entities in the sentence. The following example indicates the accepted input format of our multi-head selection model:
0 Marc B-PER ['N'] [0]
1 Smith I-PER ['lives_in','works_for'] [5,11]
2 lives O ['N'] [2]
3 in O ['N'] [3]
4 New B-LOC ['N'] [4]
5 Orleans I-LOC ['N'] [5]
6 and O ['N'] [6]
7 is O ['N'] [7]
8 hired O ['N'] [8]
9 by O ['N'] [9]
10 the O ['N'] [10]
11 government B-ORG ['N'] [11]
12 . O ['N'] [12]
The model has several parameters such as:
that could be specified in the configuration files (see config).
./run.sh
Commands executed in ./run.sh
:
python3 train_es.py
python3 train_eval.py
Please cite our work when using this software.
Giannis Bekoulis, Johannes Deleu, Thomas Demeester, Chris Develder. Joint entity recognition and relation extraction as a multi-head selection problem. Expert Systems with Applications, Volume 114, Pages 34-45, 2018
Giannis Bekoulis, Johannes Deleu, Thomas Demeester, Chris Develder. Adversarial training for multi-context joint entity and relation extraction, In the Proceedings of the Conference on Empirical Methods in Natural Language Processing (EMNLP), 2018