svmlight使用总结

首先我们需要了解svmlight的工作方式,可以参见我的github中介绍:
网址:

这里就简单介绍一下:

  1. 我们首先要安装svmlight
    mkdir svm_light
    Download svm_light.tar.gz from svmlight.joachims.org and put it in your svm_light directory.
    cd svm_light
    gunzip -c svm_light.tar.gz | tar xvf -
    make
  2. 然后以官网上的例子为例介绍如何使用svmlight
    我们首先还是要在官网上找到如下一段话,点击下载
    Download example1.tar.gz from svmlight.joachims.org.
    gunzip -c example1.tar.gz | tar xvf -
    This will create a directory called example1 that contains the training examples (train.dat) and the test examples (test.dat). To learn a support vector classifier for the training examples and then use it to classify the test examples, do this:
    之后呢按照如下操作进行:
    ./svm_learn example1/train.dat example1/model
    ./svm_classify example1/test.dat example1/model example1/predictions
    得到的predictions文件就是我们想要的结果啦~
  3. 但是通过观察train.dat我们可以发现,他的格式似乎不是那么容易得到~
    接下来以我实际的代码为例讲解一下如何生成这种格式
    https://github.com/angelamin/Natural_Language_Processing/blob/master/Natural_Language_Processing_Lab_Task3/%E4%BB%BB%E5%8A%A1%E4%B8%89%E4%BB%8B%E7%BB%8D.rtf
    以上链接是我的具体任务的介绍,简单介绍一下,我要实现将给定的语料,实现以B开头,I结尾,然后用svmlight来处理,得到以后测试文件对应汉字的B/I
    然后就开始了我的格式处理之路,大家具体参考我的代码吧~
    另外,关于所有处理程序的关键思想都写在introduce目录下
    最后我给出这个项目的网址:
    https://github.com/angelamin/Natural_Language_Processing/tree/master/Natural_Language_Processing_Lab_Task3

希望对大家有帮助~

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值