diff options
author | John Bauer <horatio@gmail.com> | 2022-09-04 07:26:12 +0300 |
---|---|---|
committer | John Bauer <horatio@gmail.com> | 2022-09-04 07:26:51 +0300 |
commit | 18c6cff8d6717425b2f6300731932b3c900ed77b (patch) | |
tree | e04a9f70c3386076e01771dbd05085fb75e2f61d | |
parent | 2f5a18f295ac37590b553e1abc385909e0679ad6 (diff) |
Replace click with argparse in the Polish NER, rather than adding a new library dependency
-rw-r--r-- | stanza/utils/datasets/ner/convert_nkjp.py | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/stanza/utils/datasets/ner/convert_nkjp.py b/stanza/utils/datasets/ner/convert_nkjp.py index 0dc0ad67..3ad3f195 100644 --- a/stanza/utils/datasets/ner/convert_nkjp.py +++ b/stanza/utils/datasets/ner/convert_nkjp.py @@ -1,7 +1,7 @@ +import argparse +import json import os import random -import json -import click from tqdm import tqdm from lxml import etree @@ -223,10 +223,13 @@ def convert_nkjp(nkjp_dir, output_dir): json.dump(split, f, ensure_ascii=False, indent=2) -@click.command() -@click.argument('nkjp_dir', default="NKJP") -def main(nkjp_dir, output_dir): - convert_nkjp(nkjp_dir, output_dir) +def main(): + parser = argparse.ArgumentParser() + parser.add_argument('--input_path', type=str, default="NKJP", help="Where to find the files") + parser.add_argument('--output_path', type=str, default="data/ner", help="Where to output the results") + args = parser.parse_args() + + convert_nkjp(args.input_path, args.output_path) if __name__ == '__main__': |