File size: 1,016 Bytes
8777ff1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import evaluate
from evaluate.evaluation_suite import SubTask


class Suite(evaluate.EvaluationSuite):

    def __init__(self, name):
        super().__init__(name)
        self.metric = evaluate.load("accuracy")
        self.preprocessor = lambda x: {"text": x["text"].lower()}
        self.suite = [
            {
                SubTask(
                    task_type="text-classification",
                    data="glue",
                    subset="mnli",
                    split="validation",
                    args_for_task={
                        "metric": self.metric,
                        "input_column": "premise",
                        "second_input_column": "hypothesis",
                        "label_column": "label",
                        "label_mapping": {
                            "ENTAILMENT": 0,
                            "NEUTRAL": 1,
                            "CONTRADICTION": 2,
                        },
                    },
                )
            }
        ]