all-mpnet-base-v2
sentence-transformers · Kit
Turns sentences and paragraphs into 768-number vectors so you can search, cluster and compare text by meaning. It suits developers and data teams working in En…
Turns text in about 100 languages into vectors so you can compare meaning across them, for search and matching. Made for developers who build multilingual retrieval.
multilingual-e5-base is a kit in the Developer category, listed by Mindket. It is free. This is version 1, last updated on . Download it on this page, a zip of its files. Nothing in it runs by itself.
pip install -U huggingface_hub hf download intfloat/multilingual-e5-base
multilingual-e5-base turns a piece of text into a list of numbers, called an embedding, so you can compare texts by meaning across languages. It has 12 layers and makes vectors of size 768. Hugging Face lists it at 278M parameters.
It suits developers and data teams who build search, matching or grouping over text in many languages.
| Industry | Who uses it | How they use it | Example |
|---|---|---|---|
| Software | Search engineers | Embed documents and queries, then rank the documents by score | Find the passage that answers a question asked in another language |
| Customer support | Help desk teams | Match a customer question to the closest help article | An English question matched to a Chinese article |
| Publishing | Content teams | Group articles by topic across languages | Gather news pieces about the same story |
| Research | Data scientists | Compare sentences across languages by score | Pair a sentence with its translation |
If you need a model that writes text or answers questions itself, you can skip it, because it only produces embeddings.
| Use case | Who | What they get back |
|---|---|---|
| Multilingual search | Search engineers | Scores that rank passages for a query in any supported language |
| Question matching | Support teams | The closest stored question or article for a new one |
| Topic grouping | Data teams | Vectors you can cluster by meaning |
You need Python with pip, plus the libraries the sample imports.
pip install -U huggingface_hub hf download intfloat/multilingual-e5-base
Start every text with "query: " or "passage: ", even when it is not English. For tasks other than retrieval, the card says the "query: " prefix is enough. Then tokenize, run the model, average the token vectors and normalize them.
import torch.nn.functional as F
from torch import Tensor
from transformers import AutoTokenizer, AutoModel
def average_pool(last_hidden_states: Tensor,
attention_mask: Tensor) -> Tensor:
last_hidden = last_hidden_states.masked_fill(~attention_mask[..., None].bool(), 0.0)
return last_hidden.sum(dim=1) / attention_mask.sum(dim=1)[..., None]
tokenizer = AutoTokenizer.from_pretrained('intfloat/multilingual-e5-base')
model = AutoModel.from_pretrained('intfloat/multilingual-e5-base')
batch_dict = tokenizer(input_texts, max_length=512, padding=True, truncation=True, return_tensors='pt')
outputs = model(**batch_dict)
embeddings = average_pool(outputs.last_hidden_state, batch_dict['attention_mask'])
embeddings = F.normalize(embeddings, p=2, dim=1)
scores = (embeddings[:2] @ embeddings[2:].T) * 100
print(scores.tolist())| Tool | What it does |
|---|---|
| AutoTokenizer | Splits each text into tokens, cut at 512 |
| AutoModel | Runs the model and returns a vector for every token |
| average_pool | Averages the token vectors into one vector per text |
| F.normalize | Scales each vector so the dot product works as a score |
You set input_texts to two queries and two passages. One query asks how much protein a woman should eat, and the other asks in Chinese about a home pumpkin dish. The passages are an English nutrition note and a Chinese recipe. The script prints a grid of scores, one for each query and passage pair.
An embedding model gives each text a position in a space, so texts with similar meaning land close together. The first small thing to try is the sample above with two short sentences of your own, each starting with its prefix.
The model starts from xlm-roberta-base. Its first training stage is contrastive pre-training on weakly paired texts, such as titles with page content, news, translation pairs, Wikipedia sections, comments with replies and questions with answers. A second stage adds supervised fine-tuning. Languages with little training data may score lower.
Turns text in about 100 languages into vectors so you can compare meaning across them, for search and matching. Made for developers who build multilingual retrieval.
Made by intfloat on Hugging Face. These notes are Mindket's, written from its model page and model card; the model's own files and license are on Hugging Face.
What it is: multilingual-e5-base turns a piece of text into a list of numbers, called an embedding, so you can compare texts by meaning across languages. It has 12 layers and makes vectors of size 768. Hugging Face lists it at 278M parameters.
Who it suits: It suits developers and data teams who build search, matching or grouping over text in many languages.
Industry | Who uses it | How they use it | Example
Software | Search engineers | Embed documents and queries, then rank the documents by score | Find the passage that answers a question asked in another language
Customer support | Help desk teams | Match a customer question to the closest help article | An English question matched to a Chinese article
Publishing | Content teams | Group articles by topic across languages | Gather news pieces about the same story
Research | Data scientists | Compare sentences across languages by score | Pair a sentence with its translation
If you need a model that writes text or answers questions itself, you can skip it, because it only produces embeddings.
Where to use it:
Use case | Who | What they get back
Multilingual search | Search engineers | Scores that rank passages for a query in any supported language
Question matching | Support teams | The closest stored question or article for a new one
Topic grouping | Data teams | Vectors you can cluster by meaning
How to set it up: You need Python with pip, plus the libraries the sample imports.
pip install -U huggingface_hub
hf download intfloat/multilingual-e5-base
How to use it: Start every text with "query: " or "passage: ", even when it is not English. For tasks other than retrieval, the card says the "query: " prefix is enough. Then tokenize, run the model, average the token vectors and normalize them.
import torch.nn.functional as F
from torch import Tensor
from transformers import AutoTokenizer, AutoModel
def average_pool(last_hidden_states: Tensor,
attention_mask: Tensor) -> Tensor:
last_hidden = last_hidden_states.masked_fill(~attention_mask[..., None].bool(), 0.0)
return last_hidden.sum(dim=1) / attention_mask.sum(dim=1)[..., None]
tokenizer = AutoTokenizer.from_pretrained('intfloat/multilingual-e5-base')
model = AutoModel.from_pretrained('intfloat/multilingual-e5-base')
batch_dict = tokenizer(input_texts, max_length=512, padding=True, truncation=True, return_tensors='pt')
outputs = model(**batch_dict)
embeddings = average_pool(outputs.last_hidden_state, batch_dict['attention_mask'])
embeddings = F.normalize(embeddings, p=2, dim=1)
scores = (embeddings[:2] @ embeddings[2:].T) * 100
print(scores.tolist())
Tool | What it does
AutoTokenizer | Splits each text into tokens, cut at 512
AutoModel | Runs the model and returns a vector for every token
average_pool | Averages the token vectors into one vector per text
F.normalize | Scales each vector so the dot product works as a score
Example: You set input_texts to two queries and two passages. One query asks how much protein a woman should eat, and the other asks in Chinese about a home pumpkin dish. The passages are an English nutrition note and a Chinese recipe. The script prints a grid of scores, one for each query and passage pair.
For newcomers and experts: An embedding model gives each text a position in a space, so texts with similar meaning land close together. The first small thing to try is the sample above with two short sentences of your own, each starting with its prefix.
The model starts from xlm-roberta-base. Its first training stage is contrastive pre-training on weakly paired texts, such as titles with page content, news, translation pairs, Wikipedia sections, comments with replies and questions with answers. A second stage adds supervised fine-tuning. Languages with little training data may score lower.
Add the query or passage prefix
Tokenize the text, up to 512 tokens
Run the model
Average the token vectors
Normalize and compare with a dot product
Good to know:
Download its files with Hugging Face's command line:
pip install -U huggingface_hub
hf download intfloat/multilingual-e5-base
Then follow the usage in its model card. Nothing in this kit runs by itself.
README.md 6 KB
Listed Hugging Face models in the same category that share the most tags with this one.
| Product | Downloads, last 30 days | Likes | Parameters | License | Last change |
|---|---|---|---|---|---|
| multilingual-e5-base This page | 4,750,367 | 422 | 278M | mit | |
| multilingual-e5-largeShares xlm-roberta · openvino · mteb | 7,120,555 | 1,284 | 560M | mit | |
| bge-small-en-v1.5Shares mteb · model-index · sentence-similarity | 45,750,548 | 671 | 33.4M | mit | |
| bge-base-en-v1.5Shares mteb · model-index · sentence-similarity | 8,508,165 | 542 | 109M | mit | |
| paraphrase-multilingual-MiniLM-L12-v2Shares openvino · sentence-similarity · text-embeddings-inference | 26,540,125 | 1,505 | 118M | apache-2.0 | |
| nomic-embed-text-v1.5Shares mteb · model-index · sentence-similarity | 11,809,681 | 994 | 137M | apache-2.0 |
Posts and comments that name this project on Hacker News, Bluesky, X, Reddit, Facebook and YouTube, found by a weekly search and on Trendshift. Mindket doesn’t write or check them. Open one to read it where it was posted.
sentence-transformers · Kit
Turns sentences and paragraphs into 768-number vectors so you can search, cluster and compare text by meaning. It suits developers and data teams working in En…
aldegad · Skill
Turns one base drawing of a character into game-ready sprites, either an atlas with a manifest or transparent motion loops, for game developers working in Code…
yanliudesign · Skill
Makes original one-ink and two-ink editorial images from a theme, an object or your photo, for posters, zines, portraits and packaging. Returns the image, the…
foryourhealth111-pixel · Skill
Picks the right skills from a large installed pool and breaks each task into checkable steps for your coding agent. In its own benchmark, mean reward rose 21.1…
elementalsouls · Skill
Gives Claude Code 83 skills and 15 slash commands for bug bounty hunting and authorized red-team work, from web vulnerability classes to enterprise identity at…
bsaleh03 · Kit
Runs Qwen3.8-27B with a vocabulary cut down to ASCII, so a single 16 GB graphics card can hold a much longer prompt. A GGUF build for English text and code wit…