Spaces:
Sleeping
Sleeping
Create reports/explainability.py
Browse files- reports/explainability.py +23 -0
reports/explainability.py
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
def explainability_report(results):
|
| 2 |
+
agencies = {r["agency"] for r in results}
|
| 3 |
+
exemptions = set()
|
| 4 |
+
|
| 5 |
+
for r in results:
|
| 6 |
+
exemptions |= set(classify_exemptions(r["snippet"])["codes"])
|
| 7 |
+
|
| 8 |
+
return f"""
|
| 9 |
+
## System Explainability Report
|
| 10 |
+
|
| 11 |
+
**Purpose:** Public FOIA document discovery
|
| 12 |
+
**Data Sources:** Public electronic reading rooms
|
| 13 |
+
**Agencies Covered:** {', '.join(agencies)}
|
| 14 |
+
|
| 15 |
+
### Safety Controls
|
| 16 |
+
- Robots.txt enforcement
|
| 17 |
+
- Per-agency kill switches
|
| 18 |
+
- Redaction detection
|
| 19 |
+
- Exemption surfacing
|
| 20 |
+
|
| 21 |
+
### FOIA Exemptions Detected
|
| 22 |
+
{', '.join(exemptions) or 'None'}
|
| 23 |
+
"""
|