我是新來的自然語言處理,我想用它來編寫新聞聚合器(在我的情況下在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