# mohtadaayesha/critix architecture

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

- Interactive diagram: https://gitdiagram.com/mohtadaayesha/critix
- Repository: https://github.com/mohtadaayesha/critix

## Overview

Critix is a Gradio movie-review analyzer. A user submits a review; the app predicts sentiment, compares the review with sentiment-matched community reviews to identify recurring aspects, and independently retrieves movie recommendations. It renders sentiment, community verdict, and recommendation cards. The graph separates the UI, analysis, and retrieval capabilities. The sole source file was sampled; asset-loading relationships shown below are explicit in that source, while no additional implementation modules are present in the tree.

Main entry points: [`app.py`](https://github.com/mohtadaayesha/critix/blob/main/app.py) (Review pipeline), [`sentiment_lstm_model.keras`](https://github.com/mohtadaayesha/critix/blob/main/sentiment_lstm_model.keras) (Sentiment model), [`tokenizer.pkl`](https://github.com/mohtadaayesha/critix/blob/main/tokenizer.pkl) (Text tokenizer), [`index_positive.faiss`](https://github.com/mohtadaayesha/critix/blob/main/index_positive.faiss) (Positive review index)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_gradio["Gradio UI<br/>[app.py]"]
  node_pipeline["Review pipeline<br/>[app.py]"]
  node_rendering["Result cards<br/>[app.py]"]
end

subgraph group_analysis["Review Analysis"]
  node_sentiment["Sentiment prediction<br/>[app.py]"]
  node_sentiment_model["Sentiment model"]
  node_tokenizer["Text tokenizer<br/>[tokenizer.pkl]"]
  node_community["Community retrieval<br/>[app.py]"]
  node_aspects["Aspect extraction<br/>[app.py]"]
  node_verdict["Critic verdict<br/>[app.py]"]
end

subgraph group_retrieval["Similarity &amp; Movies"]
  node_embedder["Text embedder<br/>[app.py]"]
  node_positive_index[("Positive review index")]
  node_negative_index[("Negative review index")]
  node_positive_texts["Positive review texts<br/>[texts_positive.csv]"]
  node_negative_texts["Negative review texts<br/>[texts_negative.csv]"]
  node_recommendation["Movie retrieval<br/>[app.py]"]
  node_movie_index[("Movie index<br/>[movie_index.faiss]")]
  node_movie_metadata["Movie metadata<br/>[movie_metadata.csv]"]
end

node_user(("Reviewer"))

node_user -->|"submits review"| node_gradio
node_gradio -->|"dispatches"| node_pipeline
node_pipeline -->|"predicts sentiment"| node_sentiment
node_sentiment -->|"tokenizes with"| node_tokenizer
node_sentiment -->|"predicts with"| node_sentiment_model
node_pipeline -->|"retrieves examples"| node_community
node_community -->|"encodes review"| node_embedder
node_community -->|"searches by sentiment"| node_positive_index
node_community -->|"searches by sentiment"| node_negative_index
node_community -->|"selects matching texts"| node_positive_texts
node_community -->|"selects matching texts"| node_negative_texts
node_pipeline -->|"extracts aspects"| node_aspects
node_pipeline -->|"builds verdict"| node_verdict
node_pipeline -->|"retrieves movies"| node_recommendation
node_recommendation -->|"encodes review"| node_embedder
node_recommendation -->|"searches"| node_movie_index
node_recommendation -->|"selects movie details"| node_movie_metadata
node_pipeline -->|"renders results"| node_rendering
node_rendering -->|"returns cards"| node_gradio

click node_gradio "https://github.com/mohtadaayesha/critix/blob/main/app.py"
click node_pipeline "https://github.com/mohtadaayesha/critix/blob/main/app.py"
click node_rendering "https://github.com/mohtadaayesha/critix/blob/main/app.py"
click node_sentiment "https://github.com/mohtadaayesha/critix/blob/main/app.py"
click node_sentiment_model "https://github.com/mohtadaayesha/critix/blob/main/sentiment_lstm_model.keras"
click node_tokenizer "https://github.com/mohtadaayesha/critix/blob/main/tokenizer.pkl"
click node_community "https://github.com/mohtadaayesha/critix/blob/main/app.py"
click node_embedder "https://github.com/mohtadaayesha/critix/blob/main/app.py"
click node_positive_index "https://github.com/mohtadaayesha/critix/blob/main/index_positive.faiss"
click node_negative_index "https://github.com/mohtadaayesha/critix/blob/main/index_negative.faiss"
click node_positive_texts "https://github.com/mohtadaayesha/critix/blob/main/texts_positive.csv"
click node_negative_texts "https://github.com/mohtadaayesha/critix/blob/main/texts_negative.csv"
click node_aspects "https://github.com/mohtadaayesha/critix/blob/main/app.py"
click node_verdict "https://github.com/mohtadaayesha/critix/blob/main/app.py"
click node_recommendation "https://github.com/mohtadaayesha/critix/blob/main/app.py"
click node_movie_index "https://github.com/mohtadaayesha/critix/blob/main/movie_index.faiss"
click node_movie_metadata "https://github.com/mohtadaayesha/critix/blob/main/movie_metadata.csv"

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_pipeline,node_rendering,node_user toneBlue
class node_sentiment,node_sentiment_model,node_tokenizer,node_community,node_aspects,node_verdict toneAmber
class node_embedder,node_positive_index,node_negative_index,node_positive_texts,node_negative_texts,node_recommendation,node_movie_index,node_movie_metadata toneMint
```

## Components

### User Interface

- [Gradio UI](https://github.com/mohtadaayesha/critix/blob/main/app.py): `app.py`
- [Review pipeline](https://github.com/mohtadaayesha/critix/blob/main/app.py): `app.py`
- [Result cards](https://github.com/mohtadaayesha/critix/blob/main/app.py): `app.py`

### Review Analysis

- [Sentiment prediction](https://github.com/mohtadaayesha/critix/blob/main/app.py): `app.py`
- [Sentiment model](https://github.com/mohtadaayesha/critix/blob/main/sentiment_lstm_model.keras): `sentiment_lstm_model.keras`
- [Text tokenizer](https://github.com/mohtadaayesha/critix/blob/main/tokenizer.pkl): `tokenizer.pkl`
- [Community retrieval](https://github.com/mohtadaayesha/critix/blob/main/app.py): `app.py`
- [Aspect extraction](https://github.com/mohtadaayesha/critix/blob/main/app.py): `app.py`
- [Critic verdict](https://github.com/mohtadaayesha/critix/blob/main/app.py): `app.py`

### Similarity & Movies

- [Text embedder](https://github.com/mohtadaayesha/critix/blob/main/app.py): `app.py`
- [Positive review index](https://github.com/mohtadaayesha/critix/blob/main/index_positive.faiss): `index_positive.faiss`
- [Negative review index](https://github.com/mohtadaayesha/critix/blob/main/index_negative.faiss): `index_negative.faiss`
- [Positive review texts](https://github.com/mohtadaayesha/critix/blob/main/texts_positive.csv): `texts_positive.csv`
- [Negative review texts](https://github.com/mohtadaayesha/critix/blob/main/texts_negative.csv): `texts_negative.csv`
- [Movie retrieval](https://github.com/mohtadaayesha/critix/blob/main/app.py): `app.py`
- [Movie index](https://github.com/mohtadaayesha/critix/blob/main/movie_index.faiss): `movie_index.faiss`
- [Movie metadata](https://github.com/mohtadaayesha/critix/blob/main/movie_metadata.csv): `movie_metadata.csv`

### Other components

- **Reviewer**

## Connections

- Reviewer → Gradio UI: submits review
- Gradio UI → Review pipeline: dispatches
- Review pipeline → Sentiment prediction: predicts sentiment
- Sentiment prediction → Text tokenizer: tokenizes with
- Sentiment prediction → Sentiment model: predicts with
- Review pipeline → Community retrieval: retrieves examples
- Community retrieval → Text embedder: encodes review
- Community retrieval → Positive review index: searches by sentiment
- Community retrieval → Negative review index: searches by sentiment
- Community retrieval → Positive review texts: selects matching texts
- Community retrieval → Negative review texts: selects matching texts
- Review pipeline → Aspect extraction: extracts aspects
- Review pipeline → Critic verdict: builds verdict
- Review pipeline → Movie retrieval: retrieves movies
- Movie retrieval → Text embedder: encodes review
- Movie retrieval → Movie index: searches
- Movie retrieval → Movie metadata: selects movie details
- Review pipeline → Result cards: renders results
- Result cards → Gradio UI: returns cards
