Convolution Neural Network for classification of semantic relations in a sentence
Convolution neural network for classification of semantic relationship between two given entities
Test accuracy: 80.06%
Macro F1 score (excluding Other): 84.18%
Prepare train.txt and text.txt run preprocess.py:
python preprocess.py
To get the vector representation of all the words, and then save them as a pickle.
You will need the embeddings we used: https://www.cs.york.ac.uk/nlp/extvec/wiki_extvec.gz
Download the .gz file and place it in a folder called 'embeddings'
python prepare_data.py
The word embeddings, look-up table, training data and test data get saved into a pickle file in ./pkl
To train the cnn model:
python train.py
All the models are saved in ./model
To view the results of the above step:
python test.py
It will display the accuracy and the F1 score on the test dataset
To use the official SemEval2010-Task8 Scorer:
perl scorer/semeval2010_task8_scorer-v1.2.pl results/HoboNet_result.txt scorer/test_key.txt > scorer/result_scores.txt
This will create result_scores.txt file that contains the official scores and confusion matrix for this task
NumPy
Keras
cPickle
gzip
Use python2