Jina Reranker
This notebook shows how to use Jina Reranker for document compression and retrieval.
%pip install -qU langchain langchain-openai langchain-community langchain-text-splitters langchainhub
%pip install --upgrade --quiet faiss
# OR (depending on Python version)
%pip install --upgrade --quiet faiss_cpu
# Helper function for printing docs
def pretty_print_docs(docs):
print(
f"\n{'-' * 100}\n".join(
[f"Document {i+1}:\n\n" + d.page_content for i, d in enumerate(docs)]
)
)