diff --git a/app/embeddings.py b/app/embeddings.py index 117ea2b..1611635 100644 --- a/app/embeddings.py +++ b/app/embeddings.py @@ -543,7 +543,7 @@ def get_relevant_quotes_for_antrag( typ="wahlprogramm", bundesland=bundesland, top_k=top_k_per_partei, - min_similarity=0.45, + min_similarity=0.35, ) # Parteiprogramm (Grundsatz, federal — bundesland=NULL matched implizit) @@ -553,7 +553,7 @@ def get_relevant_quotes_for_antrag( typ="parteiprogramm", bundesland=bundesland, top_k=top_k_per_partei, - min_similarity=0.45, + min_similarity=0.35, ) if wahl_chunks or partei_chunks: @@ -767,10 +767,10 @@ def find_chunk_for_text(text: str, chunks: list[dict]) -> Optional[dict]: if needle in norm: return c words = needle.split() - if len(words) < 5: + if len(words) < 4: return None - for i in range(len(words) - 4): - anchor = " ".join(words[i:i + 5]) + for i in range(len(words) - 3): + anchor = " ".join(words[i:i + 4]) for c, norm in chunks_norm: if anchor in norm: return c