Skip to main content

Chunking utilities for GraphRAG

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

graphrag_chunking-3.0.7.tar.gz (7.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

graphrag_chunking-3.0.7-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

Details for the file graphrag_chunking-3.0.7.tar.gz.

File metadata

  • Download URL: graphrag_chunking-3.0.7.tar.gz
  • Upload date:
  • Size: 7.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for graphrag_chunking-3.0.7.tar.gz
Algorithm Hash digest
SHA256 e09334c20805ed10b069edabe5f86c7be3648ba6273b8e98e72624f2bd48ca2c
MD5 c176d47a7378c9b1d25f6840d1a5fad7
BLAKE2b-256 5dbe8db61c438a6e8573a2c36330d0863a5e734613d6ce00092b3fa93c0a39d1

See more details on using hashes here.

File details

Details for the file graphrag_chunking-3.0.7-py3-none-any.whl.

File metadata

  • Download URL: graphrag_chunking-3.0.7-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.11 {"installer":{"name":"uv","version":"0.10.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for graphrag_chunking-3.0.7-py3-none-any.whl
Algorithm Hash digest
SHA256 e00df038c13f50cdc9ad347b5196a902943723fd561fde659b0d72dfda908557
MD5 15e4775a268ece83573151e02d34200d
BLAKE2b-256 3df3026cbcfe62140c7961316288703c1cf55380ec26119d1441de16ca017d18

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page