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
b106e4f7
Commit
b106e4f7
authored
Oct 21, 2020
by
Charles Foster
Browse files
Updated RACE to use datasets instead of nlp package.
parent
aa125d0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
lm_eval/tasks/race.py
lm_eval/tasks/race.py
+2
-2
No files found.
lm_eval/tasks/race.py
View file @
b106e4f7
from
.
common
import
HFTask
from
.
common
import
HFTask
from
..utils_stream
import
X
,
each
,
apply
,
join
,
filt
,
one
from
..utils_stream
import
X
,
each
,
apply
,
join
,
filt
,
one
import
collections
import
collections
import
nlp
import
datasets
class
RACE
(
HFTask
):
class
RACE
(
HFTask
):
...
@@ -26,7 +26,7 @@ class RACE(HFTask):
...
@@ -26,7 +26,7 @@ class RACE(HFTask):
# is shown that one document is made per passage.
# is shown that one document is made per passage.
r
=
collections
.
defaultdict
(
list
)
r
=
collections
.
defaultdict
(
list
)
for
item
in
nlp
.
load_dataset
(
path
=
self
.
DATASET_PATH
,
name
=
self
.
DATASET_NAME
)[
set
]:
for
item
in
datasets
.
load_dataset
(
path
=
self
.
DATASET_PATH
,
name
=
self
.
DATASET_NAME
)[
set
]:
r
[
item
[
'article'
]].
append
(
item
)
r
[
item
[
'article'
]].
append
(
item
)
res
=
list
(
r
.
values
()
>>
each
(
lambda
x
:
{
res
=
list
(
r
.
values
()
>>
each
(
lambda
x
:
{
...
...
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