gen_ngrams.py 文件源码

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

项目:stance_detection 作者: StanceDetection 项目源码 文件源码
def _get_ngrams(self, text, n):
        tokens = nltk.word_tokenize(text)
        tokens = [ token.lower() for token in tokens if len(token) > 1 ]
        ngram_list = list(nltk.ngrams(tokens, n))
        return ngram_list
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号