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"]`
This commit is contained in:
sarnoult
2020-11-11 16:28:23 +01:00
committed by GitHub
parent 069b63844c
commit a38d1c7c31

View File

@@ -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)