# rameshrocks-cyber/rnn-project architecture

> Architecture diagram of the GitHub repository rameshrocks-cyber/rnn-project, 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/rameshrocks-cyber/rnn-project
- Repository: https://github.com/rameshrocks-cyber/rnn-project

## Overview

This repository builds and deploys a recurrent-neural-network sentiment classifier. The main user workflow is submitting a review through the Streamlit app and receiving a sentiment label with confidence; a standalone inference API offers a separate entry point. The training workflow prepares and splits reviews, fits tokenization, trains SimpleRNN/LSTM/GRU variants, and evaluates them. The graph includes documented benchmarking and artifact export capabilities; unsampled implementation details are not expanded beyond README-supported relationships.

Main entry points: [`saved_models`](https://github.com/rameshrocks-cyber/rnn-project/tree/main/saved_models) (Saved Models and Configs), [`src/train.py`](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/train.py) (Training Orchestrator), [`src/preprocessor.py`](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/preprocessor.py) (Text Preprocessing), [`src/evaluate.py`](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/evaluate.py) (Model Evaluation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data_model["Data and Modeling"]
  node_loader["Load and Split<br/>[data_loader.py]"]
  node_preprocess["Text Preprocessing<br/>[preprocessor.py]"]
  node_config["Model Configuration<br/>[config.py]"]
  node_architectures["RNN LSTM GRU<br/>[model.py]"]
end

subgraph group_training_eval["Training and Evaluation"]
  node_trainer["Training Orchestrator<br/>[train.py]"]
  node_evaluator["Model Evaluation<br/>[evaluate.py]"]
  node_charts["Benchmark Charts"]
end

subgraph group_inference["Inference Products"]
  node_web_app["Streamlit Review App<br/>[app.py]"]
  node_modular_predictor["Modular Predictor<br/>[predict.py]"]
  node_production_engine["Production Inference Engine<br/>[prediction.py]"]
  node_api_reexport["Inference API Re-export<br/>[prediction.py]"]
end

subgraph group_artifacts["Model Artifacts"]
  node_exporter["Artifact Export"]
  node_model_store["Saved Models and Configs"]
end

node_reviewer(("Review Submitter"))
node_dataset["Raw Reviews"]
node_result["Sentiment and Confidence"]

node_dataset -->|"loads reviews"| node_loader
node_loader -->|"cleans and encodes"| node_preprocess
node_trainer -->|"loads and splits"| node_loader
node_trainer -->|"fits and transforms"| node_preprocess
node_trainer -->|"builds model"| node_architectures
node_architectures -->|"uses parameters"| node_config
node_trainer -->|"uses settings"| node_config
node_trainer -->|"saves model and history"| node_model_store
node_evaluator -->|"loads test data"| node_loader
node_evaluator -->|"checks manual reviews"| node_modular_predictor
node_evaluator -->|"transforms test text"| node_preprocess
node_evaluator -->|"loads model artifacts"| node_model_store
node_charts -.->|"writes comparisons"| node_model_store
node_exporter -->|"loads tokenizer"| node_preprocess
node_exporter -->|"exports deployment files"| node_model_store
node_reviewer -->|"submits review"| node_web_app
node_web_app -->|"loads cached artifacts"| node_model_store
node_web_app -->|"returns sentiment"| node_result
node_web_app -.->|"offers model choices"| node_architectures
node_modular_predictor -->|"transforms review"| node_preprocess
node_modular_predictor -->|"loads model and tokenizer"| node_model_store
node_production_engine -->|"returns prediction"| node_result
node_production_engine -->|"loads deployment artifacts"| node_model_store
node_api_reexport -->|"re-exports API"| node_production_engine

click node_loader "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/data_loader.py"
click node_preprocess "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/preprocessor.py"
click node_config "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/config.py"
click node_architectures "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/model.py"
click node_trainer "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/train.py"
click node_evaluator "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/evaluate.py"
click node_charts "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/benchmark_charts.py"
click node_exporter "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/export_artifacts.py"
click node_model_store "https://github.com/rameshrocks-cyber/rnn-project/tree/main/saved_models"
click node_web_app "https://github.com/rameshrocks-cyber/rnn-project/blob/main/app/app.py"
click node_modular_predictor "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/predict.py"
click node_production_engine "https://github.com/rameshrocks-cyber/rnn-project/blob/main/prediction.py"
click node_api_reexport "https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/prediction.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_loader,node_preprocess,node_config,node_architectures,node_reviewer,node_dataset toneBlue
class node_trainer,node_evaluator,node_charts toneAmber
class node_web_app,node_modular_predictor,node_production_engine,node_api_reexport toneMint
class node_exporter,node_model_store toneRose
class node_result toneIndigo
```

## Components

### Data and Modeling

- [Load and Split](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/data_loader.py): `src/data_loader.py`
- [Text Preprocessing](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/preprocessor.py): `src/preprocessor.py`
- [Model Configuration](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/config.py): `src/config.py`
- [RNN LSTM GRU](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/model.py): `src/model.py`

### Training and Evaluation

- [Training Orchestrator](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/train.py): `src/train.py`
- [Model Evaluation](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/evaluate.py): `src/evaluate.py`
- [Benchmark Charts](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/benchmark_charts.py): `src/benchmark_charts.py`

### Inference Products

- [Streamlit Review App](https://github.com/rameshrocks-cyber/rnn-project/blob/main/app/app.py): `app/app.py`
- [Modular Predictor](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/predict.py): `src/predict.py`
- [Production Inference Engine](https://github.com/rameshrocks-cyber/rnn-project/blob/main/prediction.py): `prediction.py`
- [Inference API Re-export](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/prediction.py): `src/prediction.py`

### Model Artifacts

- [Artifact Export](https://github.com/rameshrocks-cyber/rnn-project/blob/main/src/export_artifacts.py): `src/export_artifacts.py`
- [Saved Models and Configs](https://github.com/rameshrocks-cyber/rnn-project/tree/main/saved_models): `saved_models`

### Other components

- **Review Submitter**
- **Raw Reviews**
- **Sentiment and Confidence**

## Connections

- Raw Reviews → Load and Split: loads reviews (evidence: `src/data_loader.py`)
- Load and Split → Text Preprocessing: cleans and encodes (evidence: `src/data_loader.py`)
- Training Orchestrator → Load and Split: loads and splits (evidence: `src/train.py`)
- Training Orchestrator → Text Preprocessing: fits and transforms (evidence: `src/train.py`)
- Training Orchestrator → RNN LSTM GRU: builds model (evidence: `src/train.py`)
- RNN LSTM GRU → Model Configuration: uses parameters (evidence: `src/model.py`)
- Training Orchestrator → Model Configuration: uses settings (evidence: `src/train.py`)
- Training Orchestrator → Saved Models and Configs: saves model and history (evidence: `src/train.py`)
- Model Evaluation → Load and Split: loads test data (evidence: `src/evaluate.py`)
- Model Evaluation → Modular Predictor: checks manual reviews (evidence: `src/evaluate.py`)
- Model Evaluation → Text Preprocessing: transforms test text (evidence: `src/evaluate.py`)
- Model Evaluation → Saved Models and Configs: loads model artifacts (evidence: `src/evaluate.py`)
- Benchmark Charts → Saved Models and Configs: writes comparisons
- Artifact Export → Text Preprocessing: loads tokenizer (evidence: `src/export_artifacts.py`)
- Artifact Export → Saved Models and Configs: exports deployment files (evidence: `src/export_artifacts.py`)
- Review Submitter → Streamlit Review App: submits review (evidence: `README.md`)
- Streamlit Review App → Saved Models and Configs: loads cached artifacts (evidence: `app/app.py`)
- Streamlit Review App → Sentiment and Confidence: returns sentiment (evidence: `README.md`)
- Streamlit Review App → RNN LSTM GRU: offers model choices (evidence: `app/app.py`)
- Modular Predictor → Text Preprocessing: transforms review (evidence: `src/predict.py`)
- Modular Predictor → Saved Models and Configs: loads model and tokenizer (evidence: `src/predict.py`)
- Production Inference Engine → Sentiment and Confidence: returns prediction (evidence: `prediction.py`)
- Production Inference Engine → Saved Models and Configs: loads deployment artifacts (evidence: `prediction.py`)
- Inference API Re-export → Production Inference Engine: re-exports API (evidence: `src/prediction.py`)
