A domain-specific Retrieval-Augmented Generation (RAG) chatbot built to provide medical insights from a curated dataset of scientific abstracts. The model, powered by Phi-3-mini and FAISS, retrieves relevant context before generating human-like, citation-supported answers.
- Retrieves contextually relevant passages from a local corpus.
- Generates cited responses using the microsoft/Phi-3-mini-4k-instruct model.
- Displays sources used for each response.
- Handles unknown or missing information gracefully.
- Implemented and tested in Google Colab.
| Component | Description |
|---|---|
| Language Model | microsoft/Phi-3-mini-4k-instruct |
| Retriever | FAISS Vector Store |
| Embeddings | Sentence-Transformers |
| Environment | Google Colab & Kaggle |
| Programming Language | Python |
=== PathoScopy AI Chatbot Ready! ===
User: What is cardiogenic shock?
PathoScopy: Cardiogenic shock occurs when there is severe dysfunction of the heart muscle leading to insufficient perfusion of organs due to decreased pump action by the heart. It often follows events such as myocardial infarction and is associated with high mortality if not treated promptly.
Sources:
- Source 1: Multicenter registry of angioplasty therapy of cardiogenic shock: initial and long-term survival.
- Source 2: Usefulness of blood lactate as a predictor of shock development in acute myocardial infarction.
PathoScopy/
├── README.md # Project documentation
└── sandbox
└── PathoScopy.ipynb # Main notebook & RAGs chatbot
- Open
PathoScopy.ipynbin Google Colab. - Upload your dataset of medical abstracts or papers.
- Run all cells to initialize the chatbot.
- Interact with the chatbot in the notebook terminal.
Example:
User: What causes cardiogenic shock?
User: Can cardiogenic shock occur without a heart attack?
User: exit
- Add a web-based interface using Streamlit or Gradio.
- Expand the dataset to include other medical specialties.
- Integrate live PubMed API access for updated sources.
