How cosine similarity differs from Okapi BM25?

半腔热情 提交于 2019-12-11 03:07:34

问题


I'm conducting a research using elasticsearch. I was planning to use cosine similarity but I noted that it is unavailable and instead we have BM25 as default scoring function.

Is there a reason for that? Is cosine similarity improper for querying documents? Why was BM25 chosen as default? Thanks


回答1:


Longtime elasticsearch use TF/IDF algorithm to find similarity in queries. But number versions ago is changed to BM25 as more efficient. You can read the information in the documentation. And good article explains what is elastic search and how to the similarity in ES.

You can also write a custom algorithm to elasticsearch. Here a good article about how to do.



来源:https://stackoverflow.com/questions/55174358/how-cosine-similarity-differs-from-okapi-bm25

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