-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_preprocess.py
39 lines (35 loc) · 1.28 KB
/
run_preprocess.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
import argparse
import logging as logger
from src import *
from src.runs.preprocess_genia import run_preprocess_genia
from src.runs.training import run_training
from src.utils.config import Config
if __name__ != '__main__':
exit(0)
parser = argparse.ArgumentParser(description='Arguments for preprocess.')
parser.add_argument('--log_to_file',
default=None,
type=none_or_str,
action='store')
parser.add_argument('--dataset',
type=str,
action='store')
parser.add_argument('--raw_filepath',
type=str,
default='./data/GENIA/GENIAcorpus3.02.merged.xml',
action='store')
parser.add_argument('--cased',
type=int,
default=False,
action='store')
parser.add_argument('--lm_name',
default='dmis-lab/biobert-v1.1',
type=str,
action='store')
args = parser.parse_args()
setup_logger(logger, args.log_to_file)
if args.dataset == 'genia':
run_preprocess_genia(logger, args.raw_filepath, args.cased, args.lm_name)
else:
logger.error('Unknown dataset: %s' % args.dataset)
raise Exception('Unknown dataset: %s' % args.dataset)