# google/sentencepiece

Unsupervised text tokenizer for Neural Network-based text generation.

Repository: https://github.com/google/sentencepiece
Canonical: https://ross.abutalabs.com/products/sentencepiece
Language: C++
License: Apache-2.0
License Family: permissive
Topics: neural-machine-translation, natural-language-processing, word-segmentation
Last push: 2026-08-26T15:49:44+00:00

## Health v2 (maintenance only)
Score: 86/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 99, release rhythm 60, longevity 100
- inputs: {"age_days": 3466, "days_push": 7, "days_rel": 52, "gap_med": 334, "n_releases_24m": 2}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 12043, forks 1379 (observed 2026-08-28T04:10:51.474556+00:00)

## What it is
SentencePiece is a fast, lightweight unsupervised text tokenizer and detokenizer for neural network-based text generation systems, implementing BPE and unigram language model subword segmentation. It trains directly from raw sentences without language-specific pre- or post-processing, making it language-independent and end-to-end.

## Use cases
- train a subword tokenizer for an LLM from raw text
- tokenize text into subword pieces for neural machine translation
- encode and decode text with a fixed vocabulary size
- segment words in languages without whitespace delimiters
- build a language-independent preprocessing pipeline for NLP models

## When to choose
- you need a fixed-vocabulary tokenizer trained directly on raw sentences
- you want language-agnostic tokenization without pre-tokenization rules
- you need BPE or unigram subword models used by LLMs like LLaMA and T5

## When to avoid
- you need a tokenizer for a pretrained model with a different tokenizer format (e.g., WordPiece)
- you only need simple whitespace or rule-based word splitting

## Facets
- artifact type: library
- maturity: stable
- function: nlp, parser, machine-learning, llm-training
- domain: machine-learning, large-language-models
- platform: cpp, python, cross-platform
- tags: tokenizer, subword-tokenization, bpe, unigram-language-model, detokenizer, neural-machine-translation, natural-language-processing

## Member repositories
- google/sentencepiece (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:10:51.474556+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:14:59.155015+00:00, confidence not recorded.
  - readme: https://github.com/google/sentencepiece (fetched 2026-08-28T04:10:51.474556+00:00, sha 17213789ebd6)
- Data as of 2026-08-30T08:39:29.467469+00:00.
