RAGChain Docs
  • Introduction
  • Quick Start
  • Installation
  • RAGchain Structure
    • File Loader
      • Dataset Loader
        • Ko-Strategy-QA Loader
      • Hwp Loader
      • Rust Hwp Loader
      • Win32 Hwp Loader
      • OCR
        • Nougat Loader
        • Mathpix Markdown Loader
        • Deepdoctection Loader
    • Text Spliter
      • Recursive Text Splitter
      • Markdown Header Splitter
      • HTML Header splitter
      • Code splitter
      • Token splitter
    • Retrieval
      • BM25 Retrieval
      • Hybrid Retrieval
      • Hyde Retrieval
      • VectorDB Retrieval
    • LLM
    • DB
      • MongoDB
      • Pickle DB
    • Reranker
      • BM25 Reranker
      • UPR Reranker
      • TART Reranker
      • MonoT5 Reranker
      • LLM Reranker
    • Benchmark
      • Auto Evaluator
      • Dataset Evaluators
        • Qasper
        • Ko-Strategy-QA
        • Strategy-QA
        • ms-marco
  • Utils
    • Query Decomposition
    • Evidence Extractor
    • Embedding
    • Slim Vector Store
      • Pinecone Slim
      • Chroma Slim
    • File Cache
    • Linker
      • Redis Linker
      • Dynamo Linker
      • Json Linker
    • REDE Search Detector
    • Semantic Clustering
  • Pipeline
    • BasicIngestPipeline
    • BasicRunPipeline
    • RerankRunPipeline
    • ViscondeRunPipeline
  • For Advanced RAG
    • Time-Aware RAG
    • Importance-Aware RAG
Powered by GitBook
On this page
  • Overview
  • Usage
  • Initialize
  • rerank
  1. RAGchain Structure
  2. Reranker

TART Reranker

TARTReranker Class Documentation

PreviousUPR RerankerNextMonoT5 Reranker

Last updated 1 year ago

Overview

The TARTReranker class is a reranker based on . It is designed to rerank passages using specific instructions. The primary functionality of this class lies in its ability to rerank a list of passages based on a given query and instruction.

Usage

Initialize

To use the TARTReranker class, start by creating an instance of the class with an instruction that will be used to guide the reranking process. This is done by passing the instruction as a string to the TARTReranker constructor during initialization.

from RAGchain.reranker import TARTReranker

reranker = TARTReranker(instruction="Find passage to answer given question")

In this example, "Find passage to answer given question" is the instruction that will be used for reranking. You can put any instructions like "Find python code implementation of user's question." or "Find specific name of Python class."

rerank

After the TARTReranker instance has been initialized, you can use the rerank method to rerank a list of passages based on a given query. The rerank method takes two parameters: a query (a string), and a list of passages.

query = "What is query decomposition?"
passages =[...list_of_passages...] # Assume we have list_of_passages retrieved earlier

reranked_passages = reranker.rerank(query, passages)
print(reranked_passages)

The rerank method returns a new list of the passages, reordered based on the given instruction and query.

TART