awesome-repositories.com
Blog
MCP
awesome-repositories.com

Discover the best open-source repositories with AI-powered search.

ExploreCurated searchesOpen-source alternativesSelf-hosted softwareBlogSitemap
ProjectMCP serverAboutHow we rankPress
LegalPrivacyTerms
© 2026 Bringes Technology SRL·VAT RO45896025·hello@awesome-repositories.com
google avatar

google/sentencepiece

0
View on GitHub↗
11,657 stars·1,325 forks·C++·apache-2.0·30 views

Sentencepiece

SentencePiece is a text segmentation engine and tokenization library designed for machine learning workflows. It provides a comprehensive toolkit for transforming raw text into subword units or numerical identifiers, enabling consistent data representation for neural network training and inference. The library supports the training of segmentation models from raw text, allowing for the creation of custom vocabularies tailored to specific domain requirements.

The project distinguishes itself through its byte-level encoding and fallback mechanisms, which ensure that every input can be represented without relying on unknown tokens. It employs probabilistic subword modeling and stochastic sampling to improve model robustness during training. To handle large-scale datasets, the engine utilizes memory-mapped model loading and thread-safe, parallelized processing, which distributes encoding and decoding tasks across multiple CPU cores.

Beyond core segmentation, the library includes a deterministic normalization pipeline that manages Unicode transformations and whitespace formatting to ensure consistent text representation. It also provides granular control over vocabulary composition, including the reservation of special control symbols, the enforcement of atomic token definitions, and the ability to map tokens back to their original character positions for precise alignment.

Features

  • Subword Tokenization - Trains and applies subword segmentation models using Unigram or BPE algorithms for natural language processing.
  • Text Tokenizers - Transforms raw text into subword units or numerical identifiers using trained segmentation models.
  • Natural Language Processing - Converts raw text into subword units or numerical identifiers to prepare data for large language models.
  • Text Segmentation - Splits text into subword pieces with support for byte-level fallback and stochastic sampling.
  • Special Symbol Managers - The tokenization library customizes the surface strings and integer identifiers for reserved tokens like unknown, beginning-of-sequence, end-of-sequence, and padding markers.
  • Machine Learning Training - Transforms raw text into numerical identifiers and manages vocabulary constraints for neural network training.
  • Natural Language Processing Libraries - Provides a collection of tools for normalizing, encoding, and decoding text into subword units.
  • Byte-Level Tokenizers - Decomposes unknown characters into UTF-8 byte sequences to ensure full vocabulary coverage without unknown tokens.
  • Data Preprocessing - Cleans and normalizes text inputs while managing vocabulary constraints for neural network models.
  • Byte Level Encodings - Ensures full vocabulary coverage by treating raw input as a sequence of bytes rather than Unicode characters.
  • Subword Regularization Methods - Improves model robustness during training by sampling multiple possible token sequences for a single input.
  • Token Alignment Trackers - Maps individual tokens back to their original character or byte positions for precise text alignment and extraction.
  • Segmentation Model Training - Creates new tokenization models from raw text data using flexible input sources.
  • Vocabulary Management - Provides tools for defining specialized control symbols and atomic tokens to handle domain-specific requirements.
  • Token Decoders - Reconstructs original raw text from sequences of subword pieces or numerical identifiers.
  • Vocabulary Management - Applies rules on subword length and character boundaries to control the structure and composition of the generated vocabulary.
  • Natural Language Processing - Language-independent subword tokenizer and detokenizer.
  • Segmentation Boundary Enforcers - Enforces hard segmentation boundaries using custom delimiters to influence tokenization logic.
  • Memory-Mapped Weight Loaders - Maps model weight files directly into process memory to reduce RAM usage and improve load times.
  • Vocabulary Usage Restrictions - Limits tokenization output to a specific subset of allowed symbols to control the active vocabulary during inference.
  • High-Performance and Parallel Computing - Distributes tokenization and detokenization tasks across multiple CPU threads to rapidly handle massive datasets.
  • Parallel Processing - Distributes encoding and decoding workloads across multiple CPU threads to increase processing speed.
  • Control Symbol Reservoirs - Reserves specific vocabulary identifiers for model control flow that do not participate in text segmentation.
  • Atomic Token Definitions - Preserves the integrity of specific character sequences by treating them as indivisible tokens during encoding.
  • Language Model Architectures - Uses probabilistic models to determine the most likely subword segmentation by evaluating token combinations.
  • Model Training Optimizers - Controls corpus loading, shuffling, and character coverage thresholds to optimize model training.
  • Segmentation Restriction Utilities - Enforces constraints on token formation to ensure valid vocabulary generation.
  • Whitespace Formatting Utilities - Configures whitespace handling rules to ensure consistent text representation during the tokenization process.
  • Text Normalization - Applies Unicode normalization rules and custom whitespace handling to ensure consistent text representation.
  • Unicode Normalization Pipelines - Applies Unicode transformations and whitespace rules to ensure consistent text representation before segmentation.

