A Khmer language processing toolkit
Project description
๐ Khmer natural language processing toolkit๐
๐ฏTODO
- Sentence Segmentation
- Word Segmentation
- Named Entity Recognition
- Part of speech Tagging
- Text classification
๐ชInstallation
$ pip install khmer-nltk
๐น Quick tour
To get the evaluation result of khmer-nltk's functionalities, please refer the sub-modules's readme
Sentence tokenization
>>> from khmernltk import sentence_tokenize
>>> raw_text = "แแฝแแแแแถแแแธแขแจ! แขแฃ แแปแแถ แแแแถแแแธแแแแแแแแถแแถแแทแแแถแแแแแแแแทแแแแแแ แแถแแแ
แแแแ
แแแแแแแแแถแ แแถแแแแแแบแแแแแทแแถแ แแทแแแถแแแฝแแแฝแแแถแแแแธ"
>>> print(sentence_tokenize(raw_text))
['แแฝแแแแแถแแแธแขแจ!', 'แขแฃ แแปแแถ แแแแถแแแธแแแแแแแแถแแถแแทแแแถแแแแแแแแทแแแแแแ แแถแแแ
แแแแ
แแแแแแแแแถแ แแถแแแแแแบแแแแแทแแถแ แแทแแแถแแแฝแแแฝแแแถแแแแธ']
Word tokenization
>>> from khmernltk import word_tokenize
>>> raw_text = "แแฝแแแแแถแแแธแขแจ! แขแฃ แแปแแถ แแแแถแแแธแแแแแแแแถแแถแแทแแแถแแแแแแแแทแแแแแแ แแถแแแ
แแแแ
แแแแแแแแแถแ แแถแแแแแแบแแแแแทแแถแ แแทแแแถแแแฝแแแฝแแแถแแแแธ"
>>> print(word_tokenize(raw_text, return_tokens=True))
['แแฝแ', 'แแแแถแ', 'แแธ', 'แขแจ', '!', ' ', 'แขแฃ', ' ', 'แแปแแถ', ' ', 'แแแแถแแแธ', 'แแแแแแแแถ', 'แแถแแท', 'แแแถแ', 'แแแแแ', 'แแทแ', 'แแแแแ', ' ', 'แแถแ', 'แแ
', 'แแแแ
แแ', 'แแแแแแแถแ', ' ', 'แแถแ', 'แแแแแบ', 'แแแแแทแแถแ', ' ', 'แแทแ', 'แแถแแแฝแแแฝแ', 'แแถแแแแธ']
POS Tagging
Usage
>>> from khmernltk import pos_tag
>>> raw_text = "แแฝแแแแแถแแแธแขแจ! แขแฃ แแปแแถ แแแแถแแแธแแแแแแแแถแแถแแทแแแถแแแแแแแแทแแแแแแ แแถแแแ
แแแแ
แแแแแแแแแถแ แแถแแแแแแบแแแแแทแแถแ แแทแแแถแแแฝแแแฝแแแถแแแแธ"
>>> print(pos_tag(raw_text))
[('แแฝแ', 'n'), ('แแแแถแ', 'n'), ('แแธ', 'n'), ('แขแจ', '1'), ('!', '.'), (' ', 'n'), ('แขแฃ', '1'), (' ', 'n'), ('แแปแแถ', 'n'), (' ', 'n'), ('แแแแถแแแธ', 'n'), ('แแแแแแแแถ', 'n'), ('แแถแแท', 'n'), ('แแแถแ', 'o'), ('แแแแแ', 'n'), ('แแทแ', 'o'), ('แแแแแ', 'n'), (' ', 'n'), ('แแถแ', 'v'), ('แแ
', 'v'), ('แแแแ
แแ', 'v'), ('แแแแแแแถแ', 'n'), (' ', 'n'), ('แแถแ', 'v'), ('แแแแแบ', 'n'), ('แแแแแทแแถแ', 'n'), (' ', 'n'), ('แแทแ', 'o'), ('แแถแแแฝแแแฝแ', 'n'), ('แแถแแแแธ', 'o')]
โ๏ธ Citation
@misc{hoang-khmer-nltk,
author = {Phan Viet Hoang},
title = {Khmer Natural Language Processing Tookit},
year = {2020},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/VietHoang1710/khmer-nltk}}
}
๐จโ๐ References
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
khmer-nltk-1.3.tar.gz
(13.6 kB
view details)
Built Distribution
File details
Details for the file khmer-nltk-1.3.tar.gz
.
File metadata
- Download URL: khmer-nltk-1.3.tar.gz
- Upload date:
- Size: 13.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ab8cdd2bb927ec574e6ec11852b3a11e874f2985f9b82446bf22211280c3d99 |
|
MD5 | ca441cec4b8b6f6b2da0c80b4cef26a4 |
|
BLAKE2b-256 | d43e1b0b4c62173f57f48702efdd1efb9884191e861880e917c8a7b0e121b3e5 |
File details
Details for the file khmer_nltk-1.3-py3-none-any.whl
.
File metadata
- Download URL: khmer_nltk-1.3-py3-none-any.whl
- Upload date:
- Size: 7.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.6.0.post20200814 requests-toolbelt/0.9.1 tqdm/4.55.1 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95ef5879f049e771d5240e57321c24810db8442ba27bdff2d4367b27ca5a8cf1 |
|
MD5 | 538b9bb37f77c029ce066e77892ec887 |
|
BLAKE2b-256 | 0d6114ad3b462871b70a408d94870cb3ee342f69584365dd343ea2e378e743d1 |