From a38d1c7c318737b85df3be17ff7c5a4733b170de Mon Sep 17 00:00:00 2001 From: sarnoult <31313050+sarnoult@users.noreply.github.com> Date: Wed, 11 Nov 2020 16:28:23 +0100 Subject: [PATCH] Example NER script predicts on tokenized dataset (#8468) The new run_ner.py script tries to run prediction on the input test set `datasets["test"]`, but it should be the tokenized set `tokenized_datasets["test"]` --- examples/token-classification/run_ner.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/token-classification/run_ner.py b/examples/token-classification/run_ner.py index 3eed7098a5..7054dea78c 100644 --- a/examples/token-classification/run_ner.py +++ b/examples/token-classification/run_ner.py @@ -344,7 +344,7 @@ def main(): if training_args.do_predict: logger.info("*** Predict ***") - test_dataset = datasets["test"] + test_dataset = tokenized_datasets["test"] predictions, labels, metrics = trainer.predict(test_dataset) predictions = np.argmax(predictions, axis=2)