TopicDet.py 文件源码

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

项目:Data-Mining-From-Twitter 作者: N1h1l1sT 项目源码 文件源码
def get_vocabulary(doc_set):
    tokenizer = RegexpTokenizer(r'\w+')
    distinctwords = {}
    i = 0
    # loop through document list
    for text in doc_set:
        raw = text.lower()
        tokens = tokenizer.tokenize(raw)
        for word in tokens:
            if word not in distinctwords:
                distinctwords[word] = i
                i += 1
    return distinctwords
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号