Downloads · 30 days
967
2% of all-time downloads
AntiSpamInstitute/spam-detector-bert-MoE-v2.2
spam-detector-bert-MoE-v2.2 is a machine learning model from AntiSpamInstitute. Use it for the machine learning task on the model card, and read the license before you ship it in a product. The card lists the license as apache-2.0.
[](https://huggingface.co/AntiSpamInstitute/spam-detector-bert-MoE-v2.2) [](LICENSE)
Downloads · 30 days
967
2% of all-time downloads
All-time downloads
44.4K
Public
Parameters
4.4M
17.6 MB on disk
Likes
6
Public
Click a slice to open those files.
.safetensors17.5 MB · 95%
From the Hugging Face model README
The Spam Detector BERT MoE v2.2 is a state-of-the-art natural language processing model designed to accurately classify text messages and content as spam or non-spam. Leveraging a BERT-based architecture enhanced with a Mixture of Experts (MoE) approach, this model achieves high performance and scalability for diverse spam detection applications.
This model is built upon the BERT (Bidirectional Encoder Representations from Transformers) architecture and incorporates a Mixture of Experts (MoE) mechanism to improve its ability to handle a wide variety of spam patterns. The MoE layer allows the model to activate different "experts" (sub-models) based on the input, enhancing its capacity to generalize across different types of spam content.
First, ensure you have the Transformers library installed. You can install it via pip:
pip install transformers
Here's how to quickly get started with the Spam Detector BERT MoE v2.2 model using the Hugging Face transformers library:
from transformers import AutoTokenizer, AutoModelForSequenceClassification
import torch
# Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained("AntiSpamInstitute/spam-detector-bert-MoE-v2.2")
model = AutoModelForSequenceClassification.from_pretrained("AntiSpamInstitute/spam-detector-bert-MoE-v2.2")
# Sample text
texts = [
"Congratulations! You've won a $1,000 Walmart gift card. Click here to claim now.",
"Hey, are we still meeting for lunch today?"
]
# Tokenize the input
inputs = tokenizer(texts, return_tensors="pt", padding=True, truncation=True)
# Get model predictions
with torch.no_grad():
outputs = model(**inputs)
logits = outputs.logits
# Apply softmax to get probabilities
probabilities = torch.softmax(logits, dim=1)
# Get predicted labels
predictions = torch.argmax(probabilities, dim=1)
# Map labels to class names
label_map = {0: "Not Spam", 1: "Spam"}
for text, prediction in zip(texts, predictions):
print(f"Text: {text}\nPrediction: {label_map[prediction.item()]}\n")
Input:
"Limited time offer! Buy one get one free on all products. Visit our store now!"
Output:
Prediction: Spam
The Spam Detector BERT MoE v2.2 employs the following architecture components:
The model was trained on a diverse and extensive dataset comprising:
The training data was preprocessed to remove personally identifiable information (PII) and ensure compliance with data privacy standards.
The Spam Detector BERT MoE v2.2 achieves the following performance metrics on benchmark datasets:
| Dataset | Accuracy | Precision | Recall | F1 Score |
|---|---|---|---|---|
| SMS Spam Collection | 98.5% | 98.7% | 98.3% | 98.5% |
| Enron Email Dataset | 97.8% | 98.0% | 97.5% | 97.7% |
| Social Media Spam | 96.5% | 96.7% | 96.3% | 96.5% |
Note: These metrics are based on the model's performance at the time of release and may vary with different data distributions.
The Spam Detector BERT MoE v2.2 is intended for use in the following applications:
While the Spam Detector BERT MoE v2.2 demonstrates high accuracy, users should be aware of the following limitations:
If you use the Spam Detector BERT MoE v2.2 in your research or applications, please cite it as follows:
@misc{AntiSpamInstitute_spam-detector-bert-MoE-v2.2,
author = {AntiSpamInstitute},
title = {spam-detector-bert-MoE-v2.2},
year = {2024},
publisher = {Hugging Face},
url = {https://huggingface.co/AntiSpamInstitute/spam-detector-bert-MoE-v2.2}
}
This model is released under the Apache 2.0 License. Please review the license terms before using the model.
For questions, issues, or contributions, please reach out:
This README was generated to provide comprehensive information about the Spam Detector BERT MoE v2.2 model. For the latest updates and more detailed documentation, please visit the Hugging Face model page.