JavaScript的文本相似度算法算法、相似、文本、JavaScript

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

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.

阅读全文

相关推荐

最新文章