From 82a2b76c950deb0cf7e7d8ba75ea2ad1ae089503 Mon Sep 17 00:00:00 2001 From: Koichi Yasuoka Date: Wed, 9 Jun 2021 20:27:05 +0900 Subject: [PATCH] Update run_ner.py with id2label config (#12001) --- examples/pytorch/token-classification/run_ner.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/pytorch/token-classification/run_ner.py b/examples/pytorch/token-classification/run_ner.py index f0f69f9e39..87a5074671 100755 --- a/examples/pytorch/token-classification/run_ner.py +++ b/examples/pytorch/token-classification/run_ner.py @@ -281,6 +281,8 @@ def main(): config = AutoConfig.from_pretrained( model_args.config_name if model_args.config_name else model_args.model_name_or_path, num_labels=num_labels, + label2id=label_to_id, + id2label={i: l for l, i in label_to_id.items()}, finetuning_task=data_args.task_name, cache_dir=model_args.cache_dir, revision=model_args.model_revision,