A simple tokenizer for Burmese text
Project description
Burmese Tokenizer
Simple, fast Burmese text tokenization. No fancy stuff, just gets the job done.
Install
pip install burmese-tokenizer
Quick Start
from burmese_tokenizer import BurmeseTokenizer
tokenizer = BurmeseTokenizer()
text = "မင်္ဂလာပါ။ နေကောင်းပါသလား။"
# tokenize
tokens = tokenizer.encode(text)
print(tokens["pieces"])
# ['▁မင်္ဂလာ', '▁ပါ', '။', '▁နေ', '▁ကောင်း', '▁ပါ', '▁သလား', '။']
# decode back
text = tokenizer.decode(tokens["pieces"])
print(text)
# မင်္ဂလာပါ။ နေကောင်းပါသလား။
CLI
# tokenize
burmese-tokenizer "မင်္ဂလာပါ။"
# show details
burmese-tokenizer -v "မင်္ဂလာပါ။"
# decode tokens
burmese-tokenizer -d -t "▁မင်္ဂလာ,▁ပါ,။"
API
encode(text)- tokenize textdecode(pieces)- convert tokens back to textdecode_ids(ids)- convert ids to textget_vocab_size()- vocabulary sizeget_vocab()- full vocabulary
Links
License
MIT - Do whatever you want with it.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file burmese_tokenizer-0.1.3.tar.gz.
File metadata
- Download URL: burmese_tokenizer-0.1.3.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d7096e0f67635c9d50e6d2d5851d196c981d49beca87e68472e3a89b68a0100
|
|
| MD5 |
1c34ffeb7f84f7ab314831b97f6f6712
|
|
| BLAKE2b-256 |
81833d329f08f486d6a8f332d99de232cca62ed25aab4e37bad1886096e7dd14
|
File details
Details for the file burmese_tokenizer-0.1.3-py3-none-any.whl.
File metadata
- Download URL: burmese_tokenizer-0.1.3-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.8.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a4d65ea467d57e7ea1d1a55ccd12e6de6c1c7d787f1a081fd5b336509bc04c68
|
|
| MD5 |
f0306f83d6d6ef0f4714c97f04ae487b
|
|
| BLAKE2b-256 |
0c49b48277f7b90e58198a82b01642fae29ec1ba7e8e33a2672a823d1a56667a
|