Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text Classification for Spam Detection #268

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

sanga28
Copy link

@sanga28 sanga28 commented Jan 16, 2025

Closes: #70

  • Title: Spam Detection Model Integration with Jarvis
  • Your Name: Sanga Bhattacharjee
  • Open Source Program: SWOC

Describe the add-ons or changes you've made 📃

Integrated the spam detection model with Jarvis in a single Python file (jarvis_spam_detector.py).
The single file includes:
Text preprocessing using TfidfVectorizer.
Spam classification using the Multinomial Naive Bayes algorithm.
Model persistence using pickle to avoid repeated training.
Prediction logic compatible with Jarvis's input/output requirements.
Added an interactive command-line interface for testing purposes.

Checklist: ☑️

  • My code follows the Contributing Guidelines & Code of Conduct of this project.
  • This PR does not contain plagiarized content.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly wherever it was hard to understand.
  • My changes generate no new warnings.

Copy link

Thank you for submitting your pull request! We'll review it as soon as possible. For further communication, join our discord server https://discord.gg/tSqtvHUJzE.

Copy link
Owner

@Avdhesh-Varshney Avdhesh-Varshney left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have created a large chunks of commits?

MODEL_FILE = 'jarvis_spam_model.pkl'

# Function to train and save the model
def train_model():
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you training the model? This is an inappropriate. You have to build your model and submit it. Read this conversation

return "Spam" if prediction == 1 else "Not Spam"

# Entry point for Jarvis integration
if __name__ == '__main__':
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No main function should be there. Keep your function name as of file name.

  • File name is only spamDetector.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📃: Text Classification for Spam Detection
2 participants