Correct max position for SQUAD and TFDS
This commit is contained in:
1 parent
62c1fc3c1e
commit
a1f1dce0ae
1 file changed
+3
-1
@@ -571,7 +571,9 @@ class SquadExample(object):
|
||||
# Start end end positions only has a value during evaluation.
|
||||
if start_position_character is not None and not is_impossible:
|
||||
self.start_position = char_to_word_offset[start_position_character]
|
||||
self.end_position = char_to_word_offset[start_position_character + len(answer_text) - 1]
|
||||
self.end_position = char_to_word_offset[
|
||||
min(start_position_character + len(answer_text) - 1, len(char_to_word_offset) - 1)
|
||||
]
|
||||
|
||||
|
||||
class SquadFeatures(object):
|
||||
|
||||
Reference in new issue
Block a user