Files
PlantAI-rag/docs/history/v14_spl_pilot_plan.md
2026-07-10 17:59:59 +08:00

4.6 KiB
Executable File

V14.2 SPL家族试点测试计划

测试文章(8篇)

文件名 物种 年份 期刊 大小
苦荞SPL2019BMCplantbios12870-019-1916-6.pdf 苦荞 2019 BMC Plant Biology 6.5M
bmc_Brn_SPL_2016.pdf Brassica 2016 BMC 4.0M
citrus _spl_2023.pdf 柑橘 2023 - 4.2M
frontier_SmG_SPL_2025.pdf 玉米 2025 Frontiers 6.4M
frontier_SPL_FPOWERS_2025.pdf - 2025 Frontiers 980K
pecan_SPL_2021.pdf 山核桃 2021 - 2.2M
si_SPL_2022.pdf - 2022 SI 7.4M
sunflower_SPL_2023.pdf 向日葵 2023 - 2.4M

总计: 8篇文章,34MB

执行流程

Phase 1: 获取PC数据(需要你的帮助)

需要从PC数据库导出:

-- 假设PC数据库中有这些表
SELECT * FROM articles WHERE pdf_filename IN (
  '苦荞SPL2019BMCplantbios12870-019-1916-6.pdf',
  'bmc_Brn_SPL_2016.pdf',
  ...
);

SELECT * FROM entities WHERE article_id IN (...);
SELECT * FROM relations WHERE article_id IN (...);

导出格式: JSON 或 CSV 保存位置: /home/xia-lab/gene-family-mas-v2/paper/v14/spl/pc_data/

Phase 2: V14.2提取(自动化)

创建提取脚本:

# v14_spl_extract.py
from src.rag.extractors.v14 import V14Extractor
from pathlib import Path
import json

# 配置
spl_dir = Path('/home/xia-lab/gene-family-mas-v2/paper/v14/spl')
output_dir = spl_dir / 'v14_results'
output_dir.mkdir(exist_ok=True)

# 初始化提取器
extractor = V14Extractor(
    use_pc_data=True,
    use_disambiguation=True,
    use_llm_definitions=False,  # 使用模板,更稳定
    use_neo4j=False
)

# 提取每篇文章
pdf_files = list(spl_dir.glob('*.pdf'))
results = []

for pdf_file in pdf_files:
    print(f"\n{'='*80}")
    print(f"处理: {pdf_file.name}")
    print(f"{'='*80}")
    
    try:
        result = extractor.extract(pdf_file)
        
        # 保存结果
        output_name = pdf_file.stem
        extractor.save_to_json(output_dir / f'{output_name}.json')
        extractor.save_to_csv(output_dir / f'{output_name}.csv')
        
        results.append({
            'filename': pdf_file.name,
            'status': 'success',
            'entities': result['metadata']['total_entities'],
            'relations': result['metadata']['total_relations']
        })
        
    except Exception as e:
        print(f"❌ 失败: {e}")
        results.append({
            'filename': pdf_file.name,
            'status': 'failed',
            'error': str(e)
        })

# 保存汇总
with open(output_dir / 'summary.json', 'w') as f:
    json.dump(results, f, indent=2)

print(f"\n{'='*80}")
print("提取完成!")
print(f"{'='*80}")
for r in results:
    status = '✅' if r['status'] == 'success' else '❌'
    print(f"{status} {r['filename']}")

Phase 3: 对比分析

对比脚本:

# compare_spl_results.py
import json
from pathlib import Path

# 加载PC数据
pc_data_dir = Path('/home/xia-lab/gene-family-mas-v2/paper/v14/spl/pc_data')
# 加载V14.2数据
v14_data_dir = Path('/home/xia-lab/gene-family-mas-v2/paper/v14/spl/v14_results')

# 对比每篇文章
for article in articles:
    pc_result = load_pc_data(article)
    v14_result = load_v14_data(article)
    
    comparison = {
        'article': article,
        'entity_count': {
            'pc': len(pc_result['entities']),
            'v14': len(v14_result['entities'])
        },
        'relation_count': {
            'pc': len(pc_result['relations']),
            'v14': len(v14_result['relations'])
        },
        'common_relations': find_common_relations(pc_result, v14_result),
        'v14_only': find_v14_only_relations(pc_result, v14_result),
        'pc_only': find_pc_only_relations(pc_result, v14_result)
    }

Phase 4: 生成报告

报告内容:

  1. 总体对比(实体数、关系数)
  2. 每篇文章详细对比
  3. 典型案例分析
  4. 问题与建议

时间安排

阶段 时间 负责人
Phase 1: 获取PC数据 今天 你
Phase 2: V14.2提取 明天 我
Phase 3: 对比分析 后天 我
Phase 4: 报告生成 第4天 我

成功标准

最低标准:

  • 8篇文章全部提取成功
  • V14.2关系数 >= PC关系数的 70%

优秀标准:

  • V14.2关系数 >= PC关系数的 90%
  • 发现PC遗漏的关系(V14.2独有)

风险控制

风险 应对
V14.2提取失败 使用轻量级模式(禁用大文件)
PC数据缺失 优先处理有PC数据的文章
内存不足 单篇处理,及时清理缓存

下一步: 需要你从PC数据库导出这8篇文章的提取结果