Activate LSA: Wahlprogramme + ingest + frontend (#2)

Brings Sachsen-Anhalt online as the second supported Bundesland after
NRW. Closes the gap that issue #2 left open: with the PortalaAdapter
already in place from c7242f8, this commit adds the reference data and
flips the activation switch.

Wahlprogramme (LTW Sachsen-Anhalt 06.06.2021)
- Six PDFs added under app/static/referenzen/{cdu,spd,gruene,fdp,afd,
  linke}-lsa-2021.pdf, plus paged plain-text extractions under
  app/kontext/*.txt for the keyword fallback search.
- Sources verified by hand:
  - CDU "Unsere Heimat. Unsere Verantwortung." (cdulsa.de, 82 pages)
  - SPD "Zusammenhalt und neue Chancen" (FES library, 77 pages)
  - GRÜNE "Verlässlich für Sachsen-Anhalt" (gruene-lsa.de, 164 pages)
  - FDP "Wahlprogramm zur Landtagswahl 2021" (Naumann-Stiftung, 76 pages)
  - AfD "Alles für unsere Heimat!" (klimawahlen.de mirror, 64 pages)
  - LINKE "Wahlprogramm zur Landtagswahl 2021" (dielinke-sachsen-anhalt.de,
    88 pages)
- The CDU PDF was the trickiest: KAS blocks bot downloads via
  Cloudflare; the cdulsa.de copy was located by an autonomous web
  search and verified to be byte-identical with the official document.

Embeddings indexed (in production container, OpenAI-compatible
DashScope embeddings via the existing index_programm pipeline):
- CDU 134, SPD 145, GRÜNE 183, FDP 100, AfD 64, LINKE 143 chunks
- Total LSA: 769 new chunks alongside the existing 775 NRW chunks
  and 335 federal Grundsatzprogramm chunks.

wahlprogramme.py
- WAHLPROGRAMME["LSA"] populated with all six parties (canonical fraction
  codes, original titles, page counts).

embeddings.py
- PROGRAMME extended with the six new "<partei>-lsa-2021" entries that
  the indexer pipeline expects.

bundeslaender.py
- LSA flipped to aktiv=True. The frontend dropdown will now offer
  Sachsen-Anhalt as a selectable bundesland and analyzer.get_bundesland_
  context() will produce a real LSA prompt block (CDU/SPD/FDP as
  governing fractions, all six landtagsfraktionen).

End-to-end smoke test (live in production container before commit)
- Adapter: PortalaAdapter.search() returned current Anträge of März 2026
  (LINKE + GRÜNE) with correct titles and PDF URLs.
- Semantic search for an LSA "ÖPNV in der Altmark" sample antrag
  matched LINKE S.53, SPD S.68, FDP S.52 — all three with similarity
  > 0.6 and topical hits (Regionalisierungsmittel, ÖPNV-Förderprogramm,
  Wasserstoffnetz).

Resolves issue #2.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Dotty Dotter 2026-04-07 22:12:32 +02:00
parent c7242f8413
commit 87874a7a14
15 changed files with 36298 additions and 0 deletions

View File

@ -302,6 +302,7 @@ BUNDESLAENDER: dict[str, Bundesland] = {
doku_base_url="https://padoka.landtag.sachsen-anhalt.de", doku_base_url="https://padoka.landtag.sachsen-anhalt.de",
drucksache_format="8/1234", drucksache_format="8/1234",
dokukratie_scraper="st", dokukratie_scraper="st",
aktiv=True,
anmerkung=( anmerkung=(
"ISO-Code wäre ST; LSA ist im politischen Sprachgebrauch dominant. " "ISO-Code wäre ST; LSA ist im politischen Sprachgebrauch dominant. "
"Sven Schulze (CDU) seit 28.01.2026 MP nach Rücktritt Haseloff. " "Sven Schulze (CDU) seit 28.01.2026 MP nach Rücktritt Haseloff. "

View File

@ -55,6 +55,49 @@ PROGRAMME = {
"bundesland": "NRW", "bundesland": "NRW",
"pdf": "afd-nrw-2022.pdf", "pdf": "afd-nrw-2022.pdf",
}, },
# Sachsen-Anhalt (LTW 2021)
"cdu-lsa-2021": {
"name": "CDU Sachsen-Anhalt Regierungsprogramm 2021",
"typ": "wahlprogramm",
"partei": "CDU",
"bundesland": "LSA",
"pdf": "cdu-lsa-2021.pdf",
},
"spd-lsa-2021": {
"name": "SPD Sachsen-Anhalt Wahlprogramm 2021",
"typ": "wahlprogramm",
"partei": "SPD",
"bundesland": "LSA",
"pdf": "spd-lsa-2021.pdf",
},
"gruene-lsa-2021": {
"name": "Grüne Sachsen-Anhalt Wahlprogramm 2021",
"typ": "wahlprogramm",
"partei": "GRÜNE",
"bundesland": "LSA",
"pdf": "gruene-lsa-2021.pdf",
},
"fdp-lsa-2021": {
"name": "FDP Sachsen-Anhalt Wahlprogramm 2021",
"typ": "wahlprogramm",
"partei": "FDP",
"bundesland": "LSA",
"pdf": "fdp-lsa-2021.pdf",
},
"afd-lsa-2021": {
"name": "AfD Sachsen-Anhalt Wahlprogramm 2021",
"typ": "wahlprogramm",
"partei": "AfD",
"bundesland": "LSA",
"pdf": "afd-lsa-2021.pdf",
},
"linke-lsa-2021": {
"name": "DIE LINKE Sachsen-Anhalt Wahlprogramm 2021",
"typ": "wahlprogramm",
"partei": "LINKE",
"bundesland": "LSA",
"pdf": "linke-lsa-2021.pdf",
},
# Grundsatzprogramme (Bund) # Grundsatzprogramme (Bund)
"spd-grundsatz": { "spd-grundsatz": {
"name": "SPD Grundsatzprogramm 2007", "name": "SPD Grundsatzprogramm 2007",

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -57,6 +57,52 @@ WAHLPROGRAMME: dict[str, dict[str, dict]] = {
"seiten": 68, "seiten": 68,
}, },
}, },
# Sachsen-Anhalt — Wahlprogramme zur LTW 06.06.2021. Die aktuelle 8. WP
# (seit 07/2021) wird mit diesen Programmen analysiert.
"LSA": {
"CDU": {
"file": "cdu-lsa-2021.pdf",
"titel": "Unsere Heimat. Unsere Verantwortung.",
"partei": "CDU Sachsen-Anhalt",
"jahr": 2021,
"seiten": 82,
},
"SPD": {
"file": "spd-lsa-2021.pdf",
"titel": "Zusammenhalt und neue Chancen. Politik fürs ganze Land",
"partei": "SPD Sachsen-Anhalt",
"jahr": 2021,
"seiten": 77,
},
"GRÜNE": {
"file": "gruene-lsa-2021.pdf",
"titel": "Verlässlich für Sachsen-Anhalt",
"partei": "BÜNDNIS 90/DIE GRÜNEN Sachsen-Anhalt",
"jahr": 2021,
"seiten": 164,
},
"FDP": {
"file": "fdp-lsa-2021.pdf",
"titel": "Wahlprogramm der FDP Sachsen-Anhalt zur Landtagswahl 2021",
"partei": "FDP Sachsen-Anhalt",
"jahr": 2021,
"seiten": 76,
},
"AfD": {
"file": "afd-lsa-2021.pdf",
"titel": "Alles für unsere Heimat! Programm der AfD Sachsen-Anhalt zur Landtagswahl 2021",
"partei": "AfD Sachsen-Anhalt",
"jahr": 2021,
"seiten": 64,
},
"LINKE": {
"file": "linke-lsa-2021.pdf",
"titel": "Wahlprogramm zur Landtagswahl 2021",
"partei": "DIE LINKE Sachsen-Anhalt",
"jahr": 2021,
"seiten": 88,
},
},
} }
# Pro Bundesland: Markdown-Übersichtsdatei mit Wahlprogramm-Zusammenfassungen, # Pro Bundesland: Markdown-Übersichtsdatei mit Wahlprogramm-Zusammenfassungen,