Commit b5067932 authored by JessicaOjo's avatar JessicaOjo
Browse files

update afrixnli tasks

parent b84c8c9e
from sklearn.metrics import f1_score
def doc_to_target(doc):
replacements = {
0: 'True',
1: 'Neither',
2: 'False'
}
return replacements[doc["label"]]
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
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