Spaces:
Sleeping
Sleeping
added the remaining categories
Browse files
utils.py
CHANGED
@@ -12,53 +12,52 @@ ai_audit_analysis_categories = {
|
|
12 |
],
|
13 |
|
14 |
"GDPR": [
|
15 |
-
"
|
16 |
-
"
|
17 |
-
"
|
18 |
-
"
|
19 |
|
20 |
"Toxicity": [
|
21 |
-
"
|
22 |
-
"
|
23 |
-
"
|
24 |
-
"
|
25 |
|
26 |
"Legal": [
|
27 |
-
"
|
28 |
-
"
|
29 |
-
"
|
30 |
-
"GDPR Compliance"],
|
31 |
|
32 |
"Context": [
|
33 |
-
"
|
34 |
-
"
|
35 |
-
"
|
36 |
"Explainability"],
|
37 |
|
38 |
"Governance": [
|
39 |
-
"
|
40 |
-
"
|
41 |
-
"
|
42 |
-
"
|
43 |
"Explainability"
|
44 |
-
"
|
45 |
|
46 |
"RiskManagement": [
|
47 |
-
"
|
48 |
-
"
|
49 |
-
"
|
50 |
-
"Risk Management"],
|
51 |
|
52 |
"Robustness": [
|
53 |
-
"
|
54 |
-
"
|
55 |
-
"
|
|
|
56 |
|
57 |
"Sustainability": [
|
58 |
-
"
|
59 |
-
"
|
60 |
-
"
|
61 |
-
"
|
62 |
}
|
63 |
|
64 |
|
@@ -128,7 +127,179 @@ JSON_SCHEMAS = {
|
|
128 |
"toxicity_level": "string (none, low, medium, high)",
|
129 |
"toxicity_flags": "array of strings (specific words or phrases contributing to toxicity)",
|
130 |
"contextual_factors": "array of objects (additional contextual elements influencing toxicity interpretation)"
|
131 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
132 |
}
|
133 |
|
134 |
|
|
|
12 |
],
|
13 |
|
14 |
"GDPR": [
|
15 |
+
"Consent_and_Transparency",
|
16 |
+
"Data_Security",
|
17 |
+
"Privacy_Assessment",
|
18 |
+
"Environmental_Impact"],
|
19 |
|
20 |
"Toxicity": [
|
21 |
+
"Content_Moderation",
|
22 |
+
"Reporting_Mechanism",
|
23 |
+
"Content_Guidelines",
|
24 |
+
"User_Education"],
|
25 |
|
26 |
"Legal": [
|
27 |
+
"Privacy_Policy",
|
28 |
+
"Data_Retention",
|
29 |
+
"Consent_Mechanism"],
|
|
|
30 |
|
31 |
"Context": [
|
32 |
+
"Ethical_AI",
|
33 |
+
"Bais_Mitigation",
|
34 |
+
"Fairness_Assestment",
|
35 |
"Explainability"],
|
36 |
|
37 |
"Governance": [
|
38 |
+
"Model_development",
|
39 |
+
"Data_Quality",
|
40 |
+
"Bais_Mitigation",
|
41 |
+
"Fairness_Assestment"
|
42 |
"Explainability"
|
43 |
+
"User_Input"],
|
44 |
|
45 |
"RiskManagement": [
|
46 |
+
"Corporate_Ethics",
|
47 |
+
"Board_Management",
|
48 |
+
"Stakeholder_Engagement"],
|
|
|
49 |
|
50 |
"Robustness": [
|
51 |
+
"System_Reliability",
|
52 |
+
"Quality_Assurance",
|
53 |
+
"Stress_Testing",
|
54 |
+
"Fail_Safe_Procedures"],
|
55 |
|
56 |
"Sustainability": [
|
57 |
+
"Renewable_Resources",
|
58 |
+
"Waste_Reduction",
|
59 |
+
"Energy_Efficiency",
|
60 |
+
"Sustainable_Practices"]
|
61 |
}
|
62 |
|
63 |
|
|
|
127 |
"toxicity_level": "string (none, low, medium, high)",
|
128 |
"toxicity_flags": "array of strings (specific words or phrases contributing to toxicity)",
|
129 |
"contextual_factors": "array of objects (additional contextual elements influencing toxicity interpretation)"
|
130 |
+
},
|
131 |
+
|
132 |
+
# GDPR-related schemas
|
133 |
+
"Consent_and_Transparency": {
|
134 |
+
"consent_obtained": "boolean",
|
135 |
+
"transparency_level": "string (low, medium, high)",
|
136 |
+
"missing_information": "array of strings (information not clearly presented or missing)",
|
137 |
+
"user_understanding": "string (poor, average, good)"
|
138 |
+
},
|
139 |
+
"Data_Security": {
|
140 |
+
"security_status": "string (secure, at risk, breached)",
|
141 |
+
"vulnerability_points": "array of strings (specific areas of potential vulnerability)",
|
142 |
+
"data_encryption": "boolean",
|
143 |
+
"compliance_status": "string (compliant, partially compliant, non-compliant)"
|
144 |
+
},
|
145 |
+
"Environmental_Impact": {
|
146 |
+
"carbon_footprint": "number (metric tons of CO2 equivalent)",
|
147 |
+
"energy_efficiency": "string (low, moderate, high)",
|
148 |
+
"sustainable_practices": "boolean",
|
149 |
+
"environmental_impact_score": "number (0-100)"
|
150 |
+
},
|
151 |
+
"Privacy_Assessment": {
|
152 |
+
"overall_privacy_status": "string (positive, negative)" ,
|
153 |
+
"privacy_policy_compliance": "string (compliant, partially compliant, non-compliant)",
|
154 |
+
"data_minimization": "boolean",
|
155 |
+
"user_data_accessibility": "string (none, limited, full)",
|
156 |
+
"anonymization": "boolean"
|
157 |
+
},
|
158 |
+
|
159 |
+
# Toxicity-related schemas
|
160 |
+
"Content_Moderation": {
|
161 |
+
"moderation_effectiveness": "string (low, medium, high)",
|
162 |
+
"moderated_content_types": "array of strings (types of content being moderated)",
|
163 |
+
"automated_moderation": "boolean",
|
164 |
+
"human_moderation": "boolean"
|
165 |
+
},
|
166 |
+
"Reporting_Mechanism": {
|
167 |
+
"reporting_ease": "string (easy, moderate, difficult)",
|
168 |
+
"response_time": "string (fast, average, slow)",
|
169 |
+
"report_feedback": "string (detailed, minimal, none)"
|
170 |
+
},
|
171 |
+
"Content_Guidelines": {
|
172 |
+
"clarity": "string (clear, somewhat clear, unclear)",
|
173 |
+
"comprehensiveness": "string (comprehensive, partial, lacking)",
|
174 |
+
"enforcement_consistency": "string (consistent, inconsistent)"
|
175 |
+
},
|
176 |
+
"User_Education": {
|
177 |
+
"educational_resources_available": "boolean",
|
178 |
+
"resource_accessibility": "string (easy, moderate, difficult)",
|
179 |
+
"user_comprehension_level": "string (high, medium, low)"
|
180 |
+
},
|
181 |
+
|
182 |
+
# Legal-related schemas
|
183 |
+
"Privacy_Policy": {
|
184 |
+
"clarity": "string (clear, somewhat clear, unclear)",
|
185 |
+
"compliance": "string (compliant, partially compliant, non-compliant)",
|
186 |
+
"user_rights": "array of strings (specific rights mentioned in policy)"
|
187 |
+
},
|
188 |
+
"Consent_Mechanism": {
|
189 |
+
"mechanism_clarity": "string (clear, somewhat clear, unclear)",
|
190 |
+
"user_control": "boolean",
|
191 |
+
"opt_in_out": "string (opt-in, opt-out, not applicable)"
|
192 |
+
},
|
193 |
+
"GDPR_Compliance": {
|
194 |
+
"compliance_level": "string (fully compliant, partially compliant, non-compliant)",
|
195 |
+
"data_protection_officer": "boolean",
|
196 |
+
"breach_notification": "boolean"
|
197 |
+
},
|
198 |
+
|
199 |
+
# Context-related schemas
|
200 |
+
"Ethical_AI": {
|
201 |
+
"ethical_standards_adherence": "string (high, medium, low)",
|
202 |
+
"ethical_issues_identified": "array of strings",
|
203 |
+
"mitigation_measures": "array of strings"
|
204 |
+
},
|
205 |
+
"Bias_Mitigation": {
|
206 |
+
"bias_identified": "boolean",
|
207 |
+
"bias_types": "array of strings",
|
208 |
+
"mitigation_strategies": "array of strings"
|
209 |
+
},
|
210 |
+
"Fairness_Assessment": {
|
211 |
+
"fairness_level": "string (high, medium, low)",
|
212 |
+
"affected_groups": "array of strings",
|
213 |
+
"improvement_recommendations": "array of strings"
|
214 |
+
},
|
215 |
+
"Explainability": {
|
216 |
+
"model_transparency": "string (transparent, opaque)",
|
217 |
+
"explanation_comprehensibility": "string (high, medium, low)",
|
218 |
+
"user_friendly_explanations": "boolean"
|
219 |
+
},
|
220 |
+
|
221 |
+
# Governance-related schemas
|
222 |
+
"Model_Development": {
|
223 |
+
"development_process": "string (structured, ad-hoc, undefined)",
|
224 |
+
"team_composition": "array of strings (roles involved)",
|
225 |
+
"ethics_considerations": "boolean"
|
226 |
+
},
|
227 |
+
"Data_Quality": {
|
228 |
+
"accuracy_level": "string (high, medium, low)",
|
229 |
+
"completeness": "string (complete, partial, incomplete)",
|
230 |
+
"timeliness": "string (up-to-date, outdated)"
|
231 |
+
},
|
232 |
+
"User_Input": {
|
233 |
+
"user_feedback_mechanism": "boolean",
|
234 |
+
"feedback_responsiveness": "string (responsive, moderately responsive, unresponsive)",
|
235 |
+
"user_input_impact": "string (high, medium, low)"
|
236 |
+
},
|
237 |
+
|
238 |
+
# Risk Management-related schemas
|
239 |
+
"Corporate_Ethics": {
|
240 |
+
"ethics_code": "string (exists, partial, none)",
|
241 |
+
"employee_training": "boolean",
|
242 |
+
"ethics_violations": "array of strings"
|
243 |
+
},
|
244 |
+
"Board_Management": {
|
245 |
+
"board_structure": "string (effective, average, ineffective)",
|
246 |
+
"board_diversity": "boolean",
|
247 |
+
"board_ethics_compliance": "string (compliant, non-compliant)"
|
248 |
+
},
|
249 |
+
"Stakeholder_Engagement": {
|
250 |
+
"stakeholder_inclusion": "string (inclusive, partially inclusive, exclusive)",
|
251 |
+
"feedback_mechanism": "boolean",
|
252 |
+
"stakeholder_satisfaction": "string (high, medium, low)"
|
253 |
+
},
|
254 |
+
"Risk_Management": {
|
255 |
+
"risk_identification": "boolean",
|
256 |
+
"risk_mitigation_strategies": "array of strings",
|
257 |
+
"risk_monitoring": "boolean"
|
258 |
+
},
|
259 |
+
|
260 |
+
# Robustness-related schemas
|
261 |
+
"System_Reliability": {
|
262 |
+
"uptime_percentage": "number (0-100)",
|
263 |
+
"system_resilience": "string (high, medium, low)",
|
264 |
+
"redundancy_measures": "boolean"
|
265 |
+
},
|
266 |
+
"Quality_Assurance": {
|
267 |
+
"quality_standards": "array of strings",
|
268 |
+
"testing_frequency": "string (frequent, occasional, rare)",
|
269 |
+
"quality_assurance_compliance": "string (compliant, partially compliant, non-compliant)"
|
270 |
+
},
|
271 |
+
"Stress_Testing": {
|
272 |
+
"stress_test_pass_rate": "number (0-100)",
|
273 |
+
"identified_weaknesses": "array of strings",
|
274 |
+
"improvement_actions": "array of strings"
|
275 |
+
},
|
276 |
+
"Fail_Safe_Procedures": {
|
277 |
+
"procedures_defined": "boolean",
|
278 |
+
"execution_frequency": "string (regular, occasional, never)",
|
279 |
+
"effectiveness": "string (effective, partially effective, ineffective)"
|
280 |
+
},
|
281 |
+
|
282 |
+
# Sustainability-related schemas
|
283 |
+
"Renewable_Resources": {
|
284 |
+
"resource_usage": "string (high, moderate, low)",
|
285 |
+
"renewable_resource_percentage": "number (0-100)",
|
286 |
+
"sustainability_goals": "boolean"
|
287 |
+
},
|
288 |
+
"Waste_Reduction": {
|
289 |
+
"waste_management_practices": "string (effective, average, poor)",
|
290 |
+
"reduction_rate": "number (0-100)",
|
291 |
+
"recycling_initiatives": "boolean"
|
292 |
+
},
|
293 |
+
"Energy_Efficiency": {
|
294 |
+
"energy_consumption": "string (high, moderate, low)",
|
295 |
+
"energy_saving_measures": "array of strings",
|
296 |
+
"energy_audit": "boolean"
|
297 |
+
},
|
298 |
+
"Sustainable_Practices": {
|
299 |
+
"practice_adoption": "string (widespread, partial, none)",
|
300 |
+
"sustainability_training": "boolean",
|
301 |
+
"sustainability_impact": "string (high, medium, low)"
|
302 |
+
}
|
303 |
}
|
304 |
|
305 |
|