{"id":162109,"date":"2025-03-28T17:14:27","date_gmt":"2025-03-28T17:14:27","guid":{"rendered":"https:\/\/peraltafinancing.com\/analytics\/comprehensive-guide-on-reranker-for-rag\/"},"modified":"2025-03-28T17:14:27","modified_gmt":"2025-03-28T17:14:27","slug":"comprehensive-guide-on-reranker-for-rag","status":"publish","type":"post","link":"https:\/\/fivemor.com\/?p=162109","title":{"rendered":"Comprehensive Guide on Reranker for RAG"},"content":{"rendered":"<p> <br \/>\n<\/p>\n<div id=\"article-start\">\n<p>Retrieval Augmented Generation (RAG) systems are revolutionizing how we interact with information, but they\u2019re only as good as the data they retrieve. Optimizing those retrieval results is where the reranker comes in. For instance, consider it as a quality control system for your search results, ensuring that only the most relevant information comes into the final output.<\/p>\n<p>This article explores the world of rerankers, explaining why they\u2019re important, when you need them, their potential drawbacks, and their types. This article will also guide you in selecting the best reranker for your specific RAG system and how to evaluate its performance.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-what-is-a-reranker-for-rag\">What is a Reranker for RAG?<\/h2>\n<p>A reranker is an important component of the information retrieval systems, it acts as a second-pass filter. While doing an initial search (using methods like <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2023\/07\/semantic-search-applications\/\" target=\"_blank\" rel=\"noreferrer noopener\">semantic<\/a> or keyword search) it returns a set of documents, and the reranker helps to reorder them. This reordering filters and prioritizes documents based on their relevance to a specific query, hence improving the quality of search results. Rerankers achieve this balance between speed and quality by employing more complex matching techniques than the initial retrieval stage.<\/p>\n<p>This image illustrates a two-stage search process. Reranking is the second stage, where an initial set of search results, based on semantic or keyword matching, is refined to significantly improve the relevance and ordering of the final results, delivering a more accurate and useful outcome for the user\u2019s query.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-why-to-use-reranker-for-rag\">Why to Use Reranker for RAG?<\/h2>\n<p>Imagine your RAG system as a chef, and the retrieved documents are the ingredients. To create a delicious dish (accurate answer), you require the best ingredients. But what if some of those ingredients are irrelevant or simply don\u2019t belong in the recipe? That\u2019s where rerankers help!<\/p>\n<p>Here\u2019s why you need a reranker:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Hallucination Reduction:<\/strong> Rerankers filter out irrelevant documents that can cause the LLM to generate inaccurate or nonsensical responses (hallucinations).<\/li>\n<li><strong>Cost Savings:<\/strong> By focusing on the most relevant documents, you reduce the amount of information the <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/03\/top-sota-llms\/\" target=\"_blank\" rel=\"noreferrer noopener\">LLM<\/a> needs to process, saving you money on API calls and computing resources.<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-understanding-the-embedding-limitations\">Understanding the Embedding Limitations<\/h3>\n<p>Relying solely on embeddings for retrieval can be problematic due to:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Limited Semantic Understanding:<\/strong> <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2022\/09\/understanding-word-embeddings-and-building-your-first-rnn-model\/\" target=\"_blank\" rel=\"noreferrer noopener\">Embeddings<\/a> sometimes miss nuanced context. For example, they may struggle to differentiate between similar sentences with subtle but important differences.<\/li>\n<li><strong>Dimensionality Constraints:<\/strong> Representing complex information in a low-dimensional embedding space can lead to information loss.<\/li>\n<li><strong>Generalization Issues:<\/strong> Embeddings may struggle to retrieve information outside of their original training data accurately.<\/li>\n<\/ul>\n<h3 class=\"wp-block-heading\" id=\"h-rerankers-advantages\">Rerankers Advantages<\/h3>\n<p>Rerankers excel where embeddings fall short by:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Bag-of-Embeddings Approach:<\/strong> Breaking down documents into smaller, contextualized units of information instead of relying on a single vector representation.<\/li>\n<li><strong>Semantic Keyword Matching:<\/strong> Combining the strengths of powerful encoder models (like <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2024\/04\/colbert-improve-retrieval-performance-with-token-level-vector-embeddings\/\" target=\"_blank\" rel=\"noreferrer noopener\">BERT<\/a>) with keyword-based techniques to capture both semantic meaning and keyword relevance.<\/li>\n<li><strong>Improved Generalization:<\/strong> By focusing on smaller, contextualized units, rerankers handle unseen documents and queries more effectively.<\/li>\n<\/ul>\n<p>A query is used to search a vector database, retrieving the top 25 most relevant documents. These documents are then passed to a \u201cReranker\u201d module. The reranker refines the results, selecting the top 3 most relevant documents for the final output.<\/p>\n<p>Also read: <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/03\/embedding-for-rag-models\/\" target=\"_blank\" rel=\"noreferrer noopener\">How to Choose the Right Embedding for Your RAG Model<\/a><\/p>\n<h2 class=\"wp-block-heading\" id=\"h-types-of-rerankers\">Types of Rerankers<\/h2>\n<p>The world of rerankers is constantly evolving. Here\u2019s a breakdown of the main types:<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"table table-bordered border-black table-striped\">\n<tbody>\n<tr>\n<td><strong>Approach<\/strong><\/td>\n<td><strong>Examples<\/strong><\/td>\n<td><strong>Access Type<\/strong><\/td>\n<td><strong>Performance Level<\/strong><\/td>\n<td><strong>Cost Range<\/strong><\/td>\n<\/tr>\n<tr>\n<td>Cross Encoder<\/td>\n<td>Sentence Transformers, Flashrank<\/td>\n<td>Open-source<\/td>\n<td>Excellent<\/td>\n<td>Moderate<\/td>\n<\/tr>\n<tr>\n<td>Multi-Vector<\/td>\n<td>ColBERT<\/td>\n<td>Open-source<\/td>\n<td>Good<\/td>\n<td>Low<\/td>\n<\/tr>\n<tr>\n<td>Fine-tuned Large Language Model<\/td>\n<td>RankZephyr, RankT5<\/td>\n<td>Open-source<\/td>\n<td>Excellent<\/td>\n<td>High<\/td>\n<\/tr>\n<tr>\n<td>LLM as a Judge<\/td>\n<td>GPT, Claude, Gemini<\/td>\n<td>Proprietary<\/td>\n<td>Top-tier<\/td>\n<td>Very Expensive<\/td>\n<\/tr>\n<tr>\n<td>Rerank API<\/td>\n<td>Cohere, Jina<\/td>\n<td>Proprietary<\/td>\n<td>Excellent<\/td>\n<td>Moderate<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h3 class=\"wp-block-heading\" id=\"h-1-cross-encoders-deep-understanding-for-high-precision\">1. Cross-Encoders: Deep Understanding for High Precision<\/h3>\n<p>Cross-encoders classify pairs of data, analyzing the relationship between a query and a document together. They offer nuanced understanding, making them excellent for precise relevance scoring. However, they require significant computational resources, making them less suitable for real-time applications.<\/p>\n<p><strong>Example Code:<\/strong><\/p>\n<pre class=\"wp-block-code\"><code>from langchain.retrievers import ContextualCompressionRetriever\nfrom langchain.retrievers.document_compressors import FlashrankRerank\nfrom langchain_openai import ChatOpenAI\nllm = ChatOpenAI(temperature=0)\ncompressor = FlashrankRerank()\ncompression_retriever = ContextualCompressionRetriever(\n\u00a0\u00a0\u00a0base_compressor=compressor, base_retriever=retriever\n)\ncompressed_docs = compression_retriever.invoke(\n\u00a0\u00a0\u00a0\"What did the president say about Ketanji Jackson Brown\"\n)\nprint([doc.metadata[\"id\"] for doc in compressed_docs])\npretty_print_docs(compressed_docs)<\/code><\/pre>\n<p>This code snippet utilizes FlashrankRerank within a ContextualCompressionRetriever to improve the relevance of retrieved documents. It specifically reranks documents obtained by a base retriever (represented by a retriever) based on their relevance to the query \u201cWhat did the president say about Ketanji Jackson Brown\u201d. Finally, it prints the document IDs and the compressed, reranked documents.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-output\">Output:<\/h4>\n<pre class=\"wp-block-preformatted\">[0, 5, 3]<p>Document 1:<\/p><p>One of the most serious constitutional responsibilities a President has is<br\/>nominating someone to serve on the United States Supreme Court.<\/p><p>And I did that 4 days ago, when I nominated Circuit Court of Appeals Judge<br\/>Ketanji Brown Jackson. One of our nation\u2019s top legal minds, who will<br\/>continue Justice Breyer\u2019s legacy of excellence.<\/p><p>----------------------------------------------------------------------------------------------------<\/p><p>Document 2:<\/p><p>He met the Ukrainian people.<\/p><p>From President Zelenskyy to every Ukrainian, their fearlessness, their<br\/>courage, their determination, inspires the world.<\/p><p>Groups of citizens blocking tanks with their bodies. Everyone from students<br\/>to retirees teachers turned soldiers defending their homeland.<\/p><p>In this struggle as President Zelenskyy said in his speech to the European Parliament \u201cLight will win over darkness.\u201d The Ukrainian Ambassador to the United States is here tonight.<\/p><p>----------------------------------------------------------------------------------------------------<\/p><p>Document 3:<\/p><p>And tonight, I\u2019m announcing that the Justice Department will name a chief prosecutor for pandemic fraud.<\/p><p>By the end of this year, the deficit will be down to less than half what it was before I took office.\u00a0\u00a0<\/p><p>The only president ever to cut the deficit by more than one trillion dollars in a single year.<\/p><p>Lowering your costs also means demanding more competition.<\/p><p>I\u2019m a capitalist, but capitalism without competition isn\u2019t capitalism.<\/p><p>It\u2019s exploitation\u2014and it drives up prices.<\/p><\/pre>\n<p>The output shoes it reranks the retrieved chunks based on the relevancy.<\/p>\n<h3 class=\"wp-block-heading\" id=\"h-2-multi-vector-rerankers-balancing-performance-and-efficiency\">2. Multi-Vector Rerankers: Balancing Performance and Efficiency<\/h3>\n<p>Multi-vector models like ColBERT use a late interaction approach. Query and document representations are encoded independently, and their interaction occurs later in the process. This allows pre-computation of document representations, leading to faster retrieval times and reduced computational demands.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-example-code\">Example Code:<\/h4>\n<p>Install the Ragtouille library for using the ColBERT reranker<\/p>\n<pre class=\"wp-block-code\"><code>pip install -U ragatouille<\/code><\/pre>\n<p>Now setting up the ColBERT reranker<\/p>\n<pre class=\"wp-block-code\"><code>from ragatouille import RAGPretrainedModel\nfrom langchain.retrievers import ContextualCompressionRetriever\nRAG = RAGPretrainedModel.from_pretrained(\"colbert-ir\/colbertv2.0\")\ncompression_retriever = ContextualCompressionRetriever(\n\u00a0\u00a0\u00a0\u00a0base_compressor=RAG.as_langchain_document_compressor(), base_retriever=retriever\n)\ncompressed_docs = compression_retriever.invoke(\n\u00a0\u00a0\u00a0\u00a0\"What animation studio did Miyazaki found\"\n)\nprint(compressed_docs[0])<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-output-0\">Output<strong>:<\/strong><\/h4>\n<pre class=\"wp-block-preformatted\">Document(page_content=\"In June 1985, Miyazaki, Takahata, Tokuma and Suzuki<br\/>founded the animation production company Studio Ghibli, with funding from<br\/>Tokuma Shoten. Studio Ghibli\\\"s first film, Laputa: Castle in the Sky<br\/>(1986), employed the same production crew of Nausica\u00e4. Miyazaki\\'s designs<br\/>for the film\\'s setting were inspired by Greek architecture and \"European<br\/>urbanistic templates\". Some of the architecture in the film was also<br\/>inspired by a Welsh mining town; Miyazaki witnessed the mining strike upon<br\/>his first', metadata={'relevance_score': 26.5194149017334})<\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-3-fine-tuned-llm-rerankers\">3. FIne-tuned LLM Rerankers<\/h3>\n<p>Fine-tuning large language models (LLMs) for reranking tasks is essential. Pre-trained LLMs do not inherently understand how to measure the relevance of a query to a document. By fine-tuning these models on specific ranking datasets, like the MS MARCO passage ranking dataset, we can improve their ability to rank documents effectively.<\/p>\n<p>There are two main types of supervised rerankers based on their model structure:<\/p>\n<ol class=\"wp-block-list\">\n<li><strong>Encoder-Decoder Models<\/strong>: These models treat document ranking as a generation task. They use an encoder-decoder framework to optimize the reranking process. For instance, the RankT5 model is trained to produce tokens that classify query-document pairs as relevant or irrelevant.<\/li>\n<li><strong>Decoder-Only Models:<\/strong> This approach focuses on fine-tuning models that use only a decoder, such as LLaMA. Models like RankZephyr and RankGPT explore different methods for calculating relevance in this context.<\/li>\n<\/ol>\n<p>By applying these fine-tuning techniques, we can enhance the performance of LLMs in reranking tasks, making them more effective in understanding and prioritizing relevant documents.<\/p>\n<h4 class=\"wp-block-heading\" id=\"h-example-code-0\">Example Code:<\/h4>\n<p>First, install the RankLLM library<\/p>\n<pre class=\"wp-block-code\"><code>pip install --upgrade --quiet\u00a0 rank_llm<\/code><\/pre>\n<p>Set up the RankZephyr\u00a0<\/p>\n<pre class=\"wp-block-code\"><code>from langchain.retrievers.contextual_compression import ContextualCompressionRetriever\nfrom langchain_community.document_compressors.rankllm_rerank import RankLLMRerank\ncompressor = RankLLMRerank(top_n=3, model=\"zephyr\")\ncompression_retriever = ContextualCompressionRetriever(\n\u00a0\u00a0\u00a0base_compressor=compressor, base_retriever=retriever\n)\ncompressed_docs = compression_retriever.invoke(query)\npretty_print_docs(compressed_docs)<\/code><\/pre>\n<h4 class=\"wp-block-heading\" id=\"h-output-1\">Output:<\/h4>\n<pre class=\"wp-block-preformatted\">Document 1:<p>Together with our allies \u2013we are right now enforcing powerful economic<br\/>sanctions.\u00a0<\/p><p>We are cutting off Russia\u2019s largest banks from the international financial<br\/>system.\u00a0\u00a0<\/p><p>Preventing Russia\u2019s central bank from defending the Russian Ruble making<br\/>Putin\u2019s $630 Billion \u201cwar fund\u201d worthless.\u00a0\u00a0\u00a0<\/p><p>We are choking off Russia\u2019s access to technology that will sap its economic<br\/>strength and weaken its military for years to come.<\/p><p>----------------------------------------------------------------------------------------------------<\/p><p>Document 2:<\/p><p>And tonight I am announcing that we will join our allies in closing off<br\/>American air space to all Russian flights \u2013 further isolating Russia \u2013 and<br\/>adding an additional squeeze \u2013on their economy. The Ruble has lost 30% of<br\/>its value.\u00a0<\/p><p>The Russian stock market has lost 40% of its value and trading remains<br\/>suspended. Russia\u2019s economy is reeling and Putin alone is to blame.<\/p><p>----------------------------------------------------------------------------------------------------<\/p><p>Document 3:<\/p><p>And now that he has acted the free world is holding him accountable.\u00a0<\/p><p>Along with twenty-seven members of the European Union including France,<br\/>Germany, Italy, as well as countries like the United Kingdom, Canada, Japan,<br\/>Korea, Australia, New Zealand, and many others, even Switzerland.\u00a0<\/p><p>We are inflicting pain on Russia and supporting the people of Ukraine. Putin<br\/>is now isolated from the world more than ever.\u00a0<\/p><p>Together with our allies \u2013we are right now enforcing powerful economic<br\/>sanctions.<\/p><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-4-llm-as-a-judge-for-reranking\">4. LLM as a Judge for Reranking<\/h3>\n<p>Large language models can be used to improve document reranking autonomously through prompting strategies like pointwise, listwise, and pairwise methods. These methods leverage the reasoning capabilities of LLMs (LLM as a judge) to assess the relevance of documents to a query directly. While offering competitive effectiveness, the high computational cost and latency associated with LLMs can be a barrier to practical use.<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Pointwise Methods:<\/strong> Pointwise methods assess the relevance of a single document in relation to a query. They include two subcategories: relevance generation and query generation. Both approaches work well for zero-shot document reranking, meaning they can rank documents without prior training on specific examples.<\/li>\n<li><strong>Listwise Methods:<\/strong> Listwise methods rank a list of documents by including both the query and the document list in the prompt. The LLM is then instructed to output the identifiers of the reranked documents. Since LLMs have a limited input length, it is often impractical to include all candidate documents at once. To manage this, listwise methods use a sliding window strategy. This approach ranks a subset of documents at a time, moving through the list from back to front and reranking only the documents within the current window.<\/li>\n<li><strong>Pairwise Methods:<\/strong> In pairwise methods, the LLM receives a prompt that includes a query and a pair of documents. The model is tasked with identifying which document is more relevant. To aggregate results, methods like AllPairs are used. AllPairs generates all possible document pairs and calculates a final relevance score for each document. Efficient sorting algorithms, such as heap sort and bubble sort, help speed up the ranking process.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-example-code-1\">Example code:<\/h4>\n<pre class=\"wp-block-code\"><code>import openai\n# Set your OpenAI API key\nopenai.api_key = 'YOUR_API_KEY'\ndef pointwise_rerank(query, document):\n\u00a0\u00a0\u00a0prompt = f\"Rate the relevance of the following document to the query on a scale from 1 to 10:\\n\\nQuery: {query}\\nDocument: {document}\\n\\nRelevance Score:\"\n\u00a0\u00a0\u00a0response = openai.ChatCompletion.create(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0model=\"gpt-4-turbo\",\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0messages=[{\"role\": \"user\", \"content\": prompt}]\n\u00a0\u00a0\u00a0)\n\u00a0\u00a0\u00a0return response['choices'][0]['message']['content'].strip()\ndef listwise_rerank(query, documents):\n\u00a0\u00a0\u00a0# Use a sliding window approach to rerank documents\n\u00a0\u00a0\u00a0window_size = 5\n\u00a0\u00a0\u00a0reranked_docs = []\n\u00a0\u00a0\u00a0for i in range(0, len(documents), window_size):\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0window = documents[i:i + window_size]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0prompt = f\"Given the query, please rank the following documents:\\n\\nQuery: {query}\\nDocuments: {', '.join(window)}\\n\\nRanked Document Identifiers:\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0response = openai.ChatCompletion.create(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0model=\"gpt-4-turbo\",\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0messages=[{\"role\": \"user\", \"content\": prompt}]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0ranked_ids = response['choices'][0]['message']['content'].strip().split(', ')\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0reranked_docs.extend(ranked_ids)\n\u00a0\u00a0\u00a0return reranked_docs\ndef pairwise_rerank(query, documents):\n\u00a0\u00a0\u00a0scores = {}\n\u00a0\u00a0\u00a0for i in range(len(documents)):\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0for j in range(i + 1, len(documents)):\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0doc1 = documents[i]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0doc2 = documents[j]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0prompt = f\"Which document is more relevant to the query?\\n\\nQuery: {query}\\nDocument 1: {doc1}\\nDocument 2: {doc2}\\n\\nAnswer with '1' for Document 1, '2' for Document 2:\"\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0response = openai.ChatCompletion.create(\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0model=\"gpt-4-turbo\",\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0messages=[{\"role\": \"user\", \"content\": prompt}]\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0winner = response['choices'][0]['message']['content'].strip()\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0if winner == '1':\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0scores[doc1] = scores.get(doc1, 0) + 1\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0scores[doc2] = scores.get(doc2, 0)\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0elif winner == '2':\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0scores[doc2] = scores.get(doc2, 0) + 1\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0scores[doc1] = scores.get(doc1, 0)\n\u00a0\u00a0\u00a0# Sort documents based on scores\n\u00a0\u00a0\u00a0ranked_docs = sorted(scores.items(), key=lambda item: item[1], reverse=True)\n\u00a0\u00a0\u00a0return [doc for doc, score in ranked_docs]\n# Example usage\nquery = \"What are the benefits of using LLMs for document reranking?\"\ndocuments = [\n\u00a0\u00a0\u00a0\"LLMs can process large amounts of text quickly.\",\n\u00a0\u00a0\u00a0\"They require extensive fine-tuning for specific tasks.\",\n\u00a0\u00a0\u00a0\"LLMs can generate human-like text responses.\",\n\u00a0\u00a0\u00a0\"They are limited by their training data and may produce biased results.\"\n]\n# Pointwise Reranking\nfor doc in documents:\n\u00a0\u00a0\u00a0score = pointwise_rerank(query, doc)\n\u00a0\u00a0\u00a0print(f\"Document: {doc} - Relevance Score: {score}\")\n# Listwise Reranking\nreranked_listwise = listwise_rerank(query, documents)\nprint(f\"Listwise Reranked Documents: {reranked_listwise}\")\n# Pairwise Reranking\nreranked_pairwise = pairwise_rerank(query, documents)\nprint(f\"Pairwise Reranked Documents: {reranked_pairwise}\")<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">Document: LLMs can process large amounts of text quickly. - Relevance Score:<br\/>8<p>Document: They require extensive fine-tuning for specific tasks. - Relevance<br\/>Score: 6<\/p><p>Document: LLMs can generate human-like text responses. - Relevance Score: 9<\/p><p>Document: They are limited by their training data and may produce biased<br\/>results. - Relevance Score: 5<\/p><p>Listwise Reranked Documents: ['LLMs can generate human-like text responses.',<br\/>'LLMs can process large amounts of text quickly.', 'They require extensive<br\/>fine-tuning for specific tasks.', 'They are limited by their training data<br\/>and may produce biased results.']<\/p><p>Pairwise Reranked Documents: ['LLMs can generate human-like text responses.',<br\/>'LLMs can process large amounts of text quickly.', 'They require extensive<br\/>fine-tuning for specific tasks.', 'They are limited by their training data<br\/>and may produce biased results.']<\/p><\/pre>\n<h3 class=\"wp-block-heading\" id=\"h-5-reranking-apis\">5. Reranking APIs<\/h3>\n<p>Private reranking APIs offer a convenient solution for organizations seeking to enhance search systems with semantic relevance without significant infrastructure investment. Companies like Cohere, Jina, and Mixedbread offer these services.<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Cohere:<\/strong> Tailored models for English and multilingual documents, automatic document chunking, and relevance scores normalized between 0 and 1.<\/li>\n<li><strong>Jina:<\/strong> Specializes in enhancing search results with semantic understanding and longer context lengths.<\/li>\n<li><strong>Mixedbread:<\/strong> Offers a family of open-source reranking models, providing flexibility for integration into existing search infrastructure.<\/li>\n<\/ul>\n<h4 class=\"wp-block-heading\" id=\"h-example-code-2\">Example Code:<\/h4>\n<p>Install the RankLLM library:<\/p>\n<pre class=\"wp-block-code\"><code>pip install --upgrade --quiet\u00a0 cohere<\/code><\/pre>\n<p>Set up the Cohere and ContextualCompressionRetriever:<\/p>\n<pre class=\"wp-block-code\"><code>from langchain.retrievers.contextual_compression import ContextualCompressionRetriever\nfrom langchain_cohere import CohereRerank\nfrom langchain_community.llms import Cohere\nfrom langchain.chains import RetrievalQA\nllm = Cohere(temperature=0)\ncompressor = CohereRerank(model=\"rerank-english-v3.0\")\ncompression_retriever = ContextualCompressionRetriever(\n\u00a0\u00a0\u00a0base_compressor=compressor, base_retriever=retriever\n)\nchain = RetrievalQA.from_chain_type(\n\u00a0\u00a0\u00a0llm=Cohere(temperature=0), retriever=compression_retriever\n)<\/code><\/pre>\n<p><strong>Output:<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">{'query': 'What did the president say about Ketanji Brown Jackson',<p>\u00a0'result': \" The president speaks highly of Ketanji Brown Jackson, stating<br\/>that she is one of the nation's top legal minds, and will continue the<br\/>legacy of excellence of Justice Breyer. The president also mentions that he<br\/>worked with her family and that she comes from a family of public school<br\/>educators and police officers. Since her nomination, she has received<br\/>support from various groups, including the Fraternal Order of Police and<br\/>judges from both major political parties. \\n\\nWould you like me to extract<br\/>another sentence from the provided text? \"}<\/p><\/pre>\n<h2 class=\"wp-block-heading\" id=\"h-choosing-the-right-reranker-for-rag\">Choosing the Right Reranker for RAG<\/h2>\n<p>Selecting the optimal reranker for RAG requires careful evaluation of several factors:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Relevance Improvement:<\/strong> The primary goal is to improve the relevance of search results. Use metrics like NDCG (Normalized Discounted Cumulative Gain) or attribution to evaluate the reranker\u2019s impact.<\/li>\n<li><strong>Latency:<\/strong> Measures the additional time the reranker adds to the search process. Ensure it remains within acceptable limits for your application\u2019s requirements.<\/li>\n<li><strong>Contextual Understanding:<\/strong> Consider the reranker\u2019s ability to handle varying lengths of context in queries and documents.<\/li>\n<li><strong>Generalization Ability:<\/strong> Ensure the reranker performs well across different domains and datasets to prevent overfitting.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"h-latest-research-nbsp\">Latest Research\u00a0<\/h2>\n<h3 class=\"wp-block-heading\" id=\"h-cross-encoders-emerge-as-a-promising-option\">Cross-Encoders Emerge as a Promising Option<\/h3>\n<p>Recent research has highlighted the effectiveness and efficiency of cross-encoders, especially when paired with strong retrievers. While in-domain performance differences might be subtle, out-of-domain scenarios reveal the significant impact a reranker can have. Cross-encoders have shown the ability to outperform most LLMs in reranking tasks (except for GPT-4 in some cases) while being more efficient.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-conclusion\">Conclusion<\/h2>\n<p>Choosing the right reranker for <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/2025\/03\/top-rag-frameworks-for-ai-applications\/\" target=\"_blank\" rel=\"noreferrer noopener\">RAG<\/a> is important for improving systems and ensuring accurate search results. As the RAG landscape evolves, having clear visibility across the entire pipeline helps teams build effective systems. By addressing challenges in the process, teams can improve performance. Understanding the different types of rerankers and their strengths and weaknesses is essential. Carefully choosing and evaluating your reranker for RAG can enhance the accuracy and efficiency of your RAG applications. This thoughtful approach leads to better results and a more dependable system.<\/p>\n<div class=\"border-top py-3 author-info my-4\">\n<div class=\"author-card d-flex align-items-center\">\n<div class=\"flex-shrink-0 overflow-hidden\">\n                                    <a href=\"https:\/\/www.analyticsvidhya.com\/blog\/author\/harsh9480979\/\" class=\"text-decoration-none active-avatar\"><br \/>\n                                                                       <img decoding=\"async\" src=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp\" width=\"48\" height=\"48\" alt=\"Harsh Mishra\" loading=\"lazy\" class=\"rounded-circle\"\/><\/p>\n<p>                                <\/a>\n                                <\/div>\n<\/p><\/div>\n<p>Harsh Mishra is an AI\/ML Engineer who spends more time talking to Large Language Models than actual humans. Passionate about GenAI, NLP, and making machines smarter (so they don\u2019t replace him just yet). When not optimizing models, he\u2019s probably optimizing his coffee intake. \ud83d\ude80\u2615<\/p>\n<\/p><\/div>\n<\/p><\/div>\n<p><h4 class=\"fs-24 text-dark\">Login to continue reading and enjoy expert-curated content.<\/h4>\n<p>                        <button class=\"btn btn-primary mx-auto d-table\" data-bs-toggle=\"modal\" data-bs-target=\"#loginModal\" id=\"readMoreBtn\">Keep Reading for Free<\/button>\n                    <\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>Retrieval Augmented Generation (RAG) systems are revolutionizing how we interact with information, but they\u2019re only as good as the data they retrieve. Optimizing those retrieval results is where the reranker comes in. For instance, consider it as a quality control system for your search results, ensuring that only the most relevant information comes into the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12033],"tags":[10921,10099,2059,32726,66347],"dealstore":[],"offerexpiration":[],"class_list":["post-162109","post","type-post","status-publish","format-standard","hentry","category-analytics","tag-comprehensive","tag-documents","tag-guide","tag-rag","tag-reranker"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Comprehensive Guide on Reranker for RAG - Som2ny Network<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/fivemor.com\/?p=162109\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Comprehensive Guide on Reranker for RAG - Som2ny Network\" \/>\n<meta property=\"og:description\" content=\"Retrieval Augmented Generation (RAG) systems are revolutionizing how we interact with information, but they\u2019re only as good as the data they retrieve. Optimizing those retrieval results is where the reranker comes in. For instance, consider it as a quality control system for your search results, ensuring that only the most relevant information comes into the [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/fivemor.com\/?p=162109\" \/>\n<meta property=\"og:site_name\" content=\"Som2ny Network\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-28T17:14:27+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"14 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/fivemor.com\/?p=162109#article\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/?p=162109\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\"},\"headline\":\"Comprehensive Guide on Reranker for RAG\",\"datePublished\":\"2025-03-28T17:14:27+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=162109\"},\"wordCount\":1634,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=162109#primaryimage\"},\"thumbnailUrl\":\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp\",\"keywords\":[\"Comprehensive\",\"Documents\",\"Guide\",\"RAG\",\"Reranker\"],\"articleSection\":[\"Analytics\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/fivemor.com\/?p=162109#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/fivemor.com\/?p=162109\",\"url\":\"https:\/\/fivemor.com\/?p=162109\",\"name\":\"Comprehensive Guide on Reranker for RAG - Som2ny Network\",\"isPartOf\":{\"@id\":\"https:\/\/fivemor.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/fivemor.com\/?p=162109#primaryimage\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/?p=162109#primaryimage\"},\"thumbnailUrl\":\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp\",\"datePublished\":\"2025-03-28T17:14:27+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/fivemor.com\/?p=162109#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/fivemor.com\/?p=162109\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/?p=162109#primaryimage\",\"url\":\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp\",\"contentUrl\":\"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/fivemor.com\/?p=162109#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/fivemor.com\/?bp_activities=1\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Comprehensive Guide on Reranker for RAG\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/fivemor.com\/#website\",\"url\":\"https:\/\/fivemor.com\/\",\"name\":\"Som2ny Network\",\"description\":\"Daily Deals\",\"publisher\":{\"@id\":\"https:\/\/fivemor.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/fivemor.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/fivemor.com\/#organization\",\"name\":\"Som2ny Network\",\"url\":\"https:\/\/fivemor.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"contentUrl\":\"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png\",\"width\":300,\"height\":86,\"caption\":\"Som2ny Network\"},\"image\":{\"@id\":\"https:\/\/fivemor.com\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/fivemor.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png\",\"caption\":\"admin\"},\"sameAs\":[\"https:\/\/fivemor.com\"],\"url\":\"https:\/\/fivemor.com\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Comprehensive Guide on Reranker for RAG - Som2ny Network","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/fivemor.com\/?p=162109","og_locale":"en_US","og_type":"article","og_title":"Comprehensive Guide on Reranker for RAG - Som2ny Network","og_description":"Retrieval Augmented Generation (RAG) systems are revolutionizing how we interact with information, but they\u2019re only as good as the data they retrieve. Optimizing those retrieval results is where the reranker comes in. For instance, consider it as a quality control system for your search results, ensuring that only the most relevant information comes into the [&hellip;]","og_url":"https:\/\/fivemor.com\/?p=162109","og_site_name":"Som2ny Network","article_published_time":"2025-03-28T17:14:27+00:00","og_image":[{"url":"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp","type":"","width":"","height":""}],"author":"admin","twitter_card":"summary_large_image","twitter_misc":{"Written by":"admin","Est. reading time":"14 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/fivemor.com\/?p=162109#article","isPartOf":{"@id":"https:\/\/fivemor.com\/?p=162109"},"author":{"name":"admin","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371"},"headline":"Comprehensive Guide on Reranker for RAG","datePublished":"2025-03-28T17:14:27+00:00","mainEntityOfPage":{"@id":"https:\/\/fivemor.com\/?p=162109"},"wordCount":1634,"commentCount":0,"publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"image":{"@id":"https:\/\/fivemor.com\/?p=162109#primaryimage"},"thumbnailUrl":"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp","keywords":["Comprehensive","Documents","Guide","RAG","Reranker"],"articleSection":["Analytics"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/fivemor.com\/?p=162109#respond"]}]},{"@type":"WebPage","@id":"https:\/\/fivemor.com\/?p=162109","url":"https:\/\/fivemor.com\/?p=162109","name":"Comprehensive Guide on Reranker for RAG - Som2ny Network","isPartOf":{"@id":"https:\/\/fivemor.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/fivemor.com\/?p=162109#primaryimage"},"image":{"@id":"https:\/\/fivemor.com\/?p=162109#primaryimage"},"thumbnailUrl":"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp","datePublished":"2025-03-28T17:14:27+00:00","breadcrumb":{"@id":"https:\/\/fivemor.com\/?p=162109#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/fivemor.com\/?p=162109"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/?p=162109#primaryimage","url":"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp","contentUrl":"https:\/\/av-eks-lekhak.s3.amazonaws.com\/media\/lekhak-profile-images\/converted_image_0fBqNLi.webp"},{"@type":"BreadcrumbList","@id":"https:\/\/fivemor.com\/?p=162109#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/fivemor.com\/?bp_activities=1"},{"@type":"ListItem","position":2,"name":"Comprehensive Guide on Reranker for RAG"}]},{"@type":"WebSite","@id":"https:\/\/fivemor.com\/#website","url":"https:\/\/fivemor.com\/","name":"Som2ny Network","description":"Daily Deals","publisher":{"@id":"https:\/\/fivemor.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/fivemor.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/fivemor.com\/#organization","name":"Som2ny Network","url":"https:\/\/fivemor.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/","url":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","contentUrl":"https:\/\/fivemor.com\/wp-content\/uploads\/2026\/07\/4a0953c4-logo-300x86-1.png","width":300,"height":86,"caption":"Som2ny Network"},"image":{"@id":"https:\/\/fivemor.com\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/fivemor.com\/#\/schema\/person\/b85e3c3dc0e1daea076524dc8810c371","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/fivemor.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/729ae85bf62b9917e93538db2f2688ca?s=96&r=g&default=https%3A%2F%2Ffivemor.com%2Fwp-content%2Fplugins%2Fbuddypress-first-letter-avatar%2Fimages%2Fdefault%2F96%2Flatin_a.png","caption":"admin"},"sameAs":["https:\/\/fivemor.com"],"url":"https:\/\/fivemor.com\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/162109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=162109"}],"version-history":[{"count":0,"href":"https:\/\/fivemor.com\/index.php?rest_route=\/wp\/v2\/posts\/162109\/revisions"}],"wp:attachment":[{"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=162109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=162109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=162109"},{"taxonomy":"dealstore","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fdealstore&post=162109"},{"taxonomy":"offerexpiration","embeddable":true,"href":"https:\/\/fivemor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fofferexpiration&post=162109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}