cohere-rerank-3.5 | Cohere

Inference API
MAX INPUT TOKENS

4096

TASK

reranker

PRICE

$2.00 / 1k req.

Overview

Cohere Rerank v3.5 is the latest iteration in Cohere’s Rerank model series, building upon Cohere Rerank v3.0. Rerank has improved dramatically in cases where the user is expressing explicitly or implicitly constraints on what they would like returned. Rerank’s ability to rank results based on this has considerably improved performance on queries that have traditionally been the hardest for retrieval systems. Other key features include multilingual support for over 100+ languages and SOTA performance in domains like finance, hospitality and many more. The model has a context length of 4096 tokens.

Installation

pip install -U pinecone

Reranking

See rerank to learn more about reranking.

from pinecone import Pinecone

pc = Pinecone("API-KEY")

query = "Tell me about Apple's products"
results = pc.inference.rerank(
    model="cohere-rerank-3.5",
    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
)

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

Lorem Ipsum

Was this page helpful?