# bheinzerling/bpemb

Pre-trained subword embeddings in 275 languages, based on Byte-Pair Encoding (BPE)

Repository: https://github.com/bheinzerling/bpemb
Canonical: https://ross.abutalabs.com/products/bpemb
Homepage: https://nlp.h-its.org/bpemb
Language: Python
License: MIT
License Family: permissive
Topics: embeddings, subword-embeddings, natural-language-processing, nlp, multilingual
Last push: 2024-10-01T02:49:47+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3255, "days_push": 701, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1224, forks 100 (observed 2026-08-28T04:04:02.774957+00:00)

## What it is
BPEmb is a collection of pre-trained subword embeddings in 275 languages based on Byte-Pair Encoding, trained on Wikipedia, distributed as a Python library wrapping gensim KeyedVectors and SentencePiece models. It provides subword segmentation and embedding vectors intended as input layers for neural NLP models.

## Use cases
- get pretrained subword embeddings for low-resource languages
- segment text into byte-pair encoded subwords without tokenization
- initialize an embedding layer in PyTorch or TensorFlow for an NLP model
- handle out-of-vocabulary words in a neural NLP pipeline
- build a compact multilingual embedding model smaller than FastText
- encode sentences into subword IDs for downstream models

## When to choose
- you need embeddings for many languages, especially low-resource ones
- you want small pretrained embeddings without tokenization or morphological analysis
- you need subword segmentation to handle unknown words in neural models

## When to avoid
- you need state-of-the-art contextual embeddings like BERT or transformer models
- you only work with English and can use larger alternatives like FastText
- you need embeddings trained on domain-specific corpora rather than Wikipedia

## Facets
- artifact type: library
- maturity: maintenance
- function: nlp, machine-learning, parser
- domain: machine-learning
- platform: python
- tags: word-embeddings, byte-pair-encoding, subword-segmentation, sentencepiece, gensim, pretrained-models, multilingual-nlp, natural-language-processing, multilingual

## Member repositories
- bheinzerling/bpemb (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:02.774957+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-30T06:15:26.267590+00:00, confidence not recorded.
  - readme: https://github.com/bheinzerling/bpemb (fetched 2026-08-28T04:04:02.774957+00:00, sha ff3b8c318f3b)
  - homepage: https://nlp.h-its.org/bpemb (fetched 2026-08-29T12:23:45.997855+00:00, sha c5ff35da94de)
- Data as of 2026-08-30T08:39:29.467469+00:00.
