Patch evaluation for impossible values + cleanup
This commit is contained in:
@@ -312,7 +312,7 @@ class SquadProcessor(DataProcessor):
|
||||
if not evaluate:
|
||||
answer = tensor_dict['answers']['text'][0].numpy().decode('utf-8')
|
||||
answer_start = tensor_dict['answers']['answer_start'][0].numpy()
|
||||
answers = None
|
||||
answers = []
|
||||
else:
|
||||
answers = [{
|
||||
"answer_start": start.numpy(),
|
||||
@@ -408,7 +408,7 @@ class SquadProcessor(DataProcessor):
|
||||
question_text = qa["question"]
|
||||
start_position_character = None
|
||||
answer_text = None
|
||||
answers = None
|
||||
answers = []
|
||||
|
||||
if "is_impossible" in qa:
|
||||
is_impossible = qa["is_impossible"]
|
||||
@@ -469,7 +469,7 @@ class SquadExample(object):
|
||||
answer_text,
|
||||
start_position_character,
|
||||
title,
|
||||
answers=None,
|
||||
answers=[],
|
||||
is_impossible=False):
|
||||
self.qas_id = qas_id
|
||||
self.question_text = question_text
|
||||
|
||||
@@ -194,7 +194,7 @@ class PreTrainedTokenizer(object):
|
||||
|
||||
@property
|
||||
def pad_token_type_id(self):
|
||||
""" Id of the padding token in the vocabulary. Log an error if used while not having been set. """
|
||||
""" Id of the padding token type in the vocabulary."""
|
||||
return self._pad_token_type_id
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user