A Khmer language processing toolkit
Project description
๐ฏTODO
- Sentence Segmentation
- Word Segmentation
- Part of speech Tagging
- Named Entity Recognition
- 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/VietHoang1512/khmer-nltk}}
}
Used in:
- stopes: A library for preparing data for machine translation research
- LASER Language-Agnostic SEntence Representations
- Pretrained Models and Evaluation Data for the Khmer Language
- Multilingual Open Text 1.0: Public Domain News in 44 Languages
- ZusammenQA: Data Augmentation with Specialized Models for Cross-lingual Open-retrieval Question Answering System
- Shared Task on Cross-lingual Open-Retrieval QA
- No Language Left Behind: Scaling Human-Centered Machine Translation
- Wordless
๐จโ๐ References
- NLP: Text Segmentation Using Conditional Random Fields
- Khmer Word Segmentation Using Conditional Random Fields
- Word Segmentation of Khmer Text Using Conditional Random Fields
๐ Advisor
- Prof. Huong Le Thanh
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.6.tar.gz
(7.0 MB
view details)
Built Distribution
File details
Details for the file khmer-nltk-1.6.tar.gz
.
File metadata
- Download URL: khmer-nltk-1.6.tar.gz
- Upload date:
- Size: 7.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4ecfa4ddef8f88cde63b9f0d7f5544bb8389b3bb87a835f37ae7f6a2a9e3fd57 |
|
MD5 | f3d71ace85a2037163a8739a98a9eb4e |
|
BLAKE2b-256 | e1ee5c8f448d0354788c28f75d6f1cfa5078f697e0153b5e6093d34da37c300a |
File details
Details for the file khmer_nltk-1.6-py3-none-any.whl
.
File metadata
- Download URL: khmer_nltk-1.6-py3-none-any.whl
- Upload date:
- Size: 7.0 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.7.11
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d3474a06faf07b7b5bb40922377dd2433aa0db79eff9155b0087783355e7921d |
|
MD5 | af2e91c9b7d015927a7684d9aa24552f |
|
BLAKE2b-256 | 2a751ece979693214298e216a227087a173379118319620ce6569f49e40776e6 |