# bhanusrikarsai/ai-humanizer architecture

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

- Interactive diagram: https://gitdiagram.com/bhanusrikarsai/ai-humanizer
- Repository: https://github.com/bhanusrikarsai/ai-humanizer

## Overview

AI Humanizer is a web dashboard and text-processing service for analyzing and rewriting submitted prose. The principal backend workflow is entity extraction and locking, style analysis, contextual rewriting, then factuality validation with corrective retries; low-robotic-score text may bypass rewriting. The dashboard also exposes detector analysis, comparison, entity and validation details, settings, and export capabilities documented in the README. Backend orchestration and several module relationships are visible in excerpts or the SOURCE INDEX; many UI interactions and deployment-specific API routes were not sampled, so those connections are omitted rather than inferred.

Main entry points: [`backend/app.py`](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/app.py) (Backend API), [`backend/pipeline.py`](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/pipeline.py) (Workflow Orchestrator), [`frontend/src/App.jsx`](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/App.jsx) (Dashboard App), [`backend/ner_module.py`](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/ner_module.py) (Entity Locking)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_dashboard_app["Dashboard App<br/>[App.jsx]"]
  node_detector_view["Detector View"]
  node_tone_controls["Tone Controls"]
  node_entity_inspector["Entity Inspector"]
  node_comparison["Text Comparison"]
  node_nli_card["NLI Validator Card"]
  node_pipeline_view["Pipeline View"]
  node_style_metrics["Style Metrics"]
end

subgraph group_api["API Surface"]
  node_api_handler["API Handler<br/>[index.js]"]
  node_backend_app["Backend API<br/>[app.py]"]
  node_presets["Text Presets<br/>[presets.py]"]
end

subgraph group_workflow["Rewrite Workflow"]
  node_pipeline["Workflow Orchestrator<br/>[pipeline.py]"]
  node_entity_locking["Entity Locking<br/>[ner_module.py]"]
  node_rewriter["Contextual Rewriter"]
end

subgraph group_analysis["Analysis &amp; Validation"]
  node_style_analysis["Style Analysis"]
  node_factuality["Factuality Validator"]
  node_gemini_detector["Gemini Detector<br/>[gemini_detector.py]"]
end

node_user(("Text User"))

node_user -->|"submits text"| node_dashboard_app
node_dashboard_app -->|"renders"| node_detector_view
node_backend_app -->|"invokes workflow"| node_pipeline
node_backend_app -->|"serves presets"| node_presets
node_backend_app -->|"extracts entities"| node_entity_locking
node_backend_app -->|"analyzes style"| node_style_analysis
node_backend_app -->|"validates rewrite"| node_factuality
node_backend_app -->|"enhances detection"| node_gemini_detector
node_pipeline -->|"locks entities"| node_entity_locking
node_pipeline -->|"scores style"| node_style_analysis
node_pipeline -->|"rewrites text"| node_rewriter
node_pipeline -->|"checks meaning"| node_factuality
node_pipeline -->|"retries with feedback"| node_rewriter

click node_dashboard_app "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/App.jsx"
click node_detector_view "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/AbsoluteDetectorView.jsx"
click node_tone_controls "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/ContextToneControls.jsx"
click node_entity_inspector "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/EntityInspector.jsx"
click node_comparison "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/InputOutputComparison.jsx"
click node_nli_card "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/NliValidatorCard.jsx"
click node_pipeline_view "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/PipelineVisualizer.jsx"
click node_style_metrics "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/StyleMetricsCard.jsx"
click node_api_handler "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/api/index.js"
click node_backend_app "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/app.py"
click node_presets "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/presets.py"
click node_pipeline "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/pipeline.py"
click node_entity_locking "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/ner_module.py"
click node_rewriter "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/contextual_rewriter.py"
click node_style_analysis "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/style_classifier.py"
click node_factuality "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/factuality_validator.py"
click node_gemini_detector "https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/gemini_detector.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_dashboard_app,node_detector_view,node_tone_controls,node_entity_inspector,node_comparison,node_nli_card,node_pipeline_view,node_style_metrics,node_user toneBlue
class node_api_handler,node_backend_app,node_presets toneAmber
class node_pipeline,node_entity_locking,node_rewriter toneMint
class node_style_analysis,node_factuality,node_gemini_detector toneRose
```

## Components

### Dashboard

- [Dashboard App](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Detector View](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/AbsoluteDetectorView.jsx): `frontend/src/components/AbsoluteDetectorView.jsx`
- [Tone Controls](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/ContextToneControls.jsx): `frontend/src/components/ContextToneControls.jsx`
- [Entity Inspector](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/EntityInspector.jsx): `frontend/src/components/EntityInspector.jsx`
- [Text Comparison](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/InputOutputComparison.jsx): `frontend/src/components/InputOutputComparison.jsx`
- [NLI Validator Card](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/NliValidatorCard.jsx): `frontend/src/components/NliValidatorCard.jsx`
- [Pipeline View](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/PipelineVisualizer.jsx): `frontend/src/components/PipelineVisualizer.jsx`
- [Style Metrics](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/frontend/src/components/StyleMetricsCard.jsx): `frontend/src/components/StyleMetricsCard.jsx`

### API Surface

- [API Handler](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/api/index.js): `api/index.js`
- [Backend API](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/app.py): `backend/app.py`
- [Text Presets](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/presets.py): `backend/presets.py`

### Rewrite Workflow

- [Workflow Orchestrator](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/pipeline.py): `backend/pipeline.py`
- [Entity Locking](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/ner_module.py): `backend/ner_module.py`
- [Contextual Rewriter](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/contextual_rewriter.py): `backend/contextual_rewriter.py`

### Analysis & Validation

- [Style Analysis](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/style_classifier.py): `backend/style_classifier.py`
- [Factuality Validator](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/factuality_validator.py): `backend/factuality_validator.py`
- [Gemini Detector](https://github.com/bhanusrikarsai/ai-humanizer/blob/main/backend/gemini_detector.py): `backend/gemini_detector.py`

### Other components

- **Text User**

## Connections

- Text User → Dashboard App: submits text (evidence: `README.md`)
- Dashboard App → Detector View: renders (evidence: `frontend/src/App.jsx`)
- Backend API → Workflow Orchestrator: invokes workflow (evidence: `backend/app.py`)
- Backend API → Text Presets: serves presets (evidence: `backend/app.py`)
- Backend API → Entity Locking: extracts entities (evidence: `backend/app.py`)
- Backend API → Style Analysis: analyzes style (evidence: `backend/app.py`)
- Backend API → Factuality Validator: validates rewrite (evidence: `backend/app.py`)
- Backend API → Gemini Detector: enhances detection (evidence: `backend/app.py`)
- Workflow Orchestrator → Entity Locking: locks entities (evidence: `backend/pipeline.py`)
- Workflow Orchestrator → Style Analysis: scores style (evidence: `backend/pipeline.py`)
- Workflow Orchestrator → Contextual Rewriter: rewrites text (evidence: `backend/pipeline.py`)
- Workflow Orchestrator → Factuality Validator: checks meaning (evidence: `backend/pipeline.py`)
- Workflow Orchestrator → Contextual Rewriter: retries with feedback (evidence: `README.md`)
