An interactive Streamlit application for exploring connections between dermatology diseases, drugs, and symptoms using a Neo4j knowledge graph.
- Interactive Graph Visualization: Explore concepts and their relationships
- Shortest Path Finding: Discover connections between any two medical concepts
- AI-Powered Insights: Get intelligent descriptions of medical relationships
- Chat Assistant: Ask questions about the knowledge graph
- Responsive Design: Works on desktop and mobile devices
Visit the deployed app on Streamlit Community Cloud
- Python 3.8+
- Neo4j database (local or cloud instance)
- Git
- Clone the repository:
git clone https://github.com/yourusername/DermKG.git
cd DermKG- Install dependencies:
pip install -r requirements.txt- Set up your Neo4j credentials in
.streamlit/secrets.toml:
[neo4j]
uri = "neo4j+s://your-neo4j-instance.databases.neo4j.io"
user = "neo4j"
password = "your-neo4j-password"- Run the application:
streamlit run app.py- Fork this repository to your GitHub account
- Ensure all files are committed and pushed to your repository
- Go to share.streamlit.io
- Sign up with your GitHub account
- Connect your GitHub repository
- In your Streamlit Community Cloud dashboard, go to your app settings
- Navigate to the "Secrets" section
- Add the following secrets:
[neo4j]
uri = "neo4j+s://your-neo4j-instance.databases.neo4j.io"
user = "neo4j"
password = "your-neo4j-password"- Click "Deploy" in your Streamlit Community Cloud dashboard
- Select your repository and the
app.pyfile - Wait for the deployment to complete
- Visit your deployed app URL
- Verify that the Neo4j connection works
- Test the graph visualization and chat features
This application requires a Neo4j database with dermatology concepts. The database should have:
- Nodes: Concepts with a
nameproperty - Relationships: Various types connecting the concepts
- Labels: All nodes should have the
Conceptlabel
The app uses Streamlit secrets for configuration:
neo4j.uri: Neo4j connection URIneo4j.user: Neo4j usernameneo4j.password: Neo4j password
The app uses lightweight language models optimized for cloud deployment:
- Primary:
microsoft/DialoGPT-small - Fallback:
gpt2 - Lightest:
distilgpt2
If models fail to load, the app falls back to rule-based responses.
streamlit>=1.28.0- Web application frameworkneo4j>=5.12.0- Neo4j database driverstreamlit-agraph>=0.0.45- Graph visualizationtransformers>=4.21.0- AI model loadingtorch>=2.0.0- Machine learning backendaccelerate>=0.20.0- Model optimizationsentencepiece>=0.1.99- Tokenizationprotobuf>=3.20.0- Protocol buffers
- Database credentials are stored in Streamlit secrets
- No sensitive information is hardcoded
- The app includes error handling for missing credentials
-
"Neo4j credentials not found"
- Ensure secrets are properly configured in Streamlit Community Cloud
- Check that the secret keys match exactly:
neo4j.uri,neo4j.user,neo4j.password
-
"Failed to connect to Neo4j"
- Verify your Neo4j instance is running and accessible
- Check that the URI, username, and password are correct
- Ensure your Neo4j instance allows remote connections
-
"LLM models not available"
- This is normal in resource-constrained environments
- The app will still function with rule-based responses
-
Slow loading
- First-time model loading may take a few minutes
- Subsequent loads should be faster due to caching
- The app uses caching for database connections and model loading
- Graph visualizations are limited to 50 nodes for performance
- Models are optimized for low memory usage
- Fork the repository
- Create a feature branch
- Make your changes
- Test thoroughly
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- Neo4j for the graph database
- Streamlit for the web framework
- Hugging Face for the language models
- The dermatology community for domain knowledge
For questions or issues:
- Open an issue on GitHub
- Check the troubleshooting section above
- Review the deployment documentation
Note: This application is for educational and research purposes. Always consult medical professionals for health-related decisions.