Star history

Star history chart for google/sentencepieceStar history chart for google/sentencepiece

How this analysis was created: This summary and feature list are AI-generated from collected project material and can contain mistakes. Stars, license and language are imported from GitHub. Inclusion does not mean that we have tested or audited this project. Check the source documentation for any feature you depend on. Learn more on our About page.

AI search

Explore more awesome repositories

Describe what you need in plain English — the AI ranks thousands of curated open-source projects by relevance.

Start searching with AI

Frequently asked questions

What does google/sentencepiece do?

SentencePiece is a text segmentation engine and tokenization library designed for machine learning workflows. It provides a comprehensive toolkit for transforming raw text into subword units or numerical identifiers, enabling consistent data representation for neural network training and inference. The library supports the training of segmentation models from raw text, allowing for the creation of custom vocabularies tailored to specific domain requirements.

What are the main features of google/sentencepiece?

The main features of google/sentencepiece are: Subword Tokenization, Text Tokenizers, Natural Language Processing, Text Segmentation, Special Symbol Managers, Machine Learning Training, Natural Language Processing Libraries, Byte-Level Tokenizers.

Which projects share features with google/sentencepiece?

Projects with overlapping indexed features include: d2l-ai/d2l-en — This project is an educational platform and research toolkit designed to teach deep learning through a combination of… huggingface/tokenizers — This project is a high-performance library for converting raw text into tokens and IDs for machine learning models. It… spencermountain/compromise — Compromise is a natural language processing library and rule-based text parser designed to analyze unstructured text.… microsoft/onnxruntime — This project is a cross-platform machine learning inference engine designed to execute pre-trained models across… nltk/nltk — This project is a comprehensive Python toolkit designed for natural language processing, research, and education. It… karpathy/minbpe — Minimal, clean code for the Byte Pair Encoding (BPE) algorithm commonly used in LLM tokenization.

Projects sharing features with Sentencepiece

These projects share indexed features with Sentencepiece. Shared tags can include platform or build tooling; verify the primary use case before treating a result as a replacement.
  • d2l-ai/d2l-end2l-ai avatar

    d2l-ai/d2l-en

    29,001View on GitHub↗

    This project is an educational platform and research toolkit designed to teach deep learning through a combination of mathematical theory, visual diagrams, and executable code. It provides a comprehensive environment for building, training, and evaluating neural networks, grounding complex concepts in interactive computational notebooks that allow for hands-on experimentation. The framework distinguishes itself by interleaving theoretical foundations—including linear algebra, calculus, and probability—with practical implementations across multiple industry-standard libraries. It supports flex

    Pythonbookcomputer-visiondata-science
    View on GitHub↗29,001
  • huggingface/tokenizershuggingface avatar

    huggingface/tokenizers

    10,825View on GitHub↗

    This project is a high-performance library for converting raw text into tokens and IDs for machine learning models. It functions as a fast text encoder and a text preprocessing pipeline designed to transform strings into numerical representations with high throughput for research and production. The library includes a subword tokenizer trainer used to analyze text datasets and create custom vocabularies using algorithms such as byte-pair encoding and wordpiece. It provides capabilities for subword vocabulary training and text alignment, allowing character offsets to be tracked during normaliz

    Rustbertgptlanguage-model
    View on GitHub↗10,825
  • spencermountain/compromisespencermountain avatar

    spencermountain/compromise

    12,125View on GitHub↗

    Compromise is a natural language processing library and rule-based text parser designed to analyze unstructured text. It functions as a toolkit for identifying parts of speech, linguistic patterns, and semantic meaning, while providing specialized engines for named entity recognition and the parsing of temporal and numeric data. The project is distinguished by its linguistic morphological engine, which can conjugate verbs across different tenses and inflect nouns and adjectives. It further allows for linguistic model customization through a plugin system that enables the extension of lexicons

    JavaScriptnamed-entity-recognitionnlppart-of-speech
    View on GitHub↗12,125
  • microsoft/onnxruntimemicrosoft avatar

    microsoft/onnxruntime

    19,347View on GitHub↗

    This project is a cross-platform machine learning inference engine designed to execute pre-trained models across diverse operating systems and hardware environments. It functions as a standardized execution framework that manages the entire lifecycle of model inference, from loading and graph optimization to hardware-accelerated execution and generative sequence management. The runtime distinguishes itself through a highly modular architecture that decouples model logic from hardware-specific kernels. By utilizing an execution provider abstraction, it enables developers to offload computation

    C++ai-frameworkdeep-learninghardware-acceleration
    View on GitHub↗19,347
Compare all 30 related projects→