Skip to main content

A text chunking strategy that keeps document title and section as headers for each chunk.

Project description

Context-Enriched Chunking

A text chunking strategy that keeps document title and section as headers for each chunk.

from context_enriched_chunking import ContextEnrichedChunking

text = "Any text"
splitter = ContextEnrichedChunking(section_max_words=10, chunk_size=1000, chunk_overlap=100)
splitter.split_text(text, title)

Prompt para geração de palavras-chave:

Você é um assistente de inteligência artificial que extrai palavras-chave de uma resposta, e essas palavras-chave devem conter as informações mais importantes da resposta, sem as quais a resposta estaria incorreta.
Todas as palavras-chave devem ser substrings contidas na resposta.
É necessário gerar um mínimo de uma e um máximo de quatro palavras-chave.
As palavras-chave devem estar em uma única linha separadas por ;
Pergunta: {question}
Resposta: {answer}
Palavras-chave: 

.env

OPENAI_API_KEY=
LLM_EVALUATOR=gpt-4o-mini
RAGAS_DO_NOT_TRACK=true

python3 evaluate/generate_embeddings.py cec,recursive,token,semantic

python3 evaluate/generate_answers.py gpt-4o-mini-2024-07-18,deepseek-r1:8b,llama3.1:8b [--n_questions=20]

python3 evaluate/generate_answers.py gpt-4o,llama3-1-8b-instruct-v1,llama3-1-405b-instruct-v1,llama3-1-70b-instruct-v1

gpt, ollama, or evaluate/custom_llm.load_llm(model_name)

python3 evaluate/evaluate.py [--overwrite]

pip install -e .

python -m build twine upload dist/*

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

context_enriched_chunking-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

context_enriched_chunking-0.1.1-py3-none-any.whl (2.7 kB view details)

Uploaded Python 3

File details

Details for the file context_enriched_chunking-0.1.1.tar.gz.

File metadata

File hashes

Hashes for context_enriched_chunking-0.1.1.tar.gz
Algorithm Hash digest
SHA256 c337fd685d6eb6747347c3067d516e1826848d144f28a1c530f049b88f03d639
MD5 befe3dacf9b5b20eb6de7c2479903265
BLAKE2b-256 b9a25d7e40a3f770254e9efc957c6d980b8f9f3b4b0c8f0048e8d085bc7be2da

See more details on using hashes here.

File details

Details for the file context_enriched_chunking-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for context_enriched_chunking-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3e7d4e2192020cdea75db3487a411820f8bc5374d67fe667f45e4022b3f88a38
MD5 416f3f703c358f62ee213de291291585
BLAKE2b-256 6d21a8e2443c91cb7615bf0a014d57d17ee6515a8f02c57aa018e9ee25eca512

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