TensorFlow implementation of the paper,
dataset: SemEval2010 task8
word embeddings: senna
to run the code:
./run
- tensorflow 1.4.0
- python 3.5
- linux,macOs or windows
-
to train model
./run
where
num_epochs=200 --word_dim=50
have been set in 'run' file. -
to test model
excute
python src/train.py --num_epochs=200 --word_dim=50 --test
then you can get a 'results.txt' file in
/data/resuts.txt
-
to calculate F1 score
perl src/scorer.pl data/test_keys.txt data/results.txt
when you use Spyder or PyCharm to run this code, you may encounter this error:
ArgumentError: argument --train_file: conflicting option string: --train_file
solution:
-
restart spyder
-
or add annotation for all definitions of
tf.flags.FLAGS
.
such as # flags.DEFINE_string("train_file", "data/train.cln", "original training file")
- delete 'the hidden layer 2' as the paper mentioned
- use muti - window size(w=3,w=4,w=5) in convolution layer
- delete Wordnet lexical feature