文章预览
tree2retriever 面向RAG场景的递归摘要树检索器实现 Recursive Abstractive Processing for Tree-Organized Retrieval Github:https://github.com/yanqiangmiffy/tree2retriever Example import logging import pickle from tree2retriever.cluster_tree_builder import ClusterTreeBuilder, ClusterTreeConfig from tree2retriever.embedding import SBertEmbeddingModel from tree2retriever.summary import GLMSummarizationModel from tree2retriever.tree_retriever import TreeRetriever, TreeRetrieverConfig if __name__ == '__main__' : tree_builder_type = 'cluster' logging.basicConfig(format= "%(asctime)s - %(message)s" , level=logging.INFO) supported_tree_builders = { "cluster" : (ClusterTreeBuilder, ClusterTreeConfig)} tree_builder_class, tree_builder_config_class = supported_tree_builders[ tree_builder_type ] embedding_model = SBertEmbeddingModel(model_name= r"I:\pretrained_models\bert\eng
………………………………