A medical NLP web application powered by Flask and local Large Language Models (via LM Studio) that translates complex diagnostic reports and clinical jargon into clear, concise, patient-friendly explanations.
Medical reports often contain dense terminology that creates anxiety and confusion for patients. Medical Report Explainer provides an interface where patients can upload .pdf or .txt reports, or paste medical text directly. The system extracts the text and uses a locally hosted LLM to identify difficult terms and produce simple, accessible explanations.
- Multi-Format Document Ingestion: Upload
.pdfor.txtfiles with server-side extraction via PyPDF2. - Local LLM Inference: Direct connection to local inference servers (e.g., LM Studio) via the OpenAI API protocol for private, on-premise processing.
- Structured Explanations: Standardized
Term: [term]andExplanation: [simple explanation]output format. - Side-by-Side Interface: Dual-column web dashboard with Axios asynchronous uploads and live response rendering.
- Backend: Python 3.8+, Flask, Werkzeug
- Document Extraction: PyPDF2
- LLM Client: OpenAI Python SDK (LM Studio backend)
- Frontend: HTML5, CSS3, JavaScript, Axios
# 1. Clone the repository
git clone https://github.com/junxiant/Med-Report-Explainer.git
cd Med-Report-Explainer
# 2. Create and activate a virtual environment
python3 -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# 3. Install dependencies
pip install flask werkzeug pypdf2 openaiStart LM Studio:
Load your preferred local LLM (e.g., Llama, Mistral, Gemma).
Start the local server (default: http://localhost:1234/v1 or your host IP).
Configure app.py:
Set base_url and MODEL_IDENTIFIER to match your local LM Studio configuration. Start Flask Server:
python app.py
Access the dashboard at http://127.0.0.1:5000.
Author Jun Tan