开发者

What is the best algorithm for finding related post?

开发者 https://www.devze.com 2022-12-19 15:48 出处:网络
Basically this is a database and query question. How do you implement related post in your site, suppose you have this tabl开发者_如何学运维e:

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

精彩评论

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

关注公众号