An AI-powered news article classification web app built with Flask and Groq's LLaMA 3.3 70B model.
🔗 https://newsclassifier-759q.onrender.com
⚠️ Hosted on Render free tier — may take 30-60 seconds to wake up on first visit.
- Paste any news article and get instant AI-powered classification
- Identifies category with confidence level (High/Medium/Low)
- Provides a one-line reason for classification
- Extracts top 3 keywords from the article
- Clean dark-themed UI
- Flask — Web framework
- Groq LLaMA 3.3 70B — AI classification model (free tier)
- LangChain — LLM orchestration
- Render — Cloud deployment
- Docker — Containerized deployment
- Gunicorn — Production WSGI server
| Category | Example Topics |
|---|---|
| Politics | Elections, Government, Policy |
| Technology | AI, Software, Gadgets |
| Sports | Football, Cricket, Olympics |
| Business | Markets, Economy, Startups |
| Entertainment | Movies, Music, Celebrity |
| Health | Medicine, Fitness, Nutrition |
| Science | Research, Space, Discovery |
| World | International News, Diplomacy |
| Environment | Climate, Nature, Conservation |
| Crime | Law, Justice, Security |
- Python 3.11+
- Groq API key (free at console.groq.com)
- Clone the repository:
git clone https://github.com/dhrubak2004/NewsClassifier.git
cd NewsClassifier- Install dependencies:
pip install -r requirements.txt- Create a
.envfile:
GROQ_API_KEY=your_groq_api_key- Run the app:
python app.py- Fork this repository
- Go to render.com → New → Web Service
- Connect your GitHub repo
- Select Docker as runtime
- Add environment variable:
GROQ_API_KEY=your_key - Click Create Web Service
- Open the app at https://newsclassifier-759q.onrender.com
- Paste any news article into the text box
- Click "Classify Article"
- View the result:
- Category — the news topic
- Confidence — High / Medium / Low
- Reason — why it was classified that way
- Keywords — top 3 keywords from the article
- Add support for URL input (auto-fetch article from link)
- Multi-language classification
- Batch classification of multiple articles
- Export results as CSV
This project is licensed under the MIT License.
