Metadata-Version: 2.2
Name: context_enriched_chunking
Version: 0.1.1
Summary: A text chunking strategy that keeps document title and section as headers for each chunk.
Home-page: https://github.com/alvelvis/context-enriched-chunking
Author: Elvis A. de Souza
Author-email: "Elvis A. de Souza" <elvis.desouza99@gmail.com>
Project-URL: Homepage, https://github.com/alvelvis/context-enriched-chunking
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: langchain-text-splitters
Dynamic: author
Dynamic: home-page
Dynamic: requires-python

# Context-Enriched Chunking

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

```python
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/*
