In this project I created a spam or ham text classification model using LSTM.
- After importing the datasets, I encoded the categorical columns.
- Then I used
nltk
or Natural Language Toolkit along withre
or Regular Expression to preprocess the incoming text. - The model consists of one
Input
Layer, oneEmbedding
Layer, oneLSTM
Layer, twoDense
Layer and oneDropout
Layer.
Finally the loss and accuracy graphs were plotted along with a function to check if the given text is SPAM or HAM and what percentage.