ScamLens quick_score models
Collection
Every model trained for the ScamLens quick_score tool. โข 17 items โข Updated
How to use danjai/scamlens-qs-google-bert-v8 with Transformers:
# Use a pipeline as a high-level helper
from transformers import pipeline
pipe = pipeline("text-classification", model="danjai/scamlens-qs-google-bert-v8") # pip install -U transformers accelerate
# Load model directly
from transformers import AutoTokenizer, AutoModelForSequenceClassification
tokenizer = AutoTokenizer.from_pretrained("danjai/scamlens-qs-google-bert-v8")
model = AutoModelForSequenceClassification.from_pretrained("danjai/scamlens-qs-google-bert-v8", device_map="auto")A classifier that reads the wording of an SMS or chat message and gives the probability that it is a scam.
It is the quick_score tool of ScamLens, a scam-investigation agent built for a university course project (IS469).
This is the model ScamLens runs with.
| Setting | Value |
|---|---|
| base_model | google-bert/bert-base-uncased |
| epochs | 2 |
| lr | 3e-05 |
| batch_size | 8 |
| max_length | 192 |
| warmup_ratio | 0.1 |
| weight_decay | 0.01 |
| scheduler | linear |
| class_weights | balanced |
| val_ratio | 0.2 |
| seed | 42 |
a347f8eb27ae4db455f8e5523e0a983f89bd6be2cbc0af93775291fa5de1ed9b7ffae3e4dad2531b825b5e9ab44278eb3a9e5d09a3e6b4c140ea32bf21e8be23The training data is Singapore-style scam and genuine messages: messages taken from or rebuilt from public scam advisories, synthetic messages, generated bank alerts in genuine and scam pairs, and everyday SMS from public corpora.
import torch
from transformers import AutoModelForSequenceClassification, AutoTokenizer
repo = "danjai/scamlens-qs-google-bert-v8"
tokenizer = AutoTokenizer.from_pretrained(repo)
model = AutoModelForSequenceClassification.from_pretrained(repo).eval()
text = "DBS: Your account is suspended. Verify at dbs-sg-unlock.com"
inputs = tokenizer(text, return_tensors="pt", truncation=True)
with torch.no_grad():
scam_prob = torch.softmax(model(**inputs).logits, dim=-1)[0, 1].item()
print(scam_prob)
Labels: 0 = genuine, 1 = scam.
Add this line to .env. The model downloads the first time quick_score runs.
SCAMLENS_QUICK_SCORE_MODEL=danjai/scamlens-qs-google-bert-v8
ScamLens reads the probability as: high from 0.70, medium from 0.50, low below that.
Base model
google-bert/bert-base-uncased