A package for experimenting with different data chunking strategies
Project description
Chunking Experiment
A Python package to chunk pandas/numpy data with different chunking strategies.
Requirements
- Python 3.10+
- Gradio
- pandas
- pytest
- numpy
Installation
pip install chunking-experiment
Or:
make install
Usage
from chunking_experiment import ChunkingExperiment
Create an instance of a Chunking class
class_instance = ChunkingExperiment(
"input.csv",
"output.csv",
n_chunks=3,
chunking_strategy="rows"
)
Then perform the chunking:
class_instance.process_chunks()
Run the web interface
Go to the app folder and run the following command:
from gradio_interface import launch_interface
launch_interface()
Alternatively, you can run the following command to start the web interface:
python gradio_interface.py
Features
- Multiple chunking strategies (rows, columns, tokens)
- Support for CSV, JSON, Numpy and Parquet files
- Web interface using Gradio
- Comprehensive test suite
- Documentation using Sphinx
- Benchmarking the chunking strategies
Development
To install development dependencies:
pip install -e .[dev]
Or:
make install-dev
Testing
To run tests, run the following command from the root folder:
pytest
Documentation
To install the documentation dependencies:
pip install -e .[docs]
Or:
make install-docs
To build the documentation:
make docs
To serve the documentation:
make docs-serve
Below are the full list of commands that can be run from the root folder:
make benchmark
make clean
make docs
make docs-clean
make docs-serve
make install
make install-docs
make lint
make run
make test
make typecheck
License
This project is licensed under the MIT License - see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file chunking_experiment-0.1.0.tar.gz.
File metadata
- Download URL: chunking_experiment-0.1.0.tar.gz
- Upload date:
- Size: 7.7 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22c362f815ce473a73788107251952848742241ba56f33a6493d0b36b150101b
|
|
| MD5 |
c04761ce33fb6e52cb50a7bffa7a8fb5
|
|
| BLAKE2b-256 |
2d0ffe7e14733d998fcdf21d95c93022205b0e9eeee0dc7d8874e7751cb14788
|
File details
Details for the file chunking_experiment-0.1.0-py3-none-any.whl.
File metadata
- Download URL: chunking_experiment-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
765e6dc07fb9244e850a3941ed33b8e89b6542bbfbc770b175196904da9a673e
|
|
| MD5 |
2ff4b492b2d6befc980ecb340a00e057
|
|
| BLAKE2b-256 |
d133d2cce7c2d40faabfb457ead2e362cfacf617002bd1414498b325aeadb7e2
|