Skip to content

Commit

Permalink
Merge pull request #153 from SMI/feature/spacy-download
Browse files Browse the repository at this point in the history
Add -d switch for spacy script to download data file
  • Loading branch information
tznind authored Aug 11, 2022
2 parents cfd5c58 + 8a6ff92 commit 05c8943
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nlp/ner_daemon_spacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,18 @@ def text_generator(data):
"""
bindip='127.0.0.1'
parser = argparse.ArgumentParser(description = prog_name)
parser.add_argument('-d', '--download', dest='download', action="store", help='Download a SpaCy language model and exit')
parser.add_argument('-y', '--yaml', dest='yaml', action="store", help='the default.yaml config file')
parser.add_argument('-m', '--model', dest='model', action="append", help='a SpaCy language model')
parser.add_argument('-p', '--port', dest='port', action="store", help='port number, default 1881')
parser.add_argument('-i', '--ip', dest='bindip', action="store", help='IP address/hostname to bind to, default 127.0.0.1')
args = parser.parse_args()

if args.download:
spacy.cli.download(args.download)
quit()

host_name=''
port_num = int(args.port) if args.port else default_port

spacy_models = args.model if args.model else [default_spacy_model]
Expand Down

0 comments on commit 05c8943

Please sign in to comment.