Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Japanese-BPE-Tokenizer-0.1.1.tar.gz (1.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

Japanese_BPE_Tokenizer-0.1.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

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

Hashes for Japanese-BPE-Tokenizer-0.1.1.tar.gz
Algorithm Hash digest
SHA256 feb91e3e5156f0dc779b94fac6537154e46a22dd0592f626de5ab5adaa094dc1
MD5 b8b3838ac348a7357797e891865cdd3a
BLAKE2b-256 eb7040a6d0959bc1e7996ac84f65b8c405d388eafe37a871da41c71dc3659cf9

See more details on using hashes here.

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

Hashes for Japanese_BPE_Tokenizer-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 57eb01c09c6450c77ef0818abfe431e681390a25c4e9aa1ac00ee37971f25e5b
MD5 98ef63b23a0b088246943dda9638b213
BLAKE2b-256 dfdf6a0a3f179fbd1e09d8c342f814b3646fb15256b2c164cb6b9580b5cbebb3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page