mirror of
https://github.com/fxsjy/jieba.git
synced 2025-07-10 00:01:33 +08:00
Update README.md
This commit is contained in:
parent
1bb497ac09
commit
825da757d0
13
README.md
13
README.md
@ -118,7 +118,18 @@ Output:
|
|||||||
北京 ns
|
北京 ns
|
||||||
天安门 ns
|
天安门 ns
|
||||||
|
|
||||||
|
功能 5) : 并行分词
|
||||||
|
==================
|
||||||
|
* 将目标文本按行分隔后,把各行文本分配到多个python进程并行分词,然后归并结果,从而获得分词速度的可观提升
|
||||||
|
* 基于python自带的multiprocessing模块,目前暂不支持windows
|
||||||
|
* 用法:
|
||||||
|
jieba.enable_parallel(4) # 开启并行分词模式,参数为并行进程数
|
||||||
|
jieba.disable_parallel() # 关闭并行分词模式
|
||||||
|
|
||||||
|
* 例子:
|
||||||
|
https://github.com/fxsjy/jieba/blob/master/test/parallel/test_file.py
|
||||||
|
|
||||||
|
* 实验结果:在4核3.4GHz Linux机器上,对金庸全集进行分词,获得了1MB/s的速度,是单进程版的3.3倍。
|
||||||
|
|
||||||
其他词典
|
其他词典
|
||||||
========
|
========
|
||||||
|
Loading…
x
Reference in New Issue
Block a user