File tree 4 files changed +13
-9
lines changed
4 files changed +13
-9
lines changed Original file line number Diff line number Diff line change 1
1
# Kss: A Toolkit for Korean sentence segmentation
2
- <img alt =" latest version " src =" https://img.shields.io/badge/latest%20version-3.3.0 -blue.svg " /> <a href =" https://github.com/hyunwoongko/kss/blob/master/LICENSE " ><img alt =" BSD 3-Clause " src =" https://img.shields.io/badge/license-BSD%203%20Clause-blue.svg " /></a >
2
+ <img alt =" latest version " src =" https://img.shields.io/badge/latest%20version-3.3.1 -blue.svg " /> <a href =" https://github.com/hyunwoongko/kss/blob/master/LICENSE " ><img alt =" BSD 3-Clause " src =" https://img.shields.io/badge/license-BSD%203%20Clause-blue.svg " /></a >
3
3
<a href =" https://github.com/hyunwoongko/kss/issues " ><img alt =" Issues " src =" https://img.shields.io/github/issues/hyunwoongko/kss " /></a >
4
4
5
5
This repository contains the source code of Kss, a representative Korean sentence segmentation toolkit. I also conduct ongoing research about Korean sentence segmentation algorithms and report the results to this repository.
Original file line number Diff line number Diff line change 179
179
180
180
>> > split_sentences(text, backend = " none" )
181
181
[' 부디 만수무강 하옵소서 천천히 가세용~' , ' 너 밥을 먹는구나 응 맞아 난 근데 어제 이사했음 그랬구나 이제 마지막임 응응'
182
- ```
182
+ ```
183
+
184
+ # ### Kss 3.3.1
185
+ - Disable multiprocessing if length of input list is 1 .
Original file line number Diff line number Diff line change @@ -98,11 +98,6 @@ def split_sentences(
98
98
num_workers = get_num_workers (num_workers )
99
99
results = []
100
100
101
- if num_workers in [0 , 1 ]:
102
- pool = None
103
- else :
104
- pool = Pool (max_workers = num_workers )
105
-
106
101
max_recover_step = length_constraints (
107
102
text ,
108
103
max_recover_length ,
@@ -118,6 +113,11 @@ def split_sentences(
118
113
else :
119
114
_text = text
120
115
116
+ if num_workers in [0 , 1 ]:
117
+ pool = None
118
+ else :
119
+ pool = Pool (max_workers = num_workers )
120
+
121
121
if pool :
122
122
preprocessed_list = pool .map (build_preprocessed_list , _text )
123
123
else :
@@ -137,7 +137,8 @@ def split_sentences(
137
137
138
138
mp_postprocessing .append (out )
139
139
140
- if pool :
140
+ print (mp_input_texts )
141
+ if pool and len (mp_input_texts ) >= 2 :
141
142
results += pool .map (
142
143
partial (
143
144
_split_sentences ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ def read_file(filename, cb):
16
16
17
17
setup (
18
18
name = "kss" ,
19
- version = "3.3.0 " ,
19
+ version = "3.3.1 " ,
20
20
author = "Hyunwoong Ko" ,
21
21
22
22
url = "https://github.com/hyunwoongko/kss" ,
You can’t perform that action at this time.
0 commit comments