Welcome to MedicalAssistantGPT, a simple yet powerful Streamlit dashboard that leverages MongoDB, Streamlit, and OpenAI to help users explore medical symptom-disorder relationships. This repository is part of the Big Data Engineering course for the academic year 2024β2025 π.
- π Interactive dashboard built with Streamlit
- π§ Uses OpenAI GPT to generate simple medical explanations
- ποΈ Data storage and querying powered by MongoDB Atlas
- π Easy CSV data import via
load_data.py
- π Symptom-based disorder filtering
- π Real-time relation type stats
.
βββ .streamlit/
β βββ secrets.toml # Stores API keys (OpenAI)
βββ .gitignore
βββ dashboard.py # Streamlit app for interactive exploration
βββ LICENSE
βββ load_data.py # Script to load CSV data into MongoDB Atlas
βββ README.md
βββ relations.csv # Dataset: [source, relationType, destination]
βββ requirements.txt # Python dependencies
Make sure you are using Python 3.8+. Then install all required libraries:
pip install -r requirements.txt
- Create a free MongoDB Atlas account.
- Create a new cluster and database named
healthcare
. - Inside the
healthcare
database, create a collection namedrelations
. - Whitelist your IP and get your connection string.
- Update the MongoDB connection string inside
dashboard.py
andload_data.py
:
client = MongoClient("your-mongodb-connection-string")
In the file .streamlit/secrets.toml
, store your OpenAI key like this:
[openai]
api_key = "your-openai-api-key"
π This file is ignored by Git. Donβt commit your secrets!
Use the load_data.py
script to populate the relations
collection:
python load_data.py
Launch the Streamlit dashboard:
streamlit run dashboard.py
Then visit http://localhost:8501 in your browser π
- The dashboard lets users select two or more symptoms from the sidebar.
- It queries MongoDB to find disorders that match all selected symptoms.
- Then, it uses GPT to explain those disorders in simple termsβperfect for educational and demo purposes!
Select:
- Symptom A: Fever
- Symptom B: Cough
β‘οΈ The app identifies disorders like Influenza associated with both symptoms and provides a plain-language description and potential treatments.
This project is licensed under the MIT License.
Made with β€οΈ for students of Big Data Engineering 2024β25
Instructors: Antonio Romano, Giuseppe Riccio, Vincenzo Moscato π¨βπ«