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
Close
Hashes for llama_index_packs_node_parser-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b46d0fd8a8313f9b67e0321f758c6fca357f0319aecde8b8dc13473a0d51d50 |
|
MD5 | e5629c8dd695631595e49a508d7c0821 |
|
BLAKE2b-256 | 4507fd06f2c036978bf0658c532c3356316426e70da835d67ccbf28a47f3e11c |
Close
Hashes for llama_index_packs_node_parser-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed2369ebbac921c04e6a225b087038cffdf0c3e933156dd447f9d412466d86ca |
|
MD5 | f26bd2312bedf2a30b994d05d3dfc443 |
|
BLAKE2b-256 | 47a8f6422c0953507b72139879ab012daccd4379b49b2be75154d08fb8d13842 |