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
43c24325
Commit
43c24325
authored
Aug 28, 2019
by
erenup
Browse files
avoid invalid labels of truth
parent
3c7e676f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
examples/single_model_scripts/utils_multiple_choice.py
examples/single_model_scripts/utils_multiple_choice.py
+2
-0
No files found.
examples/single_model_scripts/utils_multiple_choice.py
View file @
43c24325
...
@@ -249,6 +249,7 @@ class ArcProcessor(DataProcessor):
...
@@ -249,6 +249,7 @@ class ArcProcessor(DataProcessor):
return
int
(
truth
)
-
1
return
int
(
truth
)
-
1
else
:
else
:
logger
.
info
(
"truth ERROR!"
)
logger
.
info
(
"truth ERROR!"
)
examples
=
[]
examples
=
[]
three_choice
=
0
three_choice
=
0
four_choice
=
0
four_choice
=
0
...
@@ -267,6 +268,7 @@ class ArcProcessor(DataProcessor):
...
@@ -267,6 +268,7 @@ class ArcProcessor(DataProcessor):
continue
continue
four_choice
+=
1
four_choice
+=
1
truth
=
str
(
normalize
(
data_raw
[
"answerKey"
]))
truth
=
str
(
normalize
(
data_raw
[
"answerKey"
]))
assert
truth
is
not
None
question_choices
=
data_raw
[
"question"
]
question_choices
=
data_raw
[
"question"
]
question
=
question_choices
[
"stem"
]
question
=
question_choices
[
"stem"
]
id
=
data_raw
[
"id"
]
id
=
data_raw
[
"id"
]
...
...
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