forked from aymara/lima-tfner
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_model.py
More file actions
executable file
·31 lines (25 loc) · 905 Bytes
/
build_model.py
File metadata and controls
executable file
·31 lines (25 loc) · 905 Bytes
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
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# author Romaric Besançon (romaric.besancon@cea.fr)
# date Tue Nov 10 2020
# copyright Copyright (C) 2020 by CEA - LIST
#
import sys,argparse,codecs
from tfner.configfromfile import ModelConfig
from tfner.core import build_model
#----------------------------------------------------------------------
# main function
def main(argv):
# parse command-line arguments
parser=argparse.ArgumentParser(description="build a NN model for NER")
# optional arguments
#parser.add_argument("--arg",type=int,default=42,help="description")
# positional arguments
parser.add_argument("config_file",help="configuration file indicating the parameters for the training")
param=parser.parse_args()
# do main
cfg=ModelConfig(param.config_file)
build_model(cfg)
if __name__ == "__main__":
main(sys.argv[1:])