Skip to main content

Python binding for nlpO3 Thai language processing library

Project description

Python binding for nlpO3, a Thai natural language processing library in Rust.

Features

  • Word tokenizer
    • maximal-matching dictionary-based tokenization
    • 2x faster than similar pure Python implementation (PyThaiNLP's newmm)
    • support custom dictionary

Install

pip install nlpo3

Usage

Tokenization using default dictionary:

from nlpo3 import segment

segment("สวัสดีครับ")

Load file path/to/dict.file to memory and assigned it with name dict_name. Then tokenize a text with dict_name dictionary:

from nlpo3 import load_dict, segment

load_dict("path/to/dict.file", "dict_name")
segment("สวัสดีครับ", "dict_name")

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

nlpo3-1.1.0.tar.gz (4.3 kB view hashes)

Uploaded Source

Built Distributions

nlpo3-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.9 MB view hashes)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

nlpo3-1.1.0-cp39-cp39-macosx_11_0_x86_64.whl (10.9 MB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

nlpo3-1.1.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.9 MB view hashes)

Uploaded CPython 3.8 manylinux: glibc 2.17+ x86-64

nlpo3-1.1.0-cp38-cp38-macosx_11_0_x86_64.whl (9.9 MB view hashes)

Uploaded CPython 3.8 macOS 11.0+ x86-64

nlpo3-1.1.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.9 MB view hashes)

Uploaded CPython 3.7m manylinux: glibc 2.17+ x86-64

nlpo3-1.1.0-cp37-cp37m-macosx_11_0_x86_64.whl (8.9 MB view hashes)

Uploaded CPython 3.7m macOS 11.0+ x86-64

nlpo3-1.1.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (10.9 MB view hashes)

Uploaded CPython 3.6m manylinux: glibc 2.17+ x86-64

nlpo3-1.1.0-cp36-cp36m-macosx_11_0_x86_64.whl (8.9 MB view hashes)

Uploaded CPython 3.6m macOS 11.0+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page