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
f4f7618a
Commit
f4f7618a
authored
Feb 21, 2021
by
Jon Tow
Browse files
Fixes
parent
93ebce43
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
lm_eval/tasks/drop.py
lm_eval/tasks/drop.py
+2
-1
No files found.
lm_eval/tasks/drop.py
View file @
f4f7618a
...
...
@@ -132,7 +132,7 @@ class DROP(Task):
for
pred_index
,
pred_bag
in
enumerate
(
pred_bags
):
print
(
self
.
_is_number_match
(
gold_bag
,
pred_bag
))
if
self
.
_is_number_match
(
gold_bag
,
pred_bag
):
scores
[
gold_index
,
pred_index
]
=
self
.
_bag_f1
(
pre
d_bag
,
gol
d_bag
)
scores
[
gold_index
,
pred_index
]
=
self
.
_bag_f1
(
gol
d_bag
,
pre
d_bag
)
print
(
scores
)
row_ind
,
col_ind
=
linear_sum_assignment
(
-
scores
)
max_scores
=
np
.
zeros
([
max
(
len
(
gold_bags
),
len
(
pred_bags
))])
...
...
@@ -158,6 +158,7 @@ class DROP(Task):
def
tokenize
(
text
):
return
re
.
split
(
" |-"
,
text
)
tokens
=
[
squad_metrics
.
normalize_answer
(
token
)
for
token
in
tokenize
(
answer
)]
tokens
=
[
token
for
token
in
tokens
if
token
.
strip
()]
normalized
=
" "
.
join
(
tokens
).
strip
()
return
normalized
...
...
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