MCPcopy Create free account

hub / github.com/EternityJune25/ComoRAG / functions

Functions257 in github.com/EternityJune25/ComoRAG

↓ 64 callersMethodget
Retrieve the embedding if cached.
src/comorag/embedding_model/base.py:238
↓ 17 callersMethodget_all_ids
(self)
src/comorag/embedding_store.py:141
↓ 15 callersMethodencode
(self, texts: List[str])
src/comorag/embedding_model/OpenAI.py:77
↓ 12 callersMethodrender
Render a template with the provided variables. Args: name (str): The name of the template. kwargs: Placehold
src/comorag/prompts/prompt_template_manager.py:102
↓ 11 callersFunctioncompute_mdhash_id
Compute the MD5 hash of the given content string and optionally prepend a prefix. Args: content (str): The input string to be hashed
src/comorag/utils/misc_utils.py:152
↓ 9 callersFunctionget_logger
Get a logger with a specific name and optional file logging. Args: name (str): Logger name, typically the module's `__name__`.
src/comorag/utils/logging_utils.py:12
↓ 8 callersMethodget_embeddings
(self, hash_ids, dtype=np.float32)
src/comorag/embedding_store.py:150
↓ 7 callersMethodget_temp_nodes_by_type
Get all nodes of specified type from temporary memory pool
src/comorag/utils/memory_utils.py:105
↓ 7 callersMethodinsert_strings
(self, texts: List[str])
src/comorag/embedding_store.py:63
↓ 6 callersMethodbatch_encode
(self, texts: List[str], **kwargs)
src/comorag/embedding_model/base.py:208
↓ 6 callersMethodget_level_embedding_store
Get EmbeddingStore instance for specified level Args: level: Level index output_dir: Output director
src/comorag/utils/timeline_utils.py:374
↓ 5 callersFunctionget_logger
(name)
script/eval_qa.py:9
↓ 5 callersMethodget_nodes_by_type
Get all nodes of specified type
src/comorag/utils/memory_utils.py:120
↓ 5 callersMethodget_row
(self, hash_id)
src/comorag/embedding_store.py:130
↓ 5 callersMethodget_text_for_all_rows
(self)
src/comorag/embedding_store.py:144
↓ 5 callersMethodupdate_hashes
Update hash values for all content using node_type as namespace
src/comorag/utils/memory_utils.py:37
↓ 4 callersMethod_count_tokens
Count the number of tokens in text Args: text: Input text Returns: int: Number
src/comorag/utils/timeline_utils.py:61
↓ 4 callersMethod_ensure_manager
(cls)
src/comorag/embedding_model/base.py:230
↓ 4 callersMethod_summarize_window
Summarize text within a window Args: texts: List of texts within the window is_final_summary: Whethe
src/comorag/utils/timeline_utils.py:229
↓ 4 callersMethodadd_to_temp_pool
Add node to temporary memory pool
src/comorag/utils/memory_utils.py:89
↓ 4 callersFunctionget_query_instruction
(linking_method)
src/comorag/prompts/linking.py:1
↓ 4 callersMethodinfer
Perform synchronous inference using the LLM. Args: chat (List[TextChatMessage]): Input chat history for the LLM.
src/comorag/llm/base.py:169
↓ 4 callersFunctionnormalize_answer
(s)
script/eval_qa.py:15
↓ 3 callersMethod_call_llm
(self, messages, max_completion_tokens=500, stop_sequence=None, temperature=0, top_p=1)
src/comorag/utils/agents.py:32
↓ 3 callersMethodadd_member
Add member to cluster
src/comorag/utils/cluster_utils.py:28
↓ 3 callersMethodbatch_upsert
Update existing attributes or add new ones from the given dictionary.
src/comorag/llm/base.py:80
↓ 3 callersMethoddense_passage_retrieval
(self, query: str, need_cluster: bool = False)
src/comorag/ComoRAG.py:950
↓ 3 callersMethodget_all_probes
Get probe content from all nodes and remove duplicates Returns: List[str]: List of deduplicated probe content
src/comorag/utils/memory_utils.py:141
↓ 3 callersMethodget_summary_by_level
Get summaries for specified level Args: level: Level index Returns: List[str]:
src/comorag/utils/timeline_utils.py:350
↓ 3 callersMethodindex
(self, docs: List[str])
src/comorag/ComoRAG.py:198
↓ 3 callersFunctionmin_max_normalize
(x)
src/comorag/utils/misc_utils.py:141
↓ 2 callersMethod__init__
Initialize base Agent class Args: model: Model name, defaults to "gpt-4o-mini" llm_base_url: Base URL for LLM
src/comorag/utils/agents.py:15
↓ 2 callersMethod_get_optimal_clusters
Determine optimal number of clusters
src/comorag/utils/cluster_utils.py:175
↓ 2 callersMethod_reduce_dimensions
Use UMAP for dimension reduction
src/comorag/utils/cluster_utils.py:191
↓ 2 callersMethodbatch_encode
Encode a batch of texts into embeddings. Args: texts: List of texts to encode **kwargs: Additional p
src/comorag/embedding_model/BGEEmbedding.py:131
↓ 2 callersMethodbatch_infer
Perform batched synchronous inference using the LLM. Args: batch_chat (List[List[TextChatMessage]]): Input chat
src/comorag/llm/base.py:183
↓ 2 callersMethodbatch_openie
Conduct batch OpenIE synchronously using multi-threading which includes NER and triple extraction. Args: chunks (Dict[st
src/comorag/information_extraction/openie_openai.py:197
↓ 2 callersMethodbatch_upsert
Update existing attributes or add new ones from the given dictionary.
src/comorag/embedding_model/base.py:76
↓ 2 callersFunctionconvert_text_chat_messages_to_input_ids
(messages: List[TextChatMessage], tokenizer: PreTrainedTokenizer, add_assistant_header=True)
src/comorag/llm/vllm_offline.py:14
↓ 2 callersFunctionfilter_invalid_triples
Filters out invalid and duplicate triples from a list of triples. A valid triple meets the following criteria: 1. It contains exactly th
src/comorag/utils/llm_utils.py:218
↓ 2 callersFunctionfix_broken_generated_json
Fixes a malformed JSON string by: - Removing the last comma and any trailing content. - Iterating over the JSON string once to determine
src/comorag/utils/llm_utils.py:146
↓ 2 callersMethodfrom_dict
Create an LLMConfig instance from a dictionary.
src/comorag/embedding_model/base.py:89
↓ 2 callersFunctionget_batches
(vecs, batch_size)
src/comorag/utils/embed_utils.py:35
↓ 2 callersMethodget_cluster_by_id
Get cluster by specified ID
src/comorag/utils/cluster_utils.py:371
↓ 2 callersMethodget_cluster_membership
Get all clusters and membership scores for the specified chunk Args: hash_id: Chunk's hash_id
src/comorag/utils/cluster_utils.py:359
↓ 2 callersMethodget_content_hashes
Get hash values for all content
src/comorag/utils/memory_utils.py:55
↓ 2 callersFunctionget_gold_answers
(samples)
src/comorag/utils/misc_utils.py:207
↓ 2 callersMethodget_hash_id_to_order
Returns a dictionary mapping each hash value to its sequential position in the original text list. Returns: Dict
src/comorag/embedding_store.py:159
↓ 2 callersMethodget_rows
(self, hash_ids, dtype=np.float32)
src/comorag/embedding_store.py:133
↓ 2 callersMethodget_template
Retrieve a template by name. Args: name (str): The name of the template. Returns: Union[Template, L
src/comorag/prompts/prompt_template_manager.py:153
↓ 2 callersMethodload_all_summaries
Load summary content for all levels Returns: Dict[int, List[str]]: Dictionary with level as key and summary list
src/comorag/utils/timeline_utils.py:433
↓ 2 callersMethodload_existing_openie
(self, chunk_keys: List[str])
src/comorag/ComoRAG.py:714
↓ 2 callersMethodmem_encode
(self, query: str, docs: Dict, memory_pool: MemoryPool, probe: str = None)
src/comorag/ComoRAG.py:557
↓ 2 callersMethodmerge_openie_results
(self, all_openie_info: List[dict], chunks_to_save:
src/comorag/ComoRAG.py:740
↓ 2 callersMethodprocess
(self, query, chunks=None, semantic_summaries=None, timeline_summaries=None, content=None, task='fusion', max_
src/comorag/utils/agents.py:60
↓ 2 callersMethodsave_openie_results
(self, all_openie_info: List[dict])
src/comorag/ComoRAG.py:755
↓ 2 callersMethodsummarize
(self, context, max_tokens=150)
src/comorag/utils/summarization_utils.py:13
↓ 2 callersMethodtri_retrieve
(self, query: str, memory_pool: MemoryPool, ver_top_k: int = None, sem_top_k: int = None, epi_top_k: int = Non
src/comorag/ComoRAG.py:456
↓ 2 callersMethodtry_answer
(self, queries: List[str], num_to_retrieve: int = None)
src/comorag/ComoRAG.py:432
↓ 1 callersMethod_create_summary_prompt
Create summary prompt Args: texts: List of texts to be summarized is_final_summary: Whether this is
src/comorag/utils/timeline_utils.py:192
↓ 1 callersFunction_extract_ner_from_response
(real_response)
src/comorag/information_extraction/openie_openai.py:30
↓ 1 callersMethod_generate_and_save_summaries
Generate new summaries and save them Args: output_dir: Summary storage directory
src/comorag/utils/timeline_utils.py:493
↓ 1 callersFunction_get_embedding_model_class
(embedding_model_name: str = "None")
src/comorag/embedding_model/__init__.py:10
↓ 1 callersFunction_get_llm_class
(config: BaseConfig)
src/comorag/llm/__init__.py:12
↓ 1 callersMethod_init_embedding_config
Extract embedding model-specific parameters to init the EmbeddingConfig. Returns: None
src/comorag/embedding_model/BGEEmbedding.py:63
↓ 1 callersMethod_init_embedding_config
Extract embedding model-specific parameters to init the EmbeddingConfig. Returns: None
src/comorag/embedding_model/OpenAI.py:46
↓ 1 callersMethod_init_llm_config
(self)
src/comorag/llm/openai_gpt.py:153
↓ 1 callersMethod_load_clustering_results
Load existing clustering results
src/comorag/utils/cluster_utils.py:123
↓ 1 callersMethod_load_data
(self)
src/comorag/embedding_store.py:92
↓ 1 callersMethod_load_templates
Load all templates from Python scripts in the templates directory.
src/comorag/prompts/prompt_template_manager.py:46
↓ 1 callersMethod_recursive_clustering
(self, texts, max_iterations=5, current_iteration=0)
src/comorag/ComoRAG.py:1107
↓ 1 callersMethod_save_data
(self)
src/comorag/embedding_store.py:109
↓ 1 callersMethod_upsert
(self, hash_ids, texts, embeddings)
src/comorag/embedding_store.py:122
↓ 1 callersMethodadd_fact_edges
(self, chunk_ids: List[str], chunk_triples: List[Tuple])
src/comorag/ComoRAG.py:627
↓ 1 callersMethodadd_fused_node
Add fused content as new node to memory pool Args: probe: Probe used for fusion fused_content: Fused content
src/comorag/utils/memory_utils.py:278
↓ 1 callersMethodadd_new_edges
(self)
src/comorag/ComoRAG.py:803
↓ 1 callersMethodadd_new_nodes
(self)
src/comorag/ComoRAG.py:776
↓ 1 callersMethodadd_passage_edges
(self, chunk_ids: List[str], chunk_triple_entities: List[List[str]])
src/comorag/ComoRAG.py:650
↓ 1 callersMethodadd_synonymy_edges
(self)
src/comorag/ComoRAG.py:670
↓ 1 callersMethodaugment_graph
(self)
src/comorag/ComoRAG.py:768
↓ 1 callersMethodcalculate_metric_scores
Calculate exact match (EM) scores Args: gold_answers: List of standard answers, each element is a list of answers
script/eval_qa.py:41
↓ 1 callersMethodcalculate_metric_scores
Calculate F1 scores Args: gold_answers: List of standard answers, each element is a list of answers predicte
script/eval_qa.py:76
↓ 1 callersMethodclear_temp_pool
Clear temporary memory pool
src/comorag/utils/memory_utils.py:93
↓ 1 callersMethodcompute_probe_note_embeddings
Compute embedding values for probe + atomic notes for all nodes Args: force_recompute: Whether to force recomputation of
src/comorag/utils/memory_utils.py:149
↓ 1 callersFunctionconvert_format_to_template
Converts a .format() style string to a Template-style string. Args: original_string (str): The original string using .format() place
src/comorag/utils/llm_utils.py:32
↓ 1 callersMethodcreate_fusion_content
Fuse related nodes based on probe Args: probe: Probe used for retrieval top_k_percent: Use top percentage of
src/comorag/utils/memory_utils.py:238
↓ 1 callersFunctiondynamic_retry
Factory function to create a retry decorator with dynamic parameters. Args: experiment_config (BaseConfig): Configuration containing
src/comorag/utils/llm_utils.py:102
↓ 1 callersFunctionextract_answers_from_results
(results: List[Dict])
script/eval_qa.py:178
↓ 1 callersFunctionextract_entity_nodes
(chunk_triples: List[List[Triple]])
src/comorag/utils/misc_utils.py:121
↓ 1 callersFunctionextract_final_answer
(output_text: str)
script/eval_qa.py:155
↓ 1 callersFunctionfind_and_merge_results
Find all json files containing 'results' and merge them, returning the merged result list Args: root_path: Root directory path
script/eval_qa.py:121
↓ 1 callersMethodfind_probes
(self, query: str, context: str = None, previous_probes: str = None, max_completion_tokens: int = 500)
src/comorag/utils/agents.py:151
↓ 1 callersFunctionfind_unclosed
Identifies the unclosed braces and brackets in the JSON string. Args: json_str (str): The JSON string to analyze.
src/comorag/utils/llm_utils.py:162
↓ 1 callersFunctionflatten_facts
(chunk_triples: List[Triple])
src/comorag/utils/misc_utils.py:134
↓ 1 callersMethodfrom_dict
Create an LLMConfig instance from a dictionary.
src/comorag/llm/base.py:93
↓ 1 callersMethodfrom_experiment_config
(cls, global_config: BaseConfig)
src/comorag/llm/openai_gpt.py:116
↓ 1 callersMethodfuse_memory_nodes
(self, query: str, content: str, max_completion_tokens: int = 1000)
src/comorag/utils/agents.py:118
↓ 1 callersMethodfusion
(self, query, vers, sems, epis)
src/comorag/utils/agents.py:88
↓ 1 callersMethodgenerate_timeline_summary
Generate timeline summary, only generate one level of summary Returns: Dict[str, Any]: Dictionary containing sum
src/comorag/utils/timeline_utils.py:287
↓ 1 callersMethodget_all_hashes
Get hash values for all nodes, grouped by node type Returns: Dict[str, List[str]]: Keys are node types, values are lists
src/comorag/utils/memory_utils.py:128
next →1–100 of 257, ranked by callers