Instructions to use BAAI/bge-m3 with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- sentence-transformers
How to use BAAI/bge-m3 with sentence-transformers:
from sentence_transformers import SentenceTransformer model = SentenceTransformer("BAAI/bge-m3") sentences = [ "That is a happy person", "That is a happy dog", "That is a very happy person", "Today is a sunny day" ] embeddings = model.encode(sentences) similarities = model.similarity(embeddings, embeddings) print(similarities.shape) # [4, 4] - Inference
- Notebooks
- Google Colab
- Kaggle
Do I need to add the prefix "query: " and "passage: " to input texts?
As the query prefix of 'bge-large-zh-v1.5' is "为这个句子生成表示以用于检索相关文章:", should I add the same prefix to queries with this model ?
No. bge-m3 doesn't need prefix instruction.
So the model supports both query-to-query and query-to-answer-retrieval without any prefixes or instructions. Did I get it right ?
So the model supports both query-to-query and query-to-answer-retrieval without any prefixes or instructions. Did I get it right ?
Yes, it supports both query-to-query and query-to-answer-retrieval.
So the model supports both query-to-query and query-to-answer-retrieval without any prefixes or instructions. Did I get it right ?
Yes, it supports both query-to-query and query-to-answer-retrieval.
Does it need normalizing embeddings?