# shreesha41223/ccgullm_t256 architecture

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

- Interactive diagram: https://gitdiagram.com/shreesha41223/ccgullm_t256
- Repository: https://github.com/shreesha41223/ccgullm_t256

## Overview

This repository implements a Java code-comment generator with a Streamlit interface and a trainable code-to-comment Transformer. In the interactive workflow, Java source is normalized and translated; inference derives an AST-aligned type sequence, tokenizes both inputs, encodes them, and generates comment tokens. A separate dataset-preparation and training branch creates aligned examples, builds tokenizers and datasets, trains the model, and validates it. The README is empty, so capabilities and links are based on the supplied source excerpts and SOURCE INDEX; test.py was not sampled.

Main entry points: [`train.py`](https://github.com/shreesha41223/ccgullm_t256/blob/main/train.py) (Training runner), [`translate.py`](https://github.com/shreesha41223/ccgullm_t256/blob/main/translate.py) (Translation orchestrator), [`app.py`](https://github.com/shreesha41223/ccgullm_t256/blob/main/app.py) (Streamlit app), [`myDataset/create_dataset_json_file.py`](https://github.com/shreesha41223/ccgullm_t256/blob/main/myDataset/create_dataset_json_file.py) (Dataset JSON builder)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User interface"]
  node_streamlit["Streamlit app<br/>[app.py]"]
  node_source_normalizer["Source normalizer<br/>[app.py]"]
  node_comment["Generated comment"]
end

subgraph group_inference["Comment inference"]
  node_translator["Translation orchestrator<br/>[translate.py]"]
  node_cat_generator["AST type alignment<br/>[get_CAT.py]"]
  node_tokenizers["Code and comment tokenizers<br/>[tokenizer.py]"]
  node_transformer["Encoder-decoder model<br/>[model2.py]"]
end

subgraph group_data["Dataset preparation"]
  node_dataset_builder["Dataset JSON builder"]
  node_training_data["Train and test JSON"]
end

subgraph group_training["Model training"]
  node_dataset["Tokenized dataset<br/>[dataset.py]"]
  node_training_runner["Training runner<br/>[train.py]"]
  node_validation["Validation runner<br/>[test.py]"]
  node_configuration["Model configuration<br/>[config.py]"]
  node_model_artifacts["Weights and tokenizer files"]
end

node_user(("Java developer"))

node_user -->|"enters code"| node_streamlit
node_streamlit -->|"processes input"| node_source_normalizer
node_streamlit -->|"requests comment"| node_translator
node_translator -->|"derives types"| node_cat_generator
node_translator -->|"loads tokenizers"| node_tokenizers
node_translator -->|"encodes and decodes"| node_transformer
node_translator -->|"loads settings"| node_configuration
node_translator -->|"loads weights"| node_model_artifacts
node_translator -->|"returns decoded text"| node_comment
node_dataset_builder -->|"aligns code types"| node_cat_generator
node_dataset_builder -->|"writes examples"| node_training_data
node_training_runner -->|"reads examples"| node_training_data
node_training_runner -->|"builds tokenizers"| node_tokenizers
node_training_runner -->|"creates data loaders"| node_dataset
node_training_runner -->|"trains model"| node_transformer
node_training_runner -->|"runs validation"| node_validation
node_training_runner -->|"loads settings"| node_configuration
node_training_runner -->|"saves checkpoints"| node_model_artifacts

click node_streamlit "https://github.com/shreesha41223/ccgullm_t256/blob/main/app.py"
click node_source_normalizer "https://github.com/shreesha41223/ccgullm_t256/blob/main/app.py"
click node_translator "https://github.com/shreesha41223/ccgullm_t256/blob/main/translate.py"
click node_cat_generator "https://github.com/shreesha41223/ccgullm_t256/blob/main/get_CAT.py"
click node_tokenizers "https://github.com/shreesha41223/ccgullm_t256/blob/main/tokenizer.py"
click node_transformer "https://github.com/shreesha41223/ccgullm_t256/blob/main/model2.py"
click node_dataset_builder "https://github.com/shreesha41223/ccgullm_t256/blob/main/myDataset/create_dataset_json_file.py"
click node_training_data "https://github.com/shreesha41223/ccgullm_t256/tree/main/myDataset"
click node_dataset "https://github.com/shreesha41223/ccgullm_t256/blob/main/dataset.py"
click node_training_runner "https://github.com/shreesha41223/ccgullm_t256/blob/main/train.py"
click node_validation "https://github.com/shreesha41223/ccgullm_t256/blob/main/test.py"
click node_configuration "https://github.com/shreesha41223/ccgullm_t256/blob/main/config.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_streamlit,node_source_normalizer,node_comment toneBlue
class node_translator,node_cat_generator,node_tokenizers,node_transformer toneAmber
class node_dataset_builder,node_training_data toneMint
class node_dataset,node_training_runner,node_validation,node_configuration,node_model_artifacts toneRose
class node_user toneIndigo
```

## Components

### User interface

- [Streamlit app](https://github.com/shreesha41223/ccgullm_t256/blob/main/app.py): `app.py`
- [Source normalizer](https://github.com/shreesha41223/ccgullm_t256/blob/main/app.py): `app.py`
- **Generated comment**

### Comment inference

- [Translation orchestrator](https://github.com/shreesha41223/ccgullm_t256/blob/main/translate.py): `translate.py`
- [AST type alignment](https://github.com/shreesha41223/ccgullm_t256/blob/main/get_CAT.py): `get_CAT.py`
- [Code and comment tokenizers](https://github.com/shreesha41223/ccgullm_t256/blob/main/tokenizer.py): `tokenizer.py`
- [Encoder-decoder model](https://github.com/shreesha41223/ccgullm_t256/blob/main/model2.py): `model2.py`

### Dataset preparation

- [Dataset JSON builder](https://github.com/shreesha41223/ccgullm_t256/blob/main/myDataset/create_dataset_json_file.py): `myDataset/create_dataset_json_file.py`
- [Train and test JSON](https://github.com/shreesha41223/ccgullm_t256/tree/main/myDataset): `myDataset`

### Model training

- [Tokenized dataset](https://github.com/shreesha41223/ccgullm_t256/blob/main/dataset.py): `dataset.py`
- [Training runner](https://github.com/shreesha41223/ccgullm_t256/blob/main/train.py): `train.py`
- [Validation runner](https://github.com/shreesha41223/ccgullm_t256/blob/main/test.py): `test.py`
- [Model configuration](https://github.com/shreesha41223/ccgullm_t256/blob/main/config.py): `config.py`
- **Weights and tokenizer files**

### Other components

- **Java developer**

## Connections

- Java developer → Streamlit app: enters code (evidence: `app.py`)
- Streamlit app → Source normalizer: processes input (evidence: `app.py`)
- Streamlit app → Translation orchestrator: requests comment (evidence: `app.py`)
- Translation orchestrator → AST type alignment: derives types (evidence: `translate.py`)
- Translation orchestrator → Code and comment tokenizers: loads tokenizers (evidence: `translate.py`)
- Translation orchestrator → Encoder-decoder model: encodes and decodes (evidence: `translate.py`)
- Translation orchestrator → Model configuration: loads settings (evidence: `translate.py`)
- Translation orchestrator → Weights and tokenizer files: loads weights (evidence: `translate.py`)
- Translation orchestrator → Generated comment: returns decoded text (evidence: `translate.py`)
- Dataset JSON builder → AST type alignment: aligns code types (evidence: `myDataset/create_dataset_json_file.py`)
- Dataset JSON builder → Train and test JSON: writes examples (evidence: `myDataset/create_dataset_json_file.py`)
- Training runner → Train and test JSON: reads examples (evidence: `train.py`)
- Training runner → Code and comment tokenizers: builds tokenizers (evidence: `train.py`)
- Training runner → Tokenized dataset: creates data loaders (evidence: `train.py`)
- Training runner → Encoder-decoder model: trains model (evidence: `train.py`)
- Training runner → Validation runner: runs validation (evidence: `train.py`)
- Training runner → Model configuration: loads settings (evidence: `train.py`)
- Training runner → Weights and tokenizer files: saves checkpoints (evidence: `train.py`)
