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] [--overwrite]

python3 evaluate/generate_answers.py gpt-4o,llama3-1-8b-instruct-v1,llama3-1-405b-instruct-v1,llama3-1-70b-instruct-v1 => ATENÇÃO REMOVI 70B

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

python3 evaluate/evaluate.py [--overwrite]

Publicando

editar pyproject.toml e setup.py com nova versão

pip install -e .

python3 -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.3.tar.gz (3.1 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.3-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for context_enriched_chunking-0.1.3.tar.gz
Algorithm Hash digest
SHA256 12df910bc88ce4af330200b420b1979aef6c9b34df040eb9eb10d61c56d6664a
MD5 b23d7091e86971bbe5a22def47e5e4ea
BLAKE2b-256 99eb5f5570a555a2be86cf775173961d4f4f44f710f2c593560b2ac621d57e62

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for context_enriched_chunking-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 f40af7a2799e014334240caa0e4561ef70b8c1d5eea11321ba2540f0c6a33729
MD5 2d5a135bcde8f43bf2d37c3740e6d3c7
BLAKE2b-256 59d4943861895e470691ee5978f88b4a59714f8abf95eefb970b036f21a61cff

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