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

Spam detector #273

Closed
wants to merge 18 commits into from
Closed

Spam detector #273

wants to merge 18 commits into from

Conversation

sanga28
Copy link

@sanga28 sanga28 commented Jan 20, 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 📃

This PR introduces the spamDetector function in the file spamDetector.py. The function is designed to classify text input as either "spam" or "not spam" using a pre-trained machine learning model. The implementation adheres to the project requirements by:
Using a Pre-Trained Model:
The function loads a trained model from a .pkl file specified by MODEL_PATH.
The model is pre-trained and not trained within this file.
Matching File and Function Name:
The file name is spamDetector.py, and the function provided is also named spamDetector to comply with naming conventions.
Functionality:
The spamDetector function accepts a single string input (input_text).
Preprocessing is applied (if required for the model).
The function uses the loaded model to predict whether the input text is "spam" or "not spam" and returns the result.
Error Handling:
The code checks for the existence of the trained model file (MODEL_PATH) and raises a FileNotFoundError if it’s missing.
Code Structure:
The code is modular, clean, and adheres to Python best practices (e.g., PEP8 compliance).

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.

@sanga28 sanga28 closed this Jan 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📃: Text Classification for Spam Detection
1 participant