# vinee119/hdt architecture

> Architecture diagram of the GitHub repository vinee119/hdt, 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/vinee119/hdt
- Repository: https://github.com/vinee119/hdt

## Overview

This repository is a Streamlit Human Digital Twin for simulating behavioral tendencies from a user’s situation description, scenario, and difficulty. The main workflow detects an emotion from text, maps it to a behavioral state, combines it with contextual inputs for prediction, then presents an explanation and interpretation. The README also documents synthetic-data generation and model-training capabilities, represented here as the data and model-artifact branch rather than notebook workflows. Runtime connections are grounded in the sampled app and simulation engine; broader modeling details come from the README.

Main entry points: [`app/streamlit_app.py`](https://github.com/vinee119/hdt/blob/main/app/streamlit_app.py) (Streamlit Interface), [`core/simulation_engine.py`](https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py) (Simulation Engine), [`models`](https://github.com/vinee119/hdt/tree/main/models) (Trained Model Artifacts), [`data`](https://github.com/vinee119/hdt/tree/main/data) (Behavioral Datasets)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_interface["User Interface"]
  node_app["Streamlit Interface<br/>[streamlit_app.py]"]
  node_presentation["Results and Charts<br/>[streamlit_app.py]"]
end

subgraph group_simulation["Simulation Runtime"]
  node_engine["Simulation Engine"]
  node_emotion["Emotion Detection"]
  node_mapping["Emotion Mapping"]
  node_context["Context Integration"]
  node_prediction["Behavior Prediction"]
  node_explanation["Behavior Explanation"]
  node_interpretation["Behavior Interpretation"]
end

subgraph group_resources["Data and Models"]
  node_models["Trained Model Artifacts"]
  node_data["Behavioral Datasets"]
end

node_user(("User"))

node_user -->|"enters situation"| node_app
node_app -->|"runs simulation"| node_engine
node_engine -->|"processes text"| node_emotion
node_emotion -->|"maps emotion"| node_mapping
node_mapping -->|"combines context"| node_context
node_context -->|"predicts decision"| node_prediction
node_prediction -->|"builds explanation"| node_explanation
node_app -->|"requests interpretation"| node_interpretation
node_app -->|"renders results"| node_presentation
node_engine -->|"loads artifacts"| node_models
node_data -.->|"supports training"| node_models

click node_app "https://github.com/vinee119/hdt/blob/main/app/streamlit_app.py"
click node_engine "https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py"
click node_emotion "https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py"
click node_mapping "https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py"
click node_context "https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py"
click node_prediction "https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py"
click node_explanation "https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py"
click node_interpretation "https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py"
click node_presentation "https://github.com/vinee119/hdt/blob/main/app/streamlit_app.py"
click node_models "https://github.com/vinee119/hdt/tree/main/models"
click node_data "https://github.com/vinee119/hdt/tree/main/data"

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_app,node_presentation,node_user toneBlue
class node_engine,node_emotion,node_mapping,node_context,node_prediction,node_explanation,node_interpretation toneAmber
class node_models,node_data toneMint
```

## Components

### User Interface

- [Streamlit Interface](https://github.com/vinee119/hdt/blob/main/app/streamlit_app.py): `app/streamlit_app.py`
- [Results and Charts](https://github.com/vinee119/hdt/blob/main/app/streamlit_app.py): `app/streamlit_app.py`

### Simulation Runtime

- [Simulation Engine](https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py): `core/simulation_engine.py`
- [Emotion Detection](https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py): `core/simulation_engine.py`
- [Emotion Mapping](https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py): `core/simulation_engine.py`
- [Context Integration](https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py): `core/simulation_engine.py`
- [Behavior Prediction](https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py): `core/simulation_engine.py`
- [Behavior Explanation](https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py): `core/simulation_engine.py`
- [Behavior Interpretation](https://github.com/vinee119/hdt/blob/main/core/simulation_engine.py): `core/simulation_engine.py`

### Data and Models

- [Trained Model Artifacts](https://github.com/vinee119/hdt/tree/main/models): `models`
- [Behavioral Datasets](https://github.com/vinee119/hdt/tree/main/data): `data`

### Other components

- **User**

## Connections

- User → Streamlit Interface: enters situation (evidence: `README.md`)
- Streamlit Interface → Simulation Engine: runs simulation (evidence: `app/streamlit_app.py`)
- Simulation Engine → Emotion Detection: processes text (evidence: `core/simulation_engine.py`)
- Emotion Detection → Emotion Mapping: maps emotion (evidence: `core/simulation_engine.py`)
- Emotion Mapping → Context Integration: combines context (evidence: `core/simulation_engine.py`)
- Context Integration → Behavior Prediction: predicts decision (evidence: `core/simulation_engine.py`)
- Behavior Prediction → Behavior Explanation: builds explanation (evidence: `core/simulation_engine.py`)
- Streamlit Interface → Behavior Interpretation: requests interpretation (evidence: `app/streamlit_app.py`)
- Streamlit Interface → Results and Charts: renders results (evidence: `app/streamlit_app.py`)
- Simulation Engine → Trained Model Artifacts: loads artifacts (evidence: `core/simulation_engine.py`)
- Behavioral Datasets → Trained Model Artifacts: supports training (evidence: `README.md`)
