NewsGenAI

Bangla News Title & Summarizer

Smart, fast, and privacy-conscious Bangla news title generation and summarization with a modern web UI built on Flask.

Overview

NewsGenAI addresses the need for quick information consumption in Bengali media. It allows users to paste lengthy articles and instantly receive a catchy headline or a concise abstractive summary.


The project is built with a focus on privacy and speed. It features a responsive Flask-based backend that can run in-memory mock logic for demos or plug into powerful Transformers (mT5/BanglaT5) for production-grade NLP tasks.

Key Features

What makes NewsGenAI special.

Dual Mode

Switch instantly between generating catchy Titles or detailed Summaries from the same text input.

Privacy First

Input text is processed in-memory. No databases are used, ensuring no user data is ever stored or logged.

Clean UI & UX

Built with Bootstrap 5 and AOS for smooth animations, typing effects, and instant visual feedback.

AI Extensibility

Designed with a plug-in architecture to easily swap mock logic with Hugging Face Transformers models.

Quick Start

Get the app running in minutes.

1. Setup & Install

bash
# Clone repository
git clone https://github.com/kawshik-ornob8/NewsGenAI.git
cd NewsGenAI

# Install baseline dependencies
pip install flask

# (Optional) For Real AI Models
pip install "transformers>=4.36" torch sentencepiece

2. Run Application

bash
# Start the Flask Server
python app.py

# Access in browser:
http://127.0.0.1:5000

API Reference

The backend exposes a simple REST endpoint.

POST /predict

JSON Request
{ "text": "আপনার বাংলা নিউজ কনটেন্ট এখানে দিন ...", "type": "title" // or "summary" }

Response

JSON Response
{ "result": "জেনারেটেড টেক্সট ফলাফল...", "type": "Title", "time": "0.42s" }

Real Model Integration

Replace mock logic with Transformers in app.py

python
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM import torch # Load mT5 Model optimized for Summarization MODEL_NAME = "csebuetnlp/mT5_multilingual_XLSum" tokenizer = AutoTokenizer.from_pretrained(MODEL_NAME) model = AutoModelForSeq2SeqLM.from_pretrained(MODEL_NAME).to(device) def generate_text(text, task_prefix="summarize:"): inputs = tokenizer( f"{task_prefix} {text}", return_tensors="pt", truncation=True ).to(device) outputs = model.generate( **inputs, max_length=80, num_beams=4, no_repeat_ngram_size=2 ) return tokenizer.decode(outputs[0], skip_special_tokens=True)

Tech Stack

Python 3.9+
Flask
Bootstrap 5
Hugging Face Transformers
PyTorch