Cohere / rerank-english-v3.0
Milvus Integrated
Task: Reranking
Modality: Text
Similarity Metric: N/A
License: Proprietary
Dimensions: 0
Max Input Tokens: 4096
Price: $2.00/ 1K Searches
Introduction to Cohere rerank-english-v3.0
rerank-english-v3.0 is a specialized reranking model designed to improve the accuracy of search and retrieval systems by refining ranked results based on their relevance. It is used for English language documents and semi-structured data (JSON) with a context length of 4096 tokens.
For more information about reranking and rerankers, read the below blogs.
- What Are Rerankers and How They Enhance Information Retrieval
- Optimizing RAG with Rerankers: The Role and Trade-offs
How to rerank results with rerank-english-v3.0
There are two primary ways to rerank search results:
- PyMilvus: the Python SDK for Milvus that seamlessly integrates with the
rerank-english-v3.0
model. - Cohere's API
Reranking via PyMilvus
from pymilvus.model.reranker import CohereRerankFunction
rf = CohereRerankFunction(
model_name="rerank-english-v3.0",
api_key=COHERE_API_KEY
)
query = "What event in 1956 marked the official birth of artificial intelligence as a discipline?"
documents = [
"In 1950, Alan Turing published his seminal paper, 'Computing Machinery and Intelligence,' proposing the Turing Test as a criterion of intelligence, a foundational concept in the philosophy and development of artificial intelligence.",
"The Dartmouth Conference in 1956 is considered the birthplace of artificial intelligence as a field; here, John McCarthy and others coined the term 'artificial intelligence' and laid out its basic goals.",
"In 1951, British mathematician and computer scientist Alan Turing also developed the first program designed to play chess, demonstrating an early example of AI in game strategy.",
"The invention of the Logic Theorist by Allen Newell, Herbert A. Simon, and Cliff Shaw in 1955 marked the creation of the first true AI program, which was capable of solving logic problems, akin to proving mathematical theorems."
]
results = rf(
query=query,
documents=documents,
top_k=4,
)
Reranking via Cohere API
import cohere
co = cohere.Client("your-cohere-api-key")
query = "What event in 1956 marked the official birth of artificial intelligence as a discipline?"
documents = [
"In 1950, Alan Turing published his seminal paper, 'Computing Machinery and Intelligence,' proposing the Turing Test as a criterion of intelligence, a foundational concept in the philosophy and development of artificial intelligence.",
"The Dartmouth Conference in 1956 is considered the birthplace of artificial intelligence as a field; here, John McCarthy and others coined the term 'artificial intelligence' and laid out its basic goals.",
"In 1951, British mathematician and computer scientist Alan Turing also developed the first program designed to play chess, demonstrating an early example of AI in game strategy.",
"The invention of the Logic Theorist by Allen Newell, Herbert A. Simon, and Cliff Shaw in 1955 marked the creation of the first true AI program, which was capable of solving logic problems, akin to proving mathematical theorems."
]
results = co.rerank(query=query, documents=documents, top_n=4, model='rerank-english-v3.0')
- Refer to this documentation page for more details.
- Learn Cohere Rerank Best Practices
Start Free, Scale Easily
Try the fully-managed vector database built for your GenAI applications.
Try Zilliz Cloud for Free