使用 word2vec 堆栈溢出标签预测器进行文本分类
Text classification with word2vec stack overflow tag predictor
我正在处理堆栈溢出标记预测器。
我有一个数据框 df,其中包含特征 'post' 和标签 'Tags',可以是多标签。
我的 df 是:
Tags post
0 [php] check upload file image without mime type woul...
1 [firefox] prevent firefox close press ctrl-w favorite ed...
2 [r] r error invalid type list variable import matl...
3 [c#] replace special character url probably simple ...
4 [php, api] modify whois contact detail function modify mc...
... ... ...
179995 [delphi] intraweb isapi module throw unrecognized comma...
179996 [c] opencv argc argv confusion check opencv tutori...
179997 [android] list data sdcard want display file name reside...
179998 [java, email] add sort extension imap server mail server sup...
179999 [linux, php] create carddav ldap server share host via php ...
所以想用word2vec做分类预测标签
我想使用所有机器学习分类器,如 SVM、随机森林等
我还要标签的分类报告
所以请帮助我。
word2vec 不是分类器,它是词到向量的转换器,我的建议步骤
1)预处理文本(如停用词和规范化)
2) 使用 TF-IDF 或 word2vec 将单词转换为向量
3) 然后应用 ml 模型(对于多分类,您可以使用 SVM、朴素贝叶斯和逻辑回归)
4) 验证结果
我正在处理堆栈溢出标记预测器。
我有一个数据框 df,其中包含特征 'post' 和标签 'Tags',可以是多标签。
我的 df 是:
Tags post
0 [php] check upload file image without mime type woul...
1 [firefox] prevent firefox close press ctrl-w favorite ed...
2 [r] r error invalid type list variable import matl...
3 [c#] replace special character url probably simple ...
4 [php, api] modify whois contact detail function modify mc...
... ... ...
179995 [delphi] intraweb isapi module throw unrecognized comma...
179996 [c] opencv argc argv confusion check opencv tutori...
179997 [android] list data sdcard want display file name reside...
179998 [java, email] add sort extension imap server mail server sup...
179999 [linux, php] create carddav ldap server share host via php ...
所以想用word2vec做分类预测标签
我想使用所有机器学习分类器,如 SVM、随机森林等
我还要标签的分类报告
所以请帮助我。
word2vec 不是分类器,它是词到向量的转换器,我的建议步骤 1)预处理文本(如停用词和规范化) 2) 使用 TF-IDF 或 word2vec 将单词转换为向量 3) 然后应用 ml 模型(对于多分类,您可以使用 SVM、朴素贝叶斯和逻辑回归) 4) 验证结果