All Projects → yuhaozhang → Tacred Relation

yuhaozhang / Tacred Relation

Licence: other
PyTorch implementation of the position-aware attention model for relation extraction

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Tacred Relation

Oie Resources
A curated list of Open Information Extraction (OIE) resources: papers, code, data, etc.
Stars: ✭ 283 (+4.43%)
Mutual labels:  natural-language-processing, relation-extraction, information-extraction
Gcn Over Pruned Trees
Graph Convolution over Pruned Dependency Trees Improves Relation Extraction (authors' PyTorch implementation)
Stars: ✭ 312 (+15.13%)
Mutual labels:  natural-language-processing, relation-extraction, information-extraction
Usc Ds Relationextraction
Distantly Supervised Relation Extraction
Stars: ✭ 378 (+39.48%)
Mutual labels:  natural-language-processing, relation-extraction, information-extraction
Nel
Entity linking framework
Stars: ✭ 176 (-35.06%)
Mutual labels:  natural-language-processing, information-extraction
PSPE
Pretrained Span and span Pair Encoder, code for "Pre-training Entity Relation Encoder with Intra-span and Inter-spanInformation.", EMNLP2020. It is based on our NERE toolkit (https://github.com/Receiling/NERE).
Stars: ✭ 17 (-93.73%)
Mutual labels:  information-extraction, relation-extraction
Chemdataextractor
Automatically extract chemical information from scientific documents
Stars: ✭ 152 (-43.91%)
Mutual labels:  natural-language-processing, information-extraction
Geotext
Geotext extracts country and city mentions from text
Stars: ✭ 91 (-66.42%)
Mutual labels:  natural-language-processing, information-extraction
Mitie
MITIE: library and tools for information extraction
Stars: ✭ 2,693 (+893.73%)
Mutual labels:  natural-language-processing, information-extraction
Pytorch graph Rel
A PyTorch implementation of GraphRel
Stars: ✭ 204 (-24.72%)
Mutual labels:  natural-language-processing, relation-extraction
Multiple Relations Extraction Only Look Once
Multiple-Relations-Extraction-Only-Look-Once. Just look at the sentence once and extract the multiple pairs of entities and their corresponding relations. 端到端联合多关系抽取模型,可用于 http://lic2019.ccf.org.cn/kg 信息抽取。
Stars: ✭ 269 (-0.74%)
Mutual labels:  relation-extraction, information-extraction
DocuNet
Code and dataset for the IJCAI 2021 paper "Document-level Relation Extraction as Semantic Segmentation".
Stars: ✭ 84 (-69%)
Mutual labels:  information-extraction, relation-extraction
Nl2sql
阿里天池首届中文NL2SQL挑战赛top6
Stars: ✭ 146 (-46.13%)
Mutual labels:  natural-language-processing, information-extraction
Awesome Hungarian Nlp
A curated list of NLP resources for Hungarian
Stars: ✭ 121 (-55.35%)
Mutual labels:  natural-language-processing, information-extraction
Deeplearning nlp
基于深度学习的自然语言处理库
Stars: ✭ 154 (-43.17%)
Mutual labels:  natural-language-processing, relation-extraction
Clustype
Automatic Entity Recognition and Typing for Domain-Specific Corpora (KDD'15)
Stars: ✭ 99 (-63.47%)
Mutual labels:  natural-language-processing, information-extraction
Reside
EMNLP 2018: RESIDE: Improving Distantly-Supervised Neural Relation Extraction using Side Information
Stars: ✭ 222 (-18.08%)
Mutual labels:  natural-language-processing, relation-extraction
ReQuest
Indirect Supervision for Relation Extraction Using Question-Answer Pairs (WSDM'18)
Stars: ✭ 26 (-90.41%)
Mutual labels:  information-extraction, relation-extraction
CogIE
CogIE: An Information Extraction Toolkit for Bridging Text and CogNet. ACL 2021
Stars: ✭ 47 (-82.66%)
Mutual labels:  information-extraction, relation-extraction
IE Paper Notes
Paper notes for Information Extraction, including Relation Extraction (RE), Named Entity Recognition (NER), Entity Linking (EL), Event Extraction (EE), Named Entity Disambiguation (NED).
Stars: ✭ 14 (-94.83%)
Mutual labels:  information-extraction, relation-extraction
Exemplar
An open relation extraction system
Stars: ✭ 46 (-83.03%)
Mutual labels:  natural-language-processing, relation-extraction

Position-aware Attention RNN Model for Relation Extraction

This repo contains the PyTorch code for paper Position-aware Attention and Supervised Data Improve Slot Filling.

The TACRED dataset: Details on the TAC Relation Extraction Dataset can be found on this dataset website.

Requirements

  • Python 3 (tested on 3.6.2)
  • PyTorch (tested on 1.0.0)
  • unzip, wget (for downloading only)

Preparation

First, download and unzip GloVe vectors from the Stanford website, with:

chmod +x download.sh; ./download.sh

Then prepare vocabulary and initial word vectors with:

python prepare_vocab.py dataset/tacred dataset/vocab --glove_dir dataset/glove

This will write vocabulary and word vectors as a numpy matrix into the dir dataset/vocab.

Training

Train a position-aware attention RNN model with:

python train.py --data_dir dataset/tacred --vocab_dir dataset/vocab --id 00 --info "Position-aware attention model"

Use --topn N to finetune the top N word vectors only. The script will do the preprocessing automatically (word dropout, entity masking, etc.).

Train an LSTM model with:

python train.py --data_dir dataset/tacred --vocab_dir dataset/vocab --no-attn --id 01 --info "LSTM model"

Model checkpoints and logs will be saved to ./saved_models/00.

Evaluation

Run evaluation on the test set with:

python eval.py saved_models/00 --dataset test

This will use the best_model.pt by default. Use --model checkpoint_epoch_10.pt to specify a model checkpoint file. Add --out saved_models/out/test1.pkl to write model probability output to files (for ensemble, etc.).

Ensemble

Please see the example script ensemble.sh.

License

All work contained in this package is licensed under the Apache License, Version 2.0. See the included LICENSE file.

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