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
4604f458
Commit
4604f458
authored
Sep 18, 2022
by
kabbi159
Browse files
Remove f1 metric
parent
f60f1753
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
13 deletions
+1
-13
lm_eval/tasks/kobest.py
lm_eval/tasks/kobest.py
+1
-13
No files found.
lm_eval/tasks/kobest.py
View file @
4604f458
...
...
@@ -21,7 +21,7 @@ Homepage: https://huggingface.co/datasets/skt/kobest_v1
import
numpy
as
np
from
lm_eval.base
import
MultipleChoiceTask
,
rf
,
Task
from
lm_eval.metrics
import
f1_score
,
macro_f1_score
,
mean
from
lm_eval.metrics
import
macro_f1_score
,
mean
class
BoolQ
(
Task
):
...
...
@@ -65,21 +65,18 @@ class BoolQ(Task):
pred
=
np
.
argmax
(
results
)
gold
=
doc
[
"label"
]
return
{
"f1"
:
(
gold
,
pred
),
"acc"
:
pred
==
gold
,
"macro_f1"
:
(
gold
,
pred
)
}
def
higher_is_better
(
self
):
return
{
"f1"
:
True
,
"acc"
:
True
,
"macro_f1"
:
True
}
def
aggregation
(
self
):
return
{
"f1"
:
f1_score
,
"acc"
:
mean
,
"macro_f1"
:
macro_f1_score
}
...
...
@@ -137,14 +134,12 @@ class COPA(Task):
pred
=
np
.
argmax
(
results
)
gold
=
doc
[
"label"
]
return
{
"f1"
:
(
gold
,
pred
),
"acc"
:
pred
==
gold
,
"macro_f1"
:
(
gold
,
pred
)
}
def
higher_is_better
(
self
):
return
{
"f1"
:
True
,
"acc"
:
True
,
"macro_f1"
:
True
}
...
...
@@ -152,7 +147,6 @@ class COPA(Task):
def
aggregation
(
self
):
return
{
"f1"
:
f1_score
,
"acc"
:
mean
,
"macro_f1"
:
macro_f1_score
}
...
...
@@ -198,21 +192,18 @@ class WiC(Task):
pred
=
np
.
argmax
(
results
)
gold
=
doc
[
"label"
]
return
{
"f1"
:
(
gold
,
pred
),
"acc"
:
pred
==
gold
,
"macro_f1"
:
(
gold
,
pred
)
}
def
higher_is_better
(
self
):
return
{
"f1"
:
True
,
"acc"
:
True
,
"macro_f1"
:
True
}
def
aggregation
(
self
):
return
{
"f1"
:
f1_score
,
"acc"
:
mean
,
"macro_f1"
:
macro_f1_score
}
...
...
@@ -316,21 +307,18 @@ class SentiNeg(Task):
pred
=
np
.
argmax
(
results
)
gold
=
doc
[
"label"
]
return
{
"f1"
:
(
gold
,
pred
),
"acc"
:
pred
==
gold
,
"macro_f1"
:
(
gold
,
pred
)
}
def
higher_is_better
(
self
):
return
{
"f1"
:
True
,
"acc"
:
True
,
"macro_f1"
:
True
}
def
aggregation
(
self
):
return
{
"f1"
:
f1_score
,
"acc"
:
mean
,
"macro_f1"
:
macro_f1_score
}
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