@@ 90-103 (lines=14) @@ | ||
87 | if not config.open_ended_task: |
|
88 | self.assertAlmostEqual(results["annotations"]["aqs"]["A"], 1.0) |
|
89 | ||
90 | def test_all_workers_disagree(self): |
|
91 | for w in range(2, 11): |
|
92 | test_config = self.test_conf_const.__class__ |
|
93 | data, config = crowdtruth.load( |
|
94 | file="test/" + str(w) + "work_disagr.csv", |
|
95 | config=test_config()) |
|
96 | results = crowdtruth.run(data, config) |
|
97 | self.assertAlmostEqual(results["units"]["uqs"].at[1], 0.0) |
|
98 | for wid in range(w): |
|
99 | self.assertAlmostEqual(results["workers"]["wqs"].at["W" + str(wid + 1)], 0.0) |
|
100 | if not config.open_ended_task: |
|
101 | self.assertAlmostEqual( |
|
102 | results["annotations"]["aqs"][list(string.ascii_uppercase)[w]], |
|
103 | 0.0) |
|
104 | ||
105 | def test_outlier_worker(self): |
|
106 | for w in range(3, 11): |
|
@@ 77-88 (lines=12) @@ | ||
74 | class TestAgreementClosed(unittest.TestCase): |
|
75 | test_conf_const = TestConfigClosed() |
|
76 | ||
77 | def test_all_workers_agree(self): |
|
78 | for w in range(2,11): |
|
79 | test_config = self.test_conf_const.__class__ |
|
80 | data, config = crowdtruth.load( |
|
81 | file="test/" + str(w) + "work_agr.csv", |
|
82 | config=test_config()) |
|
83 | results = crowdtruth.run(data, config) |
|
84 | self.assertAlmostEqual(results["units"]["uqs"].at[1], 1.0) |
|
85 | for wid in range(w): |
|
86 | self.assertAlmostEqual(results["workers"]["wqs"].at["W" + str(wid + 1)], 1.0) |
|
87 | if not config.open_ended_task: |
|
88 | self.assertAlmostEqual(results["annotations"]["aqs"]["A"], 1.0) |
|
89 | ||
90 | def test_all_workers_disagree(self): |
|
91 | for w in range(2, 11): |