preprocessing.py 文件源码

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

项目:KATE 作者: hugochan 项目源码 文件源码
def tiny_tokenize_xml(text, stem=False, stop_words=[]):
    return [EnglishStemmer().stem(token) if stem else token for token in wordpunct_tokenize(
                        re.sub('[%s]' % re.escape(string.punctuation), ' ', text.encode(encoding='ascii', errors='ignore'))) if
                        not token.isdigit() and not token in stop_words]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号