# sai-srushee-34/cybercrimecaseclassifier architecture

> Architecture diagram of the GitHub repository sai-srushee-34/cybercrimecaseclassifier, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/sai-srushee-34/cybercrimecaseclassifier
- Repository: https://github.com/sai-srushee-34/cybercrimecaseclassifier

## Overview

This is an end-to-end cybercrime complaint classification project: complaints are curated and partitioned, text is vectorized and classified, and a Flask demo returns a category with confidence and feature explanations. Training compares three model families; evaluation covers both held-out and external data. The graph preserves the documented analysis and reporting stages. Some links rely on README workflow descriptions because their implementation excerpts were not shown; dataset and model artifacts are represented by their existing directories.

Main entry points: [`app.py`](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/app.py) (Flask inference API), [`src/evaluate_model.py`](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/evaluate_model.py) (Test and external evaluation), [`data/processed`](https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/data/processed) (Curated complaints), [`src/train_models.py`](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/train_models.py) (Model training and comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_raw_data[("Raw complaints")]
  node_curation["Curation and redaction<br/>[curate_dataset.py]"]
  node_curated_data[("Curated complaints")]
  node_eda["Exploratory analysis<br/>[eda_analysis.py]"]
  node_splitting["Leakage-safe splits<br/>[split_dataset.py]"]
  node_split_data[("Train, validation, test")]
end

subgraph group_ml["Modeling"]
  node_text_pipeline["Text normalization and TF-IDF<br/>[text_pipeline.py]"]
  node_training["Model training and comparison<br/>[train_models.py]"]
  node_model_artifact[("Selected model pipeline")]
end

subgraph group_eval["Evaluation"]
  node_test_eval["Test and external evaluation<br/>[evaluate_model.py]"]
  node_evaluation_data[("External benchmark")]
  node_reports["Metrics and prediction reports"]
end

subgraph group_serving["Live classification"]
  node_frontend["Complaint input and results UI<br/>[index.html]"]
  node_api["Flask inference API<br/>[app.py]"]
end

node_complainant(("Complaint submitter"))
node_browser(("Web user"))

node_raw_data -->|"curates"| node_curation
node_curation -->|"writes"| node_curated_data
node_curated_data -->|"analyzes"| node_eda
node_curated_data -->|"partitions"| node_splitting
node_splitting -->|"writes"| node_split_data
node_split_data -->|"trains on"| node_training
node_training -->|"uses"| node_text_pipeline
node_training -->|"exports"| node_model_artifact
node_model_artifact -->|"evaluated by"| node_test_eval
node_evaluation_data -->|"benchmarks"| node_test_eval
node_split_data -->|"tests on"| node_test_eval
node_test_eval -->|"generates"| node_reports
node_browser -->|"enters complaint"| node_frontend
node_frontend -->|"posts text"| node_api
node_api -->|"loads model"| node_model_artifact
node_api -->|"infers with"| node_text_pipeline
node_api -->|"returns results"| node_frontend

click node_raw_data "https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/data/raw"
click node_curation "https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/curate_dataset.py"
click node_curated_data "https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/data/processed"
click node_eda "https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/eda_analysis.py"
click node_splitting "https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/split_dataset.py"
click node_split_data "https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/data/processed"
click node_text_pipeline "https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/text_pipeline.py"
click node_training "https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/train_models.py"
click node_model_artifact "https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/models"
click node_test_eval "https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/evaluate_model.py"
click node_evaluation_data "https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/data/final"
click node_reports "https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/reports"
click node_frontend "https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/templates/index.html"
click node_api "https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/app.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_raw_data,node_curation,node_curated_data,node_eda,node_splitting,node_split_data,node_browser toneBlue
class node_text_pipeline,node_training,node_model_artifact toneAmber
class node_test_eval,node_evaluation_data,node_reports toneMint
class node_frontend,node_api toneRose
class node_complainant toneIndigo
```

## Components

### Data preparation

- [Raw complaints](https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/data/raw): `data/raw`
- [Curation and redaction](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/curate_dataset.py): `src/curate_dataset.py`
- [Curated complaints](https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/data/processed): `data/processed`
- [Exploratory analysis](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/eda_analysis.py): `src/eda_analysis.py`
- [Leakage-safe splits](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/split_dataset.py): `src/split_dataset.py`
- [Train, validation, test](https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/data/processed): `data/processed`

### Modeling

- [Text normalization and TF-IDF](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/text_pipeline.py): `src/text_pipeline.py`
- [Model training and comparison](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/train_models.py): `src/train_models.py`
- [Selected model pipeline](https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/models): `models`

### Evaluation

- [Test and external evaluation](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/src/evaluate_model.py): `src/evaluate_model.py`
- [External benchmark](https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/data/final): `data/final`
- [Metrics and prediction reports](https://github.com/sai-srushee-34/cybercrimecaseclassifier/tree/main/reports): `reports`

### Live classification

- [Complaint input and results UI](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/templates/index.html): `templates/index.html`
- [Flask inference API](https://github.com/sai-srushee-34/cybercrimecaseclassifier/blob/main/app.py): `app.py`

### Other components

- **Complaint submitter**
- **Web user**

## Connections

- Raw complaints → Curation and redaction: curates (evidence: `README.md`)
- Curation and redaction → Curated complaints: writes (evidence: `README.md`)
- Curated complaints → Exploratory analysis: analyzes (evidence: `src/eda_analysis.py`)
- Curated complaints → Leakage-safe splits: partitions (evidence: `src/split_dataset.py`)
- Leakage-safe splits → Train, validation, test: writes (evidence: `src/split_dataset.py`)
- Train, validation, test → Model training and comparison: trains on (evidence: `src/train_models.py`)
- Model training and comparison → Text normalization and TF-IDF: uses (evidence: `src/train_models.py`)
- Model training and comparison → Selected model pipeline: exports (evidence: `README.md`)
- Selected model pipeline → Test and external evaluation: evaluated by (evidence: `src/evaluate_model.py`)
- External benchmark → Test and external evaluation: benchmarks (evidence: `src/evaluate_model.py`)
- Train, validation, test → Test and external evaluation: tests on (evidence: `src/evaluate_model.py`)
- Test and external evaluation → Metrics and prediction reports: generates (evidence: `src/evaluate_model.py`)
- Web user → Complaint input and results UI: enters complaint (evidence: `README.md`)
- Complaint input and results UI → Flask inference API: posts text (evidence: `README.md`)
- Flask inference API → Selected model pipeline: loads model (evidence: `app.py`)
- Flask inference API → Text normalization and TF-IDF: infers with (evidence: `app.py`)
- Flask inference API → Complaint input and results UI: returns results (evidence: `README.md`)
