Spaces:
Sleeping
Sleeping
title: Mynotebooksummary | |
emoji: 🔥 | |
colorFrom: yellow | |
colorTo: indigo | |
sdk: gradio | |
sdk_version: 5.25.1 | |
app_file: app.py | |
pinned: false | |
short_description: Summarize Jupyter notebooks | |
# Notebook Enhancer Prototype | |
This tool uses Hugging Face models to automatically enhance Python Jupyter notebooks by adding: | |
1. Descriptive titles before each code cell | |
2. Detailed summaries explaining what the code does | |
## Features | |
- Analyzes Python code in Jupyter notebooks using NLP models | |
- Generates concise titles for each code cell | |
- Creates explanatory summaries of the code's purpose and functionality | |
- User-friendly Gradio interface for easy upload and processing | |
- Works with standard `.ipynb` notebook files | |
## Requirements | |
``` | |
pip install transformers torch gradio nbformat | |
``` | |
## Usage | |
1. Run the application: | |
``` | |
python notebook_enhancer.py | |
``` | |
2. Access the Gradio interface in your browser (typically at http://127.0.0.1:7860) | |
3. Upload a Jupyter notebook file (.ipynb) | |
4. Click "Enhance Notebook" to process the file | |
5. Download the enhanced notebook | |
## How It Works | |
The application uses one Hugging Face model: | |
- "sagard21/python-code-explainer" https://huggingface.co/sagard21/python-code-explainer | |
## Limitations | |
- The Hugging Face models have a maximum input token limit, so very long code cells may be truncated | |
- The quality of summaries depends on the clarity and structure of the original code | |
- Processing large notebooks may take some time due to the NLP models | |
- This is a prototype solution; more tweaking is required | |