# fujelhrx/sentiment-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/fujelhrx/sentiment-analysis
- Repository: https://github.com/fujelhrx/sentiment-analysis

## Overview

This small repository is a sentiment-analysis workflow implemented in one Python script. It reads a reviews CSV, explores review text, scores reviews with VADER and RoBERTa, combines the scores with the source data, and visualizes and inspects the comparison. The README also describes preprocessing and extensibility, but the sampled script shows only limited text exploration rather than a separate preprocessing stage. Components share one source file; the graph reflects its visible top-level workflow, not an independently verified notebook implementation.

Main entry points: [`sentiment_analysis.py`](https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py) (Load reviews)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Review workflow"]
  node_script["Analysis script"]
  node_load["Load reviews"]
  node_explore["Explore text"]
end

subgraph group_scoring["Sentiment scoring"]
  node_vader["VADER scoring"]
  node_roberta["RoBERTa scoring"]
end

subgraph group_results["Results and analysis"]
  node_combine["Combine scores"]
  node_visualize["Visualize results"]
  node_inspect["Inspect examples"]
end

node_analyst(("Analyst"))
node_reviews["Reviews CSV"]

node_analyst -->|"runs"| node_script
node_reviews -->|"provides data"| node_load
node_script -->|"reads"| node_load
node_load -->|"supplies reviews"| node_explore
node_load -->|"supplies reviews"| node_vader
node_load -->|"supplies reviews"| node_roberta
node_vader -->|"returns scores"| node_combine
node_roberta -->|"returns scores"| node_combine
node_load -->|"provides review data"| node_combine
node_combine -->|"supplies results"| node_visualize
node_combine -->|"supplies results"| node_inspect

click node_script "https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py"
click node_load "https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py"
click node_explore "https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py"
click node_vader "https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py"
click node_roberta "https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py"
click node_combine "https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py"
click node_visualize "https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py"
click node_inspect "https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.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_script,node_load,node_explore,node_reviews toneBlue
class node_vader,node_roberta toneAmber
class node_combine,node_visualize,node_inspect toneMint
class node_analyst toneIndigo
```

## Components

### Review workflow

- [Analysis script](https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py): `sentiment_analysis.py`
- [Load reviews](https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py): `sentiment_analysis.py`
- [Explore text](https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py): `sentiment_analysis.py`

### Sentiment scoring

- [VADER scoring](https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py): `sentiment_analysis.py`
- [RoBERTa scoring](https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py): `sentiment_analysis.py`

### Results and analysis

- [Combine scores](https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py): `sentiment_analysis.py`
- [Visualize results](https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py): `sentiment_analysis.py`
- [Inspect examples](https://github.com/fujelhrx/sentiment-analysis/blob/main/sentiment_analysis.py): `sentiment_analysis.py`

### Other components

- **Analyst**
- **Reviews CSV**

## Connections

- Analyst → Analysis script: runs (evidence: `README.md`)
- Reviews CSV → Load reviews: provides data (evidence: `sentiment_analysis.py`)
- Analysis script → Load reviews: reads (evidence: `sentiment_analysis.py`)
- Load reviews → Explore text: supplies reviews (evidence: `sentiment_analysis.py`)
- Load reviews → VADER scoring: supplies reviews (evidence: `sentiment_analysis.py`)
- Load reviews → RoBERTa scoring: supplies reviews (evidence: `sentiment_analysis.py`)
- VADER scoring → Combine scores: returns scores (evidence: `sentiment_analysis.py`)
- RoBERTa scoring → Combine scores: returns scores (evidence: `sentiment_analysis.py`)
- Load reviews → Combine scores: provides review data (evidence: `sentiment_analysis.py`)
- Combine scores → Visualize results: supplies results (evidence: `sentiment_analysis.py`)
- Combine scores → Inspect examples: supplies results (evidence: `sentiment_analysis.py`)
