Downloads Β· 30 days
17
8% of all-time downloads
Rainnighttram/Scam_Detection
Scam_Detection is a machine learning model from Rainnighttram. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
A fine-tuned Llama 3.2 1B model specifically designed to detect and classify scam SMS messages in Hong Kong, with support for both Traditional Chinese and English text.
Downloads Β· 30 days
17
8% of all-time downloads
All-time downloads
210
Public
Repo size
5 GB
Likes
0
Public
Click a slice to open those files.
.gguf2.5 GB Β· 50%
From the Hugging Face model README
A fine-tuned Llama 3.2 1B model specifically designed to detect and classify scam SMS messages in Hong Kong, with support for both Traditional Chinese and English text.
This model is based on Meta's Llama 3.2 1B and has been fine-tuned using MLX framework on a carefully curated dataset of SMS messages collected in Hong Kong. The model can effectively distinguish between legitimate and fraudulent SMS messages in both Traditional Chinese and English.
| Specification | Details |
|---|---|
| Base Model | Meta Llama 3.2 1B |
| Fine-tuning Framework | MLX |
| Model Format | GGUF |
| Languages | Traditional Chinese, English |
| Training Data | Self-collected Hong Kong SMS samples |
| Model Size | ~2.5GB |
| Context Length | 8,192 tokens |
Install llama.cpp
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp
make
Download the model
# Download your model file (replace with actual download link)
wget [MODEL_DOWNLOAD_URL] -O scam_sms_detector.gguf
Run inference
./main -m scam_sms_detector.gguf -p "Classify this SMS: ζεζ¨δΈηδΊοΌθ«ι»ζιζ₯ι εηι" -n 50
# English SMS
./main -m scam_sms_detector.gguf -p "Classify: Congratulations! You've won $10,000. Click here to claim your prize!" -n 30
# Traditional Chinese SMS
./main -m scam_sms_detector.gguf -p "ει‘ζ€ηδΏ‘οΌζ¨ηιθ‘賬ζΆε·²θ’«εη΅οΌθ«η«ε³ι»ζιζ₯ι©θθΊ«δ»½" -n 30
import subprocess
import json
def classify_sms(text):
cmd = [
"./main",
"-m", "scam_sms_detector.gguf",
"-p", f"Classify this SMS as SCAM or LEGITIMATE: {text}",
"-n", "10"
]
result = subprocess.run(cmd, capture_output=True, text=True)
return result.stdout.strip()
# Example usage
messages = [
"Your package is ready for delivery. Track: https://bit.ly/track123",
"Meeting scheduled for 3 PM tomorrow in conference room A",
"ζεοΌζ¨ε·²θ’«ιΈδΈη²εΎε
θ²»iPhoneοΌθ«ι»ζι ε"
]
for msg in messages:
classification = classify_sms(msg)
print(f"Message: {msg}")
print(f"Classification: {classification}\n")
# Simple Flask API wrapper
from flask import Flask, request, jsonify
import subprocess
app = Flask(__name__)
@app.route('/classify', methods=['POST'])
def classify_sms():
data = request.json
sms_text = data.get('text', '')
cmd = [
"./main",
"-m", "scam_sms_detector.gguf",
"-p", f"Classify: {sms_text}",
"-n", "20"
]
result = subprocess.run(cmd, capture_output=True, text=True)
return jsonify({
'text': sms_text,
'classification': result.stdout.strip(),
'confidence': 'high' # You may want to implement confidence scoring
})
if __name__ == '__main__':
app.run(host='0.0.0.0', port=5000)
You are welcomed to contributions to improve the model: