Author
Jianfei YU
Mar 12, 2017
Pairwise relation classification with mirror instances and a combined convolutional neural network COLING 2016 http://aclweb.org/anthology/C/C16/C16-1223.pdf
- Python 2.7
- hdf5 (h5py)
- Torch7
- In this releasing code, we just use the Semeval-2010 dataset to show our proposed Comb+MI and Comb+RMI models.
- We attach the original dataset in the folder "SemEval2010_task8_all_data".
- 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".
- The ACE data is not included because of licensing issues.
- You can directly run the following codes:
python preprocess_mipe+dep.py
- Note that before you run, you need to download word2vec vectors from here: https://code.google.com/archive/p/word2vec/ , and then set w2v_path in line 626.
- To run the Comb+MI and Comb+RMI, you can just run:
sh run.sh
- 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".
- Most of the code are based on the code by Harvard NLP group: https://github.com/harvardnlp/sent-conv-torch.
- Using this code means you have read and accepted the copyrights set by the dataset providers.
Singapore Management University