Spaces:
Running
Running
Download backend/app/content.py from PediaMedAI/MedCaseAgent: direct link, hf CLI and curl.
- Browser
- Download file 3.82 kB
-
https://huggingface.co/spaces/PediaMedAI/MedCaseAgent/resolve/main/backend/app/content.py
- Command line
-
hf download hf://spaces/PediaMedAI/MedCaseAgent/backend/app/content.py
-
curl -L -o content.py https://huggingface.co/spaces/PediaMedAI/MedCaseAgent/resolve/main/backend/app/content.py
3.82 kB
| """Public project metadata and a deliberately incomplete synthetic walkthrough.""" | |
| import json | |
| import os | |
| import re | |
| from pathlib import Path | |
| from .models import ClinicalAtoms, Example, ExampleStage, Project, Resource | |
| NAMESPACE = os.getenv("HF_NAMESPACE", "PediaMedAI") | |
| if not re.fullmatch(r"[A-Za-z0-9][A-Za-z0-9_-]{0,95}", NAMESPACE): | |
| raise ValueError("HF_NAMESPACE must be a Hugging Face account or organization name") | |
| CODE_URL = os.getenv("CODE_URL", "https://github.com/PediaMedAI/MedCaseAgent").rstrip("/") | |
| PROJECT = Project( | |
| name="MedCaseAgent", | |
| title="From Multimodal Clinical Evidence to Rare Disease Case Reports", | |
| description="We study how AI agents can turn clinical notes, medical images, and retrieved literature into structured rare-disease case reports. MedCaseAgent brings together evidence planning, report writing, and review.", | |
| organization="PediaMed AI", | |
| resources=[ | |
| Resource(id="benchmark", name="MedCase-Bench", | |
| description="584 structured clinical input records for evaluating case-report generation.", | |
| url=f"https://huggingface.co/datasets/{NAMESPACE}/MedCase-Bench"), | |
| Resource(id="corpus", name="MedCase-150K", | |
| description="A large corpus of clinical case reports, including rare-disease cases.", | |
| url=None), | |
| Resource(id="code", name="MedCaseAgent", | |
| description="Source code for preprocessing, Planner–Writer–Editor inference, and disease retrieval.", | |
| url=CODE_URL), | |
| Resource(id="demo", name="Web Demo", | |
| description="Try MedCaseAgent online to turn clinical notes and medical images into case report drafts.", | |
| url="https://medcaseagent.medlastexam.org"), | |
| ], | |
| ) | |
| EXAMPLE = Example( | |
| title="From clinical atoms to a structured draft", | |
| label="Synthetic example · Illustrative only", | |
| description="This intentionally incomplete software-test case comes from the code repository. Switch stages to see how evidence can be organized while preserving missing information. No live inference is performed.", | |
| atoms=ClinicalAtoms.model_validate(json.loads((Path(__file__).parent / "data" / "synthetic_case.json").read_text())), | |
| stages=[ | |
| ExampleStage(id="planner", title="Planner", content="1. Establish the available timeline: three days of fatigue.\n2. Separate patient history, presentation, investigations, management, and follow-up.\n3. Mark investigations, treatment, and outcome as unavailable.\n4. Do not infer a diagnosis or add figures or references that were not supplied."), | |
| ExampleStage(id="writer", title="Writer", content="An adult with no documented prior medical history reported a three-day history of fatigue. No investigation results or treatment details were supplied. Follow-up was unavailable.\n\nThe available information is insufficient for a diagnostic discussion or a complete case report."), | |
| ExampleStage(id="editor", title="Editor", content="Evidence check\n• The three-day symptom duration is preserved.\n• No undocumented age, sex, examination findings, or diagnosis is introduced.\n• Missing investigation, treatment, and follow-up details remain explicit.\n• No references or images are fabricated.\n\nNext step: obtain the missing clinical evidence before developing a complete report."), | |
| ], | |
| report="Clinical history\nAn adult had no documented prior medical history.\n\nPresentation\nThe patient reported a three-day history of fatigue.\n\nInvestigations and management\nNo investigation results or treatment details were supplied.\n\nOutcome\nFollow-up was unavailable.\n\nCompleteness\nThis synthetic input is insufficient for a complete case report. No diagnosis or literature-supported discussion is inferred.", | |
| ) | |