SkimLit Pro is a full-stack web application that helps researchers and medical professionals quickly digest complex PubMed abstracts. A deep learning model classifies each sentence into one of five rhetorical roles: BACKGROUND, OBJECTIVE, METHODS, RESULTS, and CONCLUSIONS — with a confidence score per sentence.
- 🔬 Sentence-level classification of medical abstracts using a TensorFlow model trained on the RCT-20k dataset
- 🎨 Colour-coded Highlighter view — each sentence is highlighted by its predicted label
- 🌡️ Confidence Heatmap view — visualise model certainty across all sentences
- ⚡ FastAPI backend with async model loading and CORS support
- 🖥️ React + Vite + Tailwind CSS frontend
skimlit/
├── backend/ # FastAPI server & ML inference logic
│ ├── main.py # App entry point; /predict, /compare, /export endpoints
│ ├── predict.py # Model inference pipeline
│ ├── preprocess.py # Text preprocessing utilities
│ ├── conftest.py # pytest fixtures
│ ├── requirements.txt # Python dependencies
│ └── tests/
│ └── test_main.py # Automated API tests (pytest + httpx)
│
├── frontend/ # React application (Vite)
│ ├── src/
│ │ ├── App.jsx # Root component; handles state & API calls
│ │ └── components/
│ │ ├── Highlighter.jsx # Colour-coded sentence view
│ │ └── Heatmap.jsx # Confidence heatmap view
│ ├── index.html
│ ├── package.json
│ ├── tailwind.config.js
│ └── vite.config.js
│
├── model/ # Saved TensorFlow model (not tracked in git)
│ └── skimlit_model/ # Place your SavedModel directory here
│
├── pubmed-rct/ # Dataset used for model training
├── SkimLit.ipynb # Model training & evaluation notebook
├── helper_functions.py # Shared utility functions
└── implementation_plan.md # Development roadmap
- Python 3.9+
- Node.js 18+
- A trained model saved at
model/skimlit_model/(TensorFlow SavedModel format)
cd backend
# Create and activate a virtual environment
python -m venv venv
# Windows
.\venv\Scripts\activate
# Unix / macOS
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Start the server
python main.pyThe backend will be available at
http://localhost:8000
Note: If no model is found at
model/skimlit_model/, the server still starts but returns500on prediction endpoints.
cd frontend
npm install
npm run devThe frontend will be available at
http://localhost:5173
# From the backend/ directory with the venv active
python -m pytestTests use pytest + httpx and are located in backend/tests/test_main.py.
Health check:
curl http://localhost:8000/healthResponse:
{ "status": "ok", "model_loaded": true }Classify a single abstract:
curl -X POST http://localhost:8000/predict \
-H "Content-Type: application/json" \
-d '{"abstract": "This study evaluated the effectiveness of a new drug. We enrolled 200 patients. Results showed a significant improvement. We conclude the drug is effective."}'Compare two abstracts:
curl -X POST http://localhost:8000/compare \
-H "Content-Type: application/json" \
-d '{"abstract_a": "First abstract...", "abstract_b": "Second abstract..."}'Returns server and model status.
Response:
{ "status": "ok", "model_loaded": true }Classifies all sentences in a medical abstract.
Request body:
{ "abstract": "Full text of the abstract..." }Response:
{
"sentences": [
{
"line_number": 0,
"total_lines": 4,
"text": "This study evaluated the effectiveness of a new drug.",
"target": "OBJECTIVE",
"confidence": 0.97
}
]
}Runs /predict on two abstracts and returns both result sets.
Request body:
{
"abstract_a": "First abstract...",
"abstract_b": "Second abstract..."
}Response:
{
"a": [ /* sentences array */ ],
"b": [ /* sentences array */ ]
}Planned endpoint for exporting results to PDF or DOCX. Not yet implemented.
| Layer | Technology |
|---|---|
| Frontend | React 19, Vite 8, Tailwind CSS 4 |
| Backend | FastAPI, Uvicorn |
| ML / Inference | TensorFlow, TensorFlow Hub, scikit-learn |
| Testing | pytest, httpx |
| Data | PubMed RCT-20k dataset |
The model is trained and evaluated in SkimLit.ipynb (and the earlier skimlit notebook.ipynb). After training, export the model using:
model.save("../model/skimlit_model")Then restart the backend server to pick it up automatically.
- Fork the repository
- Create a feature branch:
git checkout -b feature/your-feature - Commit your changes:
git commit -m 'Add your feature' - Push and open a Pull Request