Skip to content

Fix #4: extract key info users already gave (fever, duration, history) - #11

Open
xiaoyao-666-coder wants to merge 2 commits into
zhengdaodeguL:mainfrom
xiaoyao-666-coder:fix/issue-4-info-extraction
Open

xiaoyao-666-coder wants to merge 2 commits into
zhengdaodeguL:mainfrom
xiaoyao-666-coder:fix/issue-4-info-extraction

Conversation

@xiaoyao-666-coder

Copy link
Copy Markdown

Closes #4.

用户已在消息中说明的信息未被提取到右侧面板,回答还反问已提供过的内容。根因:症状词表只有“发热、咽痛”等书面词,没有“发烧、喉咙痛、头疼、累、睡眠不好”等口语说法;“最近”不在持续时间前缀里;“没有慢性病”不符合既往史正则;PatientProfile 没有体温字段。

  • 症状词表扩到 41 个口语/书面词(保留用户原话,不归一化);_DURATION_PREFIX 增加“最近”;新增体温提取(35–42.x 度,PatientProfile.temperature,前端面板增加“体温”一栏);相对发病时间(昨天/前天/大前天)仅在尚无持续时间时填充,不覆盖更精确的已有值;既往史支持“没有/无/否认 + 慢性病…”的否定式。
  • 否定句(“我没有发烧”)与他人症状(“我妈妈发烧”)仍不提取。
  • 新增 backend/tests/test_info_extraction.py(7 个测试)。

验证:MEDGUIDE_MODE=test python -m pytest -q backend/tests 528 passed(基线 521 + 7 新);前端 npm test 10/10,npm run build 成功。

已知限制:相对时间只处理了昨天/前天/大前天;“没有高血压、糖尿病”这种多病种并列否定暂未记录。

…tion, history)

- Expand the symptom vocabulary in workflow.py to cover spoken
  forms (发烧, 喉咙痛, 头疼, 累, 睡眠不好, ...) so they are no
  longer dropped.
- Accept 最近 as a duration prefix; extract temperature (35-42.x C)
  into a new optional PatientProfile.temperature field and show it
  in the frontend 'already known' panel.
- Handle relative onset (昨天/前天/大前天) without overwriting a
  more precise duration, and recognise negated history
  ('没有慢性病' -> 否认慢性病).
- Add backend/tests/test_info_extraction.py (7 tests).

Closes zhengdaodeguL#4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug][严重] 关键信息提取失效:发烧、持续时间、伴随症状均未被采纳

1 participant