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
f64b943d
Commit
f64b943d
authored
May 08, 2024
by
Israel Abebe Azime
Browse files
afrimmlu folder update
parent
64490d95
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
13 deletions
+0
-13
lm_eval/tasks/masakhane/utils.py
lm_eval/tasks/masakhane/utils.py
+0
-13
No files found.
lm_eval/tasks/masakhane/utils.py
deleted
100644 → 0
View file @
64490d95
from
sklearn.metrics
import
f1_score
def
doc_to_choice
(
doc
):
choices
=
eval
(
doc
[
"choices"
])
return
choices
def
weighted_f1_score
(
items
):
unzipped_list
=
list
(
zip
(
*
items
))
golds
=
unzipped_list
[
0
]
preds
=
unzipped_list
[
1
]
fscore
=
f1_score
(
golds
,
preds
,
average
=
"weighted"
)
return
fscore
\ No newline at end of file
Prev
1
2
Next
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