This is a simple yet effective neural network that is used to train a model to distinguish between spam and ham emails. It uses NLP concept to index the words present on the trainning data and feeds the indexed sentences to the deep learning model which after processing the data through various layers produces the output 0 or 1 corresponding to spam and ham. It produced 99% accuracy on the trainning data and 96% accuracy on the validation data.
I ALSO TESTED IT WITH THE SPAM EMAILS I RECEIVED ON MY GMAIL AND IT PREDICTED THEM AS SPAM SUCCESSFULLY .