Spaces:
Running
Running
fixed arguments for each aggregation test
Browse files
tests.py
CHANGED
@@ -265,6 +265,7 @@ class TestSemF1(unittest.TestCase):
|
|
265 |
aggregate=True,
|
266 |
)
|
267 |
self.assertIsInstance(scores, Scores)
|
|
|
268 |
|
269 |
def test_aggregate_untokenized_single_ref(self):
|
270 |
scores = self.semf1_metric.compute(
|
@@ -278,12 +279,13 @@ class TestSemF1(unittest.TestCase):
|
|
278 |
aggregate=True,
|
279 |
)
|
280 |
self.assertIsInstance(scores, Scores)
|
|
|
281 |
|
282 |
def test_aggregate_tokenized_single_ref(self):
|
283 |
scores = self.semf1_metric.compute(
|
284 |
predictions=self.tokenized_single_reference_predictions,
|
285 |
references=self.tokenized_single_reference_references,
|
286 |
-
tokenize_sentences=
|
287 |
multi_references=False,
|
288 |
gpu=False,
|
289 |
batch_size=32,
|
@@ -291,38 +293,41 @@ class TestSemF1(unittest.TestCase):
|
|
291 |
aggregate=True,
|
292 |
)
|
293 |
self.assertIsInstance(scores, Scores)
|
|
|
294 |
|
295 |
def test_aggregate_untokenized_multi_ref(self):
|
296 |
scores = self.semf1_metric.compute(
|
297 |
predictions=self.untokenized_multi_reference_predictions,
|
298 |
references=self.untokenized_multi_reference_references,
|
299 |
tokenize_sentences=True,
|
300 |
-
multi_references=
|
301 |
gpu=False,
|
302 |
batch_size=32,
|
303 |
verbose=False,
|
304 |
aggregate=True,
|
305 |
)
|
306 |
self.assertIsInstance(scores, Scores)
|
|
|
307 |
|
308 |
def test_aggregate_tokenized_multi_ref(self):
|
309 |
scores = self.semf1_metric.compute(
|
310 |
predictions=self.tokenized_multi_reference_predictions,
|
311 |
references=self.tokenized_multi_reference_references,
|
312 |
-
tokenize_sentences=
|
313 |
-
multi_references=
|
314 |
gpu=False,
|
315 |
batch_size=32,
|
316 |
verbose=False,
|
317 |
aggregate=True,
|
318 |
)
|
319 |
self.assertIsInstance(scores, Scores)
|
|
|
320 |
|
321 |
def test_aggregate_same_pred_and_ref(self):
|
322 |
scores = self.semf1_metric.compute(
|
323 |
predictions=self.tokenized_single_reference_predictions,
|
324 |
references=self.tokenized_single_reference_predictions,
|
325 |
-
tokenize_sentences=
|
326 |
multi_references=False,
|
327 |
gpu=False,
|
328 |
batch_size=32,
|
@@ -330,6 +335,7 @@ class TestSemF1(unittest.TestCase):
|
|
330 |
aggregate=True,
|
331 |
)
|
332 |
self.assertIsInstance(scores, Scores)
|
|
|
333 |
|
334 |
def test_untokenized_single_reference(self):
|
335 |
scores = self.semf1_metric.compute(
|
|
|
265 |
aggregate=True,
|
266 |
)
|
267 |
self.assertIsInstance(scores, Scores)
|
268 |
+
print(f'Score: {scores}')
|
269 |
|
270 |
def test_aggregate_untokenized_single_ref(self):
|
271 |
scores = self.semf1_metric.compute(
|
|
|
279 |
aggregate=True,
|
280 |
)
|
281 |
self.assertIsInstance(scores, Scores)
|
282 |
+
print(f'Score: {scores}')
|
283 |
|
284 |
def test_aggregate_tokenized_single_ref(self):
|
285 |
scores = self.semf1_metric.compute(
|
286 |
predictions=self.tokenized_single_reference_predictions,
|
287 |
references=self.tokenized_single_reference_references,
|
288 |
+
tokenize_sentences=False,
|
289 |
multi_references=False,
|
290 |
gpu=False,
|
291 |
batch_size=32,
|
|
|
293 |
aggregate=True,
|
294 |
)
|
295 |
self.assertIsInstance(scores, Scores)
|
296 |
+
print(f'Score: {scores}')
|
297 |
|
298 |
def test_aggregate_untokenized_multi_ref(self):
|
299 |
scores = self.semf1_metric.compute(
|
300 |
predictions=self.untokenized_multi_reference_predictions,
|
301 |
references=self.untokenized_multi_reference_references,
|
302 |
tokenize_sentences=True,
|
303 |
+
multi_references=True,
|
304 |
gpu=False,
|
305 |
batch_size=32,
|
306 |
verbose=False,
|
307 |
aggregate=True,
|
308 |
)
|
309 |
self.assertIsInstance(scores, Scores)
|
310 |
+
print(f'Score: {scores}')
|
311 |
|
312 |
def test_aggregate_tokenized_multi_ref(self):
|
313 |
scores = self.semf1_metric.compute(
|
314 |
predictions=self.tokenized_multi_reference_predictions,
|
315 |
references=self.tokenized_multi_reference_references,
|
316 |
+
tokenize_sentences=False,
|
317 |
+
multi_references=True,
|
318 |
gpu=False,
|
319 |
batch_size=32,
|
320 |
verbose=False,
|
321 |
aggregate=True,
|
322 |
)
|
323 |
self.assertIsInstance(scores, Scores)
|
324 |
+
print(f'Score: {scores}')
|
325 |
|
326 |
def test_aggregate_same_pred_and_ref(self):
|
327 |
scores = self.semf1_metric.compute(
|
328 |
predictions=self.tokenized_single_reference_predictions,
|
329 |
references=self.tokenized_single_reference_predictions,
|
330 |
+
tokenize_sentences=False,
|
331 |
multi_references=False,
|
332 |
gpu=False,
|
333 |
batch_size=32,
|
|
|
335 |
aggregate=True,
|
336 |
)
|
337 |
self.assertIsInstance(scores, Scores)
|
338 |
+
print(f'Score: {scores}')
|
339 |
|
340 |
def test_untokenized_single_reference(self):
|
341 |
scores = self.semf1_metric.compute(
|