← 开源
brandonstarxel

chunking_evaluation

This package, developed as part of our research detailed in the Chroma Technical Report, provides tools for text chunking and evaluation. It allows users to compare different chunking methods and includes implementations of several novel chunking strategies.

AI EngineeringTest & guardGive agent knowledgePython
在 GitHub 打开
增长势头
+024 小时新增 Star0.0%
512
Star
94
Fork
+1
本周
2
贡献者
创建于 2024-06-14 · 更新于 2026-10-15 · 今日第 18043 名
主要开发者
brandonstarxelAnelMusic

brandonstarxel/chunking_evaluation 排名第 18,043,有 512 个星标。

同类别比较

brandonstarxel/chunking_evaluation 排名第 18,043,此处有 8 个同类条目;itbench-hub/ITBench 排名第 18,047。

同类别比较
名称排名指标
dedalus-labs/dedalus-agents-python17,997
语言:
Python
星标数:
514
分叉数:
35
简介:
Official Python SDK for the Dedalus Agents API
Zhefan-Xu/LV-DOT18,020
语言:
C++
星标数:
513
分叉数:
56
简介:
LV-DOT: LiDAR-Visual Dynamic Obstacle Detection and Tracking (C++/Python/ROS)
gnh1201/welsonjs18,022
语言:
JavaScript
星标数:
513
分叉数:
35
简介:
WelsonJS - Built-in JavaScript for Industrial Automation on Windows
jshchnz/claude-code-scheduler18,024
语言:
TypeScript
星标数:
513
分叉数:
38
简介:
Put Claude on autopilot
itbench-hub/ITBench18,047
语言:
Python
星标数:
512
分叉数:
51
简介:
An open source benchmarking framework for IT automation
seratch/ChatGPT-in-Slack18,052
语言:
Python
星标数:
512
分叉数:
178
简介:
Swift demonstration of how to build a Slack app that enables end-users to interact with a ChatGPT bot
Accenture/mcp-bench18,055
语言:
Python
星标数:
511
分叉数:
69
简介:
MCP-Bench: Benchmarking Tool-Using LLM Agents with Complex Real-World Tasks via MCP Servers
Undertone0809/promptulate18,061
语言:
Python
星标数:
511
分叉数:
43
简介:
🚀Lightweight Large language model automation and Autonomous Language Agents development framework. Build your LLM Agent Application in a pythonic way!
关键参数与规格
关键参数与规格
参数值
语言Python
类别AI Engineering
子类别Test & guard,Give agent knowledge
关键词Document understanding, Embeddings, Evals, Retrieval
星标数512
分叉数94
贡献者2
创建日期2024-06-14
更新日期2026-10-15
1 天星标数0
7 天星标数1
排名18,043
上次排名7,055
排名变化-10,988
7 天星标排名11,568
上次 7 天星标排名11,616
7 天星标排名变化48
总星标排名19,019
上次总星标排名18,977
总星标排名变化-42
README 摘录

Chunking Evaluation This package, developed as part of our research detailed in the Chroma Technical Report, provides tools for text chunking and evaluation. It allows users to compare different chunking methods and includes implementations of several novel chunking strategies. Features **Compare Chunking Methods**: Evaluate and compare various popular chunking strategies. **Novel Chunking Methods**: Implementations of new chunking methods such as and . **Evaluation Framework**: Tools to generate domain-specific datasets and evaluate retrieval quality in the context of AI applications. Quick

Start You can immediately test the package via Google Colab. Installation You can install the package directly from GitHub: Evaluating Your Own Custom Chunker This example shows how to implement your own chunking logic and evaluate its performance. Evaluating a Custom Embedding Function Usage and Evaluation of ClusterSemanticChunker This example demonstrates how to use our ClusterSemanticChunker and how you can evaluate it yourself. Synthetic Dataset Pipeline for Domain Specific Evaluation Here are the steps you can take to develop a

sythetic dataset based off your own corpora for domain specific evaluation. **Optional: If generation is unable to generate queries try approximate excerpts** Package Dependancies: The following will be installed along with the package: tiktoken fuzzywuzzy pandas numpy tqdm chromadb python-Levenshtein openai anthropic attrs Citation If you use this package in your research, please cite our technical report: Contributions We welcome contributions and are excited you'd like to get involved! Make sure your pull request goes to the dev branch

. We will test it and then later merge it to main.

常见问题

记录了多少星标和分叉?

brandonstarxel/chunking_evaluation 有 512 个星标和 94 个分叉。

仓库排名是多少?

brandonstarxel/chunking_evaluation 排名第 18,043。

记录的语言和类别是什么?

brandonstarxel/chunking_evaluation 有 512 个星标,语言为 Python,类别为 AI Engineering。

哪个仓库排名最接近?

brandonstarxel/chunking_evaluation 与 itbench-hub/ITBench 比较,后者排名第 18,047,有 512 个星标。

README

Chunking Evaluation

This package, developed as part of our research detailed in the Chroma Technical Report, provides tools for text chunking and evaluation. It allows users to compare different chunking methods and includes implementations of several novel chunking strategies.

