How nethmipamosha/scamlens works
ScamLens is a Streamlit decision-support application that classifies SMS as Legitimate, Spam, or Scam and explains the result. The main workflow runs from message entry through text preprocessing, three-class prediction, tactic detection, and calibrated risk scoring, then presents word-level explanations and safety guidance. Users can also test edited messages, check prediction stability, revisit session history, and explore model insights. The README documents product capabilities; source excerpts show key model and helper implementations, but not every dashboard interaction.
Main entry points: app.py Streamlit dashboard · model.py Risk combiner · train.py Model training · preprocess.py Text preprocessing
Components 15
User experience
- Streamlit dashboard
code/app.py - Session history
code/app.py - Model insights
code/app.py
Message analysis
- Text preprocessing
code/src/preprocess.py - Three-class classifier
code/src/model.py - Risk combiner
code/src/model.py - Tactic detection
code/src/tactics.py
Model lifecycle
- Model training
code/src/train.py - SMS dataset
code/data/sms_phishing.csv
Explanations and robustness
- Word explanations
code/src/explain.py - Safety guidance
code/src/tactics.py - What-if analysis
code/app.py - Stability testing
code/src/stability.py
Other components
- Message sender
- Message analyst
Connections 24
- Message sender → Streamlit dashboard: enters message
README.md - Streamlit dashboard → Text preprocessing: preprocesses text
README.md - Text preprocessing → Three-class classifier: extracts TF-IDF
README.md - Streamlit dashboard → Three-class classifier: requests prediction
README.md - Streamlit dashboard → Tactic detection: detects tactics
code/app.py - Streamlit dashboard → Risk combiner: requests risk score
README.md - Three-class classifier → Risk combiner: supplies class scores
code/src/model.py - Risk combiner → Streamlit dashboard: returns risk result
README.md - Streamlit dashboard → Word explanations: generates explanations
code/app.py - Word explanations → Text preprocessing: formats tokens
code/src/explain.py - Streamlit dashboard → Safety guidance: shows safety tips
code/app.py - Streamlit dashboard → What-if analysis: tests edits
README.md - What-if analysis → Risk combiner: compares risk scores
README.md - Streamlit dashboard → Stability testing: checks robustness
code/app.py - Stability testing → Risk combiner: scores variants
code/src/stability.py - Streamlit dashboard → Session history: stores session results
README.md - Session history → Streamlit dashboard: reopens message
code/app.py - Streamlit dashboard → Model insights: presents metrics
README.md - Message analyst → Model insights: explores metrics
README.md - SMS dataset → Model training: provides examples
code/src/train.py - Model training → Text preprocessing: cleans training text
code/src/train.py - Model training → Three-class classifier: fits classifier
code/src/train.py - Model training → Risk combiner: fits combiner
code/src/train.py - Model training → Model insights: generates evaluation data
README.md