----------------------------------------------------------------------------------------------------
Document 19:
I understand. 
I remember when my Dad had to leave our home in Scranton, Pennsylvania to find work. I grew up in a family where if the price of food went up, you felt it. 
That’s why one of the first things I did as President was fight to pass the American Rescue Plan.  
Because people were hurting. We needed to act, and we did. 
Few pieces of legislation have done more in a critical moment in our history to lift us out of crisis.
----------------------------------------------------------------------------------------------------
Document 20:
So let’s not abandon our streets. Or choose between safety and equal justice. 
Let’s come together to protect our communities, restore trust, and hold law enforcement accountable. 
That’s why the Justice Department required body cameras, banned chokeholds, and restricted no-knock warrants for its officers.
Doing reranking with CohereRerank#
Now let’s wrap our base retriever with a ContextualCompressionRetriever. We’ll add an CohereRerank, uses the Cohere rerank endpoint to rerank the returned results.
from langchain.llms import OpenAI
from langchain.retrievers import ContextualCompressionRetriever
from langchain.retrievers.document_compressors import CohereRerank
llm = OpenAI(temperature=0)
compressor = CohereRerank()
compression_retriever = ContextualCompressionRetriever(base_compressor=compressor, base_retriever=retriever)
compressed_docs = compression_retriever.get_relevant_documents("What did the president say about Ketanji Jackson Brown")
pretty_print_docs(compressed_docs)
Document 1:
One of the most serious constitutional responsibilities a President has is nominating someone to serve on the United States Supreme Court.
rtdocs_stable/api.python.langchain.com/en/stable/modules/indexes/retrievers/examples/cohere-reranker.html