JavaScript的文本相似度算法 [英] javascript text similarity Algorithm

查看:2304
本文介绍了JavaScript的文本相似度算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

IM建立一个网站,应该收集各种新闻提要,并希望进行比较的相似性文本。我需要的是某种形式的一个新闻正文相似度算法的。   我知道,PHP有similar_text功能,我不知道它有多好+我需要它的JavaScript。   因此,如果任何人都可以点我的例子或插件或如何这是可能的,或者至少去哪里找,并开始调查的任何指令。

im building a website that should collect various news feeds and would like the texts to be compared for similarity. What i need is some sort of a news text similarity algorithm. I know that php has the similar_text function and am not sure how good it is + i need it for javascript. So if anyone could point me to an example or a plugin or any instruction on how this is possible or at least where to look and start investigating.

谢谢, Karington

Thanks, Karington

推荐答案

有一个的Levenshtein距离的JavaScript实现度量,其通常用于文本比较。如果你想比较全的文章或标题虽然你可能会更好看的话的集合构成的文本之间的交叉点(和这些词的频率),而不仅仅是字符串的相似性措施。

There's a javascript implementation of the Levenshtein distance metric, which is often used for text comparisons. If you want to compare whole articles or headlines though you might be better off looking at intersections between the sets of words that make up the text (and frequencies of those words) rather than just string similarity measures.

这篇关于JavaScript的文本相似度算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