feat: add motion semantic drift analysis script

- Add scripts/motion_drift.py: analyzes SVD axis stability, semantic drift,
  and cross-ideological voting patterns across annual windows
- Add analysis/motion_drift.py: core analysis functions with Procrustes
  alignment fallback using party-based sign consistency
- Add matplotlib dependency for static chart generation
- Add tests/test_motion_drift.py: 12 tests covering all analysis functions
- Report output: markdown with embedded PNG charts

Key findings from real data:
- No axes are fully stable (>0.7) across 2019-2026
- All axes show moderate consistency (0.40-0.47) — stable within periods
  but flip between cabinet periods (2019/2022/2026 vs 2023/2024/2025)
- Party voting analysis detects cross-ideological voting patterns
This commit is contained in:
2026-04-05 12:24:46 +02:00
parent 846e9cf67f
commit 50fafeecf3
5 changed files with 1733 additions and 0 deletions
+33
View File
@@ -0,0 +1,33 @@
# Motion Semantic Drift Analysis Report
**Windows analyzed:** 2016, 2017, 2018, 2019, 2022, 2023, 2024, 2025, 2026
**Top N motions per axis:** 20
---
## Summary
- **Stable axes:** None
- **Axes with inflection points:** 0
- **Parties with cross-ideological voting:** 0
## Axis Stability
**Stable axes (similarity > 0.7):** None
**Reordered axes:** [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
**Unstable axes:** []
## Semantic Drift
No drift data available (no stable axes or insufficient data).
## Party Voting Analysis
No cross-ideological voting detected.
## Methodology
- **Axis stability:** Jaccard similarity of top-N motion rankings per component across windows
- **Semantic drift:** Cosine distance between fused embedding centroids of top-N motions per axis
- **Inflection points:** Drift rate exceeding 2× median drift rate
- **Cross-ideological voting:** Parties voting 'voor' on motions where canonical opposite-wing parties have high loadings