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