# shivambharti-29/sentiment-analysis-rnn-streamlit architecture

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

- Interactive diagram: https://gitdiagram.com/shivambharti-29/sentiment-analysis-rnn-streamlit
- Repository: https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit

## Overview

This is a Streamlit movie-review sentiment app. A user submits a review; the app cleans the text, vectorizes it with TF-IDF, classifies it, and displays a positive/negative result with a confidence score. The README documents the prediction stages; the excerpt confirms the app loads the serialized model and vectorizer and imports the cleaner. The prediction-call details are partly omitted, so those pipeline links are documented relationships rather than inspected call sites.

Main entry points: [`app.py`](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/app.py) (Review App), [`utils/preprocessing.py`](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/utils/preprocessing.py) (Text Cleaning), [`model/vectorizer.pkl`](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/model/vectorizer.pkl) (TF-IDF Vectorizer), [`model/model.pkl`](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/model/model.pkl) (Serialized Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_streamlit["Review App<br/>[app.py]"]
  node_sentiment["Sentiment Result<br/>[app.py]"]
end

subgraph group_inference["Sentiment Inference"]
  node_cleaner["Text Cleaning<br/>[preprocessing.py]"]
  node_tfidf["TF-IDF Vectorizer<br/>[vectorizer.pkl]"]
  node_rnn["RNN Classifier<br/>[app.py]"]
end

subgraph group_artifacts["Model Artifacts"]
  node_weights[("Serialized Model<br/>[model.pkl]")]
end

node_user(("Review Author"))

node_user -->|"submits review"| node_streamlit
node_streamlit -->|"cleans text"| node_cleaner
node_streamlit -->|"vectorizes text"| node_tfidf
node_streamlit -->|"classifies text"| node_rnn
node_streamlit -->|"loads model"| node_weights
node_streamlit -->|"displays prediction"| node_sentiment

click node_streamlit "https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/app.py"
click node_cleaner "https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/utils/preprocessing.py"
click node_tfidf "https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/model/vectorizer.pkl"
click node_rnn "https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/app.py"
click node_weights "https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/model/model.pkl"
click node_sentiment "https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/app.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_streamlit,node_sentiment,node_user toneBlue
class node_cleaner,node_tfidf,node_rnn toneAmber
class node_weights toneMint
```

## Components

### User Interface

- [Review App](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/app.py): `app.py`
- [Sentiment Result](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/app.py): `app.py`

### Sentiment Inference

- [Text Cleaning](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/utils/preprocessing.py): `utils/preprocessing.py`
- [TF-IDF Vectorizer](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/model/vectorizer.pkl): `model/vectorizer.pkl`
- [RNN Classifier](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/app.py): `app.py`

### Model Artifacts

- [Serialized Model](https://github.com/shivambharti-29/sentiment-analysis-rnn-streamlit/blob/main/model/model.pkl): `model/model.pkl`

### Other components

- **Review Author**

## Connections

- Review Author → Review App: submits review (evidence: `README.md`)
- Review App → Text Cleaning: cleans text (evidence: `app.py`)
- Review App → TF-IDF Vectorizer: vectorizes text (evidence: `README.md`)
- Review App → RNN Classifier: classifies text (evidence: `README.md`)
- Review App → Serialized Model: loads model (evidence: `app.py`)
- Review App → Sentiment Result: displays prediction (evidence: `README.md`)
