Stanford PTBTokenizer使用时所遇到的问题

根据网站https://nlp.stanford.edu/software/tokenizer.html所述,Stanford Tokenizer不是独立发布的,而是涵盖在一些software包中,例如Stanford Parser,  Stanford Part-of-Speech Tagger, Stanford Named Entity Recognizer 和 Stanford CoreNLP。本文选择Stanford Parser 进行下载。


进入下列网址中,选择包含PTBTokenizer的software。

https://nlp.stanford.edu/software/

目前下载到最新的Stanford-parser-full-2018-02-27。


由于下载的software包存放位置因人而异,所以在使用前需要set  CLASSPATH,以便找到stanford-parser.jar。打开terminal,输入

export CLASSPATH=~/xxx/xxx/stanford-parser.jar
stanford-parser.jar前面的路径指的是锁下载的software压缩包所在的路径。


(以桌面上comment文件夹中的comments.txt为例)然后输入

java edu.stanford.nlp.process.PTBTokenizer -preserveLines ~/Desktop/comment/comments.txt > ~/Desktop/comment/comments-token.txt

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值