Skip to content

Commit e4aa1b7

Browse files
committed
3.3.1
1 parent 55174cd commit e4aa1b7

File tree

4 files changed

+13
-9
lines changed

4 files changed

+13
-9
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# 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>
33
<a href="https://github.com/hyunwoongko/kss/issues"><img alt="Issues" src="https://img.shields.io/github/issues/hyunwoongko/kss"/></a>
44

55
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.

docs/UPDATE.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -179,4 +179,7 @@
179179

180180
>>> split_sentences(text, backend="none")
181181
['부디 만수무강 하옵소서 천천히 가세용~', '너 밥을 먹는구나 응 맞아 난 근데 어제 이사했음 그랬구나 이제 마지막임 응응'
182-
```
182+
```
183+
184+
#### Kss 3.3.1
185+
- Disable multiprocessing if length of input list is 1.

kss/kss.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,6 @@ def split_sentences(
9898
num_workers = get_num_workers(num_workers)
9999
results = []
100100

101-
if num_workers in [0, 1]:
102-
pool = None
103-
else:
104-
pool = Pool(max_workers=num_workers)
105-
106101
max_recover_step = length_constraints(
107102
text,
108103
max_recover_length,
@@ -118,6 +113,11 @@ def split_sentences(
118113
else:
119114
_text = text
120115

116+
if num_workers in [0, 1]:
117+
pool = None
118+
else:
119+
pool = Pool(max_workers=num_workers)
120+
121121
if pool:
122122
preprocessed_list = pool.map(build_preprocessed_list, _text)
123123
else:
@@ -137,7 +137,8 @@ def split_sentences(
137137

138138
mp_postprocessing.append(out)
139139

140-
if pool:
140+
print(mp_input_texts)
141+
if pool and len(mp_input_texts) >= 2:
141142
results += pool.map(
142143
partial(
143144
_split_sentences,

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def read_file(filename, cb):
1616

1717
setup(
1818
name="kss",
19-
version="3.3.0",
19+
version="3.3.1",
2020
author="Hyunwoong Ko",
2121
author_email="[email protected]",
2222
url="https://github.com/hyunwoongko/kss",

0 commit comments

Comments
 (0)