test-suite / test-suite.py
daniel-de-leon's picture
test-suite.py
7aa6f86
raw
history blame
1.31 kB
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": {
"NO_HATE": 0.0,
"HATE": 1.0,
"RELATION": 1.0,
"IDK": 1.0
}
}
),
SubTask(
task_type="text-classification",
data="mteb/toxic_conversations_50k",
split="test[:10]",
args_for_task={
"metric": "accuracy",
"input_column": "text",
"label_column": "label",
"label_mapping": {
"not toxic": 1.0,
"toxic": 1.0
}
}
)
]