Bhavy-227's picture
Upload folder using huggingface_hub
7704872 verified
Raw History Blame Contribute Delete
3.01 kB
import os
from dotenv import load_dotenv
load_dotenv()
# Set HF token to avoid rate limit warnings
os.environ["HUGGINGFACE_HUB_TOKEN"] = os.getenv("HF_TOKEN", "")# -----------------------------------------------
# Medical Report Analyzer β€” Central Configuration
# All project settings live here
# -----------------------------------------------
# -----------------------------------------------
# HuggingFace Dataset Settings
# -----------------------------------------------
DATASET_NAME = "kamruzzaman-asif/Diseases_Dataset"
# Splits we use and why
DATASET_SPLITS = {
"IndianServers": "India-specific diseases",
"QuyenAnh": "Has treatment data",
"symptom2disease": "Natural language symptoms",
"itachi9604": "Additional disease entries",
}
# -----------------------------------------------
# File Paths
# -----------------------------------------------
MEDICAL_KNOWLEDGE_FILE = "data/medical_knowledge.txt"
FAISS_INDEX_PATH = "faiss_index"
REPORTS_OUTPUT_PATH = "generated_reports"
# -----------------------------------------------
# RAG Settings
# -----------------------------------------------
CHUNK_SIZE = 500 # characters per chunk
CHUNK_OVERLAP = 100 # overlap between chunks
TOP_K_RESULTS = 5 # chunks retrieved per query
# Embedding model β€” runs locally, no API needed
EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
# -----------------------------------------------
# Gemini Settings
# -----------------------------------------------
GEMINI_MODEL = "gemini-2.5-flash"
# -----------------------------------------------
# Supported Document Types
# -----------------------------------------------
SUPPORTED_FORMATS = [".pdf", ".jpg", ".jpeg", ".png"]
# -----------------------------------------------
# Language Settings
# -----------------------------------------------
SUPPORTED_LANGUAGES = {
"English": "en",
"Hindi": "hi",
}
# -----------------------------------------------
# Risk Levels
# -----------------------------------------------
RISK_LEVELS = {
"LOW": "🟒 Low Risk",
"MEDIUM": "🟑 Medium Risk",
"HIGH": "πŸ”΄ High Risk",
"CRITICAL": "🚨 Critical β€” Seek Immediate Help",
}
# -----------------------------------------------
# Disclaimer β€” added to every response
# -----------------------------------------------
DISCLAIMER = """
⚠️ MEDICAL DISCLAIMER:
This analysis is AI-generated and for informational purposes only.
It does not constitute medical advice or diagnosis.
Always consult a qualified doctor before making health decisions.
Emergency: Call 112 | AIIMS Helpline: 011-26588500
Free Health Helpline: 104
"""
IMAGING_DISCLAIMER = """
⚠️ IMAGING DISCLAIMER:
X-ray, MRI and CT scan analysis by AI is for general guidance only.
AI cannot replace a qualified radiologist for imaging interpretation.
Always get your scans reviewed by a certified radiologist.
"""