1
0
mirror of https://github.com/gsi-upm/senpy synced 2025-09-13 10:02:20 +00:00

Several changes

* Add flag to run tests
* Add ntriples outformat
This commit is contained in:
J. Fernando Sánchez
2018-07-04 16:14:09 +02:00
parent 13cf0c71c5
commit 00ffbb3804
11 changed files with 103 additions and 72 deletions

View File

@@ -6,7 +6,7 @@ import pickle
import shutil
import tempfile
from unittest import TestCase, skipIf
from unittest import TestCase
from senpy.models import Results, Entry, EmotionSet, Emotion, Plugins
from senpy import plugins
from senpy.plugins.conversion.emotion.centroids import CentroidConversion
@@ -312,9 +312,7 @@ class PluginsTest(TestCase):
res = c._backwards_conversion(e)
assert res["onyx:hasEmotionCategory"] == "c2"
@skipIf(sys.version_info < (3, 0),
reason="requires Python3")
def test_evaluation(self):
def _test_evaluation(self):
testdata = []
for i in range(50):
testdata.append(["good", 1])
@@ -348,6 +346,14 @@ class PluginsTest(TestCase):
smart_metrics = results[0].metrics[0]
assert abs(smart_metrics['accuracy'] - 1) < 0.01
def test_evaluation(self):
if sys.version_info < (3, 0):
with self.assertRaises(Exception) as context:
self._test_evaluation()
self.assertTrue('GSITK ' in str(context.exception))
else:
self._test_evaluation()
def make_mini_test(fpath):
def mini_test(self):