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:
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.1.tar.gz
(14.0 kB
view details)
Built Distribution
File details
Details for the file khmer-nltk-1.1.tar.gz
.
File metadata
- Download URL: khmer-nltk-1.1.tar.gz
- Upload date:
- Size: 14.0 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.49.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb25570714a89d095c148c0071b516b4149406ba4c352ce128abde417d47a05a |
|
MD5 | 01ac40f7e6d5e7b91064d4a16c000c36 |
|
BLAKE2b-256 | cf69fe39bdde57897ef0aa6fc1ce3744ecdb490887cba8f5c005ea366dfaf049 |
File details
Details for the file khmer_nltk-1.1-py3-none-any.whl
.
File metadata
- Download URL: khmer_nltk-1.1-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.49.0 CPython/3.7.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d094ef5f9bfe84c021935e05261cc80129191a9ed15b96c20c2674e2b4a29de |
|
MD5 | f0faf38e0741fe15b24ace3bc6233811 |
|
BLAKE2b-256 | 5679e9392a5e0c110720aebc47f67104a8dd344f313943747e7141fd660b8d5b |