TART Reranker
TARTReranker Class Documentation
Overview
The TARTReranker
class is a reranker based on TART. 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.
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.
The rerank
method returns a new list of the passages, reordered based on the given instruction and query.
Last updated