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
e3c70cad
"include/vscode:/vscode.git/clone" did not exist on "6f26696f90290b013f1bd51f4de178bf189da0be"
Commit
e3c70cad
authored
Aug 22, 2023
by
lintangsutawika
Browse files
fix bleu
parent
26196917
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
6 deletions
+13
-6
lm_eval/tasks/super_glue/cb/t5-prompt.yaml
lm_eval/tasks/super_glue/cb/t5-prompt.yaml
+3
-2
lm_eval/tasks/wmt2016/metrics.py
lm_eval/tasks/wmt2016/metrics.py
+9
-3
lm_eval/tasks/wmt2016/ro_en-t5_prompt.yaml
lm_eval/tasks/wmt2016/ro_en-t5_prompt.yaml
+1
-1
No files found.
lm_eval/tasks/super_glue/cb/t5-prompt.yaml
View file @
e3c70cad
...
@@ -15,5 +15,6 @@ metric_list:
...
@@ -15,5 +15,6 @@ metric_list:
higher_is_better
:
true
higher_is_better
:
true
ignore_case
:
true
ignore_case
:
true
ignore_punctuation
:
true
ignore_punctuation
:
true
-
metric
:
f1
-
metric
:
!function
"
t5_utils.mean_3class_f1"
aggregation
:
!function
"
aggregate.cb_multi_fi"
aggregation
:
!function
"
t5_utils.agg_mean_3class_f1"
higher_is_better
:
true
lm_eval/tasks/wmt2016/metrics.py
View file @
e3c70cad
import
evaluate
import
evaluate
def
bleu
(
references
,
predictions
):
bleu_fn
=
evaluate
.
load
(
'bleu'
)
def
bleu
(
predictions
,
references
):
return
bleu_fn
.
compute
(
predictions
=
predictions
,
references
=
references
)
return
(
predictions
[
0
],
references
[
0
])
def
agg_bleu
(
items
):
bleu_fn
=
evaluate
.
load
(
"bleu"
)
predictions
,
references
=
zip
(
*
items
)
return
bleu_fn
.
compute
(
predictions
=
predictions
,
references
=
references
)[
"bleu"
]
lm_eval/tasks/wmt2016/ro_en-t5_prompt.yaml
View file @
e3c70cad
...
@@ -13,5 +13,5 @@ metric_list:
...
@@ -13,5 +13,5 @@ metric_list:
aggregation
:
mean
aggregation
:
mean
higher_is_better
:
false
higher_is_better
:
false
-
metric
:
!function
metrics.bleu
-
metric
:
!function
metrics.bleu
aggregation
:
mean
aggregation
:
!function
metrics.agg_bleu
higher_is_better
:
true
higher_is_better
:
true
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