Spaces:
Sleeping
Sleeping
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 | |