Commit 5d662de1 authored by JessicaOjo's avatar JessicaOjo
Browse files

add f1 score to mgsm

parent d66d6ca1
from sklearn.metrics import f1_score
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
......@@ -28,3 +28,11 @@ def doc_to_text(doc):
choice3=choices[2],
choice4=choices[3])
return text
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment