Skip to content

jefferyYu/Pairwise-relation-classification

Repository files navigation

Author

Jianfei YU

jfyu.2014@phdis.smu.edu.sg

Mar 12, 2017

Data and Code for:

Pairwise relation classification with mirror instances and a combined convolutional neural network COLING 2016 http://aclweb.org/anthology/C/C16/C16-1223.pdf

Requirements

  1. Python 2.7
  2. hdf5 (h5py)
  3. Torch7

I. Data

  1. In this releasing code, we just use the Semeval-2010 dataset to show our proposed Comb+MI and Comb+RMI models.
  2. We attach the original dataset in the folder "SemEval2010_task8_all_data".
  3. We also attach our extracted shortest dependency path(SDP) between two entities in the folder "SemEval2010_task8_all_data". The SDPs of training instances are under the folder "SemEval2010_task8_training", named "train_p1.txt", "train_p2.txt", "train_p3.txt" and "train_p4.txt". Each contains 2000 training instances. The SDPs of test instances are under the folder "SemEval2010_task8_testing_keys", named "test_all.txt".
  4. The ACE data is not included because of licensing issues.

II. Code

Part1: Pre-process code:

  • You can directly run the following codes:
python preprocess_mipe+dep.py

Part2: Model Code:

  • To run the Comb+MI and Comb+RMI, you can just run:
sh run.sh

Part3: Results:

  • By running the codes, you should get the following result (the "main_mipecomb.lua" file refers to the Comb+MI model, while "main_mipecombneg.lua" file refers to the Comb+RMI model):
Metrics Comb+MI Comb+RMI
F1_score 84.08 84.86
  • The results are slightly different from the results we report in Table 5 in our paper. The reason is that in our previous experiments, we use a random seed for both Comb+MI and Comb+RMI. But now for fair comparison, we set the seed in both models to the same value 0. Also, in this released code, I reduce 80% negative mirror instances while in our paper we reduce 50%.

  • For convenience, to show our running process, we also attach the "miresult.txt" and "rmiresult.txt" in the folder "runing_example".

Acknowledgements

License:

Singapore Management University

About

Code for Pairwise relation classification with mirror instances and a combined convolutional neural network

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published