rerank
Rerank provides a powerful semantic boost to the search quality of any keyword or vector search system without requiring any overhaul or replacement.
rerank
Rerank provides a powerful semantic boost to the search quality of any keyword or vector search system without requiring any overhaul or replacement.
rerank
Rerank provides a powerful semantic boost to the search quality of any keyword or vector search system without requiring any overhaul or replacement.
Improve search results
Optimize eCommerce search
Boost knowledge base search
Implement Rerank in just a few minutes
Implementation can take as little as ten minutes (we’ve seen it!) and only a few lines of code. The code here implements Rerank.
1import cohere
2co = cohere.Client('{apiKey}')
3
4query = 'What is the capital of the United States?'
5docs = ['Carson City is the capital city of the American state of Nevada.',
6 'The Commonwealth of the Northern Mariana Islands is a group of islands in the Pacific Ocean. Its capital is Saipan.',
7 'Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district. ',
8 'Capital punishment (the death penalty) has existed in the United States since before the United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states.'
9 ]
10results = co.rerank(query=query, documents=docs, top_n=3, model='rerank-english-v2.0')
1Document Rank: 1, Document Index: 2
2Document: Washington, D.C. (also known as simply Washington or D.C., and officially as the District of Columbia) is the capital of the United States. It is a federal district.
3Relevance Score: 0.98
4
5
6Document Rank: 2, Document Index: 3
7Document: Capital punishment (the death penalty) has existed in the United States since before the United States was a country. As of 2017, capital punishment is legal in 30 of the 50 states.
8Relevance Score: 0.28
9
10
11Document Rank: 3, Document Index: 0
12Document: Carson City is the capital city of the American state of Nevada.
13Relevance Score: 0.10
Rerank uses search results from existing search tools and ranks them by semantic relevance, delivering richer, more relevant results.
With just two lines of code, you can implement Rerank and start seeing improvements, all without replacing your existing search tool.
No need for a team of ML experts — working with Rerank is easy. Monthly costs are minimal, and Rerank can be hosted on any cloud platform.
Rerank uses search results from existing search tools and ranks them by semantic relevance, delivering richer, more relevant results.
With just two lines of code, you can implement Rerank and start seeing improvements, all without replacing your existing search tool.
No need for a team of ML experts — working with Rerank is easy. Monthly costs are minimal, and Rerank can be hosted on any cloud platform.
Get started with Cohere today!
Reach out to us and let’s discuss how to improve your search performance.