Download thicc/data/data_loader.py from Group056IntroToHealthInfo/THICC_Cost_Chatbot: direct link, hf CLI and curl.
- Browser
- Download file 1.41 kB
-
https://huggingface.co/spaces/Group056IntroToHealthInfo/THICC_Cost_Chatbot/resolve/main/thicc/data/data_loader.py
- Command line
-
hf download hf://spaces/Group056IntroToHealthInfo/THICC_Cost_Chatbot/thicc/data/data_loader.py
-
curl -L -o data_loader.py https://huggingface.co/spaces/Group056IntroToHealthInfo/THICC_Cost_Chatbot/resolve/main/thicc/data/data_loader.py
1.41 kB
| import pandas as pd | |
| from pathlib import Path | |
| # Directory of this file: .../thicc/data | |
| BASE_DIR = Path(__file__).resolve().parent | |
| HOSPITALS = { | |
| "Mayo Clinic": BASE_DIR / "hospitals" / "mayo_clinic_data.csv", | |
| "Cleveland Clinic": BASE_DIR / "hospitals" / "cleveland_clinic_data.csv", | |
| "Johns Hopkins Hospital": BASE_DIR / "hospitals" / "johns_hopkins_hospital_data.csv", | |
| "Massachusetts General Hospital": BASE_DIR / "hospitals" / "massachusetts_general_hospital_data.csv", | |
| "UCLA Medical Center": BASE_DIR / "hospitals" / "ucla_medical_center_data.csv", | |
| "Cedars-Sinai Medical Center": BASE_DIR / "hospitals" / "cedars_sinai_medical_center_data.csv", | |
| "NewYork-Presbyterian Hospital": BASE_DIR / "hospitals" / "newyork_presbyterian_hospital_data.csv", | |
| "Northwestern Memorial Hospital": BASE_DIR / "hospitals" / "northwestern_memorial_hospital_data.csv", | |
| "UCSF Medical Center": BASE_DIR / "hospitals" / "ucsf_medical_center_data.csv", | |
| "Houston Methodist Hospital": BASE_DIR / "hospitals" / "houston_methodist_hospital_data.csv", | |
| } | |
| def load_services_data(path) -> pd.DataFrame: | |
| """Load price data from a CSV file.""" | |
| df = pd.read_csv(path) | |
| return df[[ | |
| "intent", | |
| "description", | |
| "gross_charge", | |
| "negotiated_rate", | |
| ]] | |
| def list_services(services_data: pd.DataFrame) -> list[str]: | |
| return services_data["description"].tolist() | |