move xnli_compute_metrics to data/metrics

This commit is contained in:
VictorSanh
2019-11-05 12:53:08 -05:00
committed by Lysandre Debut
parent 73fe2e7385
commit bcd8dc6b48
4 changed files with 10 additions and 9 deletions

View File

@@ -73,13 +73,6 @@ class XnliProcessor(DataProcessor):
"""See base class."""
return ["contradiction", "entailment", "neutral"]
def xnli_compute_metrics(task_name, preds, labels):
assert len(preds) == len(labels)
if task_name == "xnli":
return {"acc": simple_accuracy(preds, labels)}
else:
raise ValueError('{} is not a supported task.'.format(task_name))
xnli_processors = {
"xnli": XnliProcessor,
}