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
Safetensors
Model size
67M params
Tensor type
F32
·
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support

Model tree for kinggreco/my-awesome-model

Finetuned
(12353)
this model