/CodSoft_Internship

CodSoft Internship Projects containing, SMS Spam prediction Model, Customer Churn Prediction and Movie Classification System Based On the Movie's Summary

Primary LanguageJupyter Notebook

CodSoft Internship ๐Ÿš€

This project is the first of three projects I am working on during my internship at Codsoft. The internship provides an opportunity to apply theoretical knowledge to real-world problems, enhance technical skills, and gain valuable industry experience.

SMS Spam Prediction Machine Learning Project ๐Ÿ“ฑ๐Ÿค–

This project is the first of three projects undertaken during my internship at Codsoft. It focuses on building a machine learning model to predict SMS spam messages. The dataset used for training and evaluation is imported from Kaggle. The project leverages various technologies such as numpy, pandas, os, and nltk for data manipulation and natural language processing.

alt text

Table of Contents

  1. Project Overview
  2. Technologies Used
  3. Setup and Installation
  4. Dataset
  5. Data Preprocessing
  6. Results

Project Overview ๐Ÿ“

The objective of this project is to classify SMS messages as spam or not spam using machine learning techniques. The project involves data preprocessing, feature extraction, model training, and evaluation.

Technologies Used ๐Ÿ› ๏ธ

  • Python: The primary programming language used.
  • numpy: For numerical operations.
  • pandas: For data manipulation and analysis.
  • os: For handling file paths and directories.
  • nltk: For natural language processing tasks.

Setup and Installation โš™๏ธ

  1. Clone the repository to your local machine:

    git clone https://github.com/ayusharma03/sms-spam-prediction.git
  2. Navigate to the project directory:

    cd sms-spam-prediction
  3. Install the required dependencies:

    pip install -r requirements.txt
  4. Ensure you have the necessary NLTK data:

    import nltk
    nltk.download('stopwords')
    nltk.download('punkt')

Dataset ๐Ÿ“Š

The dataset used in this project is sourced from Kaggle. It contains a collection of SMS messages labeled as spam or not spam.

You can refer to the link Dataset

To load the dataset, the following code is used:

import os
for dirname, _, filenames in os.walk('/kaggle/input'):
    for filename in filenames:
        print(os.path.join(dirname, filename))
        
df1 = pd.read_csv("/"relative_path"/spam.csv", encoding='latin1')

Data Preprocessing ๐Ÿงน

Data preprocessing involves cleaning the text data, tokenizing, removing stop words, and vectorizing the text. The nltk library is used extensively for these tasks.

Results ๐Ÿ“ˆ

I've got a 0.9524% accuracy on the test dataset, highlighting the effectiveness of the model in identifying spam messages.


Feel free to reach out if you have any questions or suggestions. Happy coding! ๐Ÿ’ป