当前位置:   article > 正文

jiagu和jieba的使用_python jiagu 文档

python jiagu 文档

jiagu和jieba的使用

import jiagu
import jieba
import time
text = "183014-山西省脑瘫康复医院_2019年_2019年度行政事业单位国有资产报表"
t = time.time()
words = jiagu.seg(text)
t1 = time.time()
print(words)
print(t1-t)

t2 = time.time()
word = jieba.lcut(text, cut_all=False)
t3 = time.time()
print(word)
print(t3-t2)
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15

jiagu的结果:
Building prefix dict from the default dictionary …
Loading model from cache C:\Users\clt0223\AppData\Local\Temp\jieba.cache
[‘183014’, ‘-’, ‘山西省’, ‘脑瘫’, ‘康复’, ‘医院’, ‘’, ‘2019’, ‘年’, '’, ‘2019’, ‘年度’, ‘行政’, ‘事业单位’, ‘国有资产’, ‘报表’]
0.5056478977203369

jieba的结果:
Loading model cost 0.619 seconds.
[‘183014’, ‘-’, ‘山西省’, ‘脑瘫’, ‘康复’, ‘医院’, ‘’, ‘2019’, ‘年’, '’, ‘2019’, ‘年度’, ‘行政’, ‘事业单位’, ‘国有资产’, ‘报表’]
Prefix dict has been built successfully.
0.6203413009643555

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家小花儿/article/detail/371285
推荐阅读
相关标签
  

闽ICP备14008679号