Skip to main content

llama-index packs node_parser integration

Project description

Semantic Chunking Llama Pack

This LlamaPack implements the semantic chunking algorithm first proposed by Greg Kamradt in his Five Levels of Text Splitting tutorial.

How it works:

  • Split text into sentences.
  • For each sentence, generate an embedding.
  • Measure cosine distance between each pair of consecutive sentences.
  • Get the 95% percentile cosine distance, set that as the threshold.
  • Create a new chunk if the cosine distance of a sentence compared to prev. exceeds that threshold.

CLI Usage

You can download llamapacks directly using llamaindex-cli, which comes installed with the llama-index python package:

llamaindex-cli download-llamapack LLMCompilerAgentPack --download-dir ./llm_compiler_agent_pack

You can then inspect the files at ./llm_compiler_agent_pack and use them as a template for your own project!

Code Usage

You can download the pack to a directory. NOTE: You must specify skip_load=True - the pack contains multiple files, which makes it hard to load directly.

We will show you how to import the agent from these files!

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

Built Distribution

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

File details

Details for the file llama_index_packs_node_parser_semantic_chunking-0.4.1.tar.gz.

File metadata

File hashes

Hashes for llama_index_packs_node_parser_semantic_chunking-0.4.1.tar.gz
Algorithm Hash digest
SHA256 63084525840554dff1aa2d9aae4c43b7e12533c3c81785e6ee855e739df22558
MD5 6171df1a6013d5da3971abd8a9dc1fc5
BLAKE2b-256 7c68ab7c4d502e78bb9129c19ec47b87c0074e1e56a6f6b83ec335b2b117c19f

See more details on using hashes here.

File details

Details for the file llama_index_packs_node_parser_semantic_chunking-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for llama_index_packs_node_parser_semantic_chunking-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 34baac11e4f8af782536537b6961cd1ed62203960a8bb5399066910111f48329
MD5 b9e8443313e188833df4ae1c3b2e9ce6
BLAKE2b-256 18cd44a67387effb5cd4f0b8ed91df2fa3662d6603b53dae5e84148886f9a7ef

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