# ghaithbouslimi/analyse-toxicity-webscarping-datapipeline architecture

> Architecture diagram of the GitHub repository ghaithbouslimi/analyse-toxicity-webscarping-datapipeline, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline
- Repository: https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline

## Overview

Analyse de toxicité de presse : l’API traite un texte fourni ou extrait un article depuis son URL, le score, puis enregistre la prédiction. Le parcours batch collecte des articles par site, les analyse par run, puis calcule des statistiques et exporte des rapports. Les groupes distinguent l’accès, la collecte, l’inférence et la persistance/les rapports. Le graphe s’appuie sur les extraits et le README ; les liens de composants non échantillonnés sont omis plutôt que supposés.

Main entry points: [`src/analyse_toxicite/api/application.py`](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/application.py) (Application FastAPI), [`src/analyse_toxicite/pipeline.py`](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/pipeline.py) (Pipeline batch), [`src/analyse_toxicite/cli.py`](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/cli.py) (Commandes CLI), [`src/analyse_toxicite/api/routes.py`](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/routes.py) (Routes et requêtes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Accès et orchestration"]
  node_api_app["Application FastAPI<br/>[application.py]"]
  node_api_routes["Routes et requêtes<br/>[routes.py]"]
  node_api_schemas["Schémas API<br/>[schemas.py]"]
  node_cli["Commandes CLI<br/>[cli.py]"]
  node_settings["Paramètres<br/>[parametres.py]"]
  node_logging["Journalisation<br/>[journalisation.py]"]
end

subgraph group_collect["Collecte d’articles"]
  node_article_reader["Lecture d’article API<br/>[articles.py]"]
  node_discovery["Découverte de liens<br/>[decouverte.py]"]
  node_pipeline["Pipeline batch<br/>[pipeline.py]"]
  node_download["Téléchargement HTTP<br/>[telechargement.py]"]
  node_public_transport["Transport public sécurisé"]
  node_extraction["Extraction d’article<br/>[extraction.py]"]
end

subgraph group_inference["Analyse de toxicité"]
  node_prediction["Service de prédiction<br/>[service.py]"]
  node_chunking["Découpage du texte<br/>[decoupage.py]"]
end

subgraph group_data["Persistance et rapports"]
  node_mongo[("MongoDB")]
  node_connection["Connexion MongoDB<br/>[connexion.py]"]
  node_repositories["Dépôts de données<br/>[depots.py]"]
  node_statistics["Statistiques et exports<br/>[statistiques.py]"]
end

node_api_user(("Utilisateur API"))
node_batch_user(("Opérateur batch"))
node_news_sites{{"Sites de presse"}}
node_model{{"Modèle multilingue"}}

node_api_user -->|"soumet"| node_api_routes
node_batch_user -->|"lance commandes"| node_cli
node_api_app -->|"enregistre routeur"| node_api_routes
node_api_app -->|"initialise service"| node_prediction
node_api_app -->|"initialise lecteur"| node_article_reader
node_api_app -->|"ouvre connexion"| node_connection
node_api_app -->|"initialise dépôts"| node_repositories
node_api_app -->|"charge paramètres"| node_settings
node_api_app -->|"configure journaux"| node_logging
node_api_routes -->|"valide entrées"| node_api_schemas
node_api_routes -->|"lit URL"| node_article_reader
node_api_routes -->|"prédit texte"| node_prediction
node_api_routes -->|"enregistre résultat"| node_repositories
node_article_reader -.->|"télécharge page"| node_download
node_article_reader -.->|"extrait article"| node_extraction
node_cli -->|"exécute collecte"| node_pipeline
node_cli -->|"exécute analyse"| node_pipeline
node_cli -->|"calcule rapport"| node_statistics
node_cli -->|"ouvre connexion"| node_connection
node_cli -->|"initialise dépôts"| node_repositories
node_pipeline -->|"découvre candidats"| node_discovery
node_pipeline -->|"télécharge pages"| node_download
node_pipeline -->|"extrait articles"| node_extraction
node_pipeline -->|"score articles"| node_prediction
node_pipeline -->|"enregistre observations"| node_repositories
node_download -->|"requête pages"| node_news_sites
node_download -->|"utilise transport"| node_public_transport
node_prediction -->|"découpe tokens"| node_chunking
node_prediction -.->|"calcule scores"| node_model
node_connection -->|"connecte client"| node_mongo
node_repositories -->|"lit et écrit"| node_mongo
node_statistics -->|"lit et agrège"| node_mongo
node_statistics -->|"écrit statistiques"| node_mongo

click node_api_app "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/application.py"
click node_api_routes "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/routes.py"
click node_api_schemas "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/schemas.py"
click node_cli "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/cli.py"
click node_settings "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/parametres.py"
click node_article_reader "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/articles.py"
click node_discovery "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/collecte/decouverte.py"
click node_pipeline "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/pipeline.py"
click node_download "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/collecte/telechargement.py"
click node_public_transport "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/collecte/transport_public.py"
click node_extraction "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/collecte/extraction.py"
click node_prediction "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/prediction/service.py"
click node_chunking "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/prediction/decoupage.py"
click node_connection "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/stockage/connexion.py"
click node_repositories "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/stockage/depots.py"
click node_statistics "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/statistiques.py"
click node_logging "https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/journalisation.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_api_app,node_api_routes,node_api_schemas,node_cli,node_settings,node_logging toneBlue
class node_article_reader,node_discovery,node_pipeline,node_download,node_public_transport,node_extraction toneAmber
class node_prediction,node_chunking,node_api_user toneMint
class node_mongo,node_connection,node_repositories,node_statistics toneRose
class node_batch_user,node_news_sites,node_model toneIndigo
```

## Components

### Accès et orchestration

- [Application FastAPI](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/application.py): `src/analyse_toxicite/api/application.py`
- [Routes et requêtes](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/routes.py): `src/analyse_toxicite/api/routes.py`
- [Schémas API](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/schemas.py): `src/analyse_toxicite/api/schemas.py`
- [Commandes CLI](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/cli.py): `src/analyse_toxicite/cli.py`
- [Paramètres](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/parametres.py): `src/analyse_toxicite/parametres.py`
- [Journalisation](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/journalisation.py): `src/analyse_toxicite/journalisation.py`

### Collecte d’articles

- [Lecture d’article API](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/api/articles.py): `src/analyse_toxicite/api/articles.py`
- [Découverte de liens](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/collecte/decouverte.py): `src/analyse_toxicite/collecte/decouverte.py`
- [Pipeline batch](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/pipeline.py): `src/analyse_toxicite/pipeline.py`
- [Téléchargement HTTP](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/collecte/telechargement.py): `src/analyse_toxicite/collecte/telechargement.py`
- [Transport public sécurisé](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/collecte/transport_public.py): `src/analyse_toxicite/collecte/transport_public.py`
- [Extraction d’article](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/collecte/extraction.py): `src/analyse_toxicite/collecte/extraction.py`

### Analyse de toxicité

- [Service de prédiction](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/prediction/service.py): `src/analyse_toxicite/prediction/service.py`
- [Découpage du texte](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/prediction/decoupage.py): `src/analyse_toxicite/prediction/decoupage.py`

### Persistance et rapports

- **MongoDB**
- [Connexion MongoDB](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/stockage/connexion.py): `src/analyse_toxicite/stockage/connexion.py`
- [Dépôts de données](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/stockage/depots.py): `src/analyse_toxicite/stockage/depots.py`
- [Statistiques et exports](https://github.com/ghaithbouslimi/analyse-toxicity-webscarping-datapipeline/blob/main/src/analyse_toxicite/statistiques.py): `src/analyse_toxicite/statistiques.py`

### Other components

- **Utilisateur API**
- **Opérateur batch**
- **Sites de presse**
- **Modèle multilingue**

## Connections

- Utilisateur API → Routes et requêtes: soumet (evidence: `README.md`)
- Opérateur batch → Commandes CLI: lance commandes (evidence: `README.md`)
- Application FastAPI → Routes et requêtes: enregistre routeur (evidence: `src/analyse_toxicite/api/application.py`)
- Application FastAPI → Service de prédiction: initialise service (evidence: `src/analyse_toxicite/api/application.py`)
- Application FastAPI → Lecture d’article API: initialise lecteur (evidence: `src/analyse_toxicite/api/application.py`)
- Application FastAPI → Connexion MongoDB: ouvre connexion (evidence: `src/analyse_toxicite/api/application.py`)
- Application FastAPI → Dépôts de données: initialise dépôts (evidence: `src/analyse_toxicite/api/application.py`)
- Application FastAPI → Paramètres: charge paramètres (evidence: `src/analyse_toxicite/api/application.py`)
- Application FastAPI → Journalisation: configure journaux (evidence: `src/analyse_toxicite/api/application.py`)
- Routes et requêtes → Schémas API: valide entrées (evidence: `src/analyse_toxicite/api/routes.py`)
- Routes et requêtes → Lecture d’article API: lit URL (evidence: `src/analyse_toxicite/api/routes.py`)
- Routes et requêtes → Service de prédiction: prédit texte (evidence: `src/analyse_toxicite/api/routes.py`)
- Routes et requêtes → Dépôts de données: enregistre résultat (evidence: `src/analyse_toxicite/api/routes.py`)
- Lecture d’article API → Téléchargement HTTP: télécharge page (evidence: `src/analyse_toxicite/api/articles.py`)
- Lecture d’article API → Extraction d’article: extrait article (evidence: `src/analyse_toxicite/api/articles.py`)
- Commandes CLI → Pipeline batch: exécute collecte (evidence: `src/analyse_toxicite/cli.py`)
- Commandes CLI → Pipeline batch: exécute analyse (evidence: `src/analyse_toxicite/cli.py`)
- Commandes CLI → Statistiques et exports: calcule rapport (evidence: `src/analyse_toxicite/cli.py`)
- Commandes CLI → Connexion MongoDB: ouvre connexion (evidence: `src/analyse_toxicite/cli.py`)
- Commandes CLI → Dépôts de données: initialise dépôts (evidence: `src/analyse_toxicite/cli.py`)
- Pipeline batch → Découverte de liens: découvre candidats (evidence: `src/analyse_toxicite/pipeline.py`)
- Pipeline batch → Téléchargement HTTP: télécharge pages (evidence: `src/analyse_toxicite/pipeline.py`)
- Pipeline batch → Extraction d’article: extrait articles (evidence: `src/analyse_toxicite/pipeline.py`)
- Pipeline batch → Service de prédiction: score articles (evidence: `src/analyse_toxicite/pipeline.py`)
- Pipeline batch → Dépôts de données: enregistre observations (evidence: `src/analyse_toxicite/pipeline.py`)
- Téléchargement HTTP → Sites de presse: requête pages (evidence: `src/analyse_toxicite/collecte/telechargement.py`)
- Téléchargement HTTP → Transport public sécurisé: utilise transport (evidence: `src/analyse_toxicite/collecte/telechargement.py`)
- Service de prédiction → Découpage du texte: découpe tokens (evidence: `src/analyse_toxicite/prediction/service.py`)
- Service de prédiction → Modèle multilingue: calcule scores
- Connexion MongoDB → MongoDB: connecte client (evidence: `src/analyse_toxicite/stockage/connexion.py`)
- Dépôts de données → MongoDB: lit et écrit (evidence: `src/analyse_toxicite/stockage/depots.py`)
- Statistiques et exports → MongoDB: lit et agrège (evidence: `src/analyse_toxicite/statistiques.py`)
- Statistiques et exports → MongoDB: écrit statistiques (evidence: `src/analyse_toxicite/statistiques.py`)
