Skip to main content

OKNLP

Test Linux Test Mac OS Test Windows PyPI Documentation Status codecov

安装方法

CPU only

$ pip install "oknlp[cpu]"

GPU

请参考 安装 - OKNLP文档

系统支持

Windows Linux Mac OS
Python3.6 √ √
Python3.7 √ √ √
Python3.8 √ √ √
Python3.9 √ √ √

快速入门

中文分词

import oknlp

if __name__ == "__main__":
    model = oknlp.cws.get_by_name("thulac")
    model([
        "我爱北京天安门"
    ])
    # [['我', '爱', '北京', '天安门']]

完整文档请参考 中文分词 - OKNLP文档

命名实体识别

import oknlp

if __name__ == "__main__":
    model = oknlp.ner.get_by_name("bert")
    model([
        "我爱北京天安门"
    ])
    # [[{'type': 'LOC', 'begin': 2, 'end': 4}, {'type': 'LOC', 'begin': 4, 'end': 7}]]

完整文档请参考 命名实体识别 - OKNLP文档

词性标注

import oknlp

if __name__ == "__main__":
    model = oknlp.postagging.get_by_name("bert")
    model([
        "我爱北京天安门"
    ])
    # [[('我', 'PN'), ('爱', 'VV'), ('北京', 'NR'), ('天安门', 'NR')]]

完整文档请参考 词性标注 - OKNLP文档

细粒度实体分类

import oknlp

if __name__ == "__main__":
    model = oknlp.typing.get_by_name("bert")
    model([
        ("我爱北京天安门", (2, 4))
    ])
    # [[('location', 0.7169095873832703), ('place', 0.8128180503845215), ('city', 0.6188656687736511), ('country', 0.12475886940956116)]]

完整文档请参考 细粒度实体分类 - OKNLP文档

贡献者

@a710128

@Yumiko-188

@HuShaoRu

Metadata

Release files for oknlp 0.0.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for oknlp 0.0.5
File
oknlp-0.0.5-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.12+ x86-64 Details
oknlp-0.0.5-cp39-cp39-win_amd64.whl CPython 3.9 CPython 3.9 Windows x86-64 Details
oknlp-0.0.5-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.12+ x86-64 Details
oknlp-0.0.5-cp39-cp39-macosx_10_14_x86_64.whl CPython 3.9 CPython 3.9 macOS 10.14+ x86-64 Details
oknlp-0.0.5-cp38-cp38-win_amd64.whl CPython 3.8 CPython 3.8 Windows x86-64 Details
oknlp-0.0.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.8 CPython 3.8 Linux glibc 2.12+ x86-64 Details
oknlp-0.0.5-cp38-cp38-macosx_10_14_x86_64.whl CPython 3.8 CPython 3.8 macOS 10.14+ x86-64 Details
oknlp-0.0.5-cp37-cp37m-win_amd64.whl CPython 3.7 CPython 3.7 pymalloc Windows x86-64 Details
oknlp-0.0.5-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64 Details
oknlp-0.0.5-cp37-cp37m-macosx_10_14_x86_64.whl CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64 Details
oknlp-0.0.5-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64 Details
oknlp-0.0.5-cp36-cp36m-macosx_10_14_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64 Details

Total release size: 4.4 MB

Release files / oknlp-0.0.5-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL oknlp-0.0.5-cp310-cp310-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 750.6 kB
Tags CPython 3.10 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
3fe959a06dff0d36071ad854c3fa0fde4d208b8b4bc344b4fd164b6ef9e2c755
BLAKE2b-256 checksum
How to use checksums
de0ba274c4a31b9ff50a126af77c802d13de05caf39dffb69e45d0a9116fc75d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp39-cp39-win_amd64.whl

Download URL oknlp-0.0.5-cp39-cp39-win_amd64.whl
Size 83.8 kB
Tags CPython 3.9 Windows x86-64
SHA-256 checksum
How to use checksums
053488067b846f635b8044f76e1be810b0b8fb816b0e537da0a9476745820d1d
BLAKE2b-256 checksum
How to use checksums
bde118bfd8fe4fbdefdd983cd938e5c8e54c5494a4c93868e6c781fa21bcf37c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL oknlp-0.0.5-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 750.2 kB
Tags CPython 3.9 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
7da7a41ff963d5d8a753260e88fc793fbca41958eaea1fe862ff8a956f6fdde6
BLAKE2b-256 checksum
How to use checksums
809bfe62344d3a7672fd7e60eb1653bd29b24e92c5eaed42f5524c81670210be
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp39-cp39-macosx_10_14_x86_64.whl

