jieba和thulac使用比较

来源:互联网 发布:北京邮电大学 网络 编辑:程序博客网 时间:2024/06/05 16:20

jieba和thulac使用比较


#coding=utf-8import thulacimport timeimport jieba#test='我们还提供更复杂、完善和精确的分词和词性标注联合模型Model_3和分词词表。该模型是由多语料联合训练训练得到(语料包括来自多文体的标注文本和人民日报标注文本等)'a=jieba.cut('我想听邓紫棋的忘情水')end2=time.time()print (' '.join(a))thu1=thulac.thulac(seg_only=True)text = thu1.cut('我要听邓紫棋的忘情水', text=True)end1=time.time()print (text)


Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 0.645 seconds.
Prefix dict has been built succesfully.
我 想 听 邓紫棋 的 忘情水
Model loaded succeed
我 要 听 邓 紫棋 的 忘情 水

jieba分词效果相对好些。

原创粉丝点击