# qihahfirhat/nlp_cinetext architecture

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

- Interactive diagram: https://gitdiagram.com/qihahfirhat/nlp_cinetext
- Repository: https://github.com/qihahfirhat/nlp_cinetext

## Overview

CineScope is a Streamlit movie-review sentiment analyzer with a separate training workflow. Users submit review text, which the app can translate and classify, then inspect word-level explanations; separate pages expose corpus and model-performance views. Training downloads and splits the IMDB dataset, prepares text for classical estimators, evaluates those models alongside DistilBERT, and saves the best classical model and vectorizer for app inference. The app excerpt is partial, so some documented connections are evidenced only by the README; its exact inference wiring is not fully visible.

Main entry points: [`frontend_StreamlitApp/app.py`](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py) (Streamlit App), [`backend_DataNLP/nlp_pipeline.py`](https://github.com/qihahfirhat/nlp_cinetext/blob/main/backend_DataNLP/nlp_pipeline.py) (NLP Training Pipeline), [`best_model.pkl`](https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_model.pkl) (Classical Classifier), [`best_vectorizer.pkl`](https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_vectorizer.pkl) (TF-IDF Vectorizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_experience["Streamlit Experience"]
  node_streamlit["Streamlit App<br/>[app.py]"]
  node_review["Review Input<br/>[app.py]"]
  node_pipeline_info["Pipeline &amp; Team Page<br/>[app.py]"]
end

subgraph group_inference["Review Analysis"]
  node_translator["Google Translator"]
  node_cleaner["Text Preprocessing<br/>[app.py]"]
  node_classical["Classical Classifier<br/>[best_model.pkl]"]
  node_vectorizer["TF-IDF Vectorizer"]
  node_word_impact["Token Impact<br/>[app.py]"]
end

subgraph group_training["Model Training"]
  node_transformer["DistilBERT Evaluation<br/>[nlp_pipeline.py]"]
  node_trainer["NLP Training Pipeline<br/>[nlp_pipeline.py]"]
  node_dataset[("IMDB Dataset<br/>[IMDB Dataset.csv]")]
  node_saved_model["Saved Model Artifact<br/>[best_model.pkl]"]
  node_saved_vectorizer["Saved Vectorizer Artifact"]
end

subgraph group_insights["Exploration &amp; Insights"]
  node_review_cloud["Review Word Clouds<br/>[app.py]"]
  node_corpus["Corpus Explorer<br/>[app.py]"]
  node_performance["Model Visualizations<br/>[app.py]"]
end

node_viewer(("Review User"))
node_kaggle["KaggleHub Dataset"]

node_viewer -->|"uses"| node_streamlit
node_streamlit -->|"accepts review"| node_review
node_streamlit -.->|"translates input"| node_translator
node_streamlit -->|"preprocesses text"| node_cleaner
node_streamlit -.->|"loads for inference"| node_classical
node_streamlit -.->|"loads for inference"| node_vectorizer
node_streamlit -.->|"offers sentiment analysis"| node_transformer
node_streamlit -->|"shows token impact"| node_word_impact
node_streamlit -->|"renders review clouds"| node_review_cloud
node_streamlit -->|"shows corpus data"| node_corpus
node_streamlit -->|"shows metrics"| node_performance
node_streamlit -->|"renders page"| node_pipeline_info
node_trainer -->|"downloads dataset"| node_kaggle
node_trainer -.->|"provides sample data"| node_dataset
node_trainer -.->|"duplicates preprocessing"| node_cleaner
node_trainer -->|"evaluates raw reviews"| node_transformer
node_trainer -->|"saves best model"| node_saved_model
node_trainer -->|"saves matching vectorizer"| node_saved_vectorizer
node_trainer -.->|"produces comparison metrics"| node_performance
node_classical -.->|"uses features from"| node_vectorizer

click node_streamlit "https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py"
click node_review "https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py"
click node_cleaner "https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py"
click node_classical "https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_model.pkl"
click node_vectorizer "https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_vectorizer.pkl"
click node_transformer "https://github.com/qihahfirhat/nlp_cinetext/blob/main/backend_DataNLP/nlp_pipeline.py"
click node_word_impact "https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py"
click node_review_cloud "https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py"
click node_corpus "https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py"
click node_performance "https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py"
click node_pipeline_info "https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py"
click node_trainer "https://github.com/qihahfirhat/nlp_cinetext/blob/main/backend_DataNLP/nlp_pipeline.py"
click node_dataset "https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/IMDB%20Dataset.csv"
click node_saved_model "https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_model.pkl"
click node_saved_vectorizer "https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_vectorizer.pkl"

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_review,node_pipeline_info,node_viewer toneBlue
class node_translator,node_cleaner,node_classical,node_vectorizer,node_word_impact toneAmber
class node_transformer,node_trainer,node_dataset,node_saved_model,node_saved_vectorizer toneMint
class node_review_cloud,node_corpus,node_performance toneRose
class node_kaggle toneIndigo
```

## Components

### Streamlit Experience

- [Streamlit App](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py): `frontend_StreamlitApp/app.py`
- [Review Input](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py): `frontend_StreamlitApp/app.py`
- [Pipeline & Team Page](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py): `frontend_StreamlitApp/app.py`

### Review Analysis

- **Google Translator**
- [Text Preprocessing](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py): `frontend_StreamlitApp/app.py`
- [Classical Classifier](https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_model.pkl): `best_model.pkl`
- [TF-IDF Vectorizer](https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_vectorizer.pkl): `best_vectorizer.pkl`
- [Token Impact](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py): `frontend_StreamlitApp/app.py`

### Model Training

- [DistilBERT Evaluation](https://github.com/qihahfirhat/nlp_cinetext/blob/main/backend_DataNLP/nlp_pipeline.py): `backend_DataNLP/nlp_pipeline.py`
- [NLP Training Pipeline](https://github.com/qihahfirhat/nlp_cinetext/blob/main/backend_DataNLP/nlp_pipeline.py): `backend_DataNLP/nlp_pipeline.py`
- [IMDB Dataset](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/IMDB%20Dataset.csv): `frontend_StreamlitApp/IMDB Dataset.csv`
- [Saved Model Artifact](https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_model.pkl): `best_model.pkl`
- [Saved Vectorizer Artifact](https://github.com/qihahfirhat/nlp_cinetext/blob/main/best_vectorizer.pkl): `best_vectorizer.pkl`

### Exploration & Insights

- [Review Word Clouds](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py): `frontend_StreamlitApp/app.py`
- [Corpus Explorer](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py): `frontend_StreamlitApp/app.py`
- [Model Visualizations](https://github.com/qihahfirhat/nlp_cinetext/blob/main/frontend_StreamlitApp/app.py): `frontend_StreamlitApp/app.py`

### Other components

- **Review User**
- **KaggleHub Dataset**

## Connections

- Review User → Streamlit App: uses (evidence: `README.md`)
- Streamlit App → Review Input: accepts review (evidence: `README.md`)
- Streamlit App → Google Translator: translates input (evidence: `README.md`)
- Streamlit App → Text Preprocessing: preprocesses text (evidence: `frontend_StreamlitApp/app.py`)
- Streamlit App → Classical Classifier: loads for inference (evidence: `README.md`)
- Streamlit App → TF-IDF Vectorizer: loads for inference (evidence: `README.md`)
- Streamlit App → DistilBERT Evaluation: offers sentiment analysis (evidence: `README.md`)
- Streamlit App → Token Impact: shows token impact (evidence: `README.md`)
- Streamlit App → Review Word Clouds: renders review clouds (evidence: `README.md`)
- Streamlit App → Corpus Explorer: shows corpus data (evidence: `README.md`)
- Streamlit App → Model Visualizations: shows metrics (evidence: `README.md`)
- Streamlit App → Pipeline & Team Page: renders page (evidence: `README.md`)
- NLP Training Pipeline → KaggleHub Dataset: downloads dataset (evidence: `backend_DataNLP/nlp_pipeline.py`)
- NLP Training Pipeline → IMDB Dataset: provides sample data (evidence: `README.md`)
- NLP Training Pipeline → Text Preprocessing: duplicates preprocessing (evidence: `README.md`)
- NLP Training Pipeline → DistilBERT Evaluation: evaluates raw reviews (evidence: `backend_DataNLP/nlp_pipeline.py`)
- NLP Training Pipeline → Saved Model Artifact: saves best model (evidence: `backend_DataNLP/nlp_pipeline.py`)
- NLP Training Pipeline → Saved Vectorizer Artifact: saves matching vectorizer (evidence: `backend_DataNLP/nlp_pipeline.py`)
- NLP Training Pipeline → Model Visualizations: produces comparison metrics (evidence: `README.md`)
- Classical Classifier → TF-IDF Vectorizer: uses features from (evidence: `README.md`)
