All Projects → jmshen1994 → R-BERT

jmshen1994 / R-BERT

Licence: GPL-3.0 license
Pytorch re-implementation of R-BERT model

Programming Languages

python
139335 projects - #7 most used programming language
perl
6916 projects
shell
77523 projects

Projects that are alternatives of or similar to R-BERT

Relation-Classification
Relation Classification - SEMEVAL 2010 task 8 dataset
Stars: ✭ 46 (-22.03%)
Mutual labels:  relation-extraction, relation-classification, semeval-2010
Att-BLSTM-relation-extraction
Implementation of Attention-Based Bidirectional Long Short-Term Memory Networks for Relation Classification.
Stars: ✭ 60 (+1.69%)
Mutual labels:  relation-extraction, semeval-2010
Relation Classification Using Bidirectional Lstm Tree
TensorFlow Implementation of the paper "End-to-End Relation Extraction using LSTMs on Sequences and Tree Structures" and "Classifying Relations via Long Short Term Memory Networks along Shortest Dependency Paths" for classifying relations
Stars: ✭ 167 (+183.05%)
Mutual labels:  relation-extraction
spert
PyTorch code for SpERT: Span-based Entity and Relation Transformer
Stars: ✭ 572 (+869.49%)
Mutual labels:  relation-extraction
Bert Attributeextraction
USING BERT FOR Attribute Extraction in KnowledgeGraph. fine-tuning and feature extraction. 使用基于bert的微调和特征提取方法来进行知识图谱百度百科人物词条属性抽取。
Stars: ✭ 224 (+279.66%)
Mutual labels:  relation-extraction
Cnn Re Tf
Convolutional Neural Network for Multi-label Multi-instance Relation Extraction in Tensorflow
Stars: ✭ 190 (+222.03%)
Mutual labels:  relation-extraction
FinBERT-QA
Financial Domain Question Answering with pre-trained BERT Language Model
Stars: ✭ 70 (+18.64%)
Mutual labels:  bert-model
Ruijin round2
瑞金医院MMC人工智能辅助构建知识图谱大赛复赛
Stars: ✭ 159 (+169.49%)
Mutual labels:  relation-extraction
SENet-for-Weakly-Supervised-Relation-Extraction
No description or website provided.
Stars: ✭ 39 (-33.9%)
Mutual labels:  relation-extraction
Reside
EMNLP 2018: RESIDE: Improving Distantly-Supervised Neural Relation Extraction using Side Information
Stars: ✭ 222 (+276.27%)
Mutual labels:  relation-extraction
lima
The Libre Multilingual Analyzer, a Natural Language Processing (NLP) C++ toolkit.
Stars: ✭ 75 (+27.12%)
Mutual labels:  relation-extraction
Pytorch graph Rel
A PyTorch implementation of GraphRel
Stars: ✭ 204 (+245.76%)
Mutual labels:  relation-extraction
Marktool
这是一款基于web的通用文本标注工具,支持大规模实体标注、关系标注、事件标注、文本分类、基于字典匹配和正则匹配的自动标注以及用于实现归一化的标准名标注,同时也支持文本的迭代标注和实体的嵌套标注。标注规范可自定义且同类型任务中可“一次创建多次复用”。通过分级实体集合扩大了实体类型的规模,并设计了全新高效的标注方式,提升了用户体验和标注效率。此外,本工具增加了审核环节,可对多人的标注结果进行一致性检验和调整,提高了标注语料的准确率和可靠性。
Stars: ✭ 190 (+222.03%)
Mutual labels:  relation-extraction
GP-GNN
Code and dataset of ACL2019 Paper: Graph Neural Networks with Generated Parameters for Relation Extraction.
Stars: ✭ 52 (-11.86%)
Mutual labels:  relation-extraction
Pytorch Acnn Model
code of Relation Classification via Multi-Level Attention CNNs
Stars: ✭ 170 (+188.14%)
Mutual labels:  relation-extraction
Jointnre
Joint Neural Relation Extraction with Text and KGs
Stars: ✭ 168 (+184.75%)
Mutual labels:  relation-extraction
Cnn Relation Extraction
Tensorflow Implementation of Convolutional Neural Network for Relation Extraction (COLING 2014, NAACL 2015)
Stars: ✭ 203 (+244.07%)
Mutual labels:  relation-extraction
Agriculture knowledgegraph
农业知识图谱(AgriKG):农业领域的信息检索,命名实体识别,关系抽取,智能问答,辅助决策
Stars: ✭ 2,957 (+4911.86%)
Mutual labels:  relation-extraction
Transformer Temporal Tagger
Code and data form the paper BERT Got a Date: Introducing Transformers to Temporal Tagging
Stars: ✭ 55 (-6.78%)
Mutual labels:  bert-model
ReQuest
Indirect Supervision for Relation Extraction Using Question-Answer Pairs (WSDM'18)
Stars: ✭ 26 (-55.93%)
Mutual labels:  relation-extraction

A Pytorch Implementation of R-BERT relation classification model

PWC PWC

This is an unofficial pytorch implementation of R-BERT model described paper Enriching Pre-trained Language Model with Entity Information for Relation Classification.

In addition to the SemEval 2010 dataset tested in the original paper, I aslo test implementation on the more recent TACRED dataset

Requirements:

Install

$ https://github.com/mickeystroller/R-BERT
$ cd R-BERT

Train

SemEval-2010

The SemEval-2010 dataset is already included in this repo and you can directly run:

CUDA_VISIBLE_DEVICES=0 python r_bert.py --config config.ini

TACRED

You need to first download TACRED dataset from LDC, which due to the license issue I cannot put in this repo. Then, you can directly run:

CUDA_VISIBLE_DEVICES=0 python r_bert.py --config config_tacred.ini

Eval

SemEval-2010

We use the official script for SemEval 2010 task-8

$ cd eval
$ bash test.sh
$ cat res.txt

TACRED

First, we generate prediction file tac_res.txt

$ python eval_tacred.py

You may change test file/model path in the eval_tacred.py file

Then, we use the official scoring script for TACRED dataset

$ python ./eval/score.py -gold_file <TACRED_DIR/data/gold/test.gold> -pred_file ./eval/tac_res.txt

Results

SemEval-2010

Below is the Macro-F1 score

Model Original Paper Ours
BERT-uncased-base ---- 88.40
BERT-uncased-large 89.25 90.16

TACRED

Below is the evaluation result

Model Precision (Micro) Recall (Micro) F1 (Micro)
BERT-uncased-base 72.99 62.50 67.34
BERT-cased-base 71.27 64.84 67.91
BERT-uncased-large 72.91 66.20 69.39
BERT-cased-large 70.86 65.96 68.32

Reference

  1. https://github.com/wang-h/bert-relation-classification

  2. Enriching Pre-trained Language Model with Entity Information for Relation Classification.

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].