V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
monburan
V2EX  ›  Python

关于爬虫去重算法 BloomFilter 和 simhash 这两个哪一个更好?

  •  
  •   monburan ·
    monburan · 2017-01-18 17:34:42 +08:00 · 3733 次点击
    这是一个创建于 2648 天前的主题,其中的信息可能已经有所发展或是发生改变。

    rt
    想要通过使用算法实现判断相似的 url 来去除结构相似的页面,减少后续功能的工作量。
    现在看到网上推荐的爬虫去重有 BloomFilter 和 simhash 。
    之前没有接触过去重这块的知识,有没有用过这两种算法的 V 友,或者说有更好的方法实现去重的,给点建议

    5 条回复    2017-01-19 17:44:17 +08:00
    knightdf
        1
    knightdf  
       2017-01-18 17:46:34 +08:00   ❤️ 1
    url 就用 bloomfilter, 如果是页面内容可以用 LSH
    monburan
        2
    monburan  
    OP
       2017-01-18 17:51:53 +08:00
    @knightdf 非常感谢
    binux
        3
    binux  
       2017-01-18 17:54:41 +08:00   ❤️ 2
    BloomFilter 个 simhash 不是一类东西,要怎么放在一起比较?

    bloomfilter 是用来降低去重空间复杂度的。
    simhash 是用来降低相似度比较复杂度的。

    根本不是一个东西。而且,这两个东西

    bloomfilter ,如果你的 url 数小于 10 亿,不用考虑 bloomfilter ,直接数据库去重。
    simhash , url 文本空间太小,不好使。用去除无用参数解决。
    monburan
        4
    monburan  
    OP
       2017-01-19 10:06:16 +08:00
    @binux 非常感谢
    sleshep
        5
    sleshep  
       2017-01-19 17:44:17 +08:00
    bloomfilter 生产环境用过,有个很难受的地方就是,你无法从历史数据里删除某个 url
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   3044 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 11:04 · PVG 19:04 · LAX 04:04 · JFK 07:04
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.