分词工具
Project description
分词工具
python版(有node版)
安装
pip install nlp_segmentation
command-line
搜狗分词
$ sougou_fenci 武汉市长江大桥
武汉市 n
长江 n
大桥 n
百度分词
$ baidu_fenci 武汉市长江大桥
武汉 地名
长江大桥 地名
sougou 分词 code
import nlp_segmentation
resp = nlp_segmentation.sougou("武汉市长江大桥")
for result_item in resp.result:
print(row_format.format(result_item[0], result_item[1]))
# 结 果
# 武汉市 n
# 长江 n
# 大桥 n
baidu 分词 code
import nlp_segmentation
resp = nlp_segmentation.baidu("武汉市长江大桥")
for result_item in resp.result:
print(row_format.format(result_item[0], result_item[1]))
# 结 果
# 武汉市 地名
# 长江大桥 地名
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
nlp_segmentation-1.2.5.tar.gz
(3.0 kB
view hashes)
Built Distribution
Close
Hashes for nlp_segmentation-1.2.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 273a031c2f195f5b4af7f3d96ffcec882fc112dfcbc74978e294ef0868e4cf16 |
|
MD5 | 9aee87caa6c2f13b71ac1b0144db8c0d |
|
BLAKE2b-256 | e535e0f0dbbf01525f97b73e4ae5c4f6033618c7640f874da064b9c70a9ffc50 |