# amishgodson/ettuthogai-poem-analysis architecture

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

- Interactive diagram: https://gitdiagram.com/amishgodson/ettuthogai-poem-analysis
- Repository: https://github.com/amishgodson/ettuthogai-poem-analysis

## Overview

This project classifies Tamil poem input as Ettuthogai or non-Ettuthogai, then analyzes accepted poems through tokenization, dictionary-based entity tagging, metadata matching, and meaning generation. Users can submit poems through the Flask interface or the command-line entry point. The README also describes corpus-based fallback validation, but the sampled runtime flow shows a pickled validator; its connection to the separate validator code is unverified. The graph follows the sampled orchestration and data reads; it does not assume an external model file is present in the tree.

Main entry points: [`main_logic.py`](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/main_logic.py) (Analysis orchestrator), [`modules/module3_knowledge_mapping.py`](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/modules/module3_knowledge_mapping.py) (Knowledge mapping), [`app.py`](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/app.py) (Flask interface), [`main.py`](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/main.py) (CLI interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["User entry"]
  node_web["Flask interface<br/>[app.py]"]
  node_cli["CLI interface<br/>[main.py]"]
end

subgraph group_classification["Classification"]
  node_analysis_flow["Analysis orchestrator<br/>[main_logic.py]"]
  node_classifier["Poem classifier<br/>[main_logic.py]"]
  node_fallback["Corpus validator"]
end

subgraph group_analysis["Poem analysis"]
  node_preprocess["Tamil preprocessing"]
  node_extractor["Entity extraction"]
  node_mapper["Knowledge mapping"]
  node_generator["Meaning generation"]
end

subgraph group_corpus["Corpus data"]
  node_entity_data[("Entity dictionaries")]
  node_poem_text[("Poem metadata corpus")]
end

node_user(("Poem submitter"))
node_result["Analysis result"]

node_user -->|"submits poem"| node_web
node_web -->|"analyzes with"| node_analysis_flow
node_user -->|"enters poem"| node_cli
node_cli -->|"analyzes with"| node_analysis_flow
node_analysis_flow -->|"classifies"| node_classifier
node_analysis_flow -->|"preprocesses"| node_preprocess
node_analysis_flow -->|"extracts entities"| node_extractor
node_analysis_flow -->|"maps entities"| node_mapper
node_analysis_flow -->|"reads metadata"| node_mapper
node_analysis_flow -->|"counts entities"| node_mapper
node_analysis_flow -->|"generates meaning"| node_generator
node_extractor -->|"loads dictionaries"| node_entity_data
node_mapper -->|"searches poems"| node_poem_text
node_analysis_flow -.->|"may validate"| node_fallback
node_analysis_flow -->|"returns analysis"| node_result

click node_web "https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/app.py"
click node_cli "https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/main.py"
click node_analysis_flow "https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/main_logic.py"
click node_classifier "https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/main_logic.py"
click node_fallback "https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/knowledge_base/extra_datas/ettuthogai_validator.py"
click node_preprocess "https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/modules/module1_preprocessing.py"
click node_extractor "https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/modules/module2_entity_extraction.py"
click node_mapper "https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/modules/module3_knowledge_mapping.py"
click node_generator "https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/modules/module4_sentence_generation.py"
click node_entity_data "https://github.com/amishgodson/ettuthogai-poem-analysis/tree/main/data/ettuthogai/csv"
click node_poem_text "https://github.com/amishgodson/ettuthogai-poem-analysis/tree/main/data/ettuthogai/text_2"

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_web,node_cli toneBlue
class node_analysis_flow,node_classifier,node_fallback toneAmber
class node_preprocess,node_extractor,node_mapper,node_generator toneMint
class node_entity_data,node_poem_text toneRose
class node_user,node_result toneIndigo
```

## Components

### User entry

- [Flask interface](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/app.py): `app.py`
- [CLI interface](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/main.py): `main.py`

### Classification

- [Analysis orchestrator](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/main_logic.py): `main_logic.py`
- [Poem classifier](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/main_logic.py): `main_logic.py`
- [Corpus validator](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/knowledge_base/extra_datas/ettuthogai_validator.py): `knowledge_base/extra_datas/ettuthogai_validator.py`

### Poem analysis

- [Tamil preprocessing](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/modules/module1_preprocessing.py): `modules/module1_preprocessing.py`
- [Entity extraction](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/modules/module2_entity_extraction.py): `modules/module2_entity_extraction.py`
- [Knowledge mapping](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/modules/module3_knowledge_mapping.py): `modules/module3_knowledge_mapping.py`
- [Meaning generation](https://github.com/amishgodson/ettuthogai-poem-analysis/blob/main/modules/module4_sentence_generation.py): `modules/module4_sentence_generation.py`

### Corpus data

- [Entity dictionaries](https://github.com/amishgodson/ettuthogai-poem-analysis/tree/main/data/ettuthogai/csv): `data/ettuthogai/csv`
- [Poem metadata corpus](https://github.com/amishgodson/ettuthogai-poem-analysis/tree/main/data/ettuthogai/text_2): `data/ettuthogai/text_2`

### Other components

- **Poem submitter**
- **Analysis result**

## Connections

- Poem submitter → Flask interface: submits poem (evidence: `app.py`)
- Flask interface → Analysis orchestrator: analyzes with (evidence: `app.py`)
- Poem submitter → CLI interface: enters poem (evidence: `main.py`)
- CLI interface → Analysis orchestrator: analyzes with (evidence: `main.py`)
- Analysis orchestrator → Poem classifier: classifies (evidence: `main_logic.py`)
- Analysis orchestrator → Tamil preprocessing: preprocesses (evidence: `main_logic.py`)
- Analysis orchestrator → Entity extraction: extracts entities (evidence: `main_logic.py`)
- Analysis orchestrator → Knowledge mapping: maps entities (evidence: `main_logic.py`)
- Analysis orchestrator → Knowledge mapping: reads metadata (evidence: `main_logic.py`)
- Analysis orchestrator → Knowledge mapping: counts entities (evidence: `main_logic.py`)
- Analysis orchestrator → Meaning generation: generates meaning (evidence: `main_logic.py`)
- Entity extraction → Entity dictionaries: loads dictionaries (evidence: `modules/module2_entity_extraction.py`)
- Knowledge mapping → Poem metadata corpus: searches poems (evidence: `modules/module3_knowledge_mapping.py`)
- Analysis orchestrator → Corpus validator: may validate
- Analysis orchestrator → Analysis result: returns analysis (evidence: `main_logic.py`)
