Download config.py from Bhavy-227/Medical-Report-Analyzer: direct link, hf CLI and curl.
- Browser
- Download file 3.01 kB
-
https://huggingface.co/spaces/Bhavy-227/Medical-Report-Analyzer/resolve/main/config.py
- Command line
-
hf download hf://spaces/Bhavy-227/Medical-Report-Analyzer/config.py
-
curl -L -o config.py https://huggingface.co/spaces/Bhavy-227/Medical-Report-Analyzer/resolve/main/config.py
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. | |
| """ |