Skip to content

Implementation of Neural Relation Extraction with Selective Attention over Instances.

License

Notifications You must be signed in to change notification settings

onehaitao/distant-supervised-relation-extraction

Repository files navigation

distant-supervised-relation-extraction

PWC PWC

Implementation of Neural Relation Extraction with Selective Attention over Instances.

Environment Requirements

  • python 3.6
  • pytorch 1.3.0
  • gensim 3.8.0
  • matplotloib 3.1.2
  • sklearn 0.21.3

Data

Usage

  1. Download the NYT10 and decompress it in the current directory.
  2. Preprocess the original data, and the processed data is stored in processed folder.
python preprocess.py
  1. You can use the following the commands to start the program.
python run.py --encoder='cnn' --selector='one'
python run.py --encoder='cnn' --selector='att'
python run.py --encoder='cnn' --selector='avg'
python run.py --encoder='pcnn' --selector='one'
python run.py --encoder='pcnn' --selector='att'
python run.py --encoder='pcnn' --selector='avg'

More details can be seen by python run.py -h.

  1. You can use run the draw.py to visualize the results.
python draw.py

Result

The results of my version are present as follows: pr_cnn pr_pcnn

The training log can be seen in train.log.

Note:

  • Some settings may be different from those mentioned in the paper.
  • No validation set used during training.
  • Some errors exists in my code, but on the whole it is right.
  • If you have any suggestions, please Issue.

Reference Link

About

Implementation of Neural Relation Extraction with Selective Attention over Instances.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published