Instructions to use kinggreco/my-awesome-model with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use kinggreco/my-awesome-model with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("text-classification", model="kinggreco/my-awesome-model")# Load model directly from transformers import AutoTokenizer, AutoModelForSequenceClassification tokenizer = AutoTokenizer.from_pretrained("kinggreco/my-awesome-model") model = AutoModelForSequenceClassification.from_pretrained("kinggreco/my-awesome-model", device_map="auto") - Notebooks
- Google Colab
- Kaggle
my-awesome-model
By using supervised fine-tuning on the ucirvine/sms_spam dataset, you transitioned the model from general language understanding to a specialized security tool capable of recognizing adversarial text patterns and phishing intent.
- Loss: 0.0414
- Accuracy: 0.994
- F1: 0.9806
Model description
The model is a fine-tuned DistilBERT architecture specifically optimized for classifying SMS and email strings as either Ham (safe) or Spam (malicious). By utilizing contextual embeddings and supervised fine-tuning on the ucirvine/sms_spam dataset, it identifies intent and adversarial text patterns that simpler keyword filters often miss.
Intended uses & limitations
The model is designed for cybersecurity applications, serving as a first layer of defense to identify phishing attempts and audit outbound customer support messages for spam-like markers. However, it is limited by a temporal bias toward older SMS spam patterns and requires GPU acceleration to maintain the real-time performance necessary for its auditor applications.
How to run the code
import torch from transformers import AutoTokenizer, AutoModelForSequenceClassification
1. Define the model ID from Hugging Face
model_id = "kinggreco/my-awesome-model"
2. Load the tokenizer and model
tokenizer = AutoTokenizer.from_pretrained(model_id) model = AutoModelForSequenceClassification.from_pretrained(model_id)
3. Prepare your input text
text = "URGENT: Your account has been flagged. Click here to verify now!"
4. Tokenize and predict
inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
with torch.no_grad(): logits = model(**inputs).logits prediction = torch.argmax(logits, dim=-1).item()
5. Output the result (0 = Ham, 1 = Spam)
print(f"Prediction: {'SPAM' if prediction == 1 else 'HAM'}")
Training hyperparameters
The following hyperparameters were used during training:
- learning_rate: 2e-05
- train_batch_size: 16
- eval_batch_size: 8
- seed: 42
- optimizer: Use OptimizerNames.ADAMW_TORCH_FUSED with betas=(0.9,0.999) and epsilon=1e-08 and optimizer_args=No additional optimizer arguments
- lr_scheduler_type: linear
- num_epochs: 3
Training results
| Training Loss | Epoch | Step | Validation Loss | Accuracy | F1 |
|---|---|---|---|---|---|
| No log | 1.0 | 63 | 0.0497 | 0.99 | 0.9682 |
| No log | 2.0 | 126 | 0.0496 | 0.986 | 0.9560 |
| No log | 3.0 | 189 | 0.0414 | 0.994 | 0.9806 |
Framework versions
- Transformers 5.8.0
- Pytorch 2.10.0+cu128
- Datasets 4.0.0
- Tokenizers 0.22.2
- Downloads last month
- 5
Model tree for kinggreco/my-awesome-model
Base model
distilbert/distilbert-base-uncased