Medic / README.md
mgbam's picture
Add application file
b8986a1
|
raw
history blame
2.45 kB
metadata
title: Med
emoji: ๐Ÿ†
colorFrom: blue
colorTo: purple
sdk: streamlit
sdk_version: 1.43.2
app_file: app.py
pinned: false
short_description: Medical field with nextโ€‘gen technology

AI-Powered Medical Knowledge Graph Assistant (Mini-LADDER Demo)

This repository demonstrates a Streamlit application that:

  • Retrieves PubMed abstracts via NCBIโ€™s E-utilities.
  • Indexes and retrieves relevant documents using ChromaDB.
  • Generates biomedical answers using Microsoft BioGPT-Large-PubMedQA.
  • Applies a two-stage self-improvement mechanism (inspired by Tufa Labsโ€™ LADDER) that:
    • Generates naive sub-questions.
    • Produces an initial answer.
    • Self-critiques and refines the answer.
  • Visualizes key terms in a knowledge graph using PyVis.

Key Features

  1. PubMed + Chroma: Retrieves and indexes relevant abstracts.
  2. BioGPT-Large-PubMedQA: Generates an initial answer.
  3. Mini-LADDER Approach:
    • Sub-Question Decomposition: Generates sub-questions from the main query.
    • Self-Critique & Refinement: Uses a second pass to critique and refine the answer.
  4. Interactive Knowledge Graph: Displays a PyVis graph of the top documents and key terms.

Setup Instructions

  1. Install Dependencies

    Create a virtual environment (optional) and install the required packages:

    pip install -r requirements.txt
    

Set Environment Variables

Set your PubMed API key:

bash Copy export PUBMED_API_KEY= Run the App

Launch the Streamlit app:

bash Copy streamlit run app.py Access the App

Open your browser at http://localhost:8501.

Project Structure Copy . โ”œโ”€โ”€ app.py โ”œโ”€โ”€ backend.py โ”œโ”€โ”€ mini_ladder.py โ”œโ”€โ”€ retrieval.py โ”œโ”€โ”€ visualization.py โ”œโ”€โ”€ README.md โ””โ”€โ”€ requirements.txt About the Mini-LADDER Approach Inspired by Tufa Labsโ€™ LADDER (Learning through Autonomous Difficulty-Driven Example Recursion), this demo shows how a model might:

Decompose a query into simpler sub-questions. Generate an initial answer using retrieval-augmented generation. Self-critique and refine the answer based on detected gaps. Ultimately, this approach hints at how autonomous, recursive learning could be implemented. Enjoy exploring potential extensions into code generation, theorem proving, or other domains!

yaml Copy


File: requirements.txt

streamlit
pyvis
chromadb
transformers
sentence-transformers
torch
requests