# nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection architecture

> Architecture diagram of the GitHub repository nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-09-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection
- Repository: https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection

## Overview

##### Project type and purpose
- This is a Python-based NLP/ML research project organized as a set of Jupyter notebooks.
- Its goal is to build and evaluate classifiers for hate speech and offensive language identification (OLID), comparing traditional ML models and embeddings (fastText, GloVe).

##### File structure
- Top-level files are four notebooks:
- NLP_ML_Hate_Speech.ipynb
- NLP_ML_OLID.ipynb
- NLP_fasttext_gloveipynb_Embedding_Hate_Speech_.ipynb
- NLP_fasttext_gloveipynb_Embedding_OLID_.ipynb
- README.md declares “Python project with ML and DL” but has no further structure.
- No dedicated “src” code folder, so the notebooks themselves contain data‐prep, modeling, and evaluation code.

##### README for additional insights
- Minimal content—no architecture details, dependencies, or external‐service calls.
- We infer reliance on standard Python ML/DL libraries (scikit-learn, TensorFlow/PyTorch, fastText, GloVe).

##### Key points to capture
- Modularity: swapping out an embedding or a classifier is a single‐component change.
- A model packaging/containerization step (e.g., Docker)
- A serving layer (REST API)
- A frontend or dashboard consuming predictions

## Diagram (Mermaid)

```mermaid
flowchart TB
    %% Project Overview
    Overview["Project Overview / README"]:::external
    click Overview "https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection/blob/main/README.md"

    %% Hate Speech Pipeline
    subgraph "Hate Speech Pipeline"
        HS_Data["Raw Hate Speech Dataset"]:::data
        HS_Preproc["Preprocessing & Data Split"]:::preprocess
        HS_Embed["Embedding Module"]:::embedding
        HS_fasttext["fastText Embedder"]:::embedding
        HS_glove["GloVe Embedder"]:::embedding
        HS_Model["Model Training & Selection"]:::model
        HS_ml["Traditional ML (SVM, LR)"]:::model
        HS_nn["Neural Network"]:::model
        HS_Eval["Evaluation & Reporting"]:::evaluation
    end

    %% OLID Pipeline
    subgraph "OLID Pipeline"
        OLID_Data["Raw OLID Dataset"]:::data
        OLID_Preproc["Preprocessing & Data Split"]:::preprocess
        OLID_Embed["Embedding Module"]:::embedding
        OLID_fasttext["fastText Embedder"]:::embedding
        OLID_glove["GloVe Embedder"]:::embedding
        OLID_Model["Model Training & Selection"]:::model
        OLID_ml["Traditional ML (SVM, LR)"]:::model
        OLID_nn["Neural Network"]:::model
        OLID_Eval["Evaluation & Reporting"]:::evaluation
    end

    %% Data flow - Hate Speech
    HS_Data -->|"raw text"| HS_Preproc
    HS_Preproc -->|"cleaned text"| HS_Embed
    HS_Embed -->|"embedding vectors"| HS_Model
    HS_Model -->|"predicted labels, metrics"| HS_Eval

    %% Embedding branches - Hate Speech
    HS_Embed --- HS_fasttext
    HS_Embed --- HS_glove
    HS_fasttext --> HS_Model
    HS_glove --> HS_Model

    %% Model branches - Hate Speech
    HS_Model --- HS_ml
    HS_Model --- HS_nn
    HS_ml --> HS_Eval
    HS_nn --> HS_Eval

    %% Data flow - OLID
    OLID_Data -->|"raw text"| OLID_Preproc
    OLID_Preproc -->|"cleaned text"| OLID_Embed
    OLID_Embed -->|"embedding vectors"| OLID_Model
    OLID_Model -->|"predicted labels, metrics"| OLID_Eval

    %% Embedding branches - OLID
    OLID_Embed --- OLID_fasttext
    OLID_Embed --- OLID_glove
    OLID_fasttext --> OLID_Model
    OLID_glove --> OLID_Model

    %% Model branches - OLID
    OLID_Model --- OLID_ml
    OLID_Model --- OLID_nn
    OLID_ml --> OLID_Eval
    OLID_nn --> OLID_Eval

    %% Click Events - Hate Speech
    click HS_Preproc "https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection/blob/main/NLP_ML_Hate_Speech.ipynb"
    click HS_Model "https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection/blob/main/NLP_ML_Hate_Speech.ipynb"
    click HS_fasttext "https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection/blob/main/NLP_fasttext_gloveipynb_Embedding_Hate_Speech_.ipynb"
    click HS_glove "https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection/blob/main/NLP_fasttext_gloveipynb_Embedding_Hate_Speech_.ipynb"

    %% Click Events - OLID
    click OLID_Preproc "https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection/blob/main/NLP_ML_OLID.ipynb"
    click OLID_Model "https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection/blob/main/NLP_ML_OLID.ipynb"
    click OLID_fasttext "https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection/blob/main/NLP_fasttext_gloveipynb_Embedding_OLID_.ipynb"
    click OLID_glove "https://github.com/nabilbadri/combining-fasttext-and-glove-word-embedding-for-offensive-and-hate-speech-text-detection/blob/main/NLP_fasttext_gloveipynb_Embedding_OLID_.ipynb"

    %% Styles
    classDef data fill:#B3D4FC,stroke:#333,stroke-width:1px
    classDef preprocess fill:#C6E2B3,stroke:#333,stroke-width:1px
    classDef embedding fill:#8CD3E8,stroke:#333,stroke-width:1px
    classDef model fill:#F9C66A,stroke:#333,stroke-width:1px
    classDef evaluation fill:#D3D3D3,stroke:#333,stroke-width:1px
    classDef external fill:#EFEFEF,stroke:#333,stroke-width:1px
    classDef dashedlink stroke-dasharray:5 5,stroke:#666
```
