Files
nexus/wiki/concepts/Semantic-Deduplication.md
2026-04-23 00:02:55 +08:00

2.1 KiB
Raw Blame History

title, type, last_updated
title type last_updated
Semantic Deduplication concept 2026-04-22

Definition

通过向量嵌入vector embedding计算文本内容的语义相似度在相似度超过阈值时判定为重复从而实现比精确匹配更智能的去重能力。

Mechanism

  1. Embedding 生成:将文本内容(选题、摘要、评论等)通过 LLM 或专用 embedding 模型(如 OpenAI text-embedding-3-small转为高维向量
  2. 相似度计算使用余弦相似度cosine similarity或点积dot product比较向量距离
  3. 阈值判定:相似度 > 阈值(通常 0.85-0.95)则判定为重复
  4. 存储与检索向量存入数据库SQLite + extension / pgvector / Qdrant检索时做 ANN近似最近邻搜索

Why It Matters

精确匹配(字符串/哈希去重)无法识别语义重复:

  • "Claude Code 发布了新功能" vs "Anthropic's CLI agent got an update" — 同一事件,不同措辞
  • 语义去重确保:不做重复选题,不生成相似内容,不过度覆盖同一主题

Applications

场景 工具 说明
YouTube 选题去重 YouTube-Content-Pipeline SQLite 存储向量,从不推送同一选题两次
知识库 RAG Knowledge-Base-RAG 检索时过滤语义重复的上下文片段
Newsletter 去重 Inbox-De-clutter 避免同一事件被重复摘要
竞品分析 Pre-Build-Idea-Validator 识别赛道内相似产品

Implementation Notes

  • SQLite:可用 sqlite-vss 扩展(基于 FAISS实现向量存储和 ANN 搜索
  • Embedding 模型选择text-embedding-3-smallOpenAI性价比最高BGE-m3国产支持中文
  • 阈值调优高阈值0.95保守去重低阈值0.85)激进去重,需根据场景调整
  • 更新策略:已有内容变化时需重新生成 embedding

Connections