pyspamdetector
pyspamdetector is a Python library that allows you to easily classify text messages as Spam or Not Spam using a pre-trained machine learning model. The library is designed to be simple and intuitive, with built-in methods to classify and describe text messages.
Table of Contents
Usage
Once you have the library installed, you can easily classify text messages. The main features are:
Basic Usage
To classify a message as spam or not, you simply need to import pyspamdetector and call the readText() method. Here's an example:
from pyspamdetector import PySpamDetector
# Instantiate the classifier
detector = PySpamDetector()
# Classify a message
is_spam = detector.readText("Congratulations, you've won a $1000 gift card! Click here to claim your prize.")
# Output classification result
print(is_spam) # Output will be True (Spam) or False (Not Spam)
Method Descriptions
-
readText(text: str) -> bool- Purpose: Classifies the provided text as Spam or Not Spam.
- Arguments:
text(str) - The message you want to classify. - Returns:
bool-Truefor Spam,Falsefor Not Spam.
-
describeText(text: str) -> dict- Purpose: Provides a general description of the message without classifying it.
- Arguments:
text(str) - The message you want to describe. - Returns:
dict- A JSON-like dictionary that includes:- The original message.
- A classification (
SpamorNot Spam). - An advice or warning about the message's nature.
Example:
description = detector.describeText("Congratulations, you've won a $1000 gift card! Click here to claim your prize.")
# Example output
{
"message": "Congratulations, you've won a $1000 gift card! Click here to claim your prize.",
"classification": "Spam",
"advice": "Be cautious! This message appears to be spam. Avoid clicking on links or providing sensitive information."
}
License
pyspamdetector is open-source and released under the GNU General Public License v3 (GPLv3). See the LICENSE file for more details.
Contributing
If you'd like to contribute to the project, feel free to fork the repository and submit a pull request. We welcome improvements and fixes!
Metadata
Release files for pyspamdetector 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| pyspamdetector-0.0.1.tar.gz | 136.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| pyspamdetector-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 271.5 kB
Release files / pyspamdetector-0.0.1.tar.gz
| Download URL | pyspamdetector-0.0.1.tar.gz |
|---|---|
| Size | 136.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0d638c494960c27d9c9beef8a430fb5137127904d9f39691ac05f51c7f9fc60a
|
|
BLAKE2b-256 checksum How to use checksums |
58c6c3c1c9c733728a67a0259703c7876b60dad573b43e4739dcf77a28e09a45
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.2
|
Release files / pyspamdetector-0.0.1-py3-none-any.whl
| Download URL | pyspamdetector-0.0.1-py3-none-any.whl |
|---|---|
| Size | 135.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3ba20cce28f6dd182063d32660094dcac54aaca3e6f685d8fa8e889190abf094
|
|
BLAKE2b-256 checksum How to use checksums |
9f491eb795eb140bfa89aa6dcc23cbe1ccd5752fa7c0a07b05766ad337e8e817
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.0.1 CPython/3.12.2
|