All Projects → zhengyima → Kg Baseline Pytorch

zhengyima / Kg Baseline Pytorch

2019百度的关系抽取比赛,使用Pytorch实现苏神的模型,F1在dev集可达到0.75,联合关系抽取,Joint Relation Extraction.

Programming Languages

python
139335 projects - #7 most used programming language
python3
1442 projects

Projects that are alternatives of or similar to Kg Baseline Pytorch

Rex
REx: Relation Extraction. Modernized re-write of the code in the master's thesis: "Relation Extraction using Distant Supervision, SVMs, and Probabalistic First-Order Logic"
Stars: ✭ 21 (-85.91%)
Mutual labels:  relation-extraction
Relation extraction
Relation Extraction using Deep learning(CNN)
Stars: ✭ 96 (-35.57%)
Mutual labels:  relation-extraction
Bran
Full abstract relation extraction from biological texts with bi-affine relation attention networks
Stars: ✭ 111 (-25.5%)
Mutual labels:  relation-extraction
Bbw
Semantic annotator: Matching CSV to a Wikibase instance (e.g., Wikidata) via Meta-lookup
Stars: ✭ 42 (-71.81%)
Mutual labels:  relation-extraction
Distre
[ACL 19] Fine-tuning Pre-Trained Transformer Language Models to Distantly Supervised Relation Extraction
Stars: ✭ 75 (-49.66%)
Mutual labels:  relation-extraction
Intra Bag And Inter Bag Attentions
Code for NAACL 2019 paper: Distant Supervision Relation Extraction with Intra-Bag and Inter-Bag Attentions
Stars: ✭ 98 (-34.23%)
Mutual labels:  relation-extraction
Knowledge Graphs
A collection of research on knowledge graphs
Stars: ✭ 845 (+467.11%)
Mutual labels:  relation-extraction
Hatt Proto
Code and dataset of AAAI2019 paper Hybrid Attention-Based Prototypical Networks for Noisy Few-Shot Relation Classification
Stars: ✭ 149 (+0%)
Mutual labels:  relation-extraction
Tre
[AKBC 19] Improving Relation Extraction by Pre-trained Language Representations
Stars: ✭ 95 (-36.24%)
Mutual labels:  relation-extraction
Atnre
Adversarial Training for Neural Relation Extraction
Stars: ✭ 108 (-27.52%)
Mutual labels:  relation-extraction
Exemplar
An open relation extraction system
Stars: ✭ 46 (-69.13%)
Mutual labels:  relation-extraction
Rcnn Relation Extraction
Tensorflow Implementation of Recurrent Convolutional Neural Network for Relation Extraction
Stars: ✭ 64 (-57.05%)
Mutual labels:  relation-extraction
Zhopenie
Chinese Open Information Extraction (Tree-based Triple Relation Extraction Module)
Stars: ✭ 98 (-34.23%)
Mutual labels:  relation-extraction
Jointre
End-to-end neural relation extraction using deep biaffine attention (ECIR 2019)
Stars: ✭ 41 (-72.48%)
Mutual labels:  relation-extraction
Bertem
论文实现(ACL2019):《Matching the Blanks: Distributional Similarity for Relation Learning》
Stars: ✭ 146 (-2.01%)
Mutual labels:  relation-extraction
Pytorch Nre
Neural Relation Extraction in Pytorch
Stars: ✭ 20 (-86.58%)
Mutual labels:  relation-extraction
Copymtl
AAAI20 "CopyMTL: Copy Mechanism for Joint Extraction of Entities and Relations with Multi-Task Learning"
Stars: ✭ 97 (-34.9%)
Mutual labels:  relation-extraction
Macadam
Macadam是一个以Tensorflow(Keras)和bert4keras为基础,专注于文本分类、序列标注和关系抽取的自然语言处理工具包。支持RANDOM、WORD2VEC、FASTTEXT、BERT、ALBERT、ROBERTA、NEZHA、XLNET、ELECTRA、GPT-2等EMBEDDING嵌入; 支持FineTune、FastText、TextCNN、CharCNN、BiRNN、RCNN、DCNN、CRNN、DeepMoji、SelfAttention、HAN、Capsule等文本分类算法; 支持CRF、Bi-LSTM-CRF、CNN-LSTM、DGCNN、Bi-LSTM-LAN、Lattice-LSTM-Batch、MRC等序列标注算法。
Stars: ✭ 149 (+0%)
Mutual labels:  relation-extraction
Information Extraction Chinese
Chinese Named Entity Recognition with IDCNN/biLSTM+CRF, and Relation Extraction with biGRU+2ATT 中文实体识别与关系提取
Stars: ✭ 1,888 (+1167.11%)
Mutual labels:  relation-extraction
Pytorch multi head selection re
BERT + reproduce "Joint entity recognition and relation extraction as a multi-head selection problem" for Chinese and English IE
Stars: ✭ 105 (-29.53%)
Mutual labels:  relation-extraction

kg-baseline-pytorch

2019百度的关系抽取比赛,Pytorch版苏神的baseline,联合关系抽取。

模型

与苏神的模型相同,只不过开发框架由Keras+Tensorflow变成了Pytorch,给使用Pytorch的小伙伴分享。

苏神Keras版链接:https://github.com/bojone/kg-2019-baseline

代码中复用了许多苏神的代码,因此首先对苏神表示感谢!

以下为苏神模型介绍原文:

用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}},
}

CSDN上基于本代码的算法简介:https://blog.csdn.net/qq_35268841/article/details/107063066

用法

python trans.py转换数据,python main.py跑模型并观察结果。

代码需要GPU运行!若需要CPU运行则去掉代码中所有的.cuda()并将一些cuda上的数据类型改为普通数据类型即可。

数据

数据只提供了共30条示例数据。数据由比赛官方提供,如有需要请联系比赛主办方。

结果

5个epoch到达0.73,最高能到0.75。

环境

Python 3.5+

Pytorch 1.0.1

tqdm

链接

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].