File size: 1,588 Bytes
b91943a 88f96aa b91943a 88f96aa b91943a |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
---
language:
- en
license: apache-2.0
tags:
- code-explanation
- visualization
- mermaid
- codet5
- developer-tools
pipeline_tag: text-generation
library_name: transformers
base_model: Salesforce/codet5-small
---
🧠 CODE-EXPLAIN-VIZ: AI-Powered Code Understanding & Visualization
CODE-EXPLAIN-VIZ is an advanced AI-driven code comprehension and visualization system designed to explain source code in natural language and generate visual flow diagrams automatically.
Built on top of CodeT5, this model reads raw Python code and produces a detailed explanation, step-by-step logic breakdown, and a Mermaid flowchart that represents the control flow of the program.
## Quick start
1. Install requirements:
```bash
pip install -r requirements.txt
```
2. Run CLI demo:
```bash
python cli.py --file data_examples/example_code.py
```
3. Copy the Mermaid flowchart text printed by CLI into a Mermaid live editor (https://mermaid.live) or render with mermaid-cli to see the visual flowchart.
## What you get
- `short` one-line explanation
- `detailed` explanation (multi-line)
- `mermaid` flowchart text describing control flow
- `unit_tests` template (pytest)
## How it works
- A sequence-to-sequence model (CodeT5) generates natural language explanations from code.
- `viz_generator.py` parses the function AST and produces a reliable mermaid flowchart.
- Combining both yields both human-friendly narrative and precise structural view.
## Train / Fine-tune
Use `train_docgen.py` with a JSONL dataset (each line: `{"code": "...", "doc": "..."}`).
## License
Apache-2.0
|