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
d7e32489
Commit
d7e32489
authored
Dec 29, 2021
by
thomasw21
Browse files
Pretty sure questions need to be paragraph dependent also
parent
0bde7589
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
lm_eval/metrics.py
lm_eval/metrics.py
+4
-3
lm_eval/tasks/superglue.py
lm_eval/tasks/superglue.py
+1
-1
No files found.
lm_eval/metrics.py
View file @
d7e32489
...
...
@@ -52,13 +52,14 @@ def acc_all(items):
docs
=
list
(
zip
(
*
items
))[
1
]
for
doc
,
pred
in
zip
(
docs
,
preds
):
paragraph_id
=
doc
[
"idx"
][
"paragraph"
]
question_id
=
doc
[
"idx"
][
"question"
]
if
question_id
not
in
question_scoring_dict
:
question_scoring_dict
[
question_id
]
=
[]
if
(
paragraph_id
,
question_id
)
not
in
question_scoring_dict
:
question_scoring_dict
[
(
paragraph_id
,
question_id
)
]
=
[]
gold_label
=
doc
[
"label"
]
==
1
question_scoring_dict
[
question_id
].
append
(
gold_label
==
pred
)
question_scoring_dict
[(
paragraph_id
,
question_id
)].
append
(
gold_label
==
pred
)
acc
=
np
.
mean
([
int
(
all
(
x
))
for
x
in
question_scoring_dict
.
values
()])
return
acc
...
...
lm_eval/tasks/superglue.py
View file @
d7e32489
...
...
@@ -202,7 +202,7 @@ class Copa(HFTask):
class
MultiRC
(
HFTask
):
VERSION
=
0
VERSION
=
1
DATASET_PATH
=
"super_glue"
DATASET_NAME
=
"multirc"
...
...
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