Re: [问题] Rwordseg自定义词库

楼主: psinqoo (零度空間)   2017-04-25 22:13:43
借标题一下
新的中文 文字采矿 package
https://github.com/taiyun/chinese.misc
可以研究看看
※ 引述《dustnight (一起做个有温度的人)》之铭言:
: [问题类型]:程式咨询
: [软件熟悉度]:
: 新手(没写过程式,R 是我的第一次)
: [问题叙述]:
: 最近在做text mining的练习,由于断词的过程需要考量一些专有名词,
: 因此采用Rwordseg进行断词,断词的过程当中,会遇到安装词典/或是使用自定义词典
: 的状况,产生了一些问题想来请问前辈们。
: 1. 在使用installDict时,想安装NTUSD的资料辞典,使用以下指令:
: installDict(file.choose(),"positive",dicttype="text")
: 但是安装后却出现
: 1 words were loaded! ... New dictionary 'positive' was installed!
: There were 50 or more warnings (use warnings() to see the first 50)
: Warning messages:
: 1: In readLines(dictpath, encoding = dic.enc) :
: line 1 appears to contain an embedded nul
: 等问题,看起来是有安装成功但是点进去dic档案里面看却发现只有一个词汇(原本txt档案
: 想来请问各位前辈们是否有遇到过类似问题,又该怎么解决?
: 2.
: 在自定义词库时,我用insertwords("毕业证书",save=T)来增加毕业证书这个词汇
: 但是在segmentCN("自己的毕业证书自己捡")做测试时,却仍然会有
: [1] "自己" "的" "毕业" "证书" "自己" "捡"
: 的状况,(反而结巴还会断出毕业证书...)
: 是我没有增加词库成功吗?
: 3.
: 目前不使用结巴的原因在于不确定结巴是否可以自行增加词库
: [环境叙述]:
: R version 3.3.3 (2017-03-06)
: Platform: x86_64-apple-darwin13.4.0 (64-bit)
: Running under: OS X El Capitan 10.11.6
: locale:
: [1] zh_TW.UTF-8/zh_TW.UTF-8/zh_TW.UTF-8/C/zh_TW.UTF-8/zh_TW.UTF-8
: attached base packages:
: [1] stats graphics grDevices utils datasets methods base
: other attached packages:
: [1] igraph_1.0.1 wordcloud_2.5 RColorBrewer_1.1-2 Rwordseg_0.2-1
: [5] jiebaR_0.9.1 jiebaRD_0.1 rJava_0.9-8 tm_0.7-1
: [9] NLP_0.1-9 tmcn_0.1-4
: loaded via a namespace (and not attached):
: [1] magrittr_1.5 parallel_3.3.3 tools_3.3.3 Rcpp_0.12.7 slam_0.1-38
: [关键字]:
: text mining, Rwordseg
作者: minchang (Aaron)   2017-05-01 17:41:00
刚刚试了一下,繁体中文的资料会变乱码。

Links booklink

Contact Us: admin [ a t ] ucptt.com