Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
transformers
Commits
a1f1dce0
Commit
a1f1dce0
authored
Dec 19, 2019
by
Lysandre
Browse files
Correct max position for SQUAD and TFDS
parent
62c1fc3c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
transformers/data/processors/squad.py
transformers/data/processors/squad.py
+3
-1
No files found.
transformers/data/processors/squad.py
View file @
a1f1dce0
...
@@ -571,7 +571,9 @@ class SquadExample(object):
...
@@ -571,7 +571,9 @@ class SquadExample(object):
# Start end end positions only has a value during evaluation.
# Start end end positions only has a value during evaluation.
if
start_position_character
is
not
None
and
not
is_impossible
:
if
start_position_character
is
not
None
and
not
is_impossible
:
self
.
start_position
=
char_to_word_offset
[
start_position_character
]
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
):
class
SquadFeatures
(
object
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment