我是新来的自然语言处理,我想用它来编写新闻聚合器(在我的情况下在Node.js中)。我不想仅仅使用预先包装框架,我想了解这些细节,并且从NLP部分开始。我发现这一个教程,一直至今最有帮助的:什么是自然语言处理在此准则中正确执行?
http://www.p-value.info/2012/12/howto-build-news-aggregator-in-100-loc.html
在这里面,笔者得到的RSS源,并通过他们循环找元素(或领域)title
和description
。我了解Python并理解代码。但我不明白的是,NLP在title
和description
之下正在做什么(除了刮擦和标记化,这很明显...并且这些任务不需要NLP)。
import feedparser
import nltk
corpus = []
titles=[]
ct = -1
for feed in feeds:
d = feedparser.parse(feed)
for e in d['entries']:
words = nltk.wordpunct_tokenize(nltk.clean_html(e['description']))
words.extend(nltk.wordpunct_tokenize(e['title']))
lowerwords=[x.lower() for x in words if len(x) > 1]
ct += 1
print ct, "TITLE",e['title']
corpus.append(lowerwords)
titles.append(e['title'])
这个问题很不清楚。 NLP不是做东西的东西。我认为你应该改述你的问题。 – Pierre 2014-11-09 17:15:58