🎯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
Release files for khmer-nltk 1.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| khmer-nltk-1.6.tar.gz | 7.0 MB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| khmer_nltk-1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.0 MB
Release files / khmer-nltk-1.6.tar.gz
| Download URL | khmer-nltk-1.6.tar.gz |
|---|---|
| Size | 7.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4ecfa4ddef8f88cde63b9f0d7f5544bb8389b3bb87a835f37ae7f6a2a9e3fd57
|
|
BLAKE2b-256 checksum How to use checksums |
e1ee5c8f448d0354788c28f75d6f1cfa5078f697e0153b5e6093d34da37c300a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.11
|
Release files / khmer_nltk-1.6-py3-none-any.whl
| Download URL | khmer_nltk-1.6-py3-none-any.whl |
|---|---|
| Size | 7.0 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d3474a06faf07b7b5bb40922377dd2433aa0db79eff9155b0087783355e7921d
|
|
BLAKE2b-256 checksum How to use checksums |
2a751ece979693214298e216a227087a173379118319620ce6569f49e40776e6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.7.11
|