Spaces:
Sleeping
Sleeping
update tests
Browse files- tests/model_tests.py +6 -7
tests/model_tests.py
CHANGED
@@ -18,19 +18,18 @@ class TestClassifier(unittest.TestCase):
|
|
18 |
def test_response(self):
|
19 |
"""Test if the response of the main function is correct"""
|
20 |
text = "حاجة حلوة اكيد"
|
21 |
-
predictions
|
22 |
self.assertEqual(len(predictions), 3)
|
23 |
-
self.assertEqual(len(probabilities), 3)
|
24 |
for i in range(3):
|
25 |
-
self.assertIn(predictions[i], self.dialects)
|
26 |
-
self.assertGreaterEqual(
|
27 |
-
self.assertLessEqual(
|
28 |
|
29 |
def test_model_output(self):
|
30 |
"""Test that the model correctly classifies obvious dialects"""
|
31 |
for country, text, in self.test_set.items():
|
32 |
-
|
33 |
-
self.assertEqual(
|
34 |
|
35 |
|
36 |
if __name__ == "__main__":
|
|
|
18 |
def test_response(self):
|
19 |
"""Test if the response of the main function is correct"""
|
20 |
text = "حاجة حلوة اكيد"
|
21 |
+
predictions = classify_arabic_dialect(text)
|
22 |
self.assertEqual(len(predictions), 3)
|
|
|
23 |
for i in range(3):
|
24 |
+
self.assertIn(predictions[i][0], self.dialects)
|
25 |
+
self.assertGreaterEqual(predictions[i][1], 0)
|
26 |
+
self.assertLessEqual(predictions[i][1], 1)
|
27 |
|
28 |
def test_model_output(self):
|
29 |
"""Test that the model correctly classifies obvious dialects"""
|
30 |
for country, text, in self.test_set.items():
|
31 |
+
first_prediction, _, _ = classify_arabic_dialect(text)
|
32 |
+
self.assertEqual(first_prediction[0], country)
|
33 |
|
34 |
|
35 |
if __name__ == "__main__":
|