Repository navigation
Expand file tree
/
Copy pathparse_args.py
More file actions
102 lines (98 loc) · 4.61 KB
/
Copy pathparse_args.py
File metadata and controls
102 lines (98 loc) · 4.61 KB
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
import argparse
def parse_args() -> argparse.Namespace:
parser = argparse.ArgumentParser(description='Process CLI.')
parser.add_argument('--problem',
type=str,
required=True,
help='There are three different pipelines available depending on the dataset: normal, dialogism, wan')
parser.add_argument('--text-name',
type=str,
required=True,
help='The title of the text')
parser.add_argument('--input-text-path',
type=str,
required=False,
help='Path to the text to be analyzed')
parser.add_argument('--generate-features',
type=lambda x: x.lower() == 'true',
default=False,
help='Set to True or False explicitly')
parser.add_argument('--features-path',
type=str,
required=True,
help='Path to the features of the text to be analysed')
parser.add_argument('--classifier-config-path',
type=str,
required=True,
help='The name of the classification config to be used')
parser.add_argument('--classifier-config-key',
type=str,
required=True,
help='What methods from the config should be used')
parser.add_argument('--label',
type=str,
required=False,
default='Shakespeare|Fletcher|DOS|TOL',
help='Required for normal-text and wan problems')
parser.add_argument('--language',
type=str,
required=False,
default='en',
help='Required for wan problems')
parser.add_argument('--wan-config',
type=str,
required=False,
default='C1',
help='Choose a config from the wan_configs file')
args = parser.parse_args()
return args
def parse_args_pan() -> argparse.Namespace:
parser = argparse.ArgumentParser(description='Process CLI.')
parser.add_argument('--train-dataset-path',
type=str,
required=False,
help='Path to the train dataset for PAN')
parser.add_argument('--test-dataset-path',
type=str,
required=False,
help='Path to the test dataset for PAN')
parser.add_argument('--train-truth-path',
type=str,
required=False,
help='Path to the train dataset ground truth for PAN')
parser.add_argument('--test-truth-path',
type=str,
required=False,
help='Path to the test dataset ground truth for PAN')
parser.add_argument('--generate-features',
type=lambda x: x.lower() == 'true',
default=False,
help='Set to True or False explicitly')
parser.add_argument('--features-path-train',
type=str,
required=True,
help='Path to the features of the train dataset')
parser.add_argument('--features-path-test',
type=str,
required=True,
help='Path to the features of the test dataset')
parser.add_argument('--classifier-config-path',
type=str,
required=True,
help='The name of the classification config to be used')
parser.add_argument('--classifier-config-key',
type=str,
required=True,
help='What methods from the config should be used')
parser.add_argument('--language',
type=str,
required=False,
default='en',
help='Required for wan problems')
parser.add_argument('--wan-config',
type=str,
required=False,
default= 'C1',
help='Choose a config from the wan_configs file')
args = parser.parse_args()
return args