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.3.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.3.0
File Size Uploaded
graphrag_chunking-3.3.0.tar.gz 7.4 kB Details

Built distribution (wheel)

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

Total release size: 17.4 kB

Release files / graphrag_chunking-3.3.0.tar.gz

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

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

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

Release history Release notifications | RSS feed

This release

3.3.0 This release

2 release files

3.2.0

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