Skip to main content

GraphRAG Chunking

This package contains a collection of text chunkers, a core config model, and a factory for acquiring instances.

Examples

Basic sentence chunking with nltk

The SentenceChunker class splits text into individual sentences by identifying sentence boundaries. It takes input text and returns a list where each element is a separate sentence, making it easy to process text at the sentence level.

Open the notebook to explore the basic sentence example code

Token chunking

The TokenChunker splits text into fixed-size chunks based on token count rather than sentence boundaries. It uses a tokenizer to encode text into tokens, then creates chunks of a specified size with configurable overlap between chunks.

Open the notebook to explore the token chunking example code

Using the factory via helper util

The create_chunker factory function provides a configuration-driven approach to instantiate chunkers by accepting a ChunkingConfig object that specifies the chunking strategy and parameters. This allows for more flexible and maintainable code by separating chunker configuration from direct instantiation.

Open the notebook to explore the factory helper util example code

Metadata

Release files for graphrag-chunking 3.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for graphrag-chunking 3.2.0
File Size Uploaded
graphrag_chunking-3.2.0.tar.gz 7.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for graphrag-chunking 3.2.0
File Interpreter ABI Platform
graphrag_chunking-3.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 17.4 kB

Release files / graphrag_chunking-3.2.0.tar.gz

Download URL graphrag_chunking-3.2.0.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0ae235900b46b871393ff6950ea13d4ded7c42b56580b36e0fc202e63f999995
BLAKE2b-256 checksum
How to use checksums
f3741bbc269b13e235c6997f1d00853513034c86d419a9db0507bd7c061af741
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Release files / graphrag_chunking-3.2.0-py3-none-any.whl

Download URL graphrag_chunking-3.2.0-py3-none-any.whl
Size 10.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8b886dfbef57fa6434bd626fdd5ec2f773a9887db31f81b174cbd46bbc14a25
BLAKE2b-256 checksum
How to use checksums
ee73cb26541855541cc2be21f6f1cab110b37e9877ffec98516bc23134382d4e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.17

Release history Release notifications | RSS feed

3.3.0

2 release files

This release

3.2.0 This release

2 release files

3.1.2

2 release files

3.1.1

2 release files

3.1.0

2 release files

3.0.9

2 release files

3.0.8

2 release files

3.0.7

2 release files

3.0.6

2 release files

3.0.5

2 release files

3.0.4

2 release files

3.0.3

2 release files

3.0.2

2 release files

3.0.1

2 release files

3.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page