--- title: Microbial Susceptibility Analyzer emoji: 👁 colorFrom: blue colorTo: indigo sdk: streamlit sdk_version: 1.43.2 app_file: app.py pinned: false license: mit thumbnail: >- https://cdn-uploads.huggingface.co/production/uploads/64774490312e3909019550f0/JWfMLBEIsP543Hu2G5yAR.jpeg --- # Microbial Susceptibility Analyzer ## Overview The Microbial Susceptibility Analyzer is a Streamlit-based web application that combines machine learning and rule-based decision making to predict antibiotic resistance patterns. The application provides: - Susceptibility predictions for organism-antibiotic combinations - Rule-based guidance for treatment decisions - AI-powered explanations and recommendations - Batch prediction capabilities for CSV datasets ## Installation 1. Clone the repository: ```bash git clone https://github.com/yourusername/microbial-susceptibility-analyzer.git cd microbial-susceptibility-analyzer ``` 2. Create a virtual environment: ```bash python -m venv venv source venv/bin/activate # On Windows use: venv\Scripts\activate ``` 3. Install dependencies: ```bash pip install -r requirements.txt ``` 4. Set up environment variables: Create a `.streamlit/secrets.toml` file with your API keys: ```toml OPENAI_API_KEY = "your_openai_api_key" OPENAI_BASE_URL = "https://api.openai.com/v1" ``` ## Usage Run the application: ```bash streamlit run app.py ``` The application provides several pages: - **Home**: Project overview and introduction - **Susceptibility Analysis**: Single prediction interface - **AI Assistant**: Expert system for detailed explanations - **Data Upload**: Batch prediction for CSV files - **About**: Project information and contact details ## File Structure ``` microbial-susceptibility-analyzer/ ├── app.py # Main application file ├── prediction.py # Prediction logic ├── ai_assistant.py # AI integration ├── utils.py # Utility functions ├── config.py # Configuration settings ├── requirements.txt # Python dependencies ├── README.md # This documentation ├── label_encoders/ # Label encoding files │ ├── organism_label_encoder.json │ ├── antibiotic_label_encoder.json │ └── ... ├── models/ # Trained models │ ├── best_model.pkl │ └── best_model_1.pkl └── data/ # Data files ├── implied_susceptibility_rules.csv └── microbiology_cultures_implied_susceptibility.csv ``` ## Configuration The application requires the following configuration: 1. **Model Path**: Set in `config.py` 2. **Encoder Directory**: Set in `config.py` 3. **OpenAI API**: Configure in `.streamlit/secrets.toml` ## License This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. ## Contact For questions or support, contact: Chukwuebuka Anulunko chukwuebukaanulunko@gmail.com