Mecab-based BPE toknizer for Japanese text
Project description
Byte Pair Encoding for Japanese Language
Summary
The package applies Mecab and Byte Pair Encoding algorithms to tokenize Japanese text.
Usage
To train a new tokenizer, import the module
from train.implementations import MecabBPETrainTokenizer
Instantiate the object
tokenizer = MecabBPETrainTokenizer()
Set the arguments with the text, vocab_size and special_tokens to train the tokenizer
tokenizer.train(files,
vocab_size=52000,
special_tokens=["<pad>", "<unk>", "<s>", "</s>", "<mask>"])
And finally, save the trained config files
tokenizer.save_model('config')
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 Japanese-BPE-Tokenizer-0.1.1.tar.gz.
File metadata
- Download URL: Japanese-BPE-Tokenizer-0.1.1.tar.gz
- Upload date:
- Size: 1.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
feb91e3e5156f0dc779b94fac6537154e46a22dd0592f626de5ab5adaa094dc1
|
|
| MD5 |
b8b3838ac348a7357797e891865cdd3a
|
|
| BLAKE2b-256 |
eb7040a6d0959bc1e7996ac84f65b8c405d388eafe37a871da41c71dc3659cf9
|
File details
Details for the file Japanese_BPE_Tokenizer-0.1.1-py3-none-any.whl.
File metadata
- Download URL: Japanese_BPE_Tokenizer-0.1.1-py3-none-any.whl
- Upload date:
- Size: 2.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/4.5.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.59.0 CPython/3.8.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
57eb01c09c6450c77ef0818abfe431e681390a25c4e9aa1ac00ee37971f25e5b
|
|
| MD5 |
98ef63b23a0b088246943dda9638b213
|
|
| BLAKE2b-256 |
dfdf6a0a3f179fbd1e09d8c342f814b3646fb15256b2c164cb6b9580b5cbebb3
|