2019 Baidu's relationship drawing competition, Pytorch version of Su Shen's baseline, joint relationship drawing.
The same as Su Shen’s model, except that the development framework has changed from Keras+Tensorflow to Pytorch, which is shared with friends who use Pytorch.
Sushen Keras version link: https://github.com/bojone/kg-2019-baseline
Many Su Shen’s codes are reused in the code, so I would like to thank Su Shen first!
The following is the original text of Su Shen’s model introduction:
用BiLSTM做联合标注,先预测subject,然后根据suject同时预测object和predicate,标注结构是“半指针-半标注”结构,以前也曾介绍过( https://kexue.fm/archives/5409 )
标注结构是自己设计的,我看了很多关系抽取的论文,没有发现类似的做法。所以,如果你基于此模型做出后的修改,最终获奖了或者发表paper什么的,烦请注明一下(其实也不是太奢望)
@misc{
jianlin2019bdkg,
title={Hybrid Structure of Pointer and Ragging for Relation Extraction: A Baseline},
author={Jianlin Su},
year={2019},
publisher={GitHub},
howpublished={url{https://github.com/bojone/kg-2019-baseline}},
}
Introduction to the algorithm based on this code on CSDN: https://blog.csdn.net/qq_35268841/article/details/107063066
python trans.py converts data, python main.py runs the model and observes the results.
The code requires the GPU to run! If the CPU needs to be run, remove all .cuda() in the code and change some data types on cuda to normal data types.
The data only provides a total of 30 pieces of sample data. The data is provided by the competition official. If you need it, please contact the competition organizer.
5 epochs reach 0.73, and the maximum can reach 0.75.
Python 3.5+
Pytorch 1.0.1
tqdm