Priya-0914 commited on
Commit
4dda9f7
·
verified ·
1 Parent(s): dbedc64

Create reranker.py

Browse files
Files changed (1) hide show
  1. reranker.py +7 -0
reranker.py ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ from llama_index.postprocessor.cohere_rerank import CohereRerank
2
+
3
+ def reranker(cohere_key):
4
+ # Define the Cohere Reranking object to return only the first two highest ranking chunks.
5
+ cohere_rerank3 = CohereRerank(top_n=2, api_key=cohere_key,model = 'rerank-english-v3.0')
6
+ return cohere_rerank3
7
+