pipelines.py 文件源码

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

项目:magic 作者: pan-webis-de 项目源码 文件源码
def word_bigrams():
    preprocessor = TextCleaner(lowercase=True,
                               filter_urls=True,
                               filter_mentions=True,
                               filter_hashtags=True,
                               alphabetic=True,
                               strip_accents=True,
                               filter_rt=True)
    pipeline = Pipeline([('vect', CountVectorizer(preprocessor=preprocessor,
                                                  ngram_range=(2, 2))),
                         ('tfidf', TfidfTransformer(sublinear_tf=True)),
                         ('scale', Normalizer())])
    return ('word_bigrams', pipeline)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号