MedCodeMCP / services /indexing.py
gpaasch's picture
checkpoint 2 - we are in a very good position right now, audio transcription is working, gradio page looks good, local llms are working, returning the consultation, the json that will be sent to the mcp client, and a debugging panel
5e4e457
raw
history blame contribute delete
684 Bytes
from llama_index.core import SimpleDirectoryReader, VectorStoreIndex
from llama_index.core import Settings
def create_symptom_index():
"""Create and return symptom index from ICD-10 data."""
print("build_symptom_index: Loading documents from data directory...")
documents = SimpleDirectoryReader(
input_dir="data",
filename_as_id=True
).load_data()
print(f"build_symptom_index: Creating vector index from {len(documents)} documents...")
symptom_index = VectorStoreIndex.from_documents(
documents,
show_progress=True
)
print("build_symptom_index: Symptom index created successfully")
return symptom_index