Download URL oknlp-0.0.5-cp39-cp39-macosx_10_14_x86_64.whl
Size 99.1 kB
Tags CPython 3.9 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
f3f3c7d86fa5cbcb27868106a25a0555318388eece17dcba898e2cf052ff8758
BLAKE2b-256 checksum
How to use checksums
c168f52f9b51a1c1802b10955bf1df7aa001a26b5b62b75723209ba4bcc91a50
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp38-cp38-win_amd64.whl

Download URL oknlp-0.0.5-cp38-cp38-win_amd64.whl
Size 83.8 kB
Tags CPython 3.8 Windows x86-64
SHA-256 checksum
How to use checksums
b1904de6441ffeed29e6417323a03721fa34bb51c1fe4b9a1c3a8406973b79e7
BLAKE2b-256 checksum
How to use checksums
dbc63f4f132b629504badb99c1c870c749a179fef073893649e55d25544d85f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL oknlp-0.0.5-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 750.7 kB
Tags CPython 3.8 Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
03e1162e064a9b1098411c6223654332597fccd788e9db5e73bd04c9be6e534d
BLAKE2b-256 checksum
How to use checksums
93d6da525ddbade217755f0031e171b6edd46675e4d502d0d84eaf99e232c4f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp38-cp38-macosx_10_14_x86_64.whl

Download URL oknlp-0.0.5-cp38-cp38-macosx_10_14_x86_64.whl
Size 99.1 kB
Tags CPython 3.8 macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
abca5d72b659519d91ab5a5003d7d4e7bd1058197d1c4f83463cd3e71ebabfdd
BLAKE2b-256 checksum
How to use checksums
1b3fabf869ef993e6ea72e1896a81587ebf6dbd05c56bc92339f0a2a3a1e2eb2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp37-cp37m-win_amd64.whl

Download URL oknlp-0.0.5-cp37-cp37m-win_amd64.whl
Size 83.8 kB
Tags CPython 3.7 CPython 3.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
746bcfab4e735e78b766db3b48601a0277a15ec0d742fd96f9a123d7cce816c8
BLAKE2b-256 checksum
How to use checksums
ab92514d5f68b2a9b5bad7be280cdacb0ae3acfeaecc821d2fadd6ddde94cd18
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL oknlp-0.0.5-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 751.7 kB
Tags CPython 3.7 CPython 3.7 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
125f8c5b50fe531e6651b33d853f8356afc03393870d4ca867cb46bcd3ff10fa
BLAKE2b-256 checksum
How to use checksums
fc17f8db3dea85b8cf3bb887ae0d59c3634e118091f6bef37e0a5ff80962f5f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp37-cp37m-macosx_10_14_x86_64.whl

Download URL oknlp-0.0.5-cp37-cp37m-macosx_10_14_x86_64.whl
Size 99.1 kB
Tags CPython 3.7 CPython 3.7 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
f79dd652c0d4acbeb04b2da8f2fb2477f34bff9ccc8a422925afeb537d08aa60
BLAKE2b-256 checksum
How to use checksums
b9e6c5ede50874a6b7c0311d1403843b03c50396d9146e437548d0d2ffa5c3f9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl

Download URL oknlp-0.0.5-cp36-cp36m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl
Size 750.7 kB
Tags CPython 3.6 CPython 3.6 pymalloc Linux glibc 2.12+ x86-64
SHA-256 checksum
How to use checksums
5954e55e71cbccbe83d9f3bcbb1914093b744118cab968d0f2745a7ddcda8535
BLAKE2b-256 checksum
How to use checksums
08aa87890169c191287f34cf2f8bb9066adac2da42b0a393637004bc8c111375
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6

Release files / oknlp-0.0.5-cp36-cp36m-macosx_10_14_x86_64.whl

Download URL oknlp-0.0.5-cp36-cp36m-macosx_10_14_x86_64.whl
Size 99.1 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.14+ x86-64
SHA-256 checksum
How to use checksums
9964b004c2bed77dc047b2f2fc4894cf79dc38e6f5683e8ac0afe667a1930cb9
BLAKE2b-256 checksum
How to use checksums
37661cc02fc877558c045fe1ee6e6cd1cefde5863b0c04c2f80d6829b138b3c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.9.6
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page