# rjalol/e2e-uzbek-absa architecture

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

- Interactive diagram: https://gitdiagram.com/rjalol/e2e-uzbek-absa
- Repository: https://github.com/rjalol/e2e-uzbek-absa

## Overview

This is an Uzbek aspect-based sentiment analysis system. Its documented end-to-end workflow extracts aspect terms from text with a BiLSTM-CRF, then classifies sentiment for each aspect with a gated CNN; the repository also supports separate category- and term-level sentiment tasks. Training, data preparation, embeddings, morphological tokenization, inference, and visualization are distinct capabilities. The README documents the two-stage handoff, but sampled inference code does not show an integrated runtime call between stages, so that relationship is marked unverified.

Main entry points: [`model_files/run.py`](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/run.py) (Sentiment Training), [`model_files/inference_triple.py`](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/inference_triple.py) (Sentiment Inference), [`model_files/train_ate.py`](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/train_ate.py) (ATE Training), [`run_inference_ate.py`](https://github.com/rjalol/e2e-uzbek-absa/blob/main/run_inference_ate.py) (ATE Inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_extraction["Aspect Extraction"]
  node_ate_infer["ATE Inference"]
  node_ate_model["BiLSTM-CRF<br/>[model_ate.py]"]
  node_crf["CRF Decoder<br/>[crf.py]"]
  node_ate_data["ATE Dataset<br/>[dataset_ate.py]"]
  node_ate_train["ATE Training<br/>[train_ate.py]"]
end

subgraph group_sentiment["Sentiment Analysis"]
  node_sentiment_cli["Sentiment Inference"]
  node_acsa_model["ACSA GCAE"]
  node_atsa_model["ATSA GCAE"]
  node_sentiment_train["Sentiment Training<br/>[run.py]"]
  node_train_loop["CNN Trainer<br/>[cnn_train.py]"]
end

subgraph group_data["Data And Language"]
  node_sentiment_data["Sentiment Datasets<br/>[mydatasets.py]"]
  node_data_loader["JSON Loader<br/>[getsemeval.py]"]
  node_tokenizer["Morph Tokenizer<br/>[morph_tokenizer.py]"]
  node_embeddings["FastText Embeddings<br/>[w2v.py]"]
end

subgraph group_operations["Training And Results"]
  node_visualizer["Training Visualizer<br/>[visualize.py]"]
  node_logs[("Training Logs")]
end

node_user(("Text User"))
node_fasttext[("Uzbek FastText Vectors")]
node_apertium["Apertium Uzbek FST"]
node_predictions["Aspect Sentiments"]

node_user -->|"submits text"| node_ate_infer
node_ate_infer -->|"runs extraction"| node_ate_model
node_ate_model -->|"decodes tags"| node_crf
node_ate_train -->|"loads examples"| node_ate_data
node_ate_train -->|"trains model"| node_ate_model
node_ate_infer -.->|"passes aspects"| node_sentiment_cli
node_user -->|"submits targets"| node_sentiment_cli
node_sentiment_cli -->|"predicts categories"| node_acsa_model
node_sentiment_cli -->|"predicts terms"| node_atsa_model
node_sentiment_cli -->|"returns polarity"| node_predictions
node_sentiment_train -->|"loads task data"| node_data_loader
node_sentiment_train -->|"builds datasets"| node_sentiment_data
node_sentiment_train -->|"tokenizes text"| node_tokenizer
node_sentiment_train -->|"loads vectors"| node_embeddings
node_embeddings -->|"reads vectors"| node_fasttext
node_tokenizer -.->|"uses FST"| node_apertium
node_sentiment_train -->|"selects ACSA"| node_acsa_model
node_sentiment_train -->|"selects ATSA"| node_atsa_model
node_sentiment_train -->|"dispatches training"| node_train_loop
node_train_loop -->|"writes metrics"| node_logs
node_visualizer -->|"reads training logs"| node_logs
node_ate_train -->|"saves checkpoints"| node_logs

click node_ate_infer "https://github.com/rjalol/e2e-uzbek-absa/blob/main/run_inference_ate.py"
click node_ate_model "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/model_ate.py"
click node_crf "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/crf.py"
click node_ate_data "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/dataset_ate.py"
click node_ate_train "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/train_ate.py"
click node_sentiment_cli "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/inference_triple.py"
click node_acsa_model "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/cnn_gate_aspect_model.py"
click node_atsa_model "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/cnn_gate_aspect_model_atsa.py"
click node_sentiment_train "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/run.py"
click node_train_loop "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/cnn_train.py"
click node_sentiment_data "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/mydatasets.py"
click node_data_loader "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/getsemeval.py"
click node_tokenizer "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/morph_tokenizer.py"
click node_embeddings "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/w2v.py"
click node_visualizer "https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/visualize.py"
click node_logs "https://github.com/rjalol/e2e-uzbek-absa/tree/main/snapshot"

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_ate_infer,node_ate_model,node_crf,node_ate_data,node_ate_train,node_user toneBlue
class node_sentiment_cli,node_acsa_model,node_atsa_model,node_sentiment_train,node_train_loop,node_fasttext toneAmber
class node_sentiment_data,node_data_loader,node_tokenizer,node_embeddings toneMint
class node_visualizer,node_logs toneRose
class node_apertium,node_predictions toneIndigo
```

## Components

### Aspect Extraction

- [ATE Inference](https://github.com/rjalol/e2e-uzbek-absa/blob/main/run_inference_ate.py): `run_inference_ate.py`
- [BiLSTM-CRF](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/model_ate.py): `model_files/model_ate.py`
- [CRF Decoder](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/crf.py): `model_files/crf.py`
- [ATE Dataset](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/dataset_ate.py): `model_files/dataset_ate.py`
- [ATE Training](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/train_ate.py): `model_files/train_ate.py`

### Sentiment Analysis

- [Sentiment Inference](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/inference_triple.py): `model_files/inference_triple.py`
- [ACSA GCAE](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/cnn_gate_aspect_model.py): `model_files/cnn_gate_aspect_model.py`
- [ATSA GCAE](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/cnn_gate_aspect_model_atsa.py): `model_files/cnn_gate_aspect_model_atsa.py`
- [Sentiment Training](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/run.py): `model_files/run.py`
- [CNN Trainer](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/cnn_train.py): `model_files/cnn_train.py`

### Data And Language

- [Sentiment Datasets](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/mydatasets.py): `model_files/mydatasets.py`
- [JSON Loader](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/getsemeval.py): `model_files/getsemeval.py`
- [Morph Tokenizer](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/morph_tokenizer.py): `model_files/morph_tokenizer.py`
- [FastText Embeddings](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/w2v.py): `model_files/w2v.py`

### Training And Results

- [Training Visualizer](https://github.com/rjalol/e2e-uzbek-absa/blob/main/model_files/visualize.py): `model_files/visualize.py`
- [Training Logs](https://github.com/rjalol/e2e-uzbek-absa/tree/main/snapshot): `snapshot`

### Other components

- **Text User**
- **Uzbek FastText Vectors**
- **Apertium Uzbek FST**
- **Aspect Sentiments**

## Connections

- Text User → ATE Inference: submits text (evidence: `README.md`)
- ATE Inference → BiLSTM-CRF: runs extraction (evidence: `run_inference_ate.py`)
- BiLSTM-CRF → CRF Decoder: decodes tags (evidence: `model_files/model_ate.py`)
- ATE Training → ATE Dataset: loads examples (evidence: `model_files/train_ate.py`)
- ATE Training → BiLSTM-CRF: trains model (evidence: `model_files/train_ate.py`)
- ATE Inference → Sentiment Inference: passes aspects (evidence: `README.md`)
- Text User → Sentiment Inference: submits targets (evidence: `README.md`)
- Sentiment Inference → ACSA GCAE: predicts categories (evidence: `model_files/inference_triple.py`)
- Sentiment Inference → ATSA GCAE: predicts terms (evidence: `model_files/inference_triple.py`)
- Sentiment Inference → Aspect Sentiments: returns polarity (evidence: `model_files/inference_triple.py`)
- Sentiment Training → JSON Loader: loads task data (evidence: `model_files/run.py`)
- Sentiment Training → Sentiment Datasets: builds datasets (evidence: `model_files/run.py`)
- Sentiment Training → Morph Tokenizer: tokenizes text (evidence: `model_files/run.py`)
- Sentiment Training → FastText Embeddings: loads vectors (evidence: `model_files/run.py`)
- FastText Embeddings → Uzbek FastText Vectors: reads vectors (evidence: `model_files/w2v.py`)
- Morph Tokenizer → Apertium Uzbek FST: uses FST (evidence: `README.md`)
- Sentiment Training → ACSA GCAE: selects ACSA (evidence: `model_files/run.py`)
- Sentiment Training → ATSA GCAE: selects ATSA (evidence: `model_files/run.py`)
- Sentiment Training → CNN Trainer: dispatches training (evidence: `model_files/run.py`)
- CNN Trainer → Training Logs: writes metrics (evidence: `model_files/cnn_train.py`)
- Training Visualizer → Training Logs: reads training logs (evidence: `README.md`)
- ATE Training → Training Logs: saves checkpoints (evidence: `README.md`)
