• <bdo id='QZXpC'></bdo><ul id='QZXpC'></ul>

    1. <legend id='QZXpC'><style id='QZXpC'><dir id='QZXpC'><q id='QZXpC'></q></dir></style></legend>

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

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

      2. 产生真实单词的词干算法

        时间:2023-08-20
      3. <i id='YSWES'><tr id='YSWES'><dt id='YSWES'><q id='YSWES'><span id='YSWES'><b id='YSWES'><form id='YSWES'><ins id='YSWES'></ins><ul id='YSWES'></ul><sub id='YSWES'></sub></form><legend id='YSWES'></legend><bdo id='YSWES'><pre id='YSWES'><center id='YSWES'></center></pre></bdo></b><th id='YSWES'></th></span></q></dt></tr></i><div id='YSWES'><tfoot id='YSWES'></tfoot><dl id='YSWES'><fieldset id='YSWES'></fieldset></dl></div>
            <tbody id='YSWES'></tbody>
              <legend id='YSWES'><style id='YSWES'><dir id='YSWES'><q id='YSWES'></q></dir></style></legend>
              • <tfoot id='YSWES'></tfoot>
                  <bdo id='YSWES'></bdo><ul id='YSWES'></ul>

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

                  本文介绍了产生真实单词的词干算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我需要选取一段文本并从中提取标签"列表.其中大部分是非常简单的.但是,我现在需要一些帮助来阻止生成的单词列表以避免重复.示例:社区/社区

                  I need to take a paragraph of text and extract from it a list of "tags". Most of this is quite straight forward. However I need some help now stemming the resulting word list to avoid duplicates. Example: Community / Communities

                  我使用了 Porter Stemmer 算法的实现(顺便说一下,我是用 PHP 编写的):

                  I've used an implementation of Porter Stemmer algorithm (I'm writing in PHP by the way):

                  http://tartarus.org/~martin/PorterStemmer/php.txt

                  这在一定程度上有效,但不会返回真实"单词.上面的例子是commun".

                  This works, up to a point, but doesn't return "real" words. The example above is stemmed to "commun".

                  我尝试过Snowball"(在另一个 Stack Overflow 线程中建议).

                  I've tried "Snowball" (suggested within another Stack Overflow thread).

                  http://snowball.tartarus.org/demo.php

                  就我的示例(社区/社区)而言,Snowball 源于communiti".

                  For my example (community / communities), Snowball stems to "communiti".

                  问题

                  是否有其他词干算法可以做到这一点?有没有其他人解决过这个问题?

                  Are there any other stemming algorithms that will do this? Has anyone else solved this problem?

                  我目前的想法是我可以使用词干算法来避免重复,然后选择我遇到的最短单词作为要显示的实际单词.

                  推荐答案

                  这里的核心问题是词干算法在语音基础纯粹基于语言的拼写规则而没有实际理解他们正在使用的语言.要生成真实的单词,您可能必须将词干分析器的输出与某种形式的查找函数合并,以将词干转换回真实的单词.我基本上可以看到两种可能的方法来做到这一点:

                  The core issue here is that stemming algorithms operate on a phonetic basis purely based on the language's spelling rules with no actual understanding of the language they're working with. To produce real words, you'll probably have to merge the stemmer's output with some form of lookup function to convert the stems back to real words. I can basically see two potential ways to do this:

                  1. 找到或创建一个大词典,将每个可能的词干映射回实际单词.(例如,社区 -> 社区)
                  2. 创建一个函数,将每个词干与缩减为该词干的单词列表进行比较,并尝试确定哪个词最相似.(例如,将communiti"与community"和communities"进行比较,以便将community"视为更相似的选项)

                  就我个人而言,我认为我的做法是#1 的动态形式,通过记录检查的每个单词及其词干,然后假设最常见的单词是一个,从而建立自定义词典数据库应该使用.(例如,如果我的源文本正文比社区"更频繁地使用社区",则映射社区 -> 社区.)基于字典的方法通常会更准确,并且基于词干分析器输入构建它会提供结果根据您的文本进行定制,主要缺点是需要空间,现在这通常不是问题.

                  Personally, I think the way I would do it would be a dynamic form of #1, building up a custom dictionary database by recording every word examined along with what it stemmed to and then assuming that the most common word is the one that should be used. (e.g., If my body of source text uses "communities" more often than "community", then map communiti -> communities.) A dictionary-based approach will be more accurate in general and building it based on the stemmer input will provide results customized to your texts, with the primary drawback being the space required, which is generally not an issue these days.

                  这篇关于产生真实单词的词干算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何使用 PHP 从 SFTP 服务器下载文件 下一篇:使用 PHP 进行文本挖掘

                  相关文章

                      <tfoot id='q9fd7'></tfoot>

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

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