Downloads · 30 days
6
4% of all-time downloads
corruptedzayn/distilgpt2-spam-detector
distilgpt2-spam-detector is a text generation model from corruptedzayn. Use it when you need the model to write or continue text. The card lists the license as mit.
This model fine-tunes distilgpt2 on the SMS Spam Collection dataset to classify text messages as spam or ham, framed as a text-generation task.
Downloads · 30 days
6
4% of all-time downloads
All-time downloads
135
Public
Parameters
81.9M
983 MB on disk
Likes
0
Public
Click a slice to open those files.
.safetensors328 MB · 99%
From the Hugging Face model README
This model fine-tunes distilgpt2 on the SMS Spam Collection dataset to classify text messages as spam or ham, framed as a text-generation task.
The model is trained on examples formatted as:
Message: <text>
Label: <ham or spam>
At inference time, feed it "Message: <your text> Label:" and let it generate a
few tokens — it will produce "spam" or "ham".
from transformers import AutoTokenizer, AutoModelForCausalLM
tokenizer = AutoTokenizer.from_pretrained("corruptedzayn/distilgpt2-spam-detector")
model = AutoModelForCausalLM.from_pretrained("corruptedzayn/distilgpt2-spam-detector")
prompt = "Message: Win a free iPhone now, click here!
Label:"
inputs = tokenizer(prompt, return_tensors="pt")
output = model.generate(**inputs, max_new_tokens=5, pad_token_id=tokenizer.eos_token_id)
print(tokenizer.decode(output[0], skip_special_tokens=True))
This is a small demo model trained on a small, English-only, slightly dated dataset. It is not intended for production spam filtering.