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
gaoqiong
lm-evaluation-harness
Commits
62714855
Commit
62714855
authored
Feb 09, 2021
by
Leo Gao
Browse files
Update RACE format
parent
9b14235d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
+6
-3
lm_eval/tasks/race.py
lm_eval/tasks/race.py
+6
-3
No files found.
lm_eval/tasks/race.py
View file @
62714855
...
...
@@ -82,9 +82,12 @@ class RACE(HFTask):
def
doc_to_text
(
self
,
doc
):
text
=
'Article: '
+
doc
[
'article'
]
+
'
\n\n
'
for
problem
in
doc
[
'problems'
][:
-
1
]:
assert
problem
[
'question'
][
-
6
:]
==
' _ .'
text
+=
problem
[
'question'
][
-
5
:]
+
self
.
get_answer_option
(
problem
)
+
'
\n
'
if
problem
[
'question'
][
-
6
:]
==
' _ .'
:
text
+=
problem
[
'question'
][
-
5
:]
+
self
.
get_answer_option
(
problem
)
+
'
\n
'
else
:
question
=
'Question: '
+
problem
[
'question'
]
+
'
\n
'
answer
=
'Answer: '
+
self
.
get_answer_option
(
problem
)
+
'
\n
'
text
+=
question
+
answer
text
+=
self
.
last_problem
(
doc
)[
'question'
]
return
text
...
...
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