-
Notifications
You must be signed in to change notification settings - Fork 5
/
evaluate_qanta.py
28 lines (21 loc) · 1.15 KB
/
evaluate_qanta.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
from classify.learn_classifiers import evaluate
import argparse
## - evaluate QANTA's learned representations on history questions
## and compare performance to bag of words and dependency relation baselines
## - be sure to train a model first by running qanta.py
if __name__ == '__main__':
# command line arguments
parser = argparse.ArgumentParser(description='QANTA evaluation')
parser.add_argument('-data', help='location of dataset', default='data/hist_split')
parser.add_argument('-model', help='location of trained model', default='models/hist_params')
parser.add_argument('-d', help='word embedding dimension', type=int, default=100)
args = vars(parser.parse_args())
print 'qanta performance: '
evaluate(args['data'], args['model'], args['d'], rnn_feats=True, \
bow_feats=False, rel_feats=False)
print '\n\n\n bow performance: '
evaluate(args['data'], args['model'], args['d'], rnn_feats=False, \
bow_feats=True, rel_feats=False)
print '\n\n\n bow-dt performance: '
evaluate(args['data'], args['model'], args['d'], rnn_feats=False, \
bow_feats=True, rel_feats=True)