KhamYo

Thai abbreviation to full text library


Keywords
NLP, natural, language, processing, text, analytics, localization, computational, linguistics, ThaiNLP, Thai
License
Apache-2.0
Install
pip install KhamYo==0.2.0

Documentation

KhamYo : āļ„āļģāļĒāđˆāļ­

Thai abbreviation to full text tool

Install

pip install khamyo

How to use

just call replace function and use it!!!

from khamyo import replace

print(replace("āļ•āļ­āļ™āļ—āļĩāđˆāļœāļĄāđ€āļ›āđ‡āļ™āļ„āļĢāļđāļ­āļąāļ•āļĢāļēāļˆāđ‰āļēāļ‡ āđ„āļ›āļ­āļĒāļđāđˆāđ€āļ§āļĢāļ—āļĩāđˆāļĢāļĢ.āļ—āļļāļāļ§āļąāļ™ āļˆāļ™āļāļĢāļ°āļ—āļąāđˆāļ‡āđ„āļ”āđ‰āļšāļĢāļĢāļˆāļļāļĢāļąāļšāļĢāļēāļŠāļāļēāļĢāđ€āļ›āđ‡āļ™āļ„āļĢāļđ āļˆāļēāļāļ™āļąāđ‰āļ™āđ„āļ”āđ‰āđ€āļĨāļ·āđˆāļ­āļ™āļ•āļģāđāļŦāļ™āđˆāļ‡āđ€āļ›āđ‡āļ™āļ„āļĢāļđāđƒāļŦāļāđˆāļĢāļĢ."))
# output: [
# ('āļ•āļ­āļ™āļ—āļĩāđˆāļœāļĄāđ€āļ›āđ‡āļ™āļ„āļĢāļđāļ­āļąāļ•āļĢāļēāļˆāđ‰āļēāļ‡ āđ„āļ›āļ­āļĒāļđāđˆāđ€āļ§āļĢāļ—āļĩāđˆāđ‚āļĢāļ‡āđ€āļĢāļĩāļĒāļ™āļ—āļļāļāļ§āļąāļ™ āļˆāļ™āļāļĢāļ°āļ—āļąāđˆāļ‡āđ„āļ”āđ‰āļšāļĢāļĢāļˆāļļāļĢāļąāļšāļĢāļēāļŠāļāļēāļĢāđ€āļ›āđ‡āļ™āļ„āļĢāļđ āļˆāļēāļāļ™āļąāđ‰āļ™āđ„āļ”āđ‰āđ€āļĨāļ·āđˆāļ­āļ™āļ•āļģāđāļŦāļ™āđˆāļ‡āđ€āļ›āđ‡āļ™āļ„āļĢāļđāđƒāļŦāļāđˆāđ‚āļĢāļ‡āđ€āļĢāļĩāļĒāļ™',
# tensor(0.9713)),
# ('āļ•āļ­āļ™āļ—āļĩāđˆāļœāļĄāđ€āļ›āđ‡āļ™āļ„āļĢāļđāļ­āļąāļ•āļĢāļēāļˆāđ‰āļēāļ‡ āđ„āļ›āļ­āļĒāļđāđˆāđ€āļ§āļĢāļ—āļĩāđˆāđ‚āļĢāļ‡āđ€āļĢāļĩāļĒāļ™āļ—āļļāļāļ§āļąāļ™ āļˆāļ™āļāļĢāļ°āļ—āļąāđˆāļ‡āđ„āļ”āđ‰āļšāļĢāļĢāļˆāļļāļĢāļąāļšāļĢāļēāļŠāļāļēāļĢāđ€āļ›āđ‡āļ™āļ„āļĢāļđ āļˆāļēāļāļ™āļąāđ‰āļ™āđ„āļ”āđ‰āđ€āļĨāļ·āđˆāļ­āļ™āļ•āļģāđāļŦāļ™āđˆāļ‡āđ€āļ›āđ‡āļ™āļ„āļĢāļđāđƒāļŦāļāđˆāđ‚āļĢāļ‡āđāļĢāļĄ',
# tensor(0.9595))
# ]

How to work

I use Thai abbreviation dictionary for replace text abbreviation to full text (all possibility) and I use wangchanberta pretrained for Sentence Transformer than chose 2 top-k best results.

You can customize dictionary at khamyo/data.json.

Licenses

License
Source Code and Notebooks Apache Software License 2.0
Corpora Creative Commons Zero 1.0 Universal Public Domain Dedication License (CC0)

Citations

If you use KhamYo: Thai abbreviation to full text tool in your project or publication, please cite the library as follows

Wannaphong Phatthiyaphaibun. (2021, July 8). KhamYo: Thai abbreviation to full text tool. GitHub. https://github.com/wannaphong/KhamYo

or BibTeX entry:

@misc{wannaphong,
    author       = {Wannaphong Phatthiyaphaibun},
    title        = {{KhamYo: Thai abbreviation to full text tool}},
    month        = July,
    year         = 2021,
    publisher    = {GitHub},
    url          = {https://github.com/wannaphong/KhamYo}
}