电商分词
安装
pip install ducut
使用方式
from ducut import DuCut
resource_path = '<自定义的资源文件>'
dc = DuCut(resource_path)
line = '万斯 板鞋白红'
cu = dc.cut_query(line)
print(f"brand:{cu.brand},series:{cu.series},color:{cu.color},category:{cu.category},word:{cu.word},proper:{cu.proper}")
# 加载自定义词典
dc.add_word_file("<词典路径>")
# 加载自定义单词
dc.add_word('川久保玲')
思路
- 语义实体:主要用于一些系统尚未识别的实体词,干预后,该词的切分总是能保持一致,不受其所在的上下文影响。
- 语义切分:用于指定在特定上下文中,短语的切分方式,而不影响该短语在其他上下文中的切分方式
参考资料
Metadata
Release files for ducut 0.0.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ducut-0.0.3.tar.gz | 6.0 kB | Without provenance | Details for ducut-0.0.3.tar.gz |
Release files / ducut-0.0.3.tar.gz
| Download URL | ducut-0.0.3.tar.gz |
|---|---|
| Size | 6.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
703d9b4e3ce3f78c91317a3aec4918280fb82a96d23d1c9904761080634c78a8
|
|
BLAKE2b-256 checksum How to use checksums |
cb7cd88037a6b3fac036e8c3503961ad49bb757524e92376dc1c1813fa0adf6b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6
|
Security for ducut 0.0.3
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.