Skip to content

About

This project is an SMS text classification model. This model can be used to classify the incoming SMS text as scam SMS or non-scam SMS.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SMS-text-classification-model

This project is an SMS text classification model. This model can be used to classify the incoming SMS text as scam SMS or non-scam SMS.

Operating environment

  1. Python 3.7 or later
  2. PyTorch 1.9.0 or later
  3. Scikit-learn 0.24.2 or later
  4. NLTK 3.6.2 or later
  5. Pandas 1.3.0 or later

Run command

First, run main.py
Then, code will be executed in sequence:

  1. Rule-based scam SMS recognition model
  2. Scams recognition model based on traditional machine learning
  3. Scams recognition model based on Convolutional neural network (add PCA dimensionality reduction)
  4. Scams recognition model based on convolutional neural network (without adding PCA dimension reduction) CPU and memory consumption increase in turn

Dataset

The dataset contains 5,574 SMS texts and their corresponding classification labels, which are mainly used for SMS text classification tasks. Each record in the dataset contains two columns:
1.sms: indicates the SMS content. The type is a string.
2.label: indicates the category label. The type is an integer, where:
  '0' means normal SMS (non-spam SMS)
  '1' indicates spam messages

sms label
Go until jurong point, crazy.. Available only in bugis n great world la e buffet... Cine there got amore wat... 0
Ok lar... Joking wif u oni... 0
Free entry in 2 a wkly comp to win FA Cup final tkts 21st May 2005. Text FA to 87121 to receive entry question(std txt rate)T&C's apply 08452810075over18's 1
U dun say so early hor... U c already then say... 0
Nah I don't think he goes to usf, he lives around here though 0

Model

  1. Based on rules:According to daily experience, the keywords that may appear in fraud information are extracted and classified by direct judgment.
  2. Based on traditional machine learning:TF-IDF is used to extract the feature vector from each short message. A naive Bayes classifier is used to classify short message texts.
  3. Convolutional neural network based: The convolutional neural network is trained to process the feature vectors and find the appropriate parameters to complete the establishment of the model. (At the same time, PCA processing can reduce the dimension of the feature vector and greatly improve the speed, but the accuracy will be slightly decreased).

Achieve effect

微信图片_20240620183756

About

This project is an SMS text classification model. This model can be used to classify the incoming SMS text as scam SMS or non-scam SMS.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages