新闻分类

最近手头有一个新闻分类的工作。分类是个古老的话题。我贴出来一些有意思的发现,具体的细节此处略过。

首先说一下我用到的特征:

  • 标题tfidf
  • 正文tfidf
  • 单词首次出现的位置,计算公式为log(|D|/first_pos),(我试过|D|/first_pos,不过效果不理想)
分类器我采用了线性的SVM,训练测试集是从sina, sohu, qq, 163, ifeng, people, newschina, xinhuanet等新闻网站的各个频道抓取的内容,总共19个类。其中训练数据168186条,测试数据84094条。

只用正文TFIDF特征

F1= 0.828632839406
classification report:
             precision    recall  f1-score   support

    society       0.66      0.62      0.64      3183
   politics       0.61      0.24      0.34       709
     sports       0.98      0.98      0.98     16501
       tech       0.81      0.85      0.83      8029
        ent       0.87      0.95      0.91     11178
    finance       0.79      0.81      0.80     13396
       life       0.00      0.00      0.00       257
        mil       0.75      0.76      0.75      1406
       auto       0.85      0.90      0.87      3175
      world       0.72      0.52      0.60      3038
       game       0.93      0.88      0.90      2391
     travel       0.66      0.71      0.68      1621
     health       0.71      0.83      0.77      2275
      house       0.87      0.88      0.87      7952
    fashion       0.83      0.67      0.74      1807
       book       0.69      0.77      0.73      3910
  education       0.70      0.70      0.70      2060
    culture       0.46      0.02      0.04       695
       home       0.68      0.69      0.68       511

avg / total       0.83      0.84      0.83     84094

正文特征 + 标题特征

F1= 0.835025935861
classification report:
             precision    recall  f1-score   support

    society       0.68      0.65      0.66      3183
   politics       0.63      0.25      0.36       709
     sports       0.98      0.98      0.98     16501
       tech       0.82      0.85      0.83      8029
        ent       0.89      0.95      0.92     11178
    finance       0.80      0.81      0.81     13396
       life       0.33      0.00      0.01       257
        mil       0.77      0.77      0.77      1406
       auto       0.85      0.90      0.88      3175
      world       0.72      0.53      0.61      3038
       game       0.92      0.89      0.91      2391
     travel       0.69      0.71      0.70      1621
     health       0.73      0.83      0.78      2275
      house       0.87      0.88      0.88      7952
    fashion       0.83      0.68      0.75      1807
       book       0.70      0.79      0.74      3910
  education       0.71      0.72      0.72      2060
    culture       0.52      0.05      0.09       695
       home       0.67      0.68      0.68       511

avg / total       0.84      0.84      0.84     84094

可见标题特征对于分类的作用还是比较明显的


正文特征 + 标题特征 + 单词首次出现位置特征

F1= 0.847837374012
classification report:
             precision    recall  f1-score   support

    society       0.69      0.68      0.69      3183
   politics       0.63      0.32      0.42       709
     sports       0.99      0.98      0.98     16501
       tech       0.83      0.86      0.85      8029
        ent       0.90      0.96      0.93     11178
    finance       0.81      0.83      0.82     13396
       life       0.50      0.01      0.02       257
        mil       0.78      0.78      0.78      1406
       auto       0.87      0.92      0.89      3175
      world       0.73      0.57      0.64      3038
       game       0.93      0.90      0.92      2391
     travel       0.70      0.73      0.72      1621
     health       0.74      0.84      0.79      2275
      house       0.88      0.89      0.89      7952
    fashion       0.84      0.71      0.77      1807
       book       0.72      0.82      0.77      3910
  education       0.73      0.74      0.73      2060
    culture       0.54      0.07      0.12       695
       home       0.69      0.72      0.70       511

avg / total       0.85      0.85      0.85     84094


单词首次出现位置特征对于文本分类效果的影响在某种程度上来说超过了标题的贡献。

这里我只给出了一种位置特征,按道理来说其他类型的位置特征也应该能够对于分类起到较大的作用。


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值