Skip to content

Fuzzy 去重: 三级去重器 (DOI/arxiv_id/rapidfuzz) #318

@jerry609

Description

@jerry609

问题

当前去重仅基于精确 ID 匹配, 存在 4 个缺陷:

  1. 跨源 ID 不匹配: S2 返回 doi, arXiv 返回 arxiv_id → 同一篇论文两个 key
  2. title_hash 标准化不一致: post_init strip标点, _paper_key 不strip
  3. PapersCool 不提取 arxiv_id
  4. 无模糊匹配

压测: 4 个源返回 120 篇, duplicates_removed=0.

方案

新建 PaperDeduplicator 三级去重器:

  1. DOI 精确匹配
  2. arxiv_id 精确匹配
  3. rapidfuzz.fuzz.ratio >= 0.85 模糊标题匹配

涉及文件

文件 改动
application/services/paper_search_service.py 新建 PaperDeduplicator, 替换 _paper_key
domain/paper.py 修复 _compute_title_hash 标准化
pyproject.toml / requirements.txt 新增 rapidfuzz
tests/unit/test_paper_dedup.py 新建

验收标准

  • 压测去重率 > 30%
  • rapidfuzz 阈值 0.85 不误合并

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestsearchSearch infrastructure

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions