SMS Spam Collection Dataset
5,574 SMS messages labeled as ham or spam for text classification tasks
The SMS spam dataset from the UCI Machine Learning Repository contains 5,574 labeled messages for text classification and natural language processing tasks, making it a classic small dataset for NLP beginners.
Classic NLP text classification dataset, suitable for beginners in natural language processing
The data comes from real mobile text messages, including daily conversations and various spam promotional messages, with a natural and authentic language style.
Each message is labeled as ham (normal) or spam (junk), with high labeling quality, suitable for supervised learning.
Text length is moderate, and language is concise, making it very suitable for beginners to learn text preprocessing, TF-IDF, and bag-of-words models.
Spam messages account for only 13.4%, allowing practice with various techniques for handling class imbalance issues.
Can be used for comparative experiments of various text classification methods such as Naive Bayes, SVM, and deep learning.
Originating from the UCI Machine Learning Repository, widely used as a standard text classification benchmark in the NLP community.
From basic text classification to advanced NLP, with a rich variety of application scenarios
Build a spam text message filter, the most classic application scenario for Naive Bayes classification
Practice techniques for tokenization, removing stop words, TF-IDF, and other text feature extraction methods
Use models like LSTM and BERT for text classification, comparing with traditional methods
Practice techniques for handling class imbalance such as oversampling, undersampling, and weighted loss
The following are examples of the first few rows of the SMS spam dataset
label,message ham,"Go until jurong point, crazy.. Available only in bugis n great world la e buffet..." ham,Ok lar... Joking wif u oni... spam,"Free entry in 2 a wkly comp to win FA Cup final tkts 21st May 2005." ham,"U dun say so early hor... U c already then say..." ham,"Nah I don't think he goes to usf, he lives around here though"
From browsing to analysis, you can start your data science project in just a few minutes
View dataset details on the Ace Data Cloud platform, understand field descriptions, sample size, and licensing agreements.
Download the CSV file (486 KB), which contains all labeled SMS data.
Use pandas.read_csv() to load the data, along with sklearn.feature_extraction.text for feature extraction.
A classic NLP dataset, open license, available for immediate download. 5,574 real labeled SMS messages, ideal for getting started with text classification and spam detection.