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
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
File details
Details for the file llama_index_packs_node_parser-0.1.2.tar.gz
.
File metadata
- Download URL: llama_index_packs_node_parser-0.1.2.tar.gz
- Upload date:
- Size: 4.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09a40616b05f56ac952cc209a75f7ecfc19c5208d8c2ce7b6012347909a5026b |
|
MD5 | ad63a07110505700ba4eeaf0aa96a2e9 |
|
BLAKE2b-256 | 97b28e99d14646e5c84a94368515e72995f652166f765577a35ef5d0db0d29f6 |
File details
Details for the file llama_index_packs_node_parser-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: llama_index_packs_node_parser-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.7.1 CPython/3.10.13 Darwin/23.0.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 625feb89f0df8811e57cad24945282a396d28ba2cdd0ffa8bd9cd8c9518cf77b |
|
MD5 | afd8d31045161f68b1a3ea22fbbf6db6 |
|
BLAKE2b-256 | 0c6dc39c2dc9d15b50c42d2c0ccf09c8dd7d765ce102337d8b2b9c43b53d5a91 |