def __init__(self, norm='l2', use_idf=True, smooth_idf=True,
sublinear_tf=False, **kwargs):
self.tfidf = TfidfTransformer(norm=norm, use_idf=use_idf,
smooth_idf=smooth_idf,
sublinear_tf=sublinear_tf)
# override defaults since we need the counts here
self.verbose = kwargs.get('verbose', 0)
binary = kwargs.pop('binary', False)
dtype = kwargs.pop('dtype', np.int64)
# pass remaining args to countvectorizer
self._init_params(name="TFIDF", binary=binary, dtype=dtype, **kwargs)
评论列表
文章目录