-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_identification.py
More file actions
50 lines (37 loc) · 1.61 KB
/
run_identification.py
File metadata and controls
50 lines (37 loc) · 1.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
import argparse
from typing import Union
from mpterm import MPTerm
def main(path_data:str=None, json_input:Union[str, dict]=None,
dir_output:str=None, file_output:str=None,
bool_local:bool=False):
if bool_local:
mpterm = MPTerm(input_info=path_data,
dir_output=dir_output, file_output=file_output)
else:
mpterm = MPTerm(input_info=json_input,
dir_output=dir_output, file_output=file_output)
# Load data to variables
mpterm.load_data(bool_local=bool_local)
# Run entity recognition
mpterm.entity_recog()
if bool_local:
# Save output
mpterm.save_output()
else:
print(mpterm.return_output())
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Mapping Prejudice (entity identification)')
parser.add_argument('--local', default=False,
help='Indication if running on local', action='store_true')
parser.add_argument('--path_data', default=None,
help='Path to the deed document')
parser.add_argument('--json_input', default=None,
help='String format JSON input')
parser.add_argument('--output_dir', default='./output',
help='Directory of output')
parser.add_argument('--output_file', default=None,
help='Filename of output')
args = parser.parse_args()
main(path_data=args.path_data, json_input=args.json_input,
dir_output=args.output_dir, file_output=args.output_file,
bool_local=args.local)