# duty00/job-scam-dectection architecture

> Architecture diagram of the GitHub repository duty00/job-scam-dectection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/duty00/job-scam-dectection
- Repository: https://github.com/duty00/job-scam-dectection

## Overview

This repository is a reproducible NLP project for screening English job postings for scam signals. Its main workflow downloads and audits EMSCAD, removes duplicates and groups related postings before creating leakage-resistant splits, then compares traditional text models and GloVe features, selects a model and threshold on validation, and evaluates the locked test set. An optional TextCNN benchmark and an explanatory prediction demo extend that workflow. Source excerpts show the main module dependencies; some stage transitions are documented only in the README.

Main entry points: [`modules/experiment.py`](https://github.com/duty00/job-scam-dectection/blob/main/modules/experiment.py) (Experiment workflow), [`modules/data.py`](https://github.com/duty00/job-scam-dectection/blob/main/modules/data.py) (Data audit and splits), [`run_deep_learning.py`](https://github.com/duty00/job-scam-dectection/blob/main/run_deep_learning.py) (TextCNN CLI), [`modules/deep_learning.py`](https://github.com/duty00/job-scam-dectection/blob/main/modules/deep_learning.py) (TextCNN training)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_config["Run configuration<br/>[config.py]"]
  node_data_pipeline["Data audit and splits<br/>[data.py]"]
  node_eda["Exploratory analysis<br/>[eda.py]"]
end

subgraph group_experiments["Model experiments"]
  node_cli["Experiment CLI<br/>[run_experiments.py]"]
  node_workflow["Experiment workflow<br/>[experiment.py]"]
  node_features["BoW and TF-IDF<br/>[experiment.py]"]
  node_glove["GloVe pooling<br/>[embeddings.py]"]
  node_traditional_models["Traditional candidates<br/>[experiment.py]"]
  node_evaluation["Thresholds and metrics<br/>[evaluation.py]"]
  node_experiment_results["Experiment artifacts"]
end

subgraph group_deep["Deep learning"]
  node_deep_cli["TextCNN CLI"]
  node_textcnn["TextCNN training<br/>[deep_learning.py]"]
  node_deep_results["TextCNN artifacts"]
end

subgraph group_demo["Prediction demo"]
  node_demo["Explanation demo<br/>[inference.py]"]
  node_demo_model["Fitted demo model"]
end

node_analyst(("Project user"))
node_emscad[("EMSCAD postings")]
node_glove_source[("Pretrained GloVe")]

node_analyst -->|"runs experiments"| node_cli
node_cli -->|"starts workflow"| node_workflow
node_workflow -->|"uses settings"| node_config
node_workflow -->|"loads and prepares"| node_data_pipeline
node_data_pipeline -->|"downloads data"| node_emscad
node_workflow -->|"creates analysis"| node_eda
node_data_pipeline -->|"provides split text"| node_features
node_workflow -->|"extracts features"| node_features
node_workflow -->|"builds representations"| node_glove
node_glove -->|"loads vectors"| node_glove_source
node_features -->|"feeds candidates"| node_traditional_models
node_traditional_models -->|"selects on validation"| node_evaluation
node_evaluation -->|"records scores"| node_experiment_results
node_workflow -->|"saves selection and models"| node_experiment_results
node_analyst -.->|"runs benchmark"| node_deep_cli
node_deep_cli -->|"prepares shared data"| node_workflow
node_deep_cli -->|"runs TextCNN"| node_textcnn
node_textcnn -->|"selects and scores"| node_evaluation
node_textcnn -->|"writes metrics"| node_deep_results
node_analyst -.->|"submits posting"| node_demo
node_demo -->|"cleans text"| node_data_pipeline
node_demo -->|"loads fitted bundle"| node_demo_model

click node_cli "https://github.com/duty00/job-scam-dectection/blob/main/run_experiments.py"
click node_config "https://github.com/duty00/job-scam-dectection/blob/main/modules/config.py"
click node_data_pipeline "https://github.com/duty00/job-scam-dectection/blob/main/modules/data.py"
click node_eda "https://github.com/duty00/job-scam-dectection/blob/main/modules/eda.py"
click node_workflow "https://github.com/duty00/job-scam-dectection/blob/main/modules/experiment.py"
click node_features "https://github.com/duty00/job-scam-dectection/blob/main/modules/experiment.py"
click node_glove "https://github.com/duty00/job-scam-dectection/blob/main/modules/embeddings.py"
click node_traditional_models "https://github.com/duty00/job-scam-dectection/blob/main/modules/experiment.py"
click node_evaluation "https://github.com/duty00/job-scam-dectection/blob/main/modules/evaluation.py"
click node_experiment_results "https://github.com/duty00/job-scam-dectection/tree/main/results"
click node_deep_cli "https://github.com/duty00/job-scam-dectection/blob/main/run_deep_learning.py"
click node_textcnn "https://github.com/duty00/job-scam-dectection/blob/main/modules/deep_learning.py"
click node_deep_results "https://github.com/duty00/job-scam-dectection/tree/main/results"
click node_demo "https://github.com/duty00/job-scam-dectection/blob/main/modules/inference.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_config,node_data_pipeline,node_eda,node_analyst toneBlue
class node_cli,node_workflow,node_features,node_glove,node_traditional_models,node_evaluation,node_experiment_results,node_emscad,node_glove_source toneAmber
class node_deep_cli,node_textcnn,node_deep_results toneMint
class node_demo,node_demo_model toneRose
```

## Components

### Data preparation

- [Run configuration](https://github.com/duty00/job-scam-dectection/blob/main/modules/config.py): `modules/config.py`
- [Data audit and splits](https://github.com/duty00/job-scam-dectection/blob/main/modules/data.py): `modules/data.py`
- [Exploratory analysis](https://github.com/duty00/job-scam-dectection/blob/main/modules/eda.py): `modules/eda.py`

### Model experiments

- [Experiment CLI](https://github.com/duty00/job-scam-dectection/blob/main/run_experiments.py): `run_experiments.py`
- [Experiment workflow](https://github.com/duty00/job-scam-dectection/blob/main/modules/experiment.py): `modules/experiment.py`
- [BoW and TF-IDF](https://github.com/duty00/job-scam-dectection/blob/main/modules/experiment.py): `modules/experiment.py`
- [GloVe pooling](https://github.com/duty00/job-scam-dectection/blob/main/modules/embeddings.py): `modules/embeddings.py`
- [Traditional candidates](https://github.com/duty00/job-scam-dectection/blob/main/modules/experiment.py): `modules/experiment.py`
- [Thresholds and metrics](https://github.com/duty00/job-scam-dectection/blob/main/modules/evaluation.py): `modules/evaluation.py`
- [Experiment artifacts](https://github.com/duty00/job-scam-dectection/tree/main/results): `results`

### Deep learning

- [TextCNN CLI](https://github.com/duty00/job-scam-dectection/blob/main/run_deep_learning.py): `run_deep_learning.py`
- [TextCNN training](https://github.com/duty00/job-scam-dectection/blob/main/modules/deep_learning.py): `modules/deep_learning.py`
- [TextCNN artifacts](https://github.com/duty00/job-scam-dectection/tree/main/results): `results`

### Prediction demo

- [Explanation demo](https://github.com/duty00/job-scam-dectection/blob/main/modules/inference.py): `modules/inference.py`
- **Fitted demo model**

### Other components

- **Project user**
- **EMSCAD postings**
- **Pretrained GloVe**

## Connections

- Project user → Experiment CLI: runs experiments (evidence: `README.md`)
- Experiment CLI → Experiment workflow: starts workflow (evidence: `run_experiments.py`)
- Experiment workflow → Run configuration: uses settings (evidence: `modules/experiment.py`)
- Experiment workflow → Data audit and splits: loads and prepares (evidence: `modules/experiment.py`)
- Data audit and splits → EMSCAD postings: downloads data (evidence: `modules/data.py`)
- Experiment workflow → Exploratory analysis: creates analysis (evidence: `modules/experiment.py`)
- Data audit and splits → BoW and TF-IDF: provides split text (evidence: `README.md`)
- Experiment workflow → BoW and TF-IDF: extracts features (evidence: `README.md`)
- Experiment workflow → GloVe pooling: builds representations (evidence: `README.md`)
- GloVe pooling → Pretrained GloVe: loads vectors (evidence: `modules/embeddings.py`)
- BoW and TF-IDF → Traditional candidates: feeds candidates (evidence: `README.md`)
- Traditional candidates → Thresholds and metrics: selects on validation (evidence: `README.md`)
- Thresholds and metrics → Experiment artifacts: records scores
- Experiment workflow → Experiment artifacts: saves selection and models (evidence: `modules/experiment.py`)
- Project user → TextCNN CLI: runs benchmark (evidence: `README.md`)
- TextCNN CLI → Experiment workflow: prepares shared data (evidence: `run_deep_learning.py`)
- TextCNN CLI → TextCNN training: runs TextCNN (evidence: `run_deep_learning.py`)
- TextCNN training → Thresholds and metrics: selects and scores (evidence: `modules/deep_learning.py`)
- TextCNN training → TextCNN artifacts: writes metrics (evidence: `modules/deep_learning.py`)
- Project user → Explanation demo: submits posting (evidence: `README.md`)
- Explanation demo → Data audit and splits: cleans text (evidence: `modules/inference.py`)
- Explanation demo → Fitted demo model: loads fitted bundle (evidence: `modules/inference.py`)
