Code Monkey home page Code Monkey logo

ambarish-224 / sms_spam_classifier Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 751 KB

A Natural Language Processing with SMS Data to predict whether the SMS is Spam/Ham with various ML Algorithms like multinomialNB & GaussianNB to compare accuracy and using various data cleaning and processing techniques like PorterStemmer,CountVectorizer. It is implemented using LSTM and Word Embeddings to gain accuracy of 97.70% .

Jupyter Notebook 100.00%
bag-of-words count-vectorizer gaussian-naive-bayes multinomial-naive-bayes naive-bayes-classifier nlp nlp-machine-learning sms-spam-detection

sms_spam_classifier's Introduction

SMS_SPAM_Classifier

I have used an naive bayes model along with natural language processing to create this model.

Porter Stemmer, Bag of words are the nlp techniques used for text preprocessing This model will be able to classify a message as spam or ham with an accuracy of 97 percent.

The machine learning algorithm used here is GaussianNB and MultinomialNB which uses bayes theorem from probability.

sms_spam_classifier's People

Contributors

ambarish-224 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

sms_spam_classifier's Issues

ModuleNotFoundError when importing Sequential from Keras

Hello,

I’m encountering an issue when trying to import the Sequential class from Keras. Here’s the code I’m running:

from keras.models import Sequential
from keras.layers import Embedding, LSTM, Dense

model = Sequential()
model.add(Embedding(10000, 64, input_length=80))
model.add(LSTM(100))
model.add(Dense(2, activation='sigmoid'))
model.compile(loss='binary_crossentropy', metrics=['accuracy'], optimizer='adam')

When I run this code, I get the following error:

Cell In[80], line 1
----> 1 model=Sequential()
      2 model.add(Embedding(10000,64,input_length=80))
      3 model.add(LSTM(100))

File c:\Users\Isaac\anaconda3\envs\textattackenv\lib\site-packages\keras\engine\training.py:184, in __new__(cls, *args, **kwargs)

File c:\Users\Isaac\anaconda3\envs\textattackenv\lib\site-packages\keras\utils\version_utils.py:61, in __new__(cls, *args, **kwargs)

File c:\Users\Isaac\anaconda3\envs\textattackenv\lib\site-packages\keras\utils\generic_utils.py:1221, in __getattr__(self, item)

File c:\Users\Isaac\anaconda3\envs\textattackenv\lib\site-packages\keras\utils\generic_utils.py:1212, in _load(self)

File c:\Users\Isaac\anaconda3\envs\textattackenv\lib\importlib\__init__.py:127, in import_module(name, package)
    125             break
    126         level += 1
--> 127 return _bootstrap._gcd_import(name[level:], package, level)

File <frozen importlib._bootstrap>:1014, in _gcd_import(name, package, level)

File <frozen importlib._bootstrap>:991, in _find_and_load(name, import_)

File <frozen importlib._bootstrap>:973, in _find_and_load_unlocked(name, import_)

ModuleNotFoundError: No module named 'keras.engine.base_layer_v1'

I’m not sure why this is happening. I’ve tried reinstalling Keras and TensorFlow, but the issue persists. Any help would be greatly appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.