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:
@@ -344,7 +344,7 @@ def main():
|
|||||||
if training_args.do_predict:
|
if training_args.do_predict:
|
||||||
logger.info("*** Predict ***")
|
logger.info("*** Predict ***")
|
||||||
|
|
||||||
test_dataset = datasets["test"]
|
test_dataset = tokenized_datasets["test"]
|
||||||
predictions, labels, metrics = trainer.predict(test_dataset)
|
predictions, labels, metrics = trainer.predict(test_dataset)
|
||||||
predictions = np.argmax(predictions, axis=2)
|
predictions = np.argmax(predictions, axis=2)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user