# nurrasyid14/h architecture

> Architecture diagram of the GitHub repository nurrasyid14/h, 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/nurrasyid14/h
- Repository: https://github.com/nurrasyid14/h

## Overview

IndoToxic 2024 analyzes Indonesian text for toxicity, mood, sentiment, subtopics, and candidate gambling promotions. The documented workflow starts with annotated comments, cleans text, produces TriModel mood/sentiment/subtopic signals, and feeds those signals plus lexicon features to a calibrated toxicity classifier. A separate prediction entry point combines TriModel predictions with a heuristic toxicity score; gambling detection is an independent pattern-based capability. The dashboard is explicitly unimplemented and disconnected from trained models. Several relationships below come from README documentation; unsampled internals are not inferred.

Main entry points: [`src/trimodel_rf.py`](https://github.com/nurrasyid14/h/blob/main/src/trimodel_rf.py) (TriModel coordinator), [`src/predict.py`](https://github.com/nurrasyid14/h/blob/main/src/predict.py) (Text prediction), [`src/preprocessing.py`](https://github.com/nurrasyid14/h/blob/main/src/preprocessing.py) (Text cleaning), [`data/processed/data_cleaned_before_encode.csv`](https://github.com/nurrasyid14/h/blob/main/data/processed/data_cleaned_before_encode.csv) (Cleaned modeling data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data preparation"]
  node_annotated[("Annotated comments")]
  node_cleaning["Text cleaning<br/>[preprocessing.py]"]
  node_cleaned[("Cleaned modeling data")]
end

subgraph group_models["Classification"]
  node_training["Model training<br/>[train.py]"]
  node_tri["TriModel coordinator<br/>[trimodel_rf.py]"]
  node_mood["Mood classifier<br/>[mood_rf.py]"]
  node_sentiment["Sentiment classifier<br/>[sentiment_rf.py]"]
  node_subtopic["Subtopic classifier<br/>[subtopic_rf.py]"]
  node_toxicity["Toxicity SVM<br/>[Toxic_or_not.py]"]
  node_lexicon["Lexicon rules<br/>[rule_toxicity.py]"]
end

subgraph group_inference["Prediction services"]
  node_predict["Text prediction<br/>[predict.py]"]
  node_meter["Toxicity meter<br/>[toxicity_meter.py]"]
  node_gambling["Gambling detector"]
end

subgraph group_dashboard["Dashboard"]
  node_dashboard["Dashboard app"]
end

node_analyst(("Analyst"))
node_xposts[("X posts")]

node_annotated -.->|"clean text"| node_cleaning
node_cleaning -.->|"writes data"| node_cleaned
node_cleaned -.->|"training input"| node_training
node_training -.->|"trains heads"| node_tri
node_tri -->|"fits"| node_mood
node_tri -->|"fits"| node_sentiment
node_tri -->|"fits"| node_subtopic
node_tri -.->|"feeds features"| node_toxicity
node_lexicon -->|"supplies signals"| node_toxicity
node_analyst -.->|"submits text"| node_predict
node_predict -->|"predicts heads"| node_tri
node_predict -->|"scores text"| node_meter
node_analyst -.->|"checks post"| node_gambling
node_xposts -.->|"scans optionally"| node_gambling
node_analyst -.->|"opens dashboard"| node_dashboard

click node_annotated "https://github.com/nurrasyid14/h/blob/main/data/raw/indotoxic2024_annotated_data-3.csv"
click node_cleaning "https://github.com/nurrasyid14/h/blob/main/src/preprocessing.py"
click node_cleaned "https://github.com/nurrasyid14/h/blob/main/data/processed/data_cleaned_before_encode.csv"
click node_training "https://github.com/nurrasyid14/h/blob/main/src/train.py"
click node_tri "https://github.com/nurrasyid14/h/blob/main/src/trimodel_rf.py"
click node_mood "https://github.com/nurrasyid14/h/blob/main/src/classif/mood_rf.py"
click node_sentiment "https://github.com/nurrasyid14/h/blob/main/src/classif/sentiment_rf.py"
click node_subtopic "https://github.com/nurrasyid14/h/blob/main/src/classif/subtopic_rf.py"
click node_toxicity "https://github.com/nurrasyid14/h/blob/main/src/classif/Toxic_or_not.py"
click node_lexicon "https://github.com/nurrasyid14/h/blob/main/src/classif/rule_toxicity.py"
click node_predict "https://github.com/nurrasyid14/h/blob/main/src/predict.py"
click node_meter "https://github.com/nurrasyid14/h/blob/main/src/classif/toxicity_meter.py"
click node_gambling "https://github.com/nurrasyid14/h/blob/main/src/classif/gambling_ad_detector.py"
click node_dashboard "https://github.com/nurrasyid14/h/tree/main/dashboard"

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_annotated,node_cleaning,node_cleaned toneBlue
class node_training,node_tri,node_mood,node_sentiment,node_subtopic,node_toxicity,node_lexicon,node_xposts toneAmber
class node_predict,node_meter,node_gambling toneMint
class node_dashboard toneRose
class node_analyst toneIndigo
```

## Components

### Data preparation

- [Annotated comments](https://github.com/nurrasyid14/h/blob/main/data/raw/indotoxic2024_annotated_data-3.csv): `data/raw/indotoxic2024_annotated_data-3.csv`
- [Text cleaning](https://github.com/nurrasyid14/h/blob/main/src/preprocessing.py): `src/preprocessing.py`
- [Cleaned modeling data](https://github.com/nurrasyid14/h/blob/main/data/processed/data_cleaned_before_encode.csv): `data/processed/data_cleaned_before_encode.csv`

### Classification

- [Model training](https://github.com/nurrasyid14/h/blob/main/src/train.py): `src/train.py`
- [TriModel coordinator](https://github.com/nurrasyid14/h/blob/main/src/trimodel_rf.py): `src/trimodel_rf.py`
- [Mood classifier](https://github.com/nurrasyid14/h/blob/main/src/classif/mood_rf.py): `src/classif/mood_rf.py`
- [Sentiment classifier](https://github.com/nurrasyid14/h/blob/main/src/classif/sentiment_rf.py): `src/classif/sentiment_rf.py`
- [Subtopic classifier](https://github.com/nurrasyid14/h/blob/main/src/classif/subtopic_rf.py): `src/classif/subtopic_rf.py`
- [Toxicity SVM](https://github.com/nurrasyid14/h/blob/main/src/classif/Toxic_or_not.py): `src/classif/Toxic_or_not.py`
- [Lexicon rules](https://github.com/nurrasyid14/h/blob/main/src/classif/rule_toxicity.py): `src/classif/rule_toxicity.py`

### Prediction services

- [Text prediction](https://github.com/nurrasyid14/h/blob/main/src/predict.py): `src/predict.py`
- [Toxicity meter](https://github.com/nurrasyid14/h/blob/main/src/classif/toxicity_meter.py): `src/classif/toxicity_meter.py`
- [Gambling detector](https://github.com/nurrasyid14/h/blob/main/src/classif/gambling_ad_detector.py): `src/classif/gambling_ad_detector.py`

### Dashboard

- [Dashboard app](https://github.com/nurrasyid14/h/tree/main/dashboard): `dashboard`

### Other components

- **Analyst**
- **X posts**

## Connections

- Annotated comments → Text cleaning: clean text (evidence: `README.md`)
- Text cleaning → Cleaned modeling data: writes data (evidence: `README.md`)
- Cleaned modeling data → Model training: training input (evidence: `README.md`)
- Model training → TriModel coordinator: trains heads (evidence: `README.md`)
- TriModel coordinator → Mood classifier: fits (evidence: `src/trimodel_rf.py`)
- TriModel coordinator → Sentiment classifier: fits (evidence: `src/trimodel_rf.py`)
- TriModel coordinator → Subtopic classifier: fits (evidence: `src/trimodel_rf.py`)
- TriModel coordinator → Toxicity SVM: feeds features (evidence: `README.md`)
- Lexicon rules → Toxicity SVM: supplies signals (evidence: `src/classif/Toxic_or_not.py`)
- Analyst → Text prediction: submits text
- Text prediction → TriModel coordinator: predicts heads (evidence: `src/predict.py`)
- Text prediction → Toxicity meter: scores text (evidence: `src/predict.py`)
- Analyst → Gambling detector: checks post
- X posts → Gambling detector: scans optionally (evidence: `README.md`)
- Analyst → Dashboard app: opens dashboard
