diegovelilla/email-classification-dataset
Dataset Card for Email Classification Dataset The Email Classification Dataset contains 10,900 English emails originally published as a binary spam/not_spam dataset and extended into a multiclass text classification task as part of the MLOps course at FIB-UPC (Master's in Data Science). Emails labeled not_spam in the original dataset were automatically re-labeled into multiple categories using an LLM. Dataset Details Dataset Description This dataset… See the full description on the dataset page: https://huggingface.co/datasets/diegovelilla/email-classification-dataset.
Dataset Card for Email Classification Dataset
The Email Classification Dataset contains 10,900 English emails originally published as a binary spam/notspam dataset and extended into a multiclass text classification task as part of the MLOps course at FIB-UPC (Master's in Data Science). Emails labeled `notspam` in the original dataset were automatically re-labeled into multiple categories using an LLM.
Dataset Details
Dataset Description
This dataset contains 10,900 English emails for text classification tasks. Originally a binary spam detection dataset (spam/notspam), the `notspam emails were automatically re-labeled into multiple categories using a Large Language Model (LLM), transforming the task into multiclass text classification. The dataset is split into train (8,175 rows, 75%) and test (2,725 rows, 25%) splits. It contains three columns: text (full email body), label (multiclass label assigned via LLM), and original_label` (original binary label for traceability).
- Curated by: Carles Aguilera, Alex Bueno, Joel Delgado, Berta Torrents, Diego Velilla (MLOps Course, FIB-UPC)
- Language(s) (NLP): English
- License: Apache-2.0
Dataset Sources
- Repository: https://huggingface.co/datasets/Deysi/spam-detection-dataset
Uses
Direct Use
- Multiclass Email Classification: Train models to classify emails into multiple categories beyond binary spam detection.
- Binary Spam/Ham Email Classification: Use the
original_labelcolumn for traditional spam detection tasks. - Raw Text for LLM Training: The
textcolumn provides raw English email content suitable for language model pre-training or fine-tuning.
Out-of-Scope Use
- Models trained on this dataset should not be expected to generalize to real-world phishing tactics, as the spam text contains exaggerated, promotional language that may not reflect actual phishing attempts.
- Performance on non-English emails is not tested and likely to be worse.
- Not suitable for applications requiring expert-level multiclass annotation quality, as labels were LLM-generated and may contain noise compared to human expert labeling.
Dataset Structure
Dataset Instances
Each instance contains the following fields:
Dataset Splits
Dataset Creation
Curation Rationale
The dataset was originally published as a binary spam detection dataset. As part of the MLOPS course in the Master's in Data Science at FIB-UPC, the dataset was extended to support multiclass text classification by automatically re-labeling not_spam emails into multiple categories using an LLM. This transformation enables exploration of more nuanced classification tasks beyond binary spam detection.
Source Data
Data Collection and Processing
The original dataset was sourced from Deysi/spam-detection-dataset on Hugging Face, containing 10,900 English emails with binary spam/notspam labels. The `notspam emails were then processed using an LLM to assign multiclass category labels. The original_label` column was retained for traceability, preserving the original binary classification.
Who are the source data producers?
The original binary data was sourced from Deysi and published on Hugging Face. Information from the original dataset's sources is not clear.
Annotations
Annotation process
The multiclass labels derived from not_spam emails were generated automatically using a Large Language Model (LLM). The LLM was prompted to assign category labels to emails originally labeled as not_spam.
EXPLAIN HOW DID WE GENERATE THE MULTICLASS LABELS USING THE LLM
The original_label column is preserved for traceability and validation. The annotation process for the original binary labels is unkwnown.
Bias, Risks, and Limitations
- Synthetic spam style. Original spam texts contain exaggerated, promotional language that may not reflect real-world phishing tactics. Models trained on this dataset may not generalize to real-life spam.
- Temporal drift. Dataset likely reflects spam patterns from its original (and unknown) collection period. Current spam tactics may differ.
- English-only. No multilingual coverage. Performance on non-English email is not tested and likely to be worse.
- LLM annotation noise. The multiclass labels for
not_spamemails have been LLM-generated and may differ from expert annotations.
Recommendations
Users should be made aware of the risks, biases, and limitations of the dataset. Specifically, users should:
- Be cautious when applying models trained on this dataset to real-world spam detection, as the spam style may not generalize.
- Consider validating multiclass labels with human experts if high annotation quality is required.
- Be aware that temporal and linguistic biases may limit applicability to other contexts.
Citation [optional]
BibTeX:
@dataset{email_classification_2026,
author = {Carles Aguilera, Alex Bueno, Joel Delgado, Berta Torrents, Diego Velilla},
title = {Email Classification Dataset},
year = {2026},
publisher = {Hugging Face},
url = {https://huggingface.co/datasets/Deysi/spam-detection-dataset}
}APA:
Aguilera, C., Bueno, A., Delgado, J., Torrents, B., & Velilla, D. (2026). Email Classification Dataset. Hugging Face. https://huggingface.co/datasets/Deysi/spam-detection-dataset
Dataset Card Contact
This project has been carried out by:
