Merge pull request #882 from Liangtaiwan/squad_v1_bug

fix squad v1 error (na_prob_file should be None)
This commit is contained in:
Thomas Wolf 2019-07-25 14:59:59 +02:00 committed by GitHub
commit 0b6122e96a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -241,7 +241,10 @@ def evaluate(args, model, tokenizer, prefix=""):
# Compute predictions
output_prediction_file = os.path.join(args.output_dir, "predictions_{}.json".format(prefix))
output_nbest_file = os.path.join(args.output_dir, "nbest_predictions_{}.json".format(prefix))
output_null_log_odds_file = os.path.join(args.output_dir, "null_odds_{}.json".format(prefix))
if args.version_2_with_negative:
output_null_log_odds_file = os.path.join(args.output_dir, "null_odds_{}.json".format(prefix))
else:
output_null_log_odds_file = None
if args.model_type in ['xlnet', 'xlm']:
# XLNet uses a more complex post-processing procedure