forked from ad-freiburg/aqqu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
scorer_globals.py
80 lines (75 loc) · 2.74 KB
/
scorer_globals.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
"""
Copyright 2015, University of Freiburg.
Elmar Haussmann <haussmann@cs.uni-freiburg.de>
"""
from query_translator import ranker
from collections import OrderedDict
free917_entities = "evaluation-data/free917_entities.txt"
# The scorers that can be selected.
scorer_list = [ranker.AccuModel('F917_Ranker',
"free917train",
top_ngram_percentile=2,
rel_regularization_C=0.002),
ranker.AccuModel('F917_Ranker_entity_oracle',
"free917train",
entity_oracle_file=free917_entities,
top_ngram_percentile=2,
rel_regularization_C=1.0),
ranker.AccuModel('WQ_Ranker',
"webquestionstrain",
top_ngram_percentile=5,
rel_regularization_C=1.0),
ranker.SimpleScoreRanker('SimpleRanker'),
ranker.SimpleScoreRanker('SimpleRanker_entity_oracle',
entity_oracle_file=free917_entities),
ranker.LiteralRanker('LiteralRanker'),
ranker.LiteralRanker('LiteralRanker_entity_oracle',
entity_oracle_file=free917_entities),
]
# A dictionary used for lookup via scorer name.
scorers_dict = OrderedDict(
[(s.name, s) for s in scorer_list]
)
# A dict of dataset name and file.
DATASETS = OrderedDict(
[('free917train',
'evaluation-data/'
'free917.train.json'),
('webquestionstrain',
'evaluation-data/'
'webquestions.train.json'),
('free917train_1of2',
'evaluation-data/'
'free917.train_1of2.json'),
('free917train_2of2',
'evaluation-data/'
'free917.train_2of2.json'),
('webquestionstrain_1of2',
'evaluation-data/'
'webquestions.train_1of2.json'),
('webquestionstrain_1of2_1of2',
'evaluation-data/'
'webquestions.train_1of2_1of2.json'),
('webquestionstrain_1of2_2of2',
'evaluation-data/'
'webquestions.train_1of2_2of2.json'),
('webquestionstrain_2of2',
'evaluation-data/'
'webquestions.train_2of2.json'),
('free917test',
'evaluation-data/'
'free917.test.json'),
('webquestionstest',
'evaluation-data/'
'webquestions.test.json'),
('free917test_graphparser',
'evaluation-data/'
'free917.test_graphparser.json'),
('webquestionstest_graphparser',
'evaluation-data/'
'webquestions.test_graphparser.json'),
('webquestionstrain_graphparser',
'evaluation-data/'
'webquestions.train_graphparser.json'),
]
)