File size: 821 Bytes
6a9cefc
 
 
 
 
 
 
 
 
 
 
 
17ee47c
 
6a9cefc
 
17ee47c
6a9cefc
 
06973e4
 
 
 
6a9cefc
 
 
 
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
import evaluate
from evaluate.evaluation_suite import SubTask


class Suite(evaluate.EvaluationSuite):

    def __init__(self, name):
        super().__init__(name)
        self.preprocessor = lambda x: {"text": x["text"].lower()}
        self.suite = [
            SubTask(
                task_type="text-classification",
                data="hate_speech18",
                split="train[:10]",
                args_for_task={
                    "metric": "accuracy",
                    "input_column": "text",
                    "label_column": "label",
                    "label_mapping": {
                        "noHate": 0.0,
                        "hate": 1.0,
                        "relation": 1.0,
                        "idk/skip": 1.0
                    }
                }
            )
        ]