本人小白一枚,现在正在做分词和文本挖掘的事情,翻译了下sklearn.feature_extraction.text.CountVectorizer,有错误之处还请大佬指出
将文本文档集合转换为计数矩阵此实现使用scipy.sparse.csr_matrix生成计数的稀疏表示。如果您不提供先验词典并且不使用执行某种特征选择的分析器,则功能的数量将等于通过分析数据找到的词汇量。
用法:
sklearn.feature_extraction.text(input=’content’,encoding=’utf8’, decode_error=’strict’,strip_accents=None, lowercase=True, preprocessor=None, tokenizer=None, stop_words=None, token_pattern=’(?u)\b\w\w+\b’, ngram_range=(1, 1), analyzer=’word’, max_df=1.0, min_df=1, max_features=None