-
Notifications
You must be signed in to change notification settings - Fork 14
/
parameter_settings.py
118 lines (69 loc) · 2.24 KB
/
parameter_settings.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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
from collections import OrderedDict
import argparse
parser = argparse.ArgumentParser()
parameters_crf = OrderedDict()
parser.add_argument(
"-train_data", default="../../data/train_data/Standoff_Format/",
help="Standoff_Format training files"
)
parser.add_argument(
"-test_data", default="../../data/test_data/Standoff_Format/",
help="Standoff_Format test files"
)
parser.add_argument(
"-dev_data", default="../../data/dev_data/Standoff_Format/",
help="Standoff_Format dev files"
)
parser.add_argument(
"-perf_file", default="performance.tex",
help="Output file to store the final latex table"
)
parser.add_argument(
"-pred_file", default="prediction.txt",
help="Output file to save all prediction"
)
parser.add_argument(
"-include_word_features", default="1",
help="string feature inclusion (0 to disable)"
)
parser.add_argument(
"-include_context", default="1",
help="context feature inclusion (0 to disable)"
)
parser.add_argument(
"-context_window_len", default="5",
help="context window length (default 5)"
)
parser.add_argument(
"-include_gazetteer", default="1",
help="gazetteer feature inclusion (0 to disable)"
)
parser.add_argument(
"-to_latex", default="0",
help="if print in latex format (1 to enable)"
)
opts = parser.parse_args()
parameters_crf["train_data"]=opts.train_data
parameters_crf["test_data"]=opts.test_data
parameters_crf["dev_data"]=opts.dev_data
parameters_crf["perf_file"]=opts.perf_file
parameters_crf["pred_file"]=opts.pred_file
if opts.include_gazetteer=="0":
parameters_crf["include_gazetteer"]=False
else:
parameters_crf["include_gazetteer"]=True
if opts.include_word_features=="0":
parameters_crf["include_word_features"]=False
else:
parameters_crf["include_word_features"]=True
if opts.include_context=="0":
parameters_crf["include_context"]=False
else:
parameters_crf["include_context"]=True
if opts.to_latex=="0":
parameters_crf["print_latex_format"]=False
else:
parameters_crf["print_latex_format"]=True
parameters_crf["context_window_len"]=int(opts.context_window_len)
parameters_crf["conll_output_folder"]="Conll_Outputs/"
parameters_crf["standoff_output_folder"]="Standoff_Outputs/"