MCPcopy Create free account

hub / github.com/datawhalechina/all-in-rag / functions

Functions495 in github.com/datawhalechina/all-in-rag

↓ 2 callersFunctionhas_hf_hub
(necessary=False)
code/C3/visual_bge/visual_bge/eva_clip/pretrained.py:285
↓ 2 callersMethodinitialize
初始化图RAG检索系统
code/C9/rag_modules/graph_rag_retrieval.py:76
↓ 2 callersFunctionload_clip_text_state_dict
(checkpoint_path: str, map_location: str='cpu', is_openai: bool=False, skip_list:list=[])
code/C3/visual_bge/visual_bge/eva_clip/factory.py:144
↓ 2 callersFunctionload_clip_visual_state_dict
(checkpoint_path: str, map_location: str='cpu', is_openai: bool=False, skip_list:list=[])
code/C3/visual_bge/visual_bge/eva_clip/factory.py:131
↓ 2 callersFunctionload_config
加载配置文件
code/C9/agent(代码系ai生成)/batch_manager.py:14
↓ 2 callersFunctionload_config
加载配置文件
code/C9/agent(代码系ai生成)/run_ai_agent.py:12
↓ 2 callersMethodload_documents
加载文档数据 Returns: 加载的文档列表
code/C8/rag_modules/data_preparation.py:45
↓ 2 callersMethodload_graph_data
从Neo4j加载图数据 Returns: 包含节点和关系的数据字典
code/C9/rag_modules/graph_data_preparation.py:84
↓ 2 callersMethodmerge_all_batches
合并所有批次数据到最终输出文件
code/C9/agent(代码系ai生成)/recipe_ai_agent.py:549
↓ 2 callersFunctionmerge_batches
手动合并所有批次数据
code/C9/agent(代码系ai生成)/batch_manager.py:95
↓ 2 callersMethodmetadata_filtered_search
带元数据过滤的检索 Args: query: 查询文本 filters: 元数据过滤条件 top_k: 返回结果数量 Returns:
code/C8/rag_modules/retrieval_optimization.py:69
↓ 2 callersMethodmulti_hop_traversal
多跳图遍历:这是图RAG的核心优势 通过图结构发现隐含的知识关联
code/C9/rag_modules/graph_rag_retrieval.py:263
↓ 2 callersFunctionpatch_device
(module)
code/C3/visual_bge/visual_bge/eva_clip/openai.py:97
↓ 2 callersFunctionpatch_float
(module)
code/C3/visual_bge/visual_bge/eva_clip/openai.py:121
↓ 2 callersMethodreset_classifier
(self, num_classes, global_pool='')
code/C3/visual_bge/visual_bge/eva_clip/eva_vit_model.py:485
↓ 2 callersFunctionsend_messages
(messages, tools=None)
code/C5/02_function_calling_example.py:11
↓ 2 callersMethodsentence_embedding
(self, hidden_state, mask)
code/C3/visual_bge/visual_bge/modeling.py:173
↓ 2 callersFunctionsetup_api_key
设置API密钥
code/C9/agent(代码系ai生成)/run_ai_agent.py:31
↓ 2 callersMethodsetup_embeddings
初始化嵌入模型
code/C8/rag_modules/index_construction.py:32
↓ 2 callersMethodto_dict
转换为字典
code/C9/config.py:55
↓ 2 callersFunctionwhitespace_clean
(text)
code/C3/visual_bge/visual_bge/eva_clip/tokenizer.py:66
↓ 1 callersMethod__init__
( self, dim, pt_seq_len, ft_seq_len=None, custom_freqs = None,
code/C3/visual_bge/visual_bge/eva_clip/rope.py:31
↓ 1 callersMethod__init__
(self, use_pooler_output=True)
code/C3/visual_bge/visual_bge/eva_clip/hf_model.py:60
↓ 1 callersMethod__init__
( self, embed_dim: int, vision_cfg: CLIPVisionCfg, text_cfg: C
code/C3/visual_bge/visual_bge/eva_clip/model.py:211
↓ 1 callersMethod_add_ddl_data
添加DDL数据
code/C4/text2sql/knowledge_base.py:82
↓ 1 callersMethod_add_description_data
添加描述数据
code/C4/text2sql/knowledge_base.py:111
↓ 1 callersMethod_add_qsql_data
添加Q->SQL数据
code/C4/text2sql/knowledge_base.py:97
↓ 1 callersMethod_analyze_query_complexity
分析查询复杂度
code/C9/rag_modules/graph_rag_retrieval.py:661
↓ 1 callersMethod_attach_parent_documents
RRF 去重后,前 parent_doc_top_n 条且能在映射中找到父菜谱的, 用整篇父菜谱(超 parent_doc_max_chars 截断)替换 chunk;其余原样不变。 不改顺序/数量/排名,不 mutate 输入(被替换的造新 Document,未替换
code/C9/rag_modules/hybrid_retrieval.py:726
↓ 1 callersFunction_bool_env
(name: str, default: bool = False)
Extra-chapter/PowerRAG-SDK-Text-QA/code/config.py:19
↓ 1 callersMethod_build_graph_index
构建图索引
code/C9/rag_modules/hybrid_retrieval.py:107
↓ 1 callersMethod_build_graph_index
构建图索引以加速查询
code/C9/rag_modules/graph_rag_retrieval.py:97
↓ 1 callersMethod_build_knowledge_subgraph
构建知识子图对象
code/C9/rag_modules/graph_rag_retrieval.py:562
↓ 1 callersMethod_build_path_description
构建路径的自然语言描述
code/C9/rag_modules/graph_rag_retrieval.py:633
↓ 1 callersMethod_build_reasoning_chain
构建推理链
code/C9/rag_modules/graph_rag_retrieval.py:671
↓ 1 callersMethod_build_subgraph_description
构建子图的自然语言描述
code/C9/rag_modules/graph_rag_retrieval.py:647
↓ 1 callersFunction_camel2snake
(s)
code/C3/visual_bge/visual_bge/eva_clip/hf_model.py:31
↓ 1 callersMethod_cleanup
清理资源
code/C9/main.py:406
↓ 1 callersMethod_combined_search
组合搜索策略:结合传统检索和图RAG的优势
code/C9/rag_modules/intelligent_query_router.py:207
↓ 1 callersMethod_connect
建立Neo4j连接
code/C9/rag_modules/graph_data_preparation.py:57
↓ 1 callersMethod_create_collection_schema
创建集合模式 Returns: 集合模式对象
code/C9/rag_modules/milvus_index_construction.py:91
↓ 1 callersMethod_enhance_metadata
增强文档元数据 Args: doc: 需要增强元数据的文档
code/C8/rag_modules/data_preparation.py:94
↓ 1 callersMethod_execute_sql
执行SQL语句
code/C4/text2sql/text2sql_agent.py:94
↓ 1 callersMethod_extract_filters_from_query
从用户问题中提取元数据过滤条件
code/C8/main.py:239
↓ 1 callersMethod_extract_relationships_from_graph
从Neo4j图中提取关系
code/C9/rag_modules/hybrid_retrieval.py:137
↓ 1 callersMethod_find_entity_relations
查找实体间关系
code/C9/rag_modules/graph_rag_retrieval.py:679
↓ 1 callersMethod_find_shortest_paths
查找最短路径
code/C9/rag_modules/graph_rag_retrieval.py:683
↓ 1 callersMethod_generate_ingredient_synonyms
生成食材的同义词列表
code/C9/agent(代码系ai生成)/recipe_ai_agent.py:878
↓ 1 callersMethod_generate_recipe_synonyms
生成菜谱的同义词列表
code/C9/agent(代码系ai生成)/recipe_ai_agent.py:723
↓ 1 callersMethod_generate_relation_index_keys
为关系生成多个索引键,包含全局主题
code/C9/rag_modules/graph_indexing.py:222
↓ 1 callersMethod_identify_reasoning_patterns
识别推理模式
code/C9/rag_modules/graph_rag_retrieval.py:667
↓ 1 callersFunction_in_projection_packed
https://github.com/pytorch/pytorch/blob/db2a237763eb8693a20788be94f8c192e762baa8/torch/nn/functional.py#L4726
code/C3/visual_bge/visual_bge/eva_clip/transformer.py:119
↓ 1 callersMethod_init_predefined_concepts
初始化预定义概念
code/C9/agent(代码系ai生成)/recipe_ai_agent.py:346
↓ 1 callersMethod_init_relationship_mappings
初始化关系类型映射
code/C9/agent(代码系ai生成)/recipe_ai_agent.py:330
↓ 1 callersMethod_is_chinese
检测是否为中文
code/C9/agent(代码系ai生成)/recipe_ai_agent.py:833
↓ 1 callersMethod_is_english
检测是否为英文
code/C9/agent(代码系ai生成)/recipe_ai_agent.py:826
↓ 1 callersMethod_llm_enhance_relation_keys
使用LLM增强关系索引键,生成全局主题
code/C9/rag_modules/graph_indexing.py:263
↓ 1 callersMethod_load_metadata
加载图像元数据
code/C3/work_multimodal_dragon_search.py:35
↓ 1 callersMethod_load_metadata
加载图像元数据
code/C3/work_hybrid_multimodal_search.py:35
↓ 1 callersMethod_markdown_header_split
使用Markdown标题分割器进行结构化分割 Returns: 按标题结构分割的文档列表
code/C8/rag_modules/data_preparation.py:166
↓ 1 callersFunction_natural_key
(string_)
code/C3/visual_bge/visual_bge/eva_clip/factory.py:25
↓ 1 callersMethod_neo4j_entity_level_search
Neo4j补充检索
code/C9/rag_modules/hybrid_retrieval.py:268
↓ 1 callersMethod_neo4j_topic_level_search
Neo4j主题级检索补充
code/C9/rag_modules/hybrid_retrieval.py:402
↓ 1 callersMethod_parse_neo4j_path
解析Neo4j路径记录
code/C9/rag_modules/graph_rag_retrieval.py:531
↓ 1 callersMethod_post_process_results
结果后处理:根据查询分析优化结果
code/C9/rag_modules/intelligent_query_router.py:246
↓ 1 callersMethod_rank_by_graph_relevance
基于图结构相关性排序
code/C9/rag_modules/graph_rag_retrieval.py:655
↓ 1 callersFunction_read_bytes
(path: Path)
Extra-chapter/PowerRAG-SDK-Text-QA/code/main.py:26
↓ 1 callersMethod_rebuild_key_mappings
重建键到实体/关系的映射
code/C9/rag_modules/graph_indexing.py:348
↓ 1 callersMethod_rebuild_knowledge_base
重建知识库
code/C9/main.py:378
↓ 1 callersMethod_rrf_merge
Reciprocal Rank Fusion: score(d) = Σ_i 1 / (k + best_rank_i(d)) Args: ranked_lists: 多路 (source_name, ranked_docs) — docs
code/C9/rag_modules/hybrid_retrieval.py:630
↓ 1 callersMethod_rrf_rerank
使用RRF (Reciprocal Rank Fusion) 算法重排文档 Args: vector_docs: 向量检索结果 bm25_docs: BM25检索结果 k: RRF参数,用于平
code/C8/rag_modules/retrieval_optimization.py:109
↓ 1 callersMethod_rule_based_analysis
基于规则的降级分析
code/C9/rag_modules/intelligent_query_router.py:143
↓ 1 callersMethod_setup_client
初始化Milvus客户端
code/C9/rag_modules/milvus_index_construction.py:63
↓ 1 callersMethod_setup_collection
设置集合
code/C4/text2sql/knowledge_base.py:18
↓ 1 callersMethod_setup_embeddings
初始化嵌入模型
code/C9/rag_modules/milvus_index_construction.py:79
↓ 1 callersMethod_show_system_stats
显示系统统计信息
code/C9/main.py:358
↓ 1 callersMethod_subgraph_to_documents
将知识子图转换为Document对象
code/C9/rag_modules/graph_rag_retrieval.py:610
↓ 1 callersMethod_update_route_stats
更新路由统计
code/C9/rag_modules/intelligent_query_router.py:260
↓ 1 callersMethod_validate_reasoning_chains
验证推理链
code/C9/rag_modules/graph_rag_retrieval.py:675
↓ 1 callersMethodadd_documents
向现有索引添加新文档 Args: new_chunks: 新的文档块列表
code/C8/rag_modules/index_construction.py:68
↓ 1 callersMethodask_question_with_routing
智能问答:自动选择最佳检索策略
code/C9/main.py:226
↓ 1 callersMethodattention
(self, x: torch.Tensor, attn_mask: Optional[torch.Tensor] = None)
code/C3/visual_bge/visual_bge/eva_clip/transformer.py:474
↓ 1 callersMethodbm25_search
BM25 检索:jieba 分词后查 BM25Okapi 索引,按分数降序返回 top_k。 分数写入 metadata["bm25_score"],供调试与未来潜在的分数级融合使用。
code/C9/rag_modules/hybrid_retrieval.py:582
↓ 1 callersMethodbpe
(self, token)
code/C3/visual_bge/visual_bge/eva_clip/tokenizer.py:98
↓ 1 callersMethodbuild_attention_mask
(self)
code/C3/visual_bge/visual_bge/eva_clip/transformer.py:714
↓ 1 callersMethodbuild_knowledge_base
构建知识库
code/C8/main.py:82
↓ 1 callersMethodbuild_vector_index
构建向量索引 Args: chunks: 文档块列表 Returns: FAISS向量存储对象
code/C8/rag_modules/index_construction.py:44
↓ 1 callersMethodbuild_vector_index
构建向量索引 Args: chunks: 文档块列表 Returns: 是否构建成功
code/C9/rag_modules/milvus_index_construction.py:199
↓ 1 callersMethodcalculate_colbert_similarity
ColBERT相似度计算(MaxSim操作)
code/C4/work_rerank_and_refine.py:51
↓ 1 callersMethodcalculate_colbert_similarity
ColBERT相似度计算(MaxSim操作)
code/C4/07_rerank_and_refine.py:51
↓ 1 callersMethodcall_kimi_api
调用Kimi API
code/C9/agent(代码系ai生成)/recipe_ai_agent.py:103
↓ 1 callersFunctionclean_batches
清理所有批次数据
code/C9/agent(代码系ai生成)/batch_manager.py:71
↓ 1 callersFunctionclean_progress
清理进度文件,重新开始处理
code/C9/agent(代码系ai生成)/batch_manager.py:57
↓ 1 callersFunctioncleanup
清理资源
code/C4/03_text2sql_demo.py:188
↓ 1 callersMethodcleanup
清理资源
code/C4/03_text2sql_demo_v2.py:314
↓ 1 callersMethodcleanup
清理资源
code/C3/work_hybrid_multimodal_search.py:359
↓ 1 callersMethodclose
关闭数据库连接
code/C9/rag_modules/graph_data_preparation.py:78
↓ 1 callersMethodclose
关闭连接
code/C9/rag_modules/milvus_index_construction.py:495
↓ 1 callersMethodcompare_search_modes
对比不同搜索模式的效果
code/C3/work_hybrid_multimodal_search.py:309
↓ 1 callersMethodcompute_loss
(self, scores, target)
code/C3/visual_bge/visual_bge/modeling.py:361
← previousnext →101–200 of 495, ranked by callers