MCPcopy Create free account
hub / github.com/huggingface/evaluate / setUp

Method setUp

tests/test_evaluator.py:243–251  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

241
242class TestTextClassificationEvaluator(TestCase):
243 def setUp(self):
244 self.data = Dataset.from_dict({"label": [1, 0], "text": ["great movie", "horrible movie"]})
245 self.default_model = "lvwerra/distilbert-imdb"
246 self.input_column = "text"
247 self.label_column = "label"
248 self.pipe = DummyTextClassificationPipeline()
249 self.perf_pipe = DummyTextClassificationPipeline(sleep_time=0.1)
250 self.evaluator = evaluator("text-classification")
251 self.label_mapping = {"NEGATIVE": 0.0, "POSITIVE": 1.0}
252
253 def test_pipe_init(self):
254 results = self.evaluator.compute(

Callers

nothing calls this directly

Calls 3

evaluatorFunction · 0.90
from_dictMethod · 0.80

Tested by

no test coverage detected