Repository navigation
Fix #4: extract key info users already gave (fever, duration, history) - #11
Open
xiaoyao-666-coder wants to merge 2 commits into
Open
xiaoyao-666-coder wants to merge 2 commits into
xiaoyao-666-coder wants to merge 2 commits into
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #4.
用户已在消息中说明的信息未被提取到右侧面板,回答还反问已提供过的内容。根因:症状词表只有“发热、咽痛”等书面词,没有“发烧、喉咙痛、头疼、累、睡眠不好”等口语说法;“最近”不在持续时间前缀里;“没有慢性病”不符合既往史正则;PatientProfile 没有体温字段。
_DURATION_PREFIX增加“最近”;新增体温提取(35–42.x 度,PatientProfile.temperature,前端面板增加“体温”一栏);相对发病时间(昨天/前天/大前天)仅在尚无持续时间时填充,不覆盖更精确的已有值;既往史支持“没有/无/否认 + 慢性病…”的否定式。backend/tests/test_info_extraction.py(7 个测试)。验证:
MEDGUIDE_MODE=test python -m pytest -q backend/tests528 passed(基线 521 + 7 新);前端npm test10/10,npm run build成功。已知限制:相对时间只处理了昨天/前天/大前天;“没有高血压、糖尿病”这种多病种并列否定暂未记录。