def extractRawFrequencies(self, article):
# this method is similar to above but returns
# the raw freq.cies ( all word count)
text = article[0]
text = article[1]
sentences = sent_tokenize(text)
word_sent = [word_tokenize(s.lower()) for s in sentences]
freq = defaultdict(int)
for s in word_sent:
for word in s:
if word not in self._stopwords:
freq[word] += 1
return freq
NewsArticleClass.py 文件源码
python
阅读 29
收藏 0
点赞 0
评论 0
评论列表
文章目录