Skip to content

Commit

Permalink
Merge pull request #8 from Liangtaiwan/master
Browse files Browse the repository at this point in the history
fix bugs
  • Loading branch information
shmsw25 authored Mar 18, 2020
2 parents 83051e1 + 5f24f6a commit 5620861
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions evaluate_qa.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ def get_nbest_json(prelim_predictions):
nbest_json = get_nbest_json([pred for pred in prelim_predictions if \
pred.paragraph_index<n])
all_predictions[example.qas_id].append(nbest_json[0]["text"])
all_predictions[example.qas_id].append(example.all_answers)

if write_prediction:
logger.info("Writing predictions to: %s" % (output_prediction_file))
Expand Down
2 changes: 2 additions & 0 deletions prepro.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ def is_whitespace(c):
start_position=start_positions_list,
end_position=end_positions_list,
switch=switches_list))
if "test" in input_file:
return examples
n_answers = []
for example in examples:
has_answer=False
Expand Down

0 comments on commit 5620861

Please sign in to comment.