yuhaozhang/tacred-relation
yuhaozhang/tacred-relation has 357 GitHub stars and 95 forks. Star changes are not measured yet. Last checked 2026-11-14 08:02 UTC. Last push 2024-04-24.
Gemessener Sternzuwachs
- in 24h
- Verlauf wird gesammelt
- in 7 days
- Verlauf wird gesammelt
- in 15 days
- Verlauf wird gesammelt
- in 1 month
- Verlauf wird gesammelt
Nettoänderungen in überlappenden Zeiträumen, keine Tagessummen. Fehlende Messwerte bleiben leer. Sterne zeigen Interesse, nicht Qualität.
Über uns
PyTorch implementation of the position-aware attention model for relation extraction
Maschinelles LernenREADME.md
OriginalPosition-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.
Ähnliche Projekte entdecken
tensorflow/tensorflow
Ein Open-Source-Framework für maschinelles Lernen für alle
201,591 Sternehuggingface/transformers
🤗 Transformers: das Framework zur Modelldefinition für State-of-the-Art-Modelle des maschinellen Lernens in Text, Vision, Audio und multimodal, für Inferenz und Training.
168,958 SterneAUTOMATIC1111/stable-diffusion-webui
Web-UI für Stable Diffusion
165,310 SterneComfy-Org/ComfyUI
Die leistungsstärkste und modularste GUI, API und das Backend für Diffusionsmodelle mit einer Oberfläche aus Graphen und Knoten. Die schnellste lokale Inferenz-Engine der Welt.
146,744 Sterne