<i id='kdwja'><tr id='kdwja'><dt id='kdwja'><q id='kdwja'><span id='kdwja'><b id='kdwja'><form id='kdwja'><ins id='kdwja'></ins><ul id='kdwja'></ul><sub id='kdwja'></sub></form><legend id='kdwja'></legend><bdo id='kdwja'><pre id='kdwja'><center id='kdwja'></center></pre></bdo></b><th id='kdwja'></th></span></q></dt></tr></i><div id='kdwja'><tfoot id='kdwja'></tfoot><dl id='kdwja'><fieldset id='kdwja'></fieldset></dl></div>

    1. <tfoot id='kdwja'></tfoot>

      1. <small id='kdwja'></small><noframes id='kdwja'>

          <bdo id='kdwja'></bdo><ul id='kdwja'></ul>
        <legend id='kdwja'><style id='kdwja'><dir id='kdwja'><q id='kdwja'></q></dir></style></legend>

        如何使用 Lucene 获取频繁出现的短语

        How to get frequently occurring phrases with Lucene(如何使用 Lucene 获取频繁出现的短语)

          <legend id='gc9Q4'><style id='gc9Q4'><dir id='gc9Q4'><q id='gc9Q4'></q></dir></style></legend>

            <small id='gc9Q4'></small><noframes id='gc9Q4'>

              <tfoot id='gc9Q4'></tfoot>

                • <bdo id='gc9Q4'></bdo><ul id='gc9Q4'></ul>
                    <tbody id='gc9Q4'></tbody>
                • <i id='gc9Q4'><tr id='gc9Q4'><dt id='gc9Q4'><q id='gc9Q4'><span id='gc9Q4'><b id='gc9Q4'><form id='gc9Q4'><ins id='gc9Q4'></ins><ul id='gc9Q4'></ul><sub id='gc9Q4'></sub></form><legend id='gc9Q4'></legend><bdo id='gc9Q4'><pre id='gc9Q4'><center id='gc9Q4'></center></pre></bdo></b><th id='gc9Q4'></th></span></q></dt></tr></i><div id='gc9Q4'><tfoot id='gc9Q4'></tfoot><dl id='gc9Q4'><fieldset id='gc9Q4'></fieldset></dl></div>
                • 本文介绍了如何使用 Lucene 获取频繁出现的短语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想用 Lucene 获得一些经常出现的短语.我从 TXT 文件中获取了一些信息,并且由于没有短语信息而丢失了很多上下文,例如信息检索"被索引为两个单独的词.

                  I would like to get some frequently occurring phrases with Lucene. I am getting some information from TXT files, and I am losing a lot of context for not having information for phrases e.g. "information retrieval" is indexed as two separate words.

                  有什么方法可以得到这样的短语?我在互联网上找不到任何有用的东西,所有的建议、链接、提示,尤其是示例,都非常感谢!

                  What is the way to get the phrases like this? I can not find anything useful on internet, all the advices, links, hints especially examples are appreciated!

                  我只按标题和内容存储我的文档:

                  I store my documents just by title and content:

                   Document doc = new Document();
                   doc.add(new Field("name", f.getName(), Field.Store.YES, Field.Index.NOT_ANALYZED));
                   doc.add(new Field("text", fReader, Field.TermVector.WITH_POSITIONS_OFFSETS));
                  

                  因为对我来说最重要的是文件的内容.标题通常根本不具描述性(例如,我有许多 PDF 学术论文,其标题是代码或数字).

                  because for what I am doing the most important is the content of the file. Titles are too often not descriptive at all (e.g., I have many PDF academic papers whose titles are codes or numbers).

                  我迫切需要从文本内容中索引出现频率最高的短语,刚才我发现这种简单的词袋"方法效率不高.

                  I desperately need to index top occurring phrases from text contents, just now I see how much this simple "bag of words" approach is not efficient.

                  推荐答案

                  Julia,看来你要找的是 n-grams,特别是 Bigrams(也称为搭配).

                  Julia, It seems what you are looking for is n-grams, specifically Bigrams (also called collocations).

                  这里有一个 关于寻找搭配的章节 (PDF),来自 Manning 和 Schutze 的 统计自然语言处理基础.

                  Here's a chapter about finding collocations (PDF) from Manning and Schutze's Foundations of Statistical Natural Language Processing.

                  为了使用 Lucene 做到这一点,我建议使用 Solr 和 SingleFilterFactory.有关详细信息,请参阅此讨论.

                  In order to do this with Lucene, I suggest using Solr with ShingleFilterFactory. Please see this discussion for details.

                  这篇关于如何使用 Lucene 获取频繁出现的短语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  Lucene Porter Stemmer not public(Lucene Porter Stemmer 未公开)
                  How to index pdf, ppt, xl files in lucene (java based or python or php any of these is fine)?(如何在 lucene 中索引 pdf、ppt、xl 文件(基于 java 或 python 或 php 中的任何一个都可以)?)
                  KeywordAnalyzer and LowerCaseFilter/LowerCaseTokenizer(KeywordAnalyzer 和 LowerCaseFilter/LowerCaseTokenizer)
                  How to search between dates (Hibernate Search)?(如何在日期之间搜索(休眠搜索)?)
                  How to get positions from a document term vector in Lucene?(如何从 Lucene 中的文档术语向量中获取位置?)
                  Java Lucene 4.5 how to search by case insensitive(Java Lucene 4.5如何按不区分大小写进行搜索)

                    <small id='mrpZz'></small><noframes id='mrpZz'>

                        <i id='mrpZz'><tr id='mrpZz'><dt id='mrpZz'><q id='mrpZz'><span id='mrpZz'><b id='mrpZz'><form id='mrpZz'><ins id='mrpZz'></ins><ul id='mrpZz'></ul><sub id='mrpZz'></sub></form><legend id='mrpZz'></legend><bdo id='mrpZz'><pre id='mrpZz'><center id='mrpZz'></center></pre></bdo></b><th id='mrpZz'></th></span></q></dt></tr></i><div id='mrpZz'><tfoot id='mrpZz'></tfoot><dl id='mrpZz'><fieldset id='mrpZz'></fieldset></dl></div>
                          <bdo id='mrpZz'></bdo><ul id='mrpZz'></ul>
                          <legend id='mrpZz'><style id='mrpZz'><dir id='mrpZz'><q id='mrpZz'></q></dir></style></legend>
                              <tbody id='mrpZz'></tbody>
                          1. <tfoot id='mrpZz'></tfoot>