Is there a way to define metedata filter for Raptor and BM25 retrieval ?
self.raptor_pack = RaptorPack(
documents=[],
embed_model=Settings.embed_model,
llm=self.llm,
vector_store=self.vector_store,
similarity_top_k=self.similarity_top_k,
mode="collapsed",
summary_module=self.summary_module,
)
self.bm25_retriever = BM25Retriever.from_defaults(
docstore=self.docstore, similarity_top_k=self.similarity_top_k
)
self.raptor_pack.retriever.filters = MetadataFilters(
filters=[ExactMatchFilter(key="namespace", value=self.namespace)]
)
self.fusion_retriever = QueryFusionRetriever(
[self.raptor_pack.retriever, self.bm25_retriever],
similarity_top_k=self.similarity_top_k,
num_queries=1, # set this to 1 to disable query generation
mode="reciprocal_rerank",
use_async=True,
verbose=verbose,
)