feat(asl): Implement full-text screening core LLM service and validation system (Day 1-3)

Core Components:
- PDFStorageService with Dify/OSS adapters
- LLM12FieldsService with Nougat-first + dual-model + 3-layer JSON parsing
- PromptBuilder for dynamic prompt assembly
- MedicalLogicValidator with 5 rules + fault tolerance
- EvidenceChainValidator for citation integrity
- ConflictDetectionService for dual-model comparison

Prompt Engineering:
- System Prompt (6601 chars, Section-Aware strategy)
- User Prompt template (PICOS context injection)
- JSON Schema (12 fields constraints)
- Cochrane standards (not loaded in MVP)

Key Innovations:
- 3-layer JSON parsing (JSON.parse + json-repair + code block extraction)
- Promise.allSettled for dual-model fault tolerance
- safeGetFieldValue for robust field extraction
- Mixed CN/EN token calculation

Integration Tests:
- integration-test.ts (full test)
- quick-test.ts (quick test)
- cached-result-test.ts (fault tolerance test)

Documentation Updates:
- Development record (Day 2-3 summary)
- Quality assurance strategy (full-text screening)
- Development plan (progress update)
- Module status (v1.1 update)
- Technical debt (10 new items)

Test Results:
- JSON parsing success rate: 100%
- Medical logic validation: 5/5 passed
- Dual-model parallel processing: OK
- Cost per PDF: CNY 0.10

Files: 238 changed, 14383 insertions(+), 32 deletions(-)
Docs: docs/03-涓氬姟妯″潡/ASL-AI鏅鸿兘鏂囩尞/05-寮€鍙戣褰?2025-11-22_Day2-Day3_LLM鏈嶅姟涓庨獙璇佺郴缁熷紑鍙?md
This commit is contained in:
2025-11-22 22:18:17 +08:00
parent 8eef9e0544
commit beb7f7f559
238 changed files with 20718 additions and 31 deletions

View File

@@ -0,0 +1,27 @@
全文复筛及提取模版
1. 文献来源:
2. 研究类型
3. 研究设计细节
1随访时间
2数据来源
4. 疾病诊断标准
5. 人群特征
1样本量
2人口统计学
6. 基线数据
1主要功能指标如果是肾病那么就是肾功能指标
2合并症
7. 干预措施
1药物类别
2剂量与疗程与药物类别相对应
8. 对照措施
9. 结局指标
1主要结局
2次要结局
10. 统计方法
11. 质量评价
12. 其他
1数据来源
2与Protocol匹配度
3利益冲突