MCPcopy Create free account

hub / github.com/brandonstarxel/chunking_evaluation / functions

Functions67 in github.com/brandonstarxel/chunking_evaluation

↓ 8 callersFunctionsum_of_ranges
(ranges)
chunking_evaluation/evaluation_framework/base_evaluation.py:12
↓ 5 callersFunctionunion_ranges
(ranges)
chunking_evaluation/evaluation_framework/base_evaluation.py:15
↓ 3 callersFunctionget_openai_embedding_function
()
chunking_evaluation/utils.py:71
↓ 2 callersMethod_chunker_to_collection
(self, chunker, embedding_function, chroma_db_path:str = None, collection_name:str = None)
chunking_evaluation/evaluation_framework/base_evaluation.py:280
↓ 2 callersMethod_get_synth_questions_df
(self)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:210
↓ 2 callersMethod_join_docs
(self, docs: List[str], separator: str)
chunking_evaluation/chunking/fixed_token_chunker.py:70
↓ 2 callersMethod_load_questions_df
(self)
chunking_evaluation/evaluation_framework/base_evaluation.py:110
↓ 2 callersMethod_merge_splits
(self, splits: Iterable[str], separator: str)
chunking_evaluation/chunking/fixed_token_chunker.py:79
↓ 2 callersFunctiondifference
Takes a set of ranges and a target range, and returns the difference. Args: - ranges (list of tuples): A list of tuples representing
chunking_evaluation/evaluation_framework/base_evaluation.py:51
↓ 2 callersMethodget_prompt
(self, chunked_input, current_chunk=0, invalid_response=None)
chunking_evaluation/chunking/llm_semantic_chunker.py:84
↓ 2 callersFunctionintersect_two_ranges
(range1, range2)
chunking_evaluation/evaluation_framework/base_evaluation.py:35
↓ 2 callersFunctionrigorous_document_search
This function performs a rigorous search of a target string within a document. It handles issues related to whitespace, changes in grammar,
chunking_evaluation/utils.py:26
↓ 1 callersMethod__init__
Create a new TextSplitter. Args: chunk_size: Maximum size of chunks to return chunk_overlap: Overlap in characters be
chunking_evaluation/chunking/fixed_token_chunker.py:34
↓ 1 callersMethod_calculate_reward
(self, matrix, start, end)
chunking_evaluation/chunking/cluster_semantic_chunker.py:47
↓ 1 callersMethod_corpus_filter_duplicates
(self, corpus_id, synth_questions_df, threshold)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:289
↓ 1 callersMethod_corpus_filter_poor_highlights
(self, corpus_id, synth_questions_df, threshold)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:241
↓ 1 callersMethod_extract_question_and_approx_references
(self, corpus, document_length=4000, prev_questions=[])
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:63
↓ 1 callersMethod_extract_question_and_references
(self, corpus, document_length=4000, prev_questions=[])
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:126
↓ 1 callersMethod_full_precision_score
(self, chunk_metadatas)
chunking_evaluation/evaluation_framework/base_evaluation.py:153
↓ 1 callersMethod_generate_corpus_questions
(self, corpus_id, approx=False, n=5)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:176
↓ 1 callersMethod_get_chunks_and_metadata
(self, splitter)
chunking_evaluation/evaluation_framework/base_evaluation.py:119
↓ 1 callersMethod_get_sim
(self, target, references)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:226
↓ 1 callersMethod_get_similarity_matrix
(self, embedding_function, sentences)
chunking_evaluation/chunking/cluster_semantic_chunker.py:25
↓ 1 callersMethod_optimal_segmentation
(self, matrix, max_cluster_size, window_size=3)
chunking_evaluation/chunking/cluster_semantic_chunker.py:51
↓ 1 callersMethod_save_questions_df
(self)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:36
↓ 1 callersMethod_scores_from_dataset_and_retrievals
(self, question_metadatas, highlighted_chunks_count)
chunking_evaluation/evaluation_framework/base_evaluation.py:219
↓ 1 callersMethod_split_text
Split incoming text and return chunks.
chunking_evaluation/chunking/recursive_token_chunker.py:51
↓ 1 callersFunction_split_text_with_regex
( text: str, separator: str, keep_separator: bool )
chunking_evaluation/chunking/recursive_token_chunker.py:12
↓ 1 callersMethod_tag_text
(self, text)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:39
↓ 1 callersMethodcalculate_cosine_distances
(self, sentences)
chunking_evaluation/chunking/kamradt_modified_chunker.py:104
↓ 1 callersMethodcombine_sentences
(self, sentences, buffer_size=1)
chunking_evaluation/chunking/kamradt_modified_chunker.py:74
↓ 1 callersMethodcreate_message
(self, system_prompt, messages, max_tokens=1000, temperature=1.0)
chunking_evaluation/chunking/llm_semantic_chunker.py:36
↓ 1 callersFunctionfind_query_despite_whitespace
(document, query)
chunking_evaluation/utils.py:9
↓ 1 callersFunctionopenai_token_count
Returns the number of tokens in a text string.
chunking_evaluation/utils.py:82
↓ 1 callersMethodsplit_text
(self, text: str)
chunking_evaluation/chunking/base_chunker.py:6
↓ 1 callersFunctionsplit_text_on_tokens
Split incoming text and return chunks using tokenizer.
chunking_evaluation/chunking/fixed_token_chunker.py:249
Method__init__
(self, chroma_db_path=None)
chunking_evaluation/evaluation_framework/general_evaluation.py:6
Method__init__
(self, questions_csv_path: str, chroma_db_path=None, corpora_id_paths=None)
chunking_evaluation/evaluation_framework/base_evaluation.py:91
Method__init__
(self, corpora_paths: List[str], queries_csv_path: str, chroma_db_path:str = None, openai_api_key=None, model=
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:15
Method__init__
Create a new TextSplitter.
chunking_evaluation/chunking/recursive_token_chunker.py:37
Method__init__
(self, embedding_function=None, max_chunk_size=400, min_chunk_size=50, length_function=openai_token_count)
chunking_evaluation/chunking/cluster_semantic_chunker.py:11
Method__init__
Initializes the KamradtModifiedChunker with the specified parameters. Args: avg_chunk_size (int, optional): The desired
chunking_evaluation/chunking/kamradt_modified_chunker.py:44
Method__init__
Create a new TextSplitter.
chunking_evaluation/chunking/fixed_token_chunker.py:189
Method__init__
(self, model_name, api_key=None)
chunking_evaluation/chunking/llm_semantic_chunker.py:10
Method__init__
(self, model_name, api_key=None)
chunking_evaluation/chunking/llm_semantic_chunker.py:30
Method__init__
(self, organisation:str="openai", api_key:str=None, model_name:str=None)
chunking_evaluation/chunking/llm_semantic_chunker.py:66
Method_convert_question_references_to_json
(self)
chunking_evaluation/evaluation_framework/base_evaluation.py:319
Method_encode
(_text: str)
chunking_evaluation/chunking/fixed_token_chunker.py:219
Method_tiktoken_encoder
(text: str)
chunking_evaluation/chunking/fixed_token_chunker.py:166
Methodcreate_message
(self, system_prompt, messages, max_tokens=1000, temperature=1.0)
chunking_evaluation/chunking/llm_semantic_chunker.py:15
Methodedit_row
(row)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:244
Methodfilter_duplicates
(self, threshold=0.78, corpora_subset=[])
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:353
Methodfilter_poor_excerpts
(self, threshold=0.36, corpora_subset=[])
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:278
Methodfilter_vectors
(sim_matrix, threshold)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:317
Functionfind_target_in_document
(document, target)
chunking_evaluation/evaluation_framework/base_evaluation.py:83
Methodfrom_tiktoken_encoder
Text splitter that uses tiktoken encoder to count length.
chunking_evaluation/chunking/fixed_token_chunker.py:143
Methodgenerate_queries_and_excerpts
(self, approximate_excerpts=False, num_rounds = -1, queries_per_corpus = 5)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:217
Methodget_separators_for_language
(language: Language)
chunking_evaluation/chunking/recursive_token_chunker.py:102
Methodquestion_ref_filter
(self)
chunking_evaluation/evaluation_framework/synthetic_evaluation.py:365
Methodrun
This function runs the evaluation over the provided chunker. Parameters: chunker: The chunker to evaluate. embedding
chunking_evaluation/evaluation_framework/base_evaluation.py:329
Methodsafe_json_loads
(row)
chunking_evaluation/evaluation_framework/base_evaluation.py:320
Methodsplit_text
(self, text: str)
chunking_evaluation/chunking/recursive_token_chunker.py:91
Methodsplit_text
(self, text: str)
chunking_evaluation/chunking/cluster_semantic_chunker.py:83
Methodsplit_text
Splits the input text into chunks of approximately the specified average size based on semantic similarity. Args: text (
chunking_evaluation/chunking/kamradt_modified_chunker.py:146
Methodsplit_text
Split text into multiple components.
chunking_evaluation/chunking/fixed_token_chunker.py:67
Methodsplit_text
(self, text: str)
chunking_evaluation/chunking/fixed_token_chunker.py:218
Methodsplit_text
(self, text)
chunking_evaluation/chunking/llm_semantic_chunker.py:106