推荐学习书目
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
fundchan
V2EX  ›  Python

网站有过千万的数据,每一个页面都要相关页面的栏目,如何实现阿?

  •  
  •   fundchan · May 27, 2015 · 3030 views
    This topic created in 4007 days ago, the information mentioned may be changed or developed.
    6 replies    2015-05-27 15:40:04 +08:00
    zencoding
        1
    zencoding  
       May 27, 2015
    过千万数据很大吗?
    fundchan
        2
    fundchan  
    OP
       May 27, 2015
    @zencoding 主要是怎么推荐相关内容阿,又没什么现成的工具。
    cevincheung
        3
    cevincheung  
       May 27, 2015
    elasticsearch+redis
    em70
        4
    em70  
       May 27, 2015
    推荐引擎可以写一本大部头了,难主要是推荐算法上,千万级数据只要加上索引,技术上没有难点.

    推荐算法需要你根据业务自己设计,比如出现同样关键字的文章就算一类可以相互相关
    fundchan
        5
    fundchan  
    OP
       May 27, 2015
    @em70 我只需要根据标题的相关性来进行推荐,有没现成的算法
    em70
        6
    em70  
       May 27, 2015
    @fundchan 标题怎么算相关?肯定是关键字吧,可以用结巴分词处理标题,提取到的每个关键字和文章ID关联写入另一个表,建好索引.这个表可能会好几亿记录,但因为结构简单而且有索引,检索速度会很快,不用担心性能.

    将来用的时候,显示一个文章,在这个表里检索文章ID得到全部关键字,然后还是这个表里检索每一个关键字得到相关文章ID列表,随机选几个显示就行了.
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2837 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 12:06 · PVG 20:06 · LAX 05:06 · JFK 08:06
    ♥ Do have faith in what you're doing.