Skip to main content
Pinecone Docs
current

Search documentation

Type to search this documentation.

On this pageOverview

bge-reranker-v2-m3

Use the bge-reranker-v2-m3 embedding or reranking model with Pinecone: specs and index setup. This is an open source, high performance, multilingual model.

Back to all models

This is an open source, high performance, multilingual model. It works well on messy data and short queries expected to return medium-length passages of text (1-2 paragraphs).

This model returns a relevance score for a query and passage. A sigmoid function can map the relevance score to a float value in the range [0,1].

Reranking models are designed to provide superior accuracy over retriever models but are much slower, so this model shouldn't be used with more than a few hundred documents. Due to the slowness of rerankers, we recommend using them in a two-stage retrieval system: use a retrieval to pull in a smaller number of documents from a larger database and then rerank the smaller number of documents using a reranker.

Python
pip install -U pinecone

See rerank for instructions for using bge-reranker-v2-m3 with the Pinecone Inference API rerank endpoint.

Python
from pinecone import Pinecone

pc = Pinecone("API-KEY")

query = "Tell me about Apple's products"
results = pc.inference.rerank(
    model="bge-reranker-v2-m3",
    query=query,
    documents=[
"Apple is a popular fruit known for its sweetness and crisp texture.",	
"Apple is known for its innovative products like the iPhone.",
"Many people enjoy eating apples as a healthy snack.",
"Apple Inc. has revolutionized the tech industry with its sleek designs and user-friendly interfaces.",
"An apple a day keeps the doctor away, as the saying goes.",
    ],
    top_n=3,
    return_documents=True,
    parameters= {
        "truncate": "END"
    }
)

print(query)
for r in results.data:
  print(r.score, r.document.text)

Lorem Ipsum

Suggest an edit

Propose a replacement for this page. The site team reviews it before applying any changes.

Export
Documentation menu