# omar-khecharem/tp-indexation-recherche-information architecture

> Architecture diagram of the GitHub repository omar-khecharem/tp-indexation-recherche-information, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-02). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/omar-khecharem/tp-indexation-recherche-information
- Repository: https://github.com/omar-khecharem/tp-indexation-recherche-information

## Overview

This is a small academic information-retrieval application. Its primary workflow loads a TSV document collection, preprocesses and indexes it, then ranks query results with BM25 (or optionally TF-IDF) for display. Separate exercise modules explore TF saturation and compare ranking behavior on a small corpus. The graph follows the shown entry point and module calls; relationships for the TSV input are based on the README, and no unsampled source behavior is assumed.

Main entry points: [`main.py`](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/main.py) (Application Entry), [`bm25.py`](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/bm25.py) (BM25 Search), [`indexation.py`](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/indexation.py) (Inverted Index), [`partie_b.py`](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/partie_b.py) (Ranking Comparison)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ingest["Document Ingestion"]
  node_config["Shared Settings<br/>[config.py]"]
  node_dataset["Document Collection<br/>[documents1.tsv]"]
  node_loader["TSV Loader<br/>[chargement.py]"]
  node_corpus["Exercise Corpus<br/>[corpus.py]"]
end

subgraph group_index["Indexing"]
  node_preprocess["Text Preprocessing<br/>[pretraitement.py]"]
  node_inverted["Inverted Index<br/>[indexation.py]"]
end

subgraph group_ranking["Retrieval and Ranking"]
  node_main["Application Entry<br/>[main.py]"]
  node_tfidf["TF-IDF Search<br/>[tfidf.py]"]
  node_bm25["BM25 Search<br/>[bm25.py]"]
end

subgraph group_analysis["Analysis and Output"]
  node_saturation["TF Saturation<br/>[saturation.py]"]
  node_display["Results Display<br/>[affichage.py]"]
  node_saturation_exercises["Saturation Exercises<br/>[partie_a.py]"]
  node_ranking_exercises["Ranking Comparison<br/>[partie_b.py]"]
end

node_user(("Search User"))

node_user -->|"runs search"| node_main
node_main -->|"reads settings"| node_config
node_main -->|"loads documents"| node_loader
node_loader -->|"reads TSV"| node_dataset
node_loader -->|"returns documents"| node_inverted
node_main -->|"builds index"| node_inverted
node_inverted -->|"preprocesses text"| node_preprocess
node_preprocess -->|"reads stopwords"| node_config
node_main -->|"creates model"| node_tfidf
node_main -->|"creates model"| node_bm25
node_tfidf -->|"reads index"| node_inverted
node_bm25 -->|"reads postings"| node_inverted
node_bm25 -->|"delegates scoring"| node_saturation
node_bm25 -->|"uses defaults"| node_config
node_main -->|"ranks queries"| node_bm25
node_main -->|"shows results"| node_display
node_display -->|"preprocesses query"| node_preprocess
node_display -->|"shows saturation"| node_saturation
node_saturation_exercises -->|"analyzes saturation"| node_saturation
node_saturation_exercises -->|"prints tables"| node_display
node_ranking_exercises -->|"uses corpus"| node_corpus
node_ranking_exercises -->|"selects preprocessing"| node_preprocess
node_ranking_exercises -->|"builds index"| node_inverted
node_ranking_exercises -->|"compares scores"| node_tfidf
node_ranking_exercises -->|"compares scores"| node_bm25

click node_main "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/main.py"
click node_config "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/config.py"
click node_dataset "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/documents1.tsv"
click node_loader "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/chargement.py"
click node_preprocess "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/pretraitement.py"
click node_inverted "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/indexation.py"
click node_corpus "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/corpus.py"
click node_tfidf "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/tfidf.py"
click node_bm25 "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/bm25.py"
click node_saturation "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/saturation.py"
click node_display "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/affichage.py"
click node_saturation_exercises "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/partie_a.py"
click node_ranking_exercises "https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/partie_b.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_config,node_dataset,node_loader,node_corpus,node_user toneBlue
class node_preprocess,node_inverted toneAmber
class node_main,node_tfidf,node_bm25 toneMint
class node_saturation,node_display,node_saturation_exercises,node_ranking_exercises toneRose
```

## Components

### Document Ingestion

- [Shared Settings](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/config.py): `config.py`
- [Document Collection](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/documents1.tsv): `documents1.tsv`
- [TSV Loader](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/chargement.py): `chargement.py`
- [Exercise Corpus](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/corpus.py): `corpus.py`

### Indexing

- [Text Preprocessing](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/pretraitement.py): `pretraitement.py`
- [Inverted Index](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/indexation.py): `indexation.py`

### Retrieval and Ranking

- [Application Entry](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/main.py): `main.py`
- [TF-IDF Search](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/tfidf.py): `tfidf.py`
- [BM25 Search](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/bm25.py): `bm25.py`

### Analysis and Output

- [TF Saturation](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/saturation.py): `saturation.py`
- [Results Display](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/affichage.py): `affichage.py`
- [Saturation Exercises](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/partie_a.py): `partie_a.py`
- [Ranking Comparison](https://github.com/omar-khecharem/tp-indexation-recherche-information/blob/main/partie_b.py): `partie_b.py`

### Other components

- **Search User**

## Connections

- Search User → Application Entry: runs search (evidence: `README.md`)
- Application Entry → Shared Settings: reads settings (evidence: `main.py`)
- Application Entry → TSV Loader: loads documents (evidence: `main.py`)
- TSV Loader → Document Collection: reads TSV (evidence: `README.md`)
- TSV Loader → Inverted Index: returns documents (evidence: `main.py`)
- Application Entry → Inverted Index: builds index (evidence: `main.py`)
- Inverted Index → Text Preprocessing: preprocesses text (evidence: `indexation.py`)
- Text Preprocessing → Shared Settings: reads stopwords (evidence: `pretraitement.py`)
- Application Entry → TF-IDF Search: creates model (evidence: `main.py`)
- Application Entry → BM25 Search: creates model (evidence: `main.py`)
- TF-IDF Search → Inverted Index: reads index (evidence: `tfidf.py`)
- BM25 Search → Inverted Index: reads postings (evidence: `bm25.py`)
- BM25 Search → TF Saturation: delegates scoring (evidence: `bm25.py`)
- BM25 Search → Shared Settings: uses defaults (evidence: `bm25.py`)
- Application Entry → BM25 Search: ranks queries (evidence: `main.py`)
- Application Entry → Results Display: shows results (evidence: `main.py`)
- Results Display → Text Preprocessing: preprocesses query (evidence: `affichage.py`)
- Results Display → TF Saturation: shows saturation (evidence: `affichage.py`)
- Saturation Exercises → TF Saturation: analyzes saturation (evidence: `partie_a.py`)
- Saturation Exercises → Results Display: prints tables (evidence: `partie_a.py`)
- Ranking Comparison → Exercise Corpus: uses corpus (evidence: `partie_b.py`)
- Ranking Comparison → Text Preprocessing: selects preprocessing (evidence: `partie_b.py`)
- Ranking Comparison → Inverted Index: builds index (evidence: `partie_b.py`)
- Ranking Comparison → TF-IDF Search: compares scores (evidence: `partie_b.py`)
- Ranking Comparison → BM25 Search: compares scores (evidence: `partie_b.py`)
