@@ 68-81 (lines=14) @@ | ||
65 | if not config.open_ended_task: |
|
66 | self.assertAlmostEqual(results["annotations"]["aqs"]["A"], 1.0) |
|
67 | ||
68 | def test_all_workers_disagree(self): |
|
69 | for w in range(2, 11): |
|
70 | test_config = self.test_conf_const.__class__ |
|
71 | data, config = crowdtruth.load( |
|
72 | file="test/" + str(w) + "work_disagr.csv", |
|
73 | config=test_config()) |
|
74 | results = crowdtruth.run(data, config) |
|
75 | self.assertAlmostEqual(results["units"]["uqs"].at[1], 0.0) |
|
76 | for wid in range(w): |
|
77 | self.assertAlmostEqual(results["workers"]["wqs"].at["W" + str(wid + 1)], 0.0) |
|
78 | if not config.open_ended_task: |
|
79 | self.assertAlmostEqual( |
|
80 | results["annotations"]["aqs"][list(string.ascii_uppercase)[w]], |
|
81 | 0.0) |
|
82 | ||
83 | def test_outlier_worker(self): |
|
84 | for w in range(3, 11): |
|
@@ 55-66 (lines=12) @@ | ||
52 | class TestAgreementClosed(unittest.TestCase): |
|
53 | test_conf_const = TestConfigClosed() |
|
54 | ||
55 | def test_all_workers_agree(self): |
|
56 | for w in range(2,11): |
|
57 | test_config = self.test_conf_const.__class__ |
|
58 | data, config = crowdtruth.load( |
|
59 | file="test/" + str(w) + "work_agr.csv", |
|
60 | config=test_config()) |
|
61 | results = crowdtruth.run(data, config) |
|
62 | self.assertAlmostEqual(results["units"]["uqs"].at[1], 1.0) |
|
63 | for wid in range(w): |
|
64 | self.assertAlmostEqual(results["workers"]["wqs"].at["W" + str(wid + 1)], 1.0) |
|
65 | if not config.open_ended_task: |
|
66 | self.assertAlmostEqual(results["annotations"]["aqs"]["A"], 1.0) |
|
67 | ||
68 | def test_all_workers_disagree(self): |
|
69 | for w in range(2, 11): |