NeuralBrief is a full-stack extractive text summarization application built with Python, Flask, Gensim, HTML, CSS, and JavaScript.
The application allows users to paste long-form text or upload TXT, DOCX, and PDF documents, then condenses the content into a shorter summary using TF-IDF sentence modeling and PageRank-based ranking.
No login, account, or database is required.
GitHub Pages frontend:
https://jd-dev-king.github.io/NeuralBrief-Text-Summarizer/
The GitHub Pages version hosts the static user interface. The Python Flask backend must be deployed separately for live summarization to function online.
- Paste articles, reports, or long-form text
- Upload TXT, DOCX, and PDF documents
- Generate extractive summaries
- Adjustable summary retention from 10% to 50%
- Default summary length of 20%
- Copy generated summaries to the clipboard
- Download summaries as TXT files
- Display original and summary word counts
- Display sentence-retention statistics
- Display output-length percentage
- Display processing time
- Drag-and-drop document upload
- Responsive high-tech user interface
- No authentication required
- No database required
- Python
- Flask
- Flask-CORS
- Gensim
- NetworkX
- NumPy
- SciPy
- python-docx
- pypdf
- Werkzeug
- HTML5
- CSS3
- JavaScript
- Fetch API
- GitHub Pages
NeuralBrief uses extractive summarization. Instead of generating new sentences, it selects the most important sentences directly from the original document.
The summarization pipeline:
- Cleans and normalizes the source text.
- Divides the text into sentences.
- Tokenizes each sentence with Gensim.
- Creates a Gensim dictionary and bag-of-words corpus.
- Generates TF-IDF sentence representations.
- Calculates cosine similarity between sentences.
- Builds a sentence-similarity graph.
- Uses PageRank to rank sentence importance.
- Selects the highest-ranked sentences.
- Restores the selected sentences to their original document order.
Because sentence lengths vary, a 20% sentence-retention setting may not produce exactly 20% of the original word count.
| Format | Support |
|---|---|
| TXT | Yes |
| DOCX | Yes |
| Yes | |
| Scanned image-only PDF | No |
Image-only PDFs require optical character recognition, which is not included in the current version.
NeuralBrief-Text-Summarizer/
├── backend/
│ ├── uploads/
│ │ └── .gitkeep
│ ├── app.py
│ ├── config.py
│ ├── document_reader.py
│ ├── requirements.txt
│ ├── summarizer.py
│ ├── test_document_reader.py
│ ├── test_environment.py
│ └── test_summarizer.py
│
├── frontend/
│ ├── assets/
│ ├── css/
│ │ └── style.css
│ ├── js/
│ │ └── app.js
│ └── index.html
│
├── docs/
│ ├── assets/
│ ├── css/
│ │ └── style.css
│ ├── js/
│ │ └── app.js
│ ├── .nojekyll
│ └── index.html
│
├── .gitignore
└── README.md
git clone https://github.com/jd-dev-king/NeuralBrief-Text-Summarizer.git
cd NeuralBrief-Text-Summarizercd backendOn macOS or Linux:
python3.10 -m venv .venv
source .venv/bin/activateOn Windows:
py -3.10 -m venv .venv
.venv\Scripts\activatepython -m pip install --upgrade pip setuptools wheel
python -m pip install -r requirements.txtpython app.pyOpen:
http://127.0.0.1:5000
GET /api/healthExample response:
{
"success": true,
"service": "NeuralBrief Text Summarizer API",
"status": "online",
"default_summary_ratio": 0.2,
"supported_files": [
"docx",
"pdf",
"txt"
]
}POST /api/summarizeExample request:
{
"text": "Long article or document text...",
"ratio": 0.2
}Example response:
{
"success": true,
"summary": "Generated extractive summary...",
"statistics": {
"original_words": 1250,
"summary_words": 245,
"original_sentences": 54,
"summary_sentences": 11,
"compression_percentage": 19.6,
"processing_seconds": 0.18
}
}POST /api/uploadThe request must use multipart form data with:
file: uploaded document
ratio: summary ratio
Supported ratio values range from:
0.10 to 0.50
Run the environment test:
python test_environment.pyRun the summarizer test:
python test_summarizer.pyRun the document reader test:
python test_document_reader.pyThe static GitHub Pages version is stored in:
docs/
GitHub Pages should be configured to deploy from:
Branch: main
Folder: /docs
The frontend hosted on GitHub Pages cannot directly run the Python Flask backend. A public backend deployment URL must be added to:
docs/js/app.js
Update:
const DEPLOYED_API_URL = "";with the deployed backend URL:
const DEPLOYED_API_URL =
"https://your-public-backend-url.com";- No account is required.
- No user information is stored in a database.
- Uploaded files are temporarily saved for processing.
- Temporary uploaded files are deleted after processing.
- The default maximum upload size is 10 MB.
- The application does not support scanned image-only PDFs.
- Extractive summaries may contain transitions that depend on omitted sentences.
- Summary length is based primarily on sentence retention rather than exact word count.
- The GitHub Pages version requires a separately deployed Flask API.
- The current version is optimized primarily for English-language text.
- Deploy the Flask API to a public hosting service
- Add keyword and key-phrase extraction
- Add URL-based article import
- Add article scraping support
- Add OCR support for scanned PDFs
- Add multiple summary modes
- Add sentence highlighting
- Add export to DOCX and PDF
- Add language detection
- Add automated testing
- Add Docker support
- Add backend rate limiting
This project demonstrates experience with:
- Natural language processing
- Extractive text summarization
- Gensim TF-IDF modeling
- PageRank sentence ranking
- Python application development
- Flask REST API development
- Document parsing
- File upload validation
- Responsive web interface design
- JavaScript Fetch API integration
- Git and GitHub
- GitHub Pages deployment
Jeremiah Lupton
GitHub: https://github.com/jd-dev-king
This project is intended for educational and portfolio use.