# syedanazish-debug/verifier_model architecture

> Architecture diagram of the GitHub repository syedanazish-debug/verifier_model, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-06). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/syedanazish-debug/verifier_model
- Repository: https://github.com/syedanazish-debug/verifier_model

## Overview

Verifier Lense is a Flask-based fake/real news text classifier. The main user flow is submitting article text in the web form, vectorizing it with the saved TF-IDF artifact, classifying it with the saved model, and displaying a label and confidence. Separate scripts prepare labeled data and train or evaluate models. The README mentions broader real-time verification and APIs, but the sampled runtime shows no such integration; the graph reflects the implemented workflow and documented capabilities only where supported. Training-script links are limited to relationships visible in the excerpts.

Main entry points: [`app.py`](https://github.com/syedanazish-debug/verifier_model/blob/main/app.py) (Prediction route), [`dataset_process.py`](https://github.com/syedanazish-debug/verifier_model/blob/main/dataset_process.py) (Dataset preparation), [`templates/index.html`](https://github.com/syedanazish-debug/verifier_model/blob/main/templates/index.html) (News form), [`News _dataset`](https://github.com/syedanazish-debug/verifier_model/tree/main/News%20_dataset) (Combined labeled data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web classification"]
  node_flask["Prediction route<br/>[app.py]"]
  node_form["News form<br/>[index.html]"]
end

subgraph group_artifacts["Inference artifacts"]
  node_classifier["Saved classifier"]
  node_tfidf["Saved TF-IDF"]
end

subgraph group_data["Dataset preparation"]
  node_fake_csv["Fake articles<br/>[Fake.csv]"]
  node_true_csv["Real articles<br/>[True.csv]"]
  node_dataset_process["Dataset preparation<br/>[dataset_process.py]"]
  node_diagnostics["Data diagnostics<br/>[dignostics.py]"]
  node_combined_csv["Combined labeled data"]
end

subgraph group_training["Model development"]
  node_base_training["Baseline training<br/>[baseline_modf.py]"]
  node_split_training["Grouped split<br/>[basetrain_modf.py]"]
  node_refined_training["Refined text model<br/>[control_ref_mod.py]"]
  node_alternate_training["Title classifier<br/>[verifer_model.py]"]
end

node_submitter(("News submitter"))

node_submitter -->|"enters text"| node_form
node_form -->|"posts text"| node_flask
node_flask -->|"vectorizes with"| node_tfidf
node_flask -->|"predicts with"| node_classifier
node_flask -->|"renders result"| node_form
node_dataset_process -->|"reads"| node_fake_csv
node_dataset_process -->|"reads"| node_true_csv
node_dataset_process -->|"writes combined data"| node_combined_csv
node_diagnostics -->|"inspects"| node_fake_csv
node_diagnostics -->|"inspects"| node_true_csv
node_base_training -->|"loads data"| node_combined_csv
node_split_training -->|"loads data"| node_combined_csv
node_refined_training -->|"uses training split"| node_base_training

click node_flask "https://github.com/syedanazish-debug/verifier_model/blob/main/app.py"
click node_form "https://github.com/syedanazish-debug/verifier_model/blob/main/templates/index.html"
click node_classifier "https://github.com/syedanazish-debug/verifier_model/blob/main/model/VERIFIER%20LENSE%20MODEL.pkl"
click node_tfidf "https://github.com/syedanazish-debug/verifier_model/blob/main/model/TF-IDF_VECTORIZIER.pkl"
click node_fake_csv "https://github.com/syedanazish-debug/verifier_model/blob/main/News%20_dataset/Fake.csv"
click node_true_csv "https://github.com/syedanazish-debug/verifier_model/blob/main/News%20_dataset/True.csv"
click node_dataset_process "https://github.com/syedanazish-debug/verifier_model/blob/main/dataset_process.py"
click node_diagnostics "https://github.com/syedanazish-debug/verifier_model/blob/main/dignostics.py"
click node_combined_csv "https://github.com/syedanazish-debug/verifier_model/tree/main/News%20_dataset"
click node_base_training "https://github.com/syedanazish-debug/verifier_model/blob/main/baseline_modf.py"
click node_split_training "https://github.com/syedanazish-debug/verifier_model/blob/main/basetrain_modf.py"
click node_refined_training "https://github.com/syedanazish-debug/verifier_model/blob/main/control_ref_mod.py"
click node_alternate_training "https://github.com/syedanazish-debug/verifier_model/blob/main/verifer_model.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_flask,node_form toneBlue
class node_classifier,node_tfidf toneAmber
class node_fake_csv,node_true_csv,node_dataset_process,node_diagnostics,node_combined_csv toneMint
class node_base_training,node_split_training,node_refined_training,node_alternate_training toneRose
class node_submitter toneIndigo
```

## Components

### Web classification

- [Prediction route](https://github.com/syedanazish-debug/verifier_model/blob/main/app.py): `app.py`
- [News form](https://github.com/syedanazish-debug/verifier_model/blob/main/templates/index.html): `templates/index.html`

### Inference artifacts

- [Saved classifier](https://github.com/syedanazish-debug/verifier_model/blob/main/model/VERIFIER%20LENSE%20MODEL.pkl): `model/VERIFIER LENSE MODEL.pkl`
- [Saved TF-IDF](https://github.com/syedanazish-debug/verifier_model/blob/main/model/TF-IDF_VECTORIZIER.pkl): `model/TF-IDF_VECTORIZIER.pkl`

### Dataset preparation

- [Fake articles](https://github.com/syedanazish-debug/verifier_model/blob/main/News%20_dataset/Fake.csv): `News _dataset/Fake.csv`
- [Real articles](https://github.com/syedanazish-debug/verifier_model/blob/main/News%20_dataset/True.csv): `News _dataset/True.csv`
- [Dataset preparation](https://github.com/syedanazish-debug/verifier_model/blob/main/dataset_process.py): `dataset_process.py`
- [Data diagnostics](https://github.com/syedanazish-debug/verifier_model/blob/main/dignostics.py): `dignostics.py`
- [Combined labeled data](https://github.com/syedanazish-debug/verifier_model/tree/main/News%20_dataset): `News _dataset`

### Model development

- [Baseline training](https://github.com/syedanazish-debug/verifier_model/blob/main/baseline_modf.py): `baseline_modf.py`
- [Grouped split](https://github.com/syedanazish-debug/verifier_model/blob/main/basetrain_modf.py): `basetrain_modf.py`
- [Refined text model](https://github.com/syedanazish-debug/verifier_model/blob/main/control_ref_mod.py): `control_ref_mod.py`
- [Title classifier](https://github.com/syedanazish-debug/verifier_model/blob/main/verifer_model.py): `verifer_model.py`

### Other components

- **News submitter**

## Connections

- News submitter → News form: enters text
- News form → Prediction route: posts text (evidence: `app.py`)
- Prediction route → Saved TF-IDF: vectorizes with (evidence: `app.py`)
- Prediction route → Saved classifier: predicts with (evidence: `app.py`)
- Prediction route → News form: renders result (evidence: `app.py`)
- Dataset preparation → Fake articles: reads (evidence: `dataset_process.py`)
- Dataset preparation → Real articles: reads (evidence: `dataset_process.py`)
- Dataset preparation → Combined labeled data: writes combined data (evidence: `dataset_process.py`)
- Data diagnostics → Fake articles: inspects (evidence: `dignostics.py`)
- Data diagnostics → Real articles: inspects (evidence: `dignostics.py`)
- Baseline training → Combined labeled data: loads data (evidence: `baseline_modf.py`)
- Grouped split → Combined labeled data: loads data (evidence: `basetrain_modf.py`)
- Refined text model → Baseline training: uses training split (evidence: `control_ref_mod.py`)
