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
217 lines
6.4 KiB
Markdown
217 lines
6.4 KiB
Markdown
# User Prompt Template
|
||
|
||
## 任务说明
|
||
|
||
请根据以下研究方案(PICOS标准)和论文全文,评估这篇论文的**12个字段的完整性和可用性**。
|
||
|
||
---
|
||
|
||
## 研究方案(PICOS标准)
|
||
|
||
### Population(研究人群)
|
||
成年房颤患者(≥18岁,有卒中风险因素)
|
||
|
||
### Intervention(干预措施)
|
||
利伐沙班 20mg 每日一次(肾功能不全者15mg)
|
||
|
||
### Comparison(对照措施)
|
||
华法林剂量调整(目标INR 2.0-3.0)
|
||
|
||
### Outcome(结局指标)
|
||
卒中或系统性栓塞(主要)、大出血(次要)
|
||
|
||
### Study Design(研究设计)
|
||
RCT(多中心、随机、双盲)
|
||
|
||
---
|
||
|
||
## 论文全文
|
||
|
||
**文档格式**:markdown
|
||
(`markdown` = 结构化Markdown,由Nougat提取;`plaintext` = 纯文本,由PyMuPDF提取)
|
||
|
||
**预估字数**:363 字
|
||
|
||
**⚠️ 重要提醒**:
|
||
- 如果是**markdown格式**,请注意利用章节标记(如`# Abstract`, `## Methods`)快速定位
|
||
- 如果是**plaintext格式**,请通过章节标题(如"METHODS"、"RESULTS")来识别结构
|
||
- 无论哪种格式,都要**逐段阅读**,不要跳过中间段落
|
||
|
||
---
|
||
|
||
### 论文全文内容
|
||
|
||
```
|
||
# A Randomized Trial of Rivaroxaban in Atrial Fibrillation
|
||
|
||
## Abstract
|
||
Background: Atrial fibrillation increases stroke risk...
|
||
Methods: We randomly assigned 1,000 patients...
|
||
Results: Primary outcome occurred in 2.1% vs 3.4%...
|
||
|
||
## Introduction
|
||
Atrial fibrillation is a common cardiac arrhythmia...
|
||
|
||
## Methods
|
||
### Study Design
|
||
This was a multicenter, randomized, double-blind trial...
|
||
|
||
### Randomization
|
||
Randomization was performed using a computer-generated random sequence...
|
||
|
||
## Results
|
||
Between 2020 and 2022, we enrolled 1,000 patients...
|
||
```
|
||
|
||
---
|
||
|
||
## 评估要求
|
||
|
||
### 1. 评估12个字段
|
||
|
||
请评估以下12个字段的**完整性和可用性**:
|
||
|
||
1. **文献来源**(第一作者、年份、期刊、DOI)
|
||
2. **研究类型**(RCT、队列研究等)
|
||
3. **研究设计细节**(随访时间、数据来源)
|
||
4. **疾病诊断标准**
|
||
5. **人群特征**(样本量、人口统计学)⭐
|
||
6. **基线数据**(功能指标、合并症)⭐
|
||
7. **干预措施**(药物、剂量、疗程)⭐
|
||
8. **对照措施**
|
||
9. **结局指标**(主要/次要结局)⭐⭐⭐ 最关键
|
||
10. **统计方法**
|
||
11. **质量评价**(随机化、盲法、ITT分析等)⭐⭐ 关键方法学
|
||
12. **其他信息**(注册号、利益冲突)
|
||
|
||
**对于每个字段,判断**:
|
||
- **完整**:信息充分,符合Cochrane高质量标准
|
||
- **不完整**:信息缺失、描述模糊、不符合标准
|
||
- **无法判断**:论文完全未提及该信息
|
||
|
||
### 2. 特别关注关键方法学字段
|
||
|
||
以下3个字段是评估研究质量的核心,**必须重点关注**:
|
||
|
||
#### ⭐⭐⭐ 随机化方法
|
||
- 是否有序列生成方法?(如计算机生成、随机数字表)
|
||
- 是否有分配隐藏?(如IWRS、密封信封)
|
||
- 基线特征是否平衡?
|
||
|
||
**判断要点**:
|
||
- ✅ 完整:明确序列生成方法 + 分配隐藏
|
||
- ❌ 不完整:仅提到"随机",无具体方法
|
||
|
||
#### ⭐⭐⭐ 盲法
|
||
- 盲法类型?(双盲、单盲、开放)
|
||
- 盲法对象?(受试者、研究者、评估者)
|
||
- 盲法实施方法?(如相同外观药物)
|
||
|
||
**判断要点**:
|
||
- ✅ 完整:明确盲法对象 + 实施方法
|
||
- ❌ 不完整:仅提到"双盲",无具体方法
|
||
|
||
#### ⭐⭐⭐ 结果完整性
|
||
- 失访率?(≤5%为优秀,>20%为高风险)
|
||
- 是否使用ITT分析?
|
||
- 缺失数据处理方法?
|
||
|
||
**判断要点**:
|
||
- ✅ 完整:低失访率(<5%) 或 ITT分析 + 合理缺失数据处理
|
||
- ❌ 不完整:高失访率(>20%) 或 未使用ITT且无说明
|
||
|
||
### 3. 强制处理流程
|
||
|
||
请严格按照System Prompt中的4步流程处理:
|
||
1. **章节定位**(5分钟)
|
||
2. **分字段提取**(按预期位置)
|
||
3. **交叉验证**(关键词搜索 + 重读)
|
||
4. **输出结果**(JSON格式)
|
||
|
||
**⚠️ 特别注意**:
|
||
- **Methods章节可能很长**(2000-4000字),请逐段阅读,不要跳过第2-5段(中间位置)
|
||
- **Results章节的开头**通常包含失访情况和基线数据
|
||
- **Table 1**(如果有)通常是基线特征表
|
||
- **Figure 1**(如果有)通常是CONSORT流程图(失访信息)
|
||
|
||
---
|
||
|
||
## 输出格式
|
||
|
||
请严格按照以下JSON Schema输出(参考`json_schema.json`):
|
||
|
||
```json
|
||
{
|
||
"fields": {
|
||
"文献来源": { "assessment": "...", "evidence": {...}, "reasoning": "...", "confidence": 0.95 },
|
||
"研究类型": { ... },
|
||
...
|
||
"质量评价": {
|
||
"assessment": "...",
|
||
"evidence": {...},
|
||
"reasoning": "...",
|
||
"confidence": 0.90,
|
||
"cochrane_details": {
|
||
"domains": {
|
||
"随机化过程": { "risk": "Low risk", "reasoning": "..." },
|
||
"偏离预期干预": { "risk": "Low risk", "reasoning": "..." },
|
||
"结局数据缺失": { "risk": "Low risk", "reasoning": "..." },
|
||
"结局测量": { "risk": "Low risk", "reasoning": "..." },
|
||
"选择性报告结果": { "risk": "Unclear risk", "reasoning": "..." }
|
||
},
|
||
"overall_bias_risk": "Low"
|
||
}
|
||
}
|
||
},
|
||
"processing_log": {
|
||
"sections_reviewed": ["Abstract", "Methods", "Results", "Tables", "Figures"],
|
||
"paragraphs_read_per_section": {
|
||
"Methods": 7, // 必须≥3,最好是实际段落数
|
||
"Results": 5 // 必须≥3
|
||
},
|
||
"middle_sections_attention": true,
|
||
"total_processing_time_estimate": "15 minutes"
|
||
},
|
||
"verification": {
|
||
"keywords_searched": ["randomization", "blinding", "ITT", "baseline", "dropout"],
|
||
"reread_count": 2,
|
||
"found_missed_info": false,
|
||
"cross_section_conflicts": []
|
||
},
|
||
"metadata": {
|
||
"model_name": "deepseek-v3",
|
||
"processing_date": "2025-11-22T12:17:30.843Z",
|
||
"document_format": "markdown",
|
||
"estimated_word_count": 363
|
||
}
|
||
}
|
||
```
|
||
|
||
---
|
||
|
||
## 质量检查清单(输出前必查)
|
||
|
||
在提交结果前,请逐项检查:
|
||
|
||
- [ ] 12个字段全部评估完成
|
||
- [ ] 每个字段的quote ≥ 50字
|
||
- [ ] 每个字段都有location(section + paragraph)
|
||
- [ ] processing_log显示Methods ≥ 3段, Results ≥ 3段
|
||
- [ ] 关键词搜索至少5个
|
||
- [ ] 重读至少1次
|
||
- [ ] 质量评价字段包含完整的Cochrane RoB 2.0评估(5个域)
|
||
- [ ] 低置信度字段(<0.7)标记了needs_manual_review
|
||
|
||
---
|
||
|
||
## 开始评估
|
||
|
||
现在,请开始评估这篇论文。记住:
|
||
|
||
1. ✅ **逐段阅读**(特别是Methods第2-5段)
|
||
2. ✅ **交叉验证**(关键词搜索 + 重读)
|
||
3. ✅ **完整输出**(JSON Schema + 处理日志 + 自我验证)
|
||
|
||
祝你工作顺利!🚀
|
||
|