Punctuation Restoration for Khmer language
Project description
Punctuation Restoration for Khmer language
Built with [xashru/punctuation-restoration] using [xlm-roberta-base] and then exported to onnxruntime
Install
pip install khmerpunctuate
# Or
pip install git+https://github.com/seanghay/khmerpunctuate.git
Usage
from khmernormalizer import normalize
from khmercut import tokenize
from khmerpunctuate import punctuate
text = normalize("អយ្យការអមសាលាដំបូងរាជធានីភ្នំពេញបានព្រមានថានឹងចេញដីកាបញ្ជាឲ្យបង្ខំនិងឲ្យឃុំខ្លួនតាមនីតិវិធីប្រសិនបើលោករ៉ុងឈុនដែលបច្ចុប្បន្នជាទីប្រឹក្សាគណបក្សកម្លាំងជាតិមិនបានបង់ប្រាក់ពិន័យចំនួន២លានរៀលឲ្យបានមុនថ្ងៃទី០៤ខែមីនាឆ្នាំ២០២៤ទេនោះ")
tokens = tokenize(text)
output_text = ""
for token, punct, punct_id in punctuate(tokens):
output_text += token + punct
print(output_text)
អយ្យការអមសាលាដំបូងរាជធានីភ្នំពេញ បានព្រមានថា នឹងចេញដីកាបញ្ជាឱ្យបង្ខំ និងឱ្យឃុំខ្លួនតាមនីតិវិធី ប្រសិនបើលោក រ៉ុង ឈុន ដែលបច្ចុប្បន្នជាទីប្រឹក្សាគណបក្សកម្លាំងជាតិ មិនបានបង់ប្រាក់ពិន័យចំនួន២លានរៀល ឱ្យបានមុនថ្ងៃទី០៤ ខែមីនា ឆ្នាំ២០២៤ទេនោះ។
License
MIT
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
khmerpunctuate-0.0.1.tar.gz
(2.6 MB
view hashes)
Built Distribution
Close
Hashes for khmerpunctuate-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b66805e87352e5ebbc6f41f679d5400e5b20f58bcac9aef4fb7ec77e86d45b2 |
|
MD5 | ecb8d996d0e5e963307be7db93d848da |
|
BLAKE2b-256 | 1d172ce2a76d937107b02c19fd68517d47401d534609034845d93ecc60e2344b |