fix(llm): RAG citation pages, scrub placeholders, disease-aware document choice
CI / ruff · pytest (pull_request) Successful in 1m2s

- converter marks a paragraph glued across a page break with ⟦стр. N⟧; the chunker
  strips the marker and extends the chunk's page range (wrong-page citations 24 -> 3,
  the rest are scale-form table rows split by a page)
- [NAME]/[PHONE] placeholders from privacy.scrub() no longer count as unknown words
  (a scrubbed question used to fall below the coverage gate)
- a question naming one disease boosts its guideline in retrieval and passage choice
  ("ТМС при депрессии" was answered from the PTSD guideline); "антидепрессант" is not a cue

Refs #62

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-04 04:31:59 +03:00
co-authored by Claude Opus 5.5
parent 6c212d560c
commit fe29ebd629
8 changed files with 206 additions and 91 deletions
+6
View File
@@ -59,6 +59,12 @@ retrieval:
"Приложение В": 1.5
"Приложение Г": 0.5
"Критерии оценки качества": 0.5
# Заболевание в вопросе -> профильная КР (регулярные выражения по вопросу в нижнем регистре).
# Если названы оба — ни одна не получает преимущества. Иначе «ТМС при депрессии» отвечался цитатой из КР ПТСР.
doc_cues:
kr_depression: ["(?<!анти)депресс", "\\bдэ\\b", "\\bрдр\\b"]
kr_ptsd: ["птср", "посттравмат", "травм", "\\bвойн", "боев", "фронт", "ветеран", "\\bсво\\b", "ptsd"]
doc_cue_boost: 2.0
answer:
max_chunks: 5 # в скольких лучших фрагментах ищем отрывок