# chmorfop/sentiment_analysis_llm architecture

> Architecture diagram of the GitHub repository chmorfop/sentiment_analysis_llm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-04-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chmorfop/sentiment_analysis_llm
- Repository: https://github.com/chmorfop/sentiment_analysis_llm

## Overview

##### Project Type and Purpose
- This is an analysis and visualization project using a Jupyter Notebook (Greek_Sentiment_Analysis.ipynb) that processes sentiment data extracted from movie reviews.
- The prime goal is to perform sentiment classification (positive, negative, neutral) across a large dataset (150,000 reviews) using pretrained large language models.
- Additionally, the project integrates data exploration and visualization (e.g., Wordclouds and performance charts).

##### Main Components
- Data Sources:
- External Datasets: Reviews from Athinorama and Kaggle.
- Data Preprocessing & Ingestion:
- Data Cleaning and Preparation: Steps that transform raw review text into input suitable for the models.
- Model Fine-tuning:
- Three finetuned models (BERT, T5, GPT2) – each can be represented as separate components or sub-modules, showing training and inference.
- Analysis & Visualization:
- Visualization Module: Including the generation of Wordclouds and performance charts (images in the “images” directory).
- Reporting & Output:
- Jupyter Notebook serving as the central computational document.
- Supplementary Presentation (Presentation.pptx) and Report (Report.pdf) for summarizing results.

##### Relationships and Data Flow
- Pass this data into the Preprocessing module, which cleans and prepares the text.
- The cleaned data then feeds into the three model fine-tuning modules, each processing the input to classify sentiment.
- Model outputs lead to the Analysis module, which generates visualization outputs (e.g., Wordclouds and performance metrics) as showcased in the images folder.
- Finally, the results are collated and documented in the Jupyter Notebook, with additional summarization provided in the Presentation and Report files.

##### Architectural Patterns and Design Elements
- Although this is not a full-stack web application, you still have a clear pipeline architecture (ETL and Model Training/Evaluation pipeline).
- Modular separation (data ingestion, preprocessing, model fine-tuning, evaluation, and reporting) to keep components decoupled.

##### Relevant Technologies
- Jupyter Notebook as the main orchestration document.
- Pretrained models (BERT, T5, GPT2) – these may be used via frameworks like Hugging Face’s Transformers.
- Data visualization libraries (e.g., matplotlib, seaborn, or wordcloud packages) that created the images.
- Underlying data source tools or scripts managing external data ingestion.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "Data Sources"
        A1["Athinorama"]:::datasource
        A2["Kaggle"]:::datasource
    end

    DIP["Data Ingestion & Preprocessing\n(Clean Review Data)"]:::processing
    A1 -->|"feeds"| DIP
    A2 -->|"feeds"| DIP

    subgraph "Model Training"
        M1["BERT Finetuning"]:::model
        M2["T5 Finetuning"]:::model
        M3["GPT2 Finetuning"]:::model
    end
    DIP -->|"supplies data"| M1
    DIP -->|"supplies data"| M2
    DIP -->|"supplies data"| M3

    AV["Analysis & Visualization\n(Generate Wordclouds & Performance Charts)"]:::output
    M1 -->|"outputs"| AV
    M2 -->|"outputs"| AV
    M3 -->|"outputs"| AV

    JN["Jupyter Notebook"]:::notebook
    AV -->|"collates results"| JN

    subgraph "Reporting & Output"
        PRES["Presentation"]:::output
        REP["Report"]:::output
    end
    JN -->|"generates"| PRES
    JN -->|"generates"| REP

    DOC["Documentation"]:::processing
    DOC ---|"reference"| DIP

    click JN "https://github.com/chmorfop/sentiment_analysis_llm/blob/main/Greek_Sentiment_Analysis.ipynb"
    click PRES "https://github.com/chmorfop/sentiment_analysis_llm/blob/main/Presentation.pptx"
    click REP "https://github.com/chmorfop/sentiment_analysis_llm/blob/main/Report.pdf"
    click AV "https://github.com/chmorfop/sentiment_analysis_llm/tree/main/images"
    click DOC "https://github.com/chmorfop/sentiment_analysis_llm/blob/main/README.md"

    classDef datasource fill:#a8e6cf,stroke:#333,stroke-width:2px;
    classDef processing fill:#ffd3b6,stroke:#333,stroke-width:2px;
    classDef model fill:#ffaaa5,stroke:#333,stroke-width:2px;
    classDef output fill:#ffcc5c,stroke:#333,stroke-width:2px;
    classDef notebook fill:#dcedc1,stroke:#333,stroke-width:2px;
```
