Thai abbreviation to full text tool
pip install khamyo
just call replace function and use it!!!
from khamyo import replace
print(replace("āļāļāļāļāļĩāđāļāļĄāđāļāđāļāļāļĢāļđāļāļąāļāļĢāļēāļāđāļēāļ āđāļāļāļĒāļđāđāđāļ§āļĢāļāļĩāđāļĢāļĢ.āļāļļāļāļ§āļąāļ āļāļāļāļĢāļ°āļāļąāđāļāđāļāđāļāļĢāļĢāļāļļāļĢāļąāļāļĢāļēāļāļāļēāļĢāđāļāđāļāļāļĢāļđ āļāļēāļāļāļąāđāļāđāļāđāđāļĨāļ·āđāļāļāļāļģāđāļŦāļāđāļāđāļāđāļāļāļĢāļđāđāļŦāļāđāļĢāļĢ."))
# output: [
# ('āļāļāļāļāļĩāđāļāļĄāđāļāđāļāļāļĢāļđāļāļąāļāļĢāļēāļāđāļēāļ āđāļāļāļĒāļđāđāđāļ§āļĢāļāļĩāđāđāļĢāļāđāļĢāļĩāļĒāļāļāļļāļāļ§āļąāļ āļāļāļāļĢāļ°āļāļąāđāļāđāļāđāļāļĢāļĢāļāļļāļĢāļąāļāļĢāļēāļāļāļēāļĢāđāļāđāļāļāļĢāļđ āļāļēāļāļāļąāđāļāđāļāđāđāļĨāļ·āđāļāļāļāļģāđāļŦāļāđāļāđāļāđāļāļāļĢāļđāđāļŦāļāđāđāļĢāļāđāļĢāļĩāļĒāļ',
# tensor(0.9713)),
# ('āļāļāļāļāļĩāđāļāļĄāđāļāđāļāļāļĢāļđāļāļąāļāļĢāļēāļāđāļēāļ āđāļāļāļĒāļđāđāđāļ§āļĢāļāļĩāđāđāļĢāļāđāļĢāļĩāļĒāļāļāļļāļāļ§āļąāļ āļāļāļāļĢāļ°āļāļąāđāļāđāļāđāļāļĢāļĢāļāļļāļĢāļąāļāļĢāļēāļāļāļēāļĢāđāļāđāļāļāļĢāļđ āļāļēāļāļāļąāđāļāđāļāđāđāļĨāļ·āđāļāļāļāļģāđāļŦāļāđāļāđāļāđāļāļāļĢāļđāđāļŦāļāđāđāļĢāļāđāļĢāļĄ',
# tensor(0.9595))
# ]
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
.
License | |
---|---|
Source Code and Notebooks | Apache Software License 2.0 |
Corpora | Creative Commons Zero 1.0 Universal Public Domain Dedication License (CC0) |
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}
}