Features

  • Compare Chunking Methods: Evaluate and compare various popular chunking strategies.
  • Novel Chunking Methods: Implementations of new chunking methods such as ClusterSemanticChunker and LLMChunker.
  • Evaluation Framework: Tools to generate domain-specific datasets and evaluate retrieval quality in the context of AI applications.

Quick Start

You can immediately test the package via Google Colab.

Installation

You can install the package directly from GitHub:

pip install git+https://github.com/brandonstarxel/chunking_evaluation.git

Evaluating Your Own Custom Chunker

This example shows how to implement your own chunking logic and evaluate its performance.

from chunking_evaluation import BaseChunker, GeneralEvaluation
from chromadb.utils import embedding_functions

# Define a custom chunking class
class CustomChunker(BaseChunker):
    def split_text(self, text):
        # Custom chunking logic
        return [text[i:i+1200] for i in range(0, len(text), 1200)]

# Instantiate the custom chunker and evaluation
chunker = CustomChunker()
evaluation = GeneralEvaluation()

# Choose embedding function
default_ef = embedding_functions.OpenAIEmbeddingFunction(
    api_key="OPENAI_API_KEY",
    model_name="text-embedding-3-large"
)

# Evaluate the chunker
results = evaluation.run(chunker, default_ef)

print(results)
# {'iou_mean': 0.17715979570301696, 'iou_std': 0.10619791407460026, 
# 'recall_mean': 0.8091207841640163, 'recall_std': 0.3792297991952294}

Evaluating a Custom Embedding Function

from chromadb import Documents, EmbeddingFunction, Embeddings

class MyEmbeddingFunction(EmbeddingFunction):
    def __call__(self, input: Documents) -> Embeddings:
        # embed the documents somehow
        return embeddings

# Instantiate instance of ef
default_ef = MyEmbeddingFunction()

# Evaluate the embedding function with a chunker
results = evaluation.run(chunker, default_ef)

Usage and Evaluation of ClusterSemanticChunker

This example demonstrates how to use our ClusterSemanticChunker and how you can evaluate it yourself.

from chunking_evaluation import BaseChunker, GeneralEvaluation
from chunking_evaluation.chunking import ClusterSemanticChunker
from chromadb.utils import embedding_functions

# Instantiate evaluation
evaluation = GeneralEvaluation()

# Choose embedding function
default_ef = embedding_functions.OpenAIEmbeddingFunction(
    api_key="OPENAI_API_KEY",
    model_name="text-embedding-3-large"
)

# Instantiate chunker and run the evaluation
chunker = ClusterSemanticChunker(default_ef, max_chunk_size=400)
results = evaluation.run(chunker, default_ef)

print(results)
# {'iou_mean': 0.18255175232840098, 'iou_std': 0.12773219595465307, 
# 'recall_mean': 0.8973469551927365, 'recall_std': 0.29042203879923994}

Synthetic Dataset Pipeline for Domain Specific Evaluation

Here are the steps you can take to develop a sythetic dataset based off your own corpora for domain specific evaluation.

  1. Initialize the Environment:

    from chunking_evaluation import SyntheticEvaluation
    
    # Specify the corpora paths and output CSV file
    corpora_paths = [
        'path/to/chatlogs.txt',
        'path/to/finance.txt',
        # Add more corpora files as needed
    ]
    queries_csv_path = 'generated_queries_excerpts.csv'
    
    # Initialize the evaluation
    evaluation = SyntheticEvaluation(corpora_paths, queries_csv_path, openai_api_key="OPENAI_API_KEY")
    
  2. Generate Queries and Excerpts:

    # Generate queries and excerpts, and save to CSV
    evaluation.generate_queries_and_excerpts()
    
  3. Apply Filters:

    # Apply filter to remove queries with poor excerpts
    evaluation.filter_poor_excerpts(threshold=0.36)
    
    # Apply filter to remove duplicates
    evaluation.filter_duplicates(threshold=0.6)
    
  4. Run the Evaluation:

    from chunking_evaluation import BaseChunker
    
    # Define a custom chunking class
    class CustomChunker(BaseChunker):
        def split_text(self, text):
            # Custom chunking logic
            return [text[i:i+1200] for i in range(0, len(text), 1200)]
    
    # Instantiate the custom chunker
    chunker = CustomChunker()
    
    # Run the evaluation on the filtered data
    results = evaluation.run(chunker)
    print("Evaluation Results:", results)
    
  5. Optional: If generation is unable to generate queries try approximate excerpts

    # Generate queries and excerpts, and save to CSV
    evaluation.generate_queries_and_excerpts(approximate_excerpts=True)
    

Package Dependancies:

The following will be installed along with the package:

  • tiktoken
  • fuzzywuzzy
  • pandas
  • numpy
  • tqdm
  • chromadb
  • python-Levenshtein
  • openai
  • anthropic
  • attrs

Citation

If you use this package in your research, please cite our technical report:

@techreport{smith2024evaluating,
  title = {Evaluating Chunking Strategies for Retrieval},
  author = {Smith, Brandon and Troynikov, Anton},
  year = {2024},
  month = {July},
  institution = {Chroma},
  url = {https://research.trychroma.com/evaluating-chunking},
}

Contributions

We welcome contributions and are excited you'd like to get involved! Make sure your pull request goes to the dev branch. We will test it and then later merge it to main.

排名相邻
同类项目