Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions document_processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
import re
import pandas as pd
from sentence_transformers import SentenceTransformer
import chromadb
from dotenv import load_dotenv
import requests
from bs4 import BeautifulSoup
import time

load_dotenv()

Expand Down Expand Up @@ -65,8 +60,6 @@ def load_documents(self, filename: str = "medical_documents.json") -> List[Dict[

def save_documents(self, documents: List[Dict[str, Any]], filename: str = "medical_documents.json"):
"""Save documents to JSON file"""
os.makedirs(self.data_dir, exist_ok=True)
filepath = os.path.join(self.data_dir, filename)
with open(filepath, 'w') as f:
json.dump(documents, f, indent=2)
print(f"Saved {len(documents)} documents to {filepath}")
Expand Down Expand Up @@ -244,4 +237,4 @@ def run_pipeline(self, json_file=None, urls=None):
medical_urls = []

count = processor.run_pipeline(urls=medical_urls)
print(f"Successfully processed documents into {count} chunks in the vector database")
print(f"Successfully processed documents into {count} chunks in the vector database")