开发者

What is the best algorithm for finding related post?

Basically this is a database and query question. How do you implement related post in your site, suppose you have this tabl开发者_如何学运维e:

+------+        +------+
+ Post +        + Tags  +
-------- N : M  --------

where post have the body and link m:n to tag. This is a very common scenario of implement tag and post.

so, How do you implement related post in your site?


Find all the posts which overlap on at least one tag and use term frequency - inverse document frequency to weight the tags by importance, and sum the weights. Return related posts in descending order of total weight.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