# nishahussain03-afk/cyberbullying-detection-project architecture

> Architecture diagram of the GitHub repository nishahussain03-afk/cyberbullying-detection-project, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-23). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nishahussain03-afk/cyberbullying-detection-project
- Repository: https://github.com/nishahussain03-afk/cyberbullying-detection-project

## Overview

This repository provides a Streamlit app that accepts text, cleans it, combines a TF-IDF/model prediction with a keyword check, and displays a detection result. The README also describes model training and includes a dataset and notebook; their implementation details and connections are not shown in the sampled source, so they are represented as a separate development branch without inferred data-flow edges.

Main entry points: [`app.py`](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py) (Streamlit app), [`tfidf_vectorizer.pkl`](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/tfidf_vectorizer.pkl) (TF-IDF vectorizer), [`cyberbullying_model.pkl`](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/cyberbullying_model.pkl) (Classifier model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web application"]
  node_app["Streamlit app<br/>[app.py]"]
  node_result["Displayed result<br/>[app.py]"]
end

subgraph group_inference["Text inference"]
  node_clean["Text cleaning<br/>[app.py]"]
  node_vectorizer["TF-IDF vectorizer"]
  node_model["Classifier model"]
  node_keyword["Keyword check<br/>[app.py]"]
  node_decision["Final decision<br/>[app.py]"]
end

subgraph group_training["Training assets"]
  node_dataset["Training dataset<br/>[dataset.csv]"]
  node_notebook["Training notebook"]
end

node_user(("User"))

node_user -->|"enters text"| node_app
node_app -->|"cleans text"| node_clean
node_app -->|"transforms text"| node_vectorizer
node_clean -->|"cleaned text"| node_vectorizer
node_app -->|"predicts"| node_model
node_vectorizer -->|"feature vector"| node_model
node_app -->|"checks keywords"| node_keyword
node_app -->|"applies decision"| node_decision
node_model -->|"prediction"| node_decision
node_keyword -->|"keyword match"| node_decision
node_decision -->|"selects message"| node_result
node_app -->|"displays result"| node_result

click node_app "https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py"
click node_clean "https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py"
click node_vectorizer "https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/tfidf_vectorizer.pkl"
click node_model "https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/cyberbullying_model.pkl"
click node_keyword "https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py"
click node_decision "https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py"
click node_result "https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py"
click node_dataset "https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/dataset.csv"
click node_notebook "https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/Cyberbullying_web.ipynb"

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_app,node_result,node_user toneBlue
class node_clean,node_vectorizer,node_model,node_keyword,node_decision toneAmber
class node_dataset,node_notebook toneMint
```

## Components

### Web application

- [Streamlit app](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py): `app.py`
- [Displayed result](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py): `app.py`

### Text inference

- [Text cleaning](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py): `app.py`
- [TF-IDF vectorizer](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/tfidf_vectorizer.pkl): `tfidf_vectorizer.pkl`
- [Classifier model](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/cyberbullying_model.pkl): `cyberbullying_model.pkl`
- [Keyword check](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py): `app.py`
- [Final decision](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/app.py): `app.py`

### Training assets

- [Training dataset](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/dataset.csv): `dataset.csv`
- [Training notebook](https://github.com/nishahussain03-afk/cyberbullying-detection-project/blob/main/Cyberbullying_web.ipynb): `Cyberbullying_web.ipynb`

### Other components

- **User**

## Connections

- User → Streamlit app: enters text
- Streamlit app → Text cleaning: cleans text
- Streamlit app → TF-IDF vectorizer: transforms text
- Text cleaning → TF-IDF vectorizer: cleaned text
- Streamlit app → Classifier model: predicts
- TF-IDF vectorizer → Classifier model: feature vector
- Streamlit app → Keyword check: checks keywords
- Streamlit app → Final decision: applies decision
- Classifier model → Final decision: prediction
- Keyword check → Final decision: keyword match
- Final decision → Displayed result: selects message
- Streamlit app → Displayed result: displays result
