# Semantic Chunking Llama Pack
This LlamaPack implements the semantic chunking algorithm first proposed by Greg Kamradt in his [Five Levels of Text Splitting](https://github.com/FullStackRetrieval-com/RetrievalTutorials/blob/main/5_Levels_Of_Text_Splitting.ipynb) 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:
```bash
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!
Raw data
{
"_id": null,
"home_page": "",
"name": "llama-index-packs-node-parser-semantic-chunking",
"maintainer": "jerryjliu",
"docs_url": null,
"requires_python": ">=3.8.1,<4.0",
"maintainer_email": "",
"keywords": "chunk,chunking,embedding,node,parser,semantic",
"author": "Your Name",
"author_email": "you@example.com",
"download_url": "https://files.pythonhosted.org/packages/52/14/09f710f0c9094513ce1bcf8293063e6b8adf9c41f787e49873fbeafc8f21/llama_index_packs_node_parser_semantic_chunking-0.1.3.tar.gz",
"platform": null,
"description": "# Semantic Chunking Llama Pack\n\nThis LlamaPack implements the semantic chunking algorithm first proposed by Greg Kamradt in his [Five Levels of Text Splitting](https://github.com/FullStackRetrieval-com/RetrievalTutorials/blob/main/5_Levels_Of_Text_Splitting.ipynb) tutorial.\n\nHow it works:\n\n- Split text into sentences.\n- For each sentence, generate an embedding.\n- Measure cosine distance between each pair of consecutive sentences.\n- Get the 95% percentile cosine distance, set that as the threshold.\n- Create a new chunk if the cosine distance of a sentence compared to prev. exceeds that threshold.\n\n## CLI Usage\n\nYou can download llamapacks directly using `llamaindex-cli`, which comes installed with the `llama-index` python package:\n\n```bash\nllamaindex-cli download-llamapack LLMCompilerAgentPack --download-dir ./llm_compiler_agent_pack\n```\n\nYou can then inspect the files at `./llm_compiler_agent_pack` and use them as a template for your own project!\n\n## Code Usage\n\nYou can download the pack to a directory. **NOTE**: You must specify `skip_load=True` - the pack contains multiple files,\nwhich makes it hard to load directly.\n\nWe will show you how to import the agent from these files!\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "llama-index packs node_parser integration",
"version": "0.1.3",
"project_urls": null,
"split_keywords": [
"chunk",
"chunking",
"embedding",
"node",
"parser",
"semantic"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "a24217648f68b8378c16a6370221c2ea6860c5ed7e9737e7312a8493150a5002",
"md5": "6e0114aacc2be621ccf8cf5c314596a1",
"sha256": "728e386a80b586f90ec0e0b6fdd85f4e30fe930d4f7426aca4dbbaab918a7342"
},
"downloads": -1,
"filename": "llama_index_packs_node_parser_semantic_chunking-0.1.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "6e0114aacc2be621ccf8cf5c314596a1",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<4.0",
"size": 5011,
"upload_time": "2024-02-22T01:26:13",
"upload_time_iso_8601": "2024-02-22T01:26:13.073289Z",
"url": "https://files.pythonhosted.org/packages/a2/42/17648f68b8378c16a6370221c2ea6860c5ed7e9737e7312a8493150a5002/llama_index_packs_node_parser_semantic_chunking-0.1.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "521409f710f0c9094513ce1bcf8293063e6b8adf9c41f787e49873fbeafc8f21",
"md5": "08e1e539cd4c0925026b1ae0c48c2216",
"sha256": "77cef609cf992d7998ea98860117a1384d118bec4ac2995262a91356386b7fe2"
},
"downloads": -1,
"filename": "llama_index_packs_node_parser_semantic_chunking-0.1.3.tar.gz",
"has_sig": false,
"md5_digest": "08e1e539cd4c0925026b1ae0c48c2216",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<4.0",
"size": 4543,
"upload_time": "2024-02-22T01:26:14",
"upload_time_iso_8601": "2024-02-22T01:26:14.337919Z",
"url": "https://files.pythonhosted.org/packages/52/14/09f710f0c9094513ce1bcf8293063e6b8adf9c41f787e49873fbeafc8f21/llama_index_packs_node_parser_semantic_chunking-0.1.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-22 01:26:14",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "llama-index-packs-node-parser-semantic-chunking"
}