Skip to main content

Dynamic hybrid tokenizer for micro-datasets

Project description

PHTokenizer

Dynamic Hybrid Tokenizer optimized for micro-datasets (100–500 samples).

Features

  • Optimized for small datasets to prevent over-fragmentation.
  • Hybrid strategy using atomic tokens and selective BPE.
  • Low CPU and RAM usage with LRU cache.
  • Supports JSON, CSV, and raw text formats.

Quick Start

from phtokenizer import DynamicHybridTokenizer, TokenizerConfig

config = TokenizerConfig(vocab_size=1000)
tokenizer = DynamicHybridTokenizer(config=config)

data = ["sample text one", "sample text two"]
tokenizer.fit(data)

tokens = tokenizer.tokenize("sample text")
print(tokens)

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

phtokenizer-1.0.0.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

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

phtokenizer-1.0.0-py3-none-any.whl (2.2 kB view details)

Uploaded Python 3

File details

Details for the file phtokenizer-1.0.0.tar.gz.

File metadata

  • Download URL: phtokenizer-1.0.0.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for phtokenizer-1.0.0.tar.gz
Algorithm Hash digest
SHA256 7ac5131bd427fb83894ac89ad1966b8b46dee0e090fbdf2f0f76252309b481f5
MD5 02a8568193525317fb7e3ba218a7fee7
BLAKE2b-256 db462416ff77db1ed6f2e901d1358119d0f11a8742098051fcbd69a7f1201a6c

See more details on using hashes here.

File details

Details for the file phtokenizer-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: phtokenizer-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 2.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.6

File hashes

Hashes for phtokenizer-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 53bbbf8c8420a1d7f91dfb9b8db702d3dc61f69037aaa9ad03a6a955b79335ba
MD5 c4b68186a2bd9654e2d6db59f3e4af38
BLAKE2b-256 3ac434ee56ade9398978e3296889851aafb007aebd95b8d720118e6b0334ce30

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