Skip to content

Commit 7219e56

Browse files
authored
Revise README for demo script and project details
Updated the README to include a new demo script and improved clarity in sections.
1 parent 18d1e7d commit 7219e56

1 file changed

Lines changed: 33 additions & 13 deletions

File tree

README.md

Lines changed: 33 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,56 @@
88

99
> A PyTorch-based 1D Convolutional Neural Network for real-world text classification tasks. Includes tokenization, padded sequence handling, GPU-accelerated training, performance evaluation, and reproducible preprocessing utilities.
1010
11-
---
11+
## 🚀 Quickstart Demo (For Reviewers)
1212

13-
## 🚀 Quickstart Demo
13+
Run a simple inference example using sample text:
1414

1515
```bash
1616
pip install -r requirements.txt
17-
python run_demo.py
17+
python demo_predict.py
1818
```
1919

20-
Runs an end-to-end example using a sample complaint for inference.
20+
This confirms preprocessing, embedding, convolutional feature extraction, and classifier output.
21+
22+
---
23+
24+
## 📦 Full Training Run
25+
26+
Train the full 1D-CNN model:
27+
28+
```bash
29+
python train_cnn_classifier.py
30+
```
31+
32+
This script handles:
33+
34+
- Tokenization + vocabulary
35+
- Sequence batching
36+
- CNN feature extraction
37+
- Classification head training
38+
- Train/validation split
39+
- Accuracy reporting
2140

2241
---
2342

2443
## 📁 Files
2544

2645
```text
2746
train_cnn_classifier.py # Full supervised training script
28-
run_demo.py # Sample inference demo
47+
run_demo.py # Example inference demo
2948
requirements.txt # Dependencies
3049
```
3150

3251
---
3352

3453
## 🏗 Overview
3554

36-
- Token embedding layer
37-
- 1D convolutional feature extractor
38-
- Global max pooling layer
39-
- Fully connected classification head
40-
- Cross-entropy loss + accuracy tracking
55+
- Token Embedding → Conv1D → Global Max Pool → Linear Classifier
56+
- Efficient for short-to-medium text sequences
57+
- Demonstrates convolutional NLP modeling
58+
- Fast training even on CPU
4159

42-
This design balances speed, simplicity, and performance for text classification.
60+
This architecture is commonly used for sentiment analysis and short-text classification.
4361

4462
---
4563

@@ -50,7 +68,8 @@ This design balances speed, simplicity, and performance for text classification.
5068
├── train_cnn_classifier.py
5169
├── run_demo.py
5270
├── requirements.txt
53-
└── CONTRIBUTING.md
71+
├── CONTRIBUTING.md
72+
└── SECURITY.md
5473
```
5574

5675
---
@@ -113,9 +132,10 @@ Embedding layer -> [batch, seq_len, embed_dim]
113132
---
114133

115134
## 🤝 Contributing
116-
See CONTRIBUTING.md for guidelines on code style and submitting pull requests.
135+
See `CONTRIBUTING.md` for coding style, branching strategy, and PR workflow.
117136

118137
---
119138

120139
## 📄 License
121140
MIT License. See `LICENSE` for details.
141+

0 commit comments

Comments
 (0)