# md-abrar-hossain/critix architecture

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

- Interactive diagram: https://gitdiagram.com/md-abrar-hossain/critix
- Repository: https://github.com/md-abrar-hossain/critix

## Overview

Critix is a Gradio movie-review analyzer. A submitted review enters the app workflow, receives sentiment classification, then drives sentiment-matched review retrieval, aspect extraction and a community verdict, alongside movie recommendations; the app presents the results in chat history. The sampled implementation uses an MLP with TF-IDF and metadata features, despite the README’s broader deep-learning description. Some documented datasets and indexes are absent from the tree, so their runtime use is shown only where sampled code supports it.

Main entry points: [`app.py`](https://github.com/md-abrar-hossain/critix/blob/main/app.py) (Review workflow), [`src/sentiment.py`](https://github.com/md-abrar-hossain/critix/blob/main/src/sentiment.py) (Sentiment prediction), [`src/retrieval.py`](https://github.com/md-abrar-hossain/critix/blob/main/src/retrieval.py) (Similar-review retrieval), [`src/recommendation.py`](https://github.com/md-abrar-hossain/critix/blob/main/src/recommendation.py) (Movie recommendations)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["Chat interface"]
  node_gradio["Gradio interface<br/>[app.py]"]
  node_workflow["Review workflow<br/>[app.py]"]
  node_transcript["Chat transcript<br/>[app.py]"]
end

subgraph group_analysis["Review analysis"]
  node_sentiment["Sentiment prediction<br/>[sentiment.py]"]
  node_preprocess["Text preprocessing<br/>[preprocessing.py]"]
end

subgraph group_discovery["Review and movie search"]
  node_review_search["Similar-review retrieval<br/>[retrieval.py]"]
  node_aspect["Aspect extraction<br/>[retrieval.py]"]
  node_verdict["Community verdict<br/>[retrieval.py]"]
  node_movie_search["Movie recommendations<br/>[recommendation.py]"]
  node_embedding["Sentence embedder<br/>[retrieval.py]"]
end

subgraph group_resources["Models and data"]
  node_model_files[("Classifier resources")]
  node_review_index[("Review indexes and pools")]
  node_movie_data[("Movie metadata<br/>[movie_metadata.csv]")]
  node_path_helper["Project path helper<br/>[utils.py]"]
end

node_reviewer(("Reviewer"))

node_reviewer -->|"submits review"| node_gradio
node_gradio -->|"dispatches"| node_workflow
node_workflow -->|"predicts sentiment"| node_sentiment
node_sentiment -->|"cleans text"| node_preprocess
node_sentiment -->|"loads model features"| node_model_files
node_workflow -->|"retrieves reviews"| node_review_search
node_review_search -->|"encodes query"| node_embedding
node_review_search -->|"searches sentiment pool"| node_review_index
node_workflow -->|"extracts aspects"| node_aspect
node_workflow -->|"builds verdict"| node_verdict
node_workflow -->|"recommends movies"| node_movie_search
node_movie_search -->|"encodes query"| node_embedding
node_movie_search -->|"loads metadata"| node_movie_data
node_workflow -->|"renders results"| node_transcript
node_gradio -->|"displays history"| node_transcript
node_sentiment -->|"resolves resource paths"| node_path_helper
node_review_search -->|"resolves resource paths"| node_path_helper
node_movie_search -->|"resolves resource paths"| node_path_helper

click node_gradio "https://github.com/md-abrar-hossain/critix/blob/main/app.py"
click node_workflow "https://github.com/md-abrar-hossain/critix/blob/main/app.py"
click node_transcript "https://github.com/md-abrar-hossain/critix/blob/main/app.py"
click node_sentiment "https://github.com/md-abrar-hossain/critix/blob/main/src/sentiment.py"
click node_preprocess "https://github.com/md-abrar-hossain/critix/blob/main/src/preprocessing.py"
click node_review_search "https://github.com/md-abrar-hossain/critix/blob/main/src/retrieval.py"
click node_aspect "https://github.com/md-abrar-hossain/critix/blob/main/src/retrieval.py"
click node_verdict "https://github.com/md-abrar-hossain/critix/blob/main/src/retrieval.py"
click node_movie_search "https://github.com/md-abrar-hossain/critix/blob/main/src/recommendation.py"
click node_embedding "https://github.com/md-abrar-hossain/critix/blob/main/src/retrieval.py"
click node_model_files "https://github.com/md-abrar-hossain/critix/tree/main/models"
click node_review_index "https://github.com/md-abrar-hossain/critix/tree/main/indexes"
click node_movie_data "https://github.com/md-abrar-hossain/critix/blob/main/data/movie_metadata.csv"
click node_path_helper "https://github.com/md-abrar-hossain/critix/blob/main/src/utils.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_gradio,node_workflow,node_transcript,node_reviewer toneBlue
class node_sentiment,node_preprocess toneAmber
class node_review_search,node_aspect,node_verdict,node_movie_search,node_embedding toneMint
class node_model_files,node_review_index,node_movie_data,node_path_helper toneRose
```

## Components

### Chat interface

- [Gradio interface](https://github.com/md-abrar-hossain/critix/blob/main/app.py): `app.py`
- [Review workflow](https://github.com/md-abrar-hossain/critix/blob/main/app.py): `app.py`
- [Chat transcript](https://github.com/md-abrar-hossain/critix/blob/main/app.py): `app.py`

### Review analysis

- [Sentiment prediction](https://github.com/md-abrar-hossain/critix/blob/main/src/sentiment.py): `src/sentiment.py`
- [Text preprocessing](https://github.com/md-abrar-hossain/critix/blob/main/src/preprocessing.py): `src/preprocessing.py`

### Review and movie search

- [Similar-review retrieval](https://github.com/md-abrar-hossain/critix/blob/main/src/retrieval.py): `src/retrieval.py`
- [Aspect extraction](https://github.com/md-abrar-hossain/critix/blob/main/src/retrieval.py): `src/retrieval.py`
- [Community verdict](https://github.com/md-abrar-hossain/critix/blob/main/src/retrieval.py): `src/retrieval.py`
- [Movie recommendations](https://github.com/md-abrar-hossain/critix/blob/main/src/recommendation.py): `src/recommendation.py`
- [Sentence embedder](https://github.com/md-abrar-hossain/critix/blob/main/src/retrieval.py): `src/retrieval.py`

### Models and data

- [Classifier resources](https://github.com/md-abrar-hossain/critix/tree/main/models): `models`
- [Review indexes and pools](https://github.com/md-abrar-hossain/critix/tree/main/indexes): `indexes`
- [Movie metadata](https://github.com/md-abrar-hossain/critix/blob/main/data/movie_metadata.csv): `data/movie_metadata.csv`
- [Project path helper](https://github.com/md-abrar-hossain/critix/blob/main/src/utils.py): `src/utils.py`

### Other components

- **Reviewer**

## Connections

- Reviewer → Gradio interface: submits review (evidence: `README.md`)
- Gradio interface → Review workflow: dispatches (evidence: `app.py`)
- Review workflow → Sentiment prediction: predicts sentiment (evidence: `app.py`)
- Sentiment prediction → Text preprocessing: cleans text (evidence: `src/sentiment.py`)
- Sentiment prediction → Classifier resources: loads model features (evidence: `src/sentiment.py`)
- Review workflow → Similar-review retrieval: retrieves reviews (evidence: `app.py`)
- Similar-review retrieval → Sentence embedder: encodes query (evidence: `src/retrieval.py`)
- Similar-review retrieval → Review indexes and pools: searches sentiment pool (evidence: `src/retrieval.py`)
- Review workflow → Aspect extraction: extracts aspects (evidence: `app.py`)
- Review workflow → Community verdict: builds verdict (evidence: `app.py`)
- Review workflow → Movie recommendations: recommends movies (evidence: `app.py`)
- Movie recommendations → Sentence embedder: encodes query (evidence: `src/recommendation.py`)
- Movie recommendations → Movie metadata: loads metadata (evidence: `src/recommendation.py`)
- Review workflow → Chat transcript: renders results (evidence: `app.py`)
- Gradio interface → Chat transcript: displays history (evidence: `app.py`)
- Sentiment prediction → Project path helper: resolves resource paths (evidence: `src/sentiment.py`)
- Similar-review retrieval → Project path helper: resolves resource paths (evidence: `src/retrieval.py`)
- Movie recommendations → Project path helper: resolves resource paths (evidence: `src/recommendation.py`)
