Lucene 中两个文件之间的差异

发布于 2025-01-03 11:09:04 字数 369 浏览 6 评论 0原文

在 C# 的 Lucene 中,我试图找出索引是否包含重复的文件或几乎相同的文件,以查看是否需要用新文件替换它。为此,我想出了一种方法,可能是使用 MoreLikeThis 类,然后获取相关文档的列表。然后比较这些相关文档,看看它们是否与我添加的文档匹配——比如 90% 匹配。然后程序会询问用户这两个是否重复以及保留哪一个。

  1. 可以使用 Lucene 来完成吗? ...这是最好的方法吗?
  2. 如果无法做到这一点,则使用 Levenshtein 距离算法 是比较两个文件的最有效方法看看他们是否有类似的比赛?

谢谢!

In Lucene in C# I am trying to find out if the index contains duplicate files or almost identical to see if it needs to be replaced with the new file. To do this I have figured a way of doing it might be to use the MoreLikeThis class, then get a list of related documents. Then after compare these related documents to see if they match the document I am adding in—say a 90% match. The program will then ask if the user if the two are duplicates and which one to keep.

  1. Can this be done using Lucene? ...and is this the best way to go about doing it?
  2. If this can't be done, is using the Levenshtein Distance Algorithm the most efficient way of comparing two files to see if they have a similar match?

Thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

两个我 2025-01-10 11:09:04

为了与 lucene 比较文档,您还可以使用 TermFreqVector 并将 TermVector 保存在索引中。您还可以使用此向量计算狄利克雷相似度。

for comparing documents with lucene you can also use TermFreqVector and saving TermVector in your index. Also you can compute Dirichlet similarity with this vecotr.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文