pip install llama-index-postprocessor-sbert-rerank
from llama_index.postprocessor.sbert_rerank import SentenceTransformerRerank postprocessor = SentenceTransformerRerank( model="<model name>", top_n=3 )