Update README.md
Browse files
README.md
CHANGED
|
@@ -41,3 +41,114 @@ configs:
|
|
| 41 |
- split: train
|
| 42 |
path: data/train-*
|
| 43 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
- split: train
|
| 42 |
path: data/train-*
|
| 43 |
---
|
| 44 |
+
|
| 45 |
+
# SMS Spam Enriched Dataset
|
| 46 |
+
|
| 47 |
+
An enriched version of the classic **SMS Spam Collection Dataset from UC Irvine** with additional engineered features and semantic embeddings.
|
| 48 |
+
This dataset is designed for **spam detection, feature engineering experiments, and model interpretability research**.
|
| 49 |
+
|
| 50 |
+
---
|
| 51 |
+
|
| 52 |
+
## Dataset Overview
|
| 53 |
+
|
| 54 |
+
- **Total samples**: 5,171
|
| 55 |
+
- **Classes**:
|
| 56 |
+
- `0`: Ham (non-spam)
|
| 57 |
+
- `1`: Spam
|
| 58 |
+
|
| 59 |
+
---
|
| 60 |
+
|
| 61 |
+
## Enrichments Added
|
| 62 |
+
|
| 63 |
+
Alongside the raw SMS text (`sms`) and labels (`label`), we engineered multiple new features:
|
| 64 |
+
|
| 65 |
+
1. **char_len** β Total characters in the message
|
| 66 |
+
2. **word_count** β Total words in the message
|
| 67 |
+
3. **punct_score** β Weighted score for punctuation usage (`!`, `?`, `...`)
|
| 68 |
+
4. **spam_keywords** β Count of known spammy tokens (`free`, `win`, `urgent`, etc.)
|
| 69 |
+
5. **lexical_diversity** β Ratio of unique words to total words
|
| 70 |
+
6. **readability** β Flesch Reading Ease score
|
| 71 |
+
7. **caps_ratio** β Proportion of uppercase characters
|
| 72 |
+
8. **digit_ratio** β Proportion of numeric digits
|
| 73 |
+
9. **exclaim_ratio** β Ratio of exclamation marks to total characters
|
| 74 |
+
10. **url_flag** β Binary indicator for presence of URLs
|
| 75 |
+
11. **spammy_words** β Count of flagged high-signal words
|
| 76 |
+
12. **entropy** β Shannon entropy of characters
|
| 77 |
+
13. **embeddings** β Sentence-transformer vector representations (for downstream tasks like clustering, semantic similarity, visualization)
|
| 78 |
+
|
| 79 |
+
---
|
| 80 |
+
|
| 81 |
+
## Example Row
|
| 82 |
+
|
| 83 |
+
| sms | label | char_len | word_count | punct_score | spam_keywords | lexical_diversity | readability | caps_ratio | digit_ratio | url_flag | entropy |
|
| 84 |
+
|------------------------------------------------|-------|----------|------------|-------------|---------------|-------------------|-------------|------------|-------------|----------|---------|
|
| 85 |
+
| "Free entry in 2 a wkly comp to win FA Cup..." | 1 | 156 | 28 | 0 | 3 | 0.857 | 80.83 | 0.064 | 0.16 | 0 | 4.69 |
|
| 86 |
+
|
| 87 |
+
---
|
| 88 |
+
|
| 89 |
+
## Visualizations
|
| 90 |
+
|
| 91 |
+
Below is a **PCA projection** of SMS embeddings, showing clear separation between spam (red) and ham (blue):
|
| 92 |
+
|
| 93 |
+

|
| 94 |
+
|
| 95 |
+
---
|
| 96 |
+
|
| 97 |
+
## Benchmark Models
|
| 98 |
+
|
| 99 |
+
We trained baseline classifiers using the enriched dataset:
|
| 100 |
+
|
| 101 |
+
- **Logistic Regression (with combined features)**
|
| 102 |
+
- Accuracy: ~99%
|
| 103 |
+
- F1 (spam): ~0.95
|
| 104 |
+
|
| 105 |
+
- **Random Forest (with combined features)**
|
| 106 |
+
- Accuracy: ~98%
|
| 107 |
+
- F1 (spam): ~0.92
|
| 108 |
+
|
| 109 |
+
Logistic Regression Report (Combined Features):
|
| 110 |
+
precision recall f1-score support
|
| 111 |
+
|
| 112 |
+
0 0.99 1.00 0.99 904
|
| 113 |
+
1 0.98 0.92 0.95 131
|
| 114 |
+
|
| 115 |
+
accuracy 0.99 1035
|
| 116 |
+
macro avg 0.99 0.96 0.97 1035
|
| 117 |
+
weighted avg 0.99 0.99 0.99 1035
|
| 118 |
+
|
| 119 |
+
|
| 120 |
+
Random Forest Report (Combined Features):
|
| 121 |
+
precision recall f1-score support
|
| 122 |
+
|
| 123 |
+
0 0.98 1.00 0.99 904
|
| 124 |
+
1 0.99 0.86 0.92 131
|
| 125 |
+
|
| 126 |
+
accuracy 0.98 1035
|
| 127 |
+
macro avg 0.99 0.93 0.96 1035
|
| 128 |
+
weighted avg 0.98 0.98 0.98 1035
|
| 129 |
+
|
| 130 |
+
---
|
| 131 |
+
|
| 132 |
+
## Use Cases
|
| 133 |
+
|
| 134 |
+
- Spam detection model training
|
| 135 |
+
- Feature engineering demonstration
|
| 136 |
+
- Embedding-based similarity and clustering tasks
|
| 137 |
+
- Educational material for NLP + ML pipelines
|
| 138 |
+
|
| 139 |
+
---
|
| 140 |
+
|
| 141 |
+
## Citation
|
| 142 |
+
|
| 143 |
+
If you use this dataset, please cite the original SMS Spam Collection dataset:
|
| 144 |
+
|
| 145 |
+
> @inproceedings{Almeida2011SpamFiltering, title={Contributions to the Study of SMS Spam Filtering: New Collection and Results}, author={Tiago A. Almeida and Jose Maria Gomez Hidalgo and Akebo Yamakami}, year={2011}, booktitle = "Proceedings of the 2011 ACM Symposium on Document Engineering (DOCENG'11)", }.
|
| 146 |
+
|
| 147 |
+
---
|
| 148 |
+
|
| 149 |
+
## License
|
| 150 |
+
|
| 151 |
+
This dataset is distributed under the same terms as the original SMS Spam dataset (publicly available for research).
|
| 152 |
+
|
| 153 |
+
---
|
| 154 |
+
|