forked from 4kssoft/CUTIE
-
Notifications
You must be signed in to change notification settings - Fork 1
/
main_build_dict.py
21 lines (18 loc) · 937 Bytes
/
main_build_dict.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# written by Xiaohui Zhao
# 2018-01
import tensorflow as tf
import argparse
from data_loader_json import DataLoader
parser = argparse.ArgumentParser(description='CUTIE parameters')
parser.add_argument('--dict_path', type=str, default='dict/SROIE')
parser.add_argument('--doc_path', type=str, default='data/SROIE')
parser.add_argument('--test_path', type=str, default='') # leave empty if no test data provided
parser.add_argument('--text_case', type=bool, default=True) # case sensitive
parser.add_argument('--tokenize', type=bool, default=True) # tokenize input text
parser.add_argument('--batch_size', type=int, default=5)
parser.add_argument('--use_cutie2', type=bool, default=False)
params = parser.parse_args()
if __name__ == '__main__':
## run this program before training to create a basic dictionary for training
data_loader = DataLoader(params, update_dict=True, load_dictionary=False)