Document comparison / similarity using Whoosh Python Search Library

流过昼夜 提交于 2019-12-10 20:24:12

问题


How do I get a similarity measure of a document using Whoosh?

I want to create a "Related" feature that ranks other previously indexed documents that have a high similarity to a document.

Do I input the document as a long query string? Do I add the document to the index and extract a similarity query result somehow from there?

Thanks


回答1:


The Whoosh searcher class has a method called 'more_like()'.

It allows you to compare and indexed document to other indexed documents and returns a list of documents similar to the given document.

And the class whoosh.searching.Hit can give a rank and a score.



来源:https://stackoverflow.com/questions/9010660/document-comparison-similarity-using-whoosh-python-search-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!