m2v-mrl-multilingual-european-256
sentence-transformers/static-similarity-mrl-multilingual-v1, cut to its first 256 Matryoshka dimensions and pruned to European scripts, packaged in the model2vec format.
What changed
| Original | This model | |
|---|---|---|
| Vocabulary | 105,879 tokens | 73,845 tokens |
| Embedding dim | 1024 | 256 (first 256 Matryoshka dims) |
| Weights | ~434 MB | ~76 MB |
- Dimensions: the original was trained with Matryoshka loss, so its first 256 dimensions work on their own; the rest are dropped.
- Vocabulary: every token holding a character from these scripts is removed: CJK, Hangul, Hiragana, Katakana, Arabic, Hebrew, Thai, Lao, Devanagari, Bengali, Tamil, Telugu, Kannada, Malayalam, Gujarati, Gurmukhi, Oriya, Sinhala, Myanmar, Ethiopic, Tibetan, Khmer. Latin, Greek, Cyrillic, Armenian, Georgian and symbols are kept. Token ids are renumbered.
- Text in European scripts tokenizes exactly as before and gets the same vectors as the original truncated to 256
dims. Words in removed scripts become
[UNK].
The tokenizer is unchanged otherwise (BERT WordPiece, lowercasing and accent stripping in the normalizer).
Files
tokenizer.json: Hugging Face tokenizers format.model.safetensors: one float32 tensor,embeddings, shape 73,845 × 256.config.json: model2vec config.
Usage
from model2vec import StaticModel
model = StaticModel.from_pretrained("javierlgroba/m2v-mrl-multilingual-european-256")
embeddings = model.encode(["Duschgel", "shower gel", "gel douche"])
Or pool by hand: tokenize without special tokens, take the mean of the token rows, compare with cosine similarity.
License
Apache-2.0, same as the base model sentence-transformers/static-similarity-mrl-multilingual-v1.