我需要相当于wordpress清理文本的Python
标题:
'mygubbi raises $25 mn seed funding from bigbasket co founder others'
wordpress提供
"mygubbi-raises-2-5-mn-seed-funding-bigbasket-co-founder-others"
Python slugify提供
"mygubbi-raises-2-5-mn-seed-funding-from-bigbasket-co-founder-others"
我用过python slugify python库。你知道吗
我是不是应该去掉像from,in,to这样的词。我在哪能找到那些停止语?你知道吗
有一个名为nltk的python模块。这就为你提供了一种可能。你知道吗
http://www.bogotobogo.com/python/NLTK/tokenization_tagging_NLTK.php
只需在这个网站上向下滚动一点,找到标题“删除停止词”。下面有一些使用此模块执行此操作的示例。你知道吗
python-slugify库有一个
stopwords
参数,可以与nltk
一起使用,如下所示:这将打印:
安装
nltk
之后,您可以安装其他语料库,其中一个是stopwords
。要执行此操作,请按如下方式运行其内置下载实用程序:选择
Corpora
,向下滚动到stopwords
,然后单击Download
按钮。你知道吗相关问题 更多 >
编程相关推荐