File size: 2,200 Bytes
1eb63ff
a7fed31
1eb63ff
 
 
 
 
 
 
 
 
 
a7fed31
 
1eb63ff
4a86a4b
 
 
 
 
 
 
 
 
 
0a89dc3
4a86a4b
0a89dc3
4a86a4b
 
 
 
 
 
 
 
 
 
 
0a89dc3
 
4a86a4b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
0a89dc3
 
4a86a4b
 
 
 
 
 
 
 
 
 
 
 
 
 
0a89dc3
4a86a4b
 
 
 
 
 
 
 
0a89dc3
 
 
 
 
ed4eb4d
 
 
1eb63ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90

---
title: NLP Assistant
emoji: 🧠
colorFrom: blue
colorTo: indigo
sdk: gradio
sdk_version: 5.27.0
app_file: app.py
python_version: 3.11
hardware: cpu-basic
pinned: false
---


# πŸ€– NLP Assistant

A lightweight NLP-powered assistant that provides **summarization**, **news classification**, and **event detection** from text, PDF uploads, or article URLs. Built using `Transformers`, `KeyBERT`, `Streamlit`, and `pdfplumber`.

---

## πŸš€ Features

- πŸ“„ **Summarization** (with sliding window + meta-summary)
- πŸ—žοΈ **News Classification** using `DistilBERT`
- πŸ“Œ **Event Detection** with `KeyBERT`, `spaCy` & `TF-IDF`
- πŸ“₯ Upload **PDFs**
- πŸ”— Input article **URLs** using `newspaper3k`

---

## πŸ› οΈ Tech Stack

- `Streamlit` - Web UI
- `Transformers` (HuggingFace)
- `KeyBERT`
- `pdfplumber` for PDF extraction
- `PyTorch` (auto GPU/CPU)
- `scikit-learn` & `sentence-transformers` for KeyBERT
- `newspaper3k` for url support
- `spacy` & `TfidfVectorizer` for Extracting NER

---

## πŸ“ Folder Structure

nlp_assistant/ β”œβ”€β”€ app.py # Main Streamlit app β”œβ”€β”€ requirements.txt # Python dependencies β”œβ”€β”€ README.md # Project documentation β”œβ”€β”€ assets/ # Optional test PDFs β”‚ └── sample.pdf └── modules/ # Modularized logic β”œβ”€β”€ init.py β”œβ”€β”€ classifier.py # News classification β”œβ”€β”€ event_detector.py # Event detection β”œβ”€β”€ models.py # Model loading β”œβ”€β”€ summarizer.py # Summarization └── utils.py # PDF reader


---

## πŸ§‘β€πŸ’» Getting Started

### 1. Clone the repo

```bash
git clone https://github.com/Raahul-Thakur/NLP-Assistant.git
cd NLP-ASSISTANT
```

### 2. Requirements

pip install -r requirements.txt

### 3. Run the app

streamlit run app.py


Models Used
Task	            Model
Summarization	pszemraj/led-large-book-summary (Long LED Transformer)
Classification	
Event Detection	     KeyBERT with sentence-transformers

---

Let me know if you’d like to:

- Add badges (stars, forks, license)
- Include a demo GIF/screenshot
- contact
  
LinkedIn: https://www.linkedin.com/in/rahul-t-171458190/
Instagram: https://www.instagram.com/rah.ipynb
Gmail: [email protected]

---

## Deployment