A tool for visualizing ML model development processes from research papers, inspired by GitDiagram.
ML Paper Visualizer is an application that enables researchers and ML enthusiasts to easily understand the model development process in research papers. It automatically extracts and visualizes the complete ML workflow from data collection through preprocessing, modeling, to results evaluation.
- Paper Input: Upload PDF files or provide URLs to research papers
- ML Workflow Extraction: Automatically identify data collection methods, preprocessing steps, model architecture, training methodology, and evaluation metrics
- Interactive Visualization: View the complete ML process as an interactive diagram with clickable components
- Component Details: Access detailed information about each component of the ML workflow
- Paper Reference: Link visualization components back to relevant sections in the original paper
- Customization Options: Adjust visualization layout, theme, and detail level
ml_paper_visualizer/
├── backend/ # FastAPI backend
│ ├── app/
│ │ ├── core/ # Core models and utilities
│ │ ├── routers/ # API endpoints
│ │ ├── services/ # Business logic services
│ │ └── utils/ # Utility functions
│ └── tests/ # Backend tests
├── frontend/ # Next.js frontend
│ ├── src/
│ │ ├── app/ # Next.js pages
│ │ ├── components/ # React components
│ │ └── lib/ # Frontend utilities
├── docs/ # Documentation
│ ├── architecture.md # System architecture
│ ├── features.md # Feature specifications
│ ├── requirements.md # Project requirements
│ └── ui_design.md # UI/UX design
├── research/ # Research findings
└── tests/ # Integration tests and sample papers
- Python 3.10+
- Node.js 18+
- npm or pnpm
-
Navigate to the backend directory:
cd ml_paper_visualizer/backend
-
Create a virtual environment:
python -m venv venv source venv/bin/activate # On Windows: venv\Scripts\activate
-
Install dependencies:
pip install -r requirements.txt
-
Set up environment variables:
# Create a .env file with the following variables OPENAI_API_KEY=your_openai_api_key
-
Run the backend server:
uvicorn app.main:app --reload --host 0.0.0.0 --port 8000
-
Navigate to the frontend directory:
cd ml_paper_visualizer/frontend
-
Install dependencies:
npm install # or pnpm install
-
Run the development server:
npm run dev # or pnpm dev
-
Open http://localhost:3000 in your browser to see the application.
This is the recommended way to run the application as it handles dependencies and setup within isolated containers.
- Docker (Install Docker)
- Docker Compose (Usually included with Docker Desktop)
-
Environment Variables: Create a
.env
file in the project root directory (the same directory asdocker-compose.yml
). Add your OpenAI API key to this file:OPENAI_API_KEY=your_actual_openai_api_key
Important: Ensure
.env
is listed in your root.gitignore
file to prevent committing secrets. -
Frontend API URL: The frontend service in
docker-compose.yml
is configured to connect to the backend athttp://backend:8000
. Ensure your frontend code usesprocess.env.NEXT_PUBLIC_API_URL
to make API calls.
-
Navigate to the project root directory in your terminal.
-
Run the following command to build the images and start the containers:
docker compose up --build
To run the containers in the background (detached mode), use:
docker compose up --build -d
-
Accessing the Application:
- Frontend: Open http://localhost:3000 in your browser.
- Backend API Docs: Open http://localhost:8000/docs.
To stop the containers, run the following command in the project root directory:
docker compose down
-
Upload a Paper: On the home page, either upload a PDF file or enter a URL to a research paper.
-
View Visualization: After processing, the application will display an interactive visualization of the ML workflow.
-
Explore Components: Click on components in the visualization to view detailed information about each part of the ML process.
-
Customize View: Use the customization panel to adjust the visualization layout, theme, and detail level.
-
Export Results: Export the visualization as an image or interactive HTML file for sharing or inclusion in presentations.
Run the backend tests with pytest:
cd ml_paper_visualizer/backend
pytest
Run the frontend tests with Jest:
cd ml_paper_visualizer/frontend
npm test
- Backend: FastAPI, PyMuPDF, OpenAI API, Hugging Face Transformers
- Frontend: Next.js, TypeScript, Tailwind CSS, D3.js/Mermaid.js
- Testing: Pytest, Jest
Contributions are welcome! Please read our Contributing Guidelines for details on how to get started, report bugs, and suggest enhancements.
This project is licensed under the MIT License - see the LICENSE file for details.
- Inspired by GitDiagram
- Uses research papers from arXiv
image.png