NewsArticleClass.py 文件源码

python
阅读 29 收藏 0 点赞 0 评论 0

项目:Python-Scripts-Repo-on-Data-Science 作者: qalhata 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号