简体   繁体   中英

Computing Cosine Similarity in Perl

How do I compute the cosine similarity distance of two documents in Perl? A few questions: 1) Are there already modules for computing the cosine similarity distance in CPAN? Or is this task easy enough to code up? 2) When I say documents, I really mean that one "document" is a sentence and the other "document" is just a list of keywords. To be fair, should I tokenize, lowercase and sort all the keywords in each document respectively before computing the cosine similarity distance?

好吧,快速搜索CPAN上的余弦相似度会弹出Text :: Document

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM