Core Logic and Library Choices

MediMind’s core logic combines the strengths of a pre-trained RNN for rapid initial disease prediction and an LLM for interactive diagnosis refinement and recommendation generation.

Workflow:

  1. Symptom Input: The user inputs their symptoms via a chat interface.

  2. RNN-based Prediction: The RNN model processes the symptoms and provides an initial disease prediction.

  3. LLM-based Follow-up: The LLM generates follow-up questions to gather more information.

  4. User Interaction: The user answers the follow-up questions.

  5. Final Diagnosis: The LLM integrates the initial prediction, user input, and follow-up answers to provide a refined diagnosis.

  6. Recommendation Generation: The LLM generates treatment and prevention recommendations based on the refined diagnosis.

  7. Output: The final diagnosis and recommendations are presented to the user.

Key Libraries:

  • Streamlit: For creating the web application’s user interface.

  • PyTorch: For building and deploying the RNN model.

  • Transformers: For using the Large Language Model (LLM).

  • Scikit-learn: For data preprocessing and the TF-IDF vectorizer.

  • NLTK: For text processing tasks such as tokenization and stemming.

  • Pandas: For data manipulation.