Spam Detection SLM

A custom Small Language Model project for detecting spam and ham messages.

Project Overview

This project uses a custom Transformer-based classifier to classify text messages as Spam or Ham.

Model Architecture

  • Custom Qwen-inspired Transformer
  • Vocabulary size: 151669
  • Embedding dimension: 128
  • Attention heads: 4
  • KV groups: 2
  • Transformer layers: 2
  • Feed-forward dimension: 256
  • Output classes: 2

Labels

  • 0 = Ham
  • 1 = Spam

Dataset

Training dataset contains 28,544 records.

  • Ham: 13,998
  • Spam: 14,546
  • Columns: text, label

Dataset: https://huggingface.co/datasets/Pannuru/Spam-Detection-Dataset

Files

  • spam_slm_model.pth
  • config.json
  • dataset_info.json
  • tokenizer/
  • requirements.txt

Usage

Load the matching tokenizer and custom model architecture, then load spam_slm_model.pth using PyTorch.

Ollama Demo

Ollama Qwen2.5 0.5B is used as an explanation assistant alongside the custom PyTorch spam classifier. The classifier performs the Spam/Ham prediction.

GitHub

Add your GitHub repository URL here.

Note

This checkpoint is a binary text classifier, not a standalone generative language model.

GGUF and Ollama Compatibility

This project uses a custom PyTorch Transformer architecture for binary Spam and Ham classification. The trained model is provided in .pth format.

Direct GGUF conversion and standard Ollama execution are not currently supported because the custom classification architecture requires a dedicated inference implementation.

Ollama Qwen2.5 0.5B is used separately as an explanation assistant, while the custom PyTorch model performs the actual Spam/Ham classification.

Downloads last month
153
GGUF
Model size
19.7M params
Architecture
spam_transformer_classifier
Hardware compatibility
Log In to add your hardware

We're not able to determine the quantization variants.

Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support