|
|
--- |
|
|
dataset_info: |
|
|
features: |
|
|
- name: sms |
|
|
dtype: string |
|
|
- name: label |
|
|
dtype: int64 |
|
|
- name: char_len |
|
|
dtype: int64 |
|
|
- name: word_count |
|
|
dtype: int64 |
|
|
- name: punct_score |
|
|
dtype: int64 |
|
|
- name: spam_keywords |
|
|
dtype: int64 |
|
|
- name: lexical_diversity |
|
|
dtype: float64 |
|
|
- name: readability |
|
|
dtype: float64 |
|
|
- name: caps_ratio |
|
|
dtype: float64 |
|
|
- name: digit_ratio |
|
|
dtype: float64 |
|
|
- name: exclaim_ratio |
|
|
dtype: float64 |
|
|
- name: url_flag |
|
|
dtype: int64 |
|
|
- name: spammy_words |
|
|
dtype: int64 |
|
|
- name: entropy |
|
|
dtype: float64 |
|
|
splits: |
|
|
- name: train |
|
|
num_bytes: 974514 |
|
|
num_examples: 5171 |
|
|
download_size: 446788 |
|
|
dataset_size: 974514 |
|
|
configs: |
|
|
- config_name: default |
|
|
data_files: |
|
|
- split: train |
|
|
path: data/train-* |
|
|
--- |
|
|
|
|
|
# SMS Spam Enriched Dataset |
|
|
|
|
|
An enriched version of the classic **SMS Spam Collection Dataset from UC Irvine** with additional engineered features and semantic embeddings. |
|
|
This dataset is designed for **spam detection, feature engineering experiments, and model interpretability research**. |
|
|
|
|
|
--- |
|
|
|
|
|
## Dataset Overview |
|
|
|
|
|
- **Total samples**: 5,171 |
|
|
- **Classes**: |
|
|
- `0`: Ham (non-spam) |
|
|
- `1`: Spam |
|
|
|
|
|
--- |
|
|
|
|
|
## Enrichments Added |
|
|
|
|
|
Alongside the raw SMS text (`sms`) and labels (`label`), we engineered multiple new features: |
|
|
|
|
|
1. **char_len** → Total characters in the message |
|
|
2. **word_count** → Total words in the message |
|
|
3. **punct_score** → Weighted score for punctuation usage (`!`, `?`, `...`) |
|
|
4. **spam_keywords** → Count of known spammy tokens (`free`, `win`, `urgent`, etc.) |
|
|
5. **lexical_diversity** → Ratio of unique words to total words |
|
|
6. **readability** → Flesch Reading Ease score |
|
|
7. **caps_ratio** → Proportion of uppercase characters |
|
|
8. **digit_ratio** → Proportion of numeric digits |
|
|
9. **exclaim_ratio** → Ratio of exclamation marks to total characters |
|
|
10. **url_flag** → Binary indicator for presence of URLs |
|
|
11. **spammy_words** → Count of flagged high-signal words |
|
|
12. **entropy** → Shannon entropy of characters |
|
|
13. **embeddings** → Sentence-transformer vector representations (for downstream tasks like clustering, semantic similarity, visualization) |
|
|
|
|
|
--- |
|
|
|
|
|
## Example Row |
|
|
|
|
|
| sms | label | char_len | word_count | punct_score | spam_keywords | lexical_diversity | readability | caps_ratio | digit_ratio | url_flag | entropy | |
|
|
|------------------------------------------------|-------|----------|------------|-------------|---------------|-------------------|-------------|------------|-------------|----------|---------| |
|
|
| "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 | |
|
|
|
|
|
--- |
|
|
|
|
|
## Visualizations |
|
|
|
|
|
Below is a **PCA projection** of SMS embeddings, showing clear separation between spam (red) and ham (blue): |
|
|
|
|
|
 |
|
|
|
|
|
--- |
|
|
|
|
|
## Benchmark Models |
|
|
|
|
|
We trained baseline classifiers using the enriched dataset: |
|
|
|
|
|
- **Logistic Regression (with combined features)** |
|
|
- Accuracy: ~99% |
|
|
- F1 (spam): ~0.95 |
|
|
|
|
|
- **Random Forest (with combined features)** |
|
|
- Accuracy: ~98% |
|
|
- F1 (spam): ~0.92 |
|
|
|
|
|
Logistic Regression Report (Combined Features): |
|
|
|
|
|
|
|
|
precision recall f1-score support |
|
|
|
|
|
0 0.99 1.00 0.99 904 |
|
|
1 0.98 0.92 0.95 131 |
|
|
|
|
|
accuracy 0.99 1035 |
|
|
|
|
|
|
|
|
macro avg 0.99 0.96 0.97 1035 |
|
|
|
|
|
|
|
|
weighted avg 0.99 0.99 0.99 1035 |
|
|
|
|
|
|
|
|
Random Forest Report (Combined Features): |
|
|
precision recall f1-score support |
|
|
|
|
|
0 0.98 1.00 0.99 904 |
|
|
1 0.99 0.86 0.92 131 |
|
|
|
|
|
accuracy 0.98 1035 |
|
|
|
|
|
macro avg 0.99 0.93 0.96 1035 |
|
|
|
|
|
weighted avg 0.98 0.98 0.98 1035 |
|
|
|
|
|
--- |
|
|
|
|
|
## Use Cases |
|
|
|
|
|
- Spam detection model training |
|
|
- Feature engineering demonstration |
|
|
- Embedding-based similarity and clustering tasks |
|
|
- Educational material for NLP + ML pipelines |
|
|
|
|
|
--- |
|
|
|
|
|
## Citation |
|
|
|
|
|
If you use this dataset, please cite the original SMS Spam Collection dataset: |
|
|
|
|
|
> @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)", }. |
|
|
|
|
|
> Dataset Enrichment and Feature Engineering contributions by Naga Adithya Kaushik (GenAIDevTOProd). |
|
|
--- |
|
|
|
|
|
## License |
|
|
|
|
|
This dataset is distributed under the same terms as the original SMS Spam dataset (publicly available for research). |
|
|
|
|
|
--- |
|
|
|
|
|
|