A Python project that uses OpenAI GPT to summarize long text into concise summaries.
Ideal for quickly understanding articles, notes, or any long paragraphs.
- 🎨 Modern Web Interface - Beautiful, responsive UI built with Flask
- 🤖 AI-Powered - Uses OpenAI GPT for intelligent summarization
- 📏 Adjustable Length - Choose between short, medium, or long summaries
- 📊 Statistics - See character count and reduction percentage
- 📋 Copy to Clipboard - Easy one-click copy functionality
- 💻 CLI Support - Command-line interface still available via
main.py
git clone https://github.com/ankitmodanwall/ai-text-summarizer.git
cd ai-text-summarizerpip install -r requirements.txtCreate a .env file in the project root:
cp .env.example .envEdit .env and add your OpenAI API key:
OPENAI_API_KEY=your_openai_api_key_here
OPENAI_MODEL=gpt-3.5-turbo
Get your API key from OpenAI Platform
- Start the Flask server:
python app.py- Open your browser and navigate to:
http://localhost:5000
- Enter your text, choose summary length, and click "Summarize Text"!
Run the CLI version:
python main.pyFollow the prompts to enter text and choose summary length.
ai-text-summarizer/
├── app.py # Flask web application
├── main.py # CLI version
├── requirements.txt # Python dependencies
├── .env # Environment variables (create this)
├── .env.example # Example environment file
├── templates/
│ └── index.html # Web interface HTML
└── static/
├── style.css # Styling
└── script.js # Frontend JavaScript
- Python 3.x
- OpenAI API - GPT models for text summarization
- Flask - Web framework
- HTML/CSS/JavaScript - Frontend interface
- python-dotenv - Environment variable management
- Short: 1-2 sentences - Quick overview
- Medium: 3-4 sentences - Balanced summary (default)
- Long: 6-8 sentences - Detailed summary
Contributions are welcome! Feel free to:
- Report bugs
- Suggest new features
- Submit pull requests
See LICENSE.md for details.
Issue: "OpenAI API key not configured"
- Make sure you created a
.envfile with your API key
Issue: "Module not found"
- Run
pip install -r requirements.txtto install dependencies
Issue: Port 5000 already in use
- Change the port in
app.py:app.run(debug=True, port=5001)
Built with ❤️ using OpenAI GPT