Run today's most used tokenizers directly in your browser or Node.js application. No heavy dependencies, no server required. Just fast, client-side tokenization compatible with thousands of models on the Hugging Face Hub. These tokenizers are also used in 🤗 Transformers.js
Features
Lightweight (~ 8.3kB gzip)
Zero dependencies
Works in browsers and Node.js
Installation
npm install @huggingface/tokenizers
Alternatively, you can use it via a CDN as follows:
Natural is a general natural language processing library for Node.js. It provides tokenization, stemming, classification, and other NLP tools. While it offers a broader range of NLP functionalities, it may not be as optimized for speed and efficiency in tokenization as @huggingface/tokenizers.
Compromise is a lightweight NLP library for Node.js that provides fast and easy-to-use text processing tools. It includes tokenization, part-of-speech tagging, and named entity recognition. While it is user-friendly and fast, it may not offer the same level of customization and pre-trained model support as @huggingface/tokenizers.
Wink Tokenizer is a fast and lightweight tokenizer for JavaScript. It is designed for speed and simplicity, providing basic tokenization capabilities. However, it lacks the advanced features and pre-trained model support found in @huggingface/tokenizers.
FAQs
🤗 Tokenizers.js: A pure JS/TS implementation of today's most used tokenizers
The npm package @huggingface/tokenizers receives a total of 672,050 weekly downloads. As such, @huggingface/tokenizers popularity was classified as popular.
We found that @huggingface/tokenizers demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.It has 5 open source maintainers collaborating on the project.