Lung-Cancer-AI-Advisor / core /text_processors.py
moazx's picture
Update .env.example with OpenAI and LangSmith configuration, modify app.py to dynamically set the port for deployment, enhance CORS middleware to support additional local development origins, and improve document retrieval settings for more comprehensive context in responses.
0a5dcf9
raw
history blame contribute delete
570 Bytes
from langchain.text_splitter import (
RecursiveCharacterTextSplitter,
MarkdownHeaderTextSplitter
)
recursive_splitter = RecursiveCharacterTextSplitter(
chunk_size=3500,
chunk_overlap=400,
length_function=len,
separators=["\n\n", "\n", ". ", " ", ""],
)
markdown_splitter = MarkdownHeaderTextSplitter(
headers_to_split_on=[
("##", "Header 2"), # Main guideline source (NCCN, ESMO, WHO…)
("###", "Header 3"), # Subsections (Features, Recommendations, Statistics…)
],
strip_headers=False,
)