简体   繁体   English

如果功能是文本摘要,如何在scikit中使用SVC学习?

[英]How do I use SVC in scikit learn if a feature is text summary?


My question is if there are 6 features in a dataset, if some feature are non-numeric, I can convert them via label encoder or other methods. 我的问题是数据集中是否有6个要素,如果某些要素是非数字的,我可以通过标签编码器或其他方法将其转换。 But if one of the feature is a huge text body (a paragraph), what pre-processing techniques should I be using to use to to model a SVC or KNN classifier (and not Naive Bayes) ? 但是,如果功能之一是巨大的文本正文(一个段落),我应该使用哪些预处理技术来建模SVC或KNN分类器(而不是朴素贝叶斯)?
Thanks. 谢谢。

You can use CountVectorizer or TfidfVectorizer, which are standard methods for text feature extraction. 您可以使用CountVectorizer或TfidfVectorizer,这是文本特征提取的标准方法。 You can find the documentation here , and a comprehensive tutorial on working with text data here . 您可以在此处找到文档 ,并在此处找到有关处理文本数据全面教程

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM