# lucasrss27/dtm-pir_insa_toulouse_4agmm architecture

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

- Interactive diagram: https://gitdiagram.com/lucasrss27/dtm-pir_insa_toulouse_4agmm
- Repository: https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm

## Overview

This is a Dynamic Topic Modeling analytics app: users upload a time-stamped text CSV, configure filtering and model settings, train a temporal topic model, and explore topic evolution, word trends, and training diagnostics. The main stages are corpus preparation, differentiable model training with temporal smoothing, and interactive visualization. The repository also contains a New York Times archive collection script and a sample corpus. Some dashboard internals and core routines were not fully excerpted, so only documented or visible relationships are shown.

Main entry points: [`DTM_dash.py`](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DTM_dash.py) (Dashboard app), [`DataSet/NYT_Scrapping.py`](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DataSet/NYT_Scrapping.py) (NYT archive scraper), [`dtm_core.py`](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/dtm_core.py) (Temporal topic model), [`DataSet/nyt_articles_2019_2021.csv`](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DataSet/nyt_articles_2019_2021.csv) (NYT sample corpus)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Interactive dashboard"]
  node_app["Dashboard app<br/>[DTM_dash.py]"]
  node_visuals["Trend and diagnostics views<br/>[DTM_dash.py]"]
end

subgraph group_analysis["Corpus and modeling"]
  node_preprocess["Corpus preparation<br/>[dtm_core.py]"]
  node_model["Temporal topic model<br/>[dtm_core.py]"]
  node_smoothing["Kalman smoothing<br/>[dtm_core.py]"]
end

subgraph group_data["Corpus sources"]
  node_scraper["NYT archive scraper<br/>[NYT_Scrapping.py]"]
  node_nyt_csv["NYT sample corpus"]
  node_europress_csv["Europress sample corpus"]
end

node_user(("Analyst"))
node_nyt_api["NYT archive API"]

node_user -->|"uploads CSV"| node_app
node_app -->|"prepares corpus"| node_preprocess
node_app -->|"trains model"| node_model
node_model -.->|"smooths trajectories"| node_smoothing
node_app -->|"gets proportions"| node_smoothing
node_app -->|"renders results"| node_visuals
node_scraper -->|"fetches archives"| node_nyt_api
node_scraper -->|"writes corpus"| node_nyt_csv

click node_app "https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DTM_dash.py"
click node_preprocess "https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/dtm_core.py"
click node_model "https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/dtm_core.py"
click node_smoothing "https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/dtm_core.py"
click node_visuals "https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DTM_dash.py"
click node_scraper "https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DataSet/NYT_Scrapping.py"
click node_nyt_csv "https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DataSet/nyt_articles_2019_2021.csv"
click node_europress_csv "https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DataSet/Europress_Nestle.csv"

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_visuals toneBlue
class node_preprocess,node_model,node_smoothing toneAmber
class node_scraper,node_nyt_csv,node_europress_csv,node_nyt_api toneMint
class node_user toneIndigo
```

## Components

### Interactive dashboard

- [Dashboard app](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DTM_dash.py): `DTM_dash.py`
- [Trend and diagnostics views](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DTM_dash.py): `DTM_dash.py`

### Corpus and modeling

- [Corpus preparation](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/dtm_core.py): `dtm_core.py`
- [Temporal topic model](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/dtm_core.py): `dtm_core.py`
- [Kalman smoothing](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/dtm_core.py): `dtm_core.py`

### Corpus sources

- [NYT archive scraper](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DataSet/NYT_Scrapping.py): `DataSet/NYT_Scrapping.py`
- [NYT sample corpus](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DataSet/nyt_articles_2019_2021.csv): `DataSet/nyt_articles_2019_2021.csv`
- [Europress sample corpus](https://github.com/lucasrss27/dtm-pir_insa_toulouse_4agmm/blob/main/DataSet/Europress_Nestle.csv): `DataSet/Europress_Nestle.csv`

### Other components

- **Analyst**
- **NYT archive API**

## Connections

- Analyst → Dashboard app: uploads CSV (evidence: `README.md`)
- Dashboard app → Corpus preparation: prepares corpus (evidence: `DTM_dash.py`)
- Dashboard app → Temporal topic model: trains model (evidence: `DTM_dash.py`)
- Temporal topic model → Kalman smoothing: smooths trajectories (evidence: `dtm_core.py`)
- Dashboard app → Kalman smoothing: gets proportions (evidence: `DTM_dash.py`)
- Dashboard app → Trend and diagnostics views: renders results (evidence: `DTM_dash.py`)
- NYT archive scraper → NYT archive API: fetches archives (evidence: `DataSet/NYT_Scrapping.py`)
- NYT archive scraper → NYT sample corpus: writes corpus (evidence: `DataSet/NYT_Scrapping.py`)
