Spaces:
Sleeping
Sleeping
Create reports/explainability.py
Browse files- reports/explainability.py +39 -44
reports/explainability.py
CHANGED
|
@@ -1,56 +1,51 @@
|
|
| 1 |
"""
|
| 2 |
-
Explainability Report
|
| 3 |
Federal FOIA Intelligence Search
|
| 4 |
Public Electronic Reading Rooms Only
|
| 5 |
"""
|
| 6 |
|
| 7 |
-
|
| 8 |
-
Federal FOIA Intelligence Search is a public-interest discovery system
|
| 9 |
-
that indexes only documents already released by U.S. Government agencies
|
| 10 |
-
in FOIA Electronic Reading Rooms.
|
| 11 |
|
| 12 |
-
The platform does not bypass access controls, does not scrape restricted
|
| 13 |
-
systems, and does not declassify information.
|
| 14 |
-
"""
|
| 15 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
|
| 18 |
-
All indexed materials originate from agency-operated FOIA Electronic
|
| 19 |
-
Reading Rooms. Each result includes explicit source attribution.
|
| 20 |
|
| 21 |
-
|
| 22 |
-
|
|
|
|
|
|
|
| 23 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 24 |
|
| 25 |
-
|
| 26 |
-
|
| 27 |
- Robots.txt enforcement
|
| 28 |
-
- Per-agency
|
| 29 |
-
-
|
| 30 |
-
-
|
| 31 |
-
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
-
|
| 38 |
-
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
regulators, reviewers, or Trust & Safety teams.
|
| 50 |
-
"""
|
| 51 |
-
return "\n\n".join([
|
| 52 |
-
EXPLAINABILITY_SUMMARY,
|
| 53 |
-
DATA_SOURCES_EXPLANATION,
|
| 54 |
-
SAFETY_CONTROLS,
|
| 55 |
-
INTENDED_USE,
|
| 56 |
-
])
|
|
|
|
| 1 |
"""
|
| 2 |
+
Regulator-Facing Explainability Report
|
| 3 |
Federal FOIA Intelligence Search
|
| 4 |
Public Electronic Reading Rooms Only
|
| 5 |
"""
|
| 6 |
|
| 7 |
+
from datetime import datetime
|
|
|
|
|
|
|
|
|
|
| 8 |
|
|
|
|
|
|
|
|
|
|
| 9 |
|
| 10 |
+
def generate_report(stats: dict) -> str:
|
| 11 |
+
return f"""
|
| 12 |
+
Federal FOIA Intelligence Search
|
| 13 |
+
Explainability Report
|
| 14 |
|
| 15 |
+
Generated: {datetime.utcnow().isoformat()} UTC
|
|
|
|
|
|
|
| 16 |
|
| 17 |
+
Scope
|
| 18 |
+
-----
|
| 19 |
+
This system indexes only documents already released to the public
|
| 20 |
+
via U.S. Government FOIA Electronic Reading Rooms.
|
| 21 |
|
| 22 |
+
Data Sources
|
| 23 |
+
------------
|
| 24 |
+
- Agency-managed FOIA portals
|
| 25 |
+
- Public PDFs and HTML disclosures
|
| 26 |
+
- No internal or restricted systems
|
| 27 |
|
| 28 |
+
Safeguards
|
| 29 |
+
----------
|
| 30 |
- Robots.txt enforcement
|
| 31 |
+
- Per-agency kill switches
|
| 32 |
+
- Adapter compliance testing
|
| 33 |
+
- No authentication bypass
|
| 34 |
+
- No scraping beyond published endpoints
|
| 35 |
+
|
| 36 |
+
Analytics
|
| 37 |
+
---------
|
| 38 |
+
- Keyword-based retrieval
|
| 39 |
+
- Optional semantic clustering (FAISS)
|
| 40 |
+
- No predictive inference
|
| 41 |
+
- No content alteration
|
| 42 |
+
|
| 43 |
+
Results Summary
|
| 44 |
+
---------------
|
| 45 |
+
Total Documents: {stats.get('total_docs', 'N/A')}
|
| 46 |
+
Agencies Covered: {len(stats.get('agencies', []))}
|
| 47 |
+
|
| 48 |
+
Compliance Statement
|
| 49 |
+
--------------------
|
| 50 |
+
This system complies with FOIA, CFAA, and platform terms by design.
|
| 51 |
+
"""
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|