# sekharb04/text-summarizer architecture

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

- Interactive diagram: https://gitdiagram.com/sekharb04/text-summarizer
- Repository: https://github.com/sekharb04/text-summarizer

## Overview

This Flask application lets a user submit text and choose extractive, abstractive, or combined summarization with a requested length. The route invokes the selected summarizer, computes confidence scores and labels, then renders both results in the web template. A separate route serves a downloadable summary. The README advertises PDF export, but the sampled download route returns plain text; the template and summarizer implementations were not sampled, so their internal details are not inferred.

Main entry points: [`app.py`](https://github.com/sekharb04/text-summarizer/blob/main/app.py) (Flask routes), [`templates/index.html`](https://github.com/sekharb04/text-summarizer/blob/main/templates/index.html) (Summary interface), [`summarizer.py`](https://github.com/sekharb04/text-summarizer/blob/main/summarizer.py) (T5 summarizer), [`textrank.py`](https://github.com/sekharb04/text-summarizer/blob/main/textrank.py) (TextRank summarizer)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_web["Web experience"]
  node_interface["Summary interface<br/>[index.html]"]
  node_web_routes["Flask routes<br/>[app.py]"]
  node_download["Summary download<br/>[app.py]"]
end

subgraph group_summarization["Summary generation"]
  node_abstractive["T5 summarizer<br/>[summarizer.py]"]
  node_extractive["TextRank summarizer<br/>[textrank.py]"]
end

subgraph group_interpretation["Confidence interpretation"]
  node_confidence["Confidence scoring<br/>[confidence.py]"]
  node_confidence_labels["Trust labels<br/>[confidence.py]"]
end

node_user(("User"))

node_user -->|"submits text"| node_interface
node_interface -->|"posts input"| node_web_routes
node_web_routes -->|"generates summary"| node_abstractive
node_web_routes -->|"selects sentences"| node_extractive
node_web_routes -->|"scores summaries"| node_confidence
node_web_routes -->|"labels scores"| node_confidence_labels
node_web_routes -->|"renders results"| node_interface
node_user -->|"requests download"| node_download

click node_interface "https://github.com/sekharb04/text-summarizer/blob/main/templates/index.html"
click node_web_routes "https://github.com/sekharb04/text-summarizer/blob/main/app.py"
click node_download "https://github.com/sekharb04/text-summarizer/blob/main/app.py"
click node_abstractive "https://github.com/sekharb04/text-summarizer/blob/main/summarizer.py"
click node_extractive "https://github.com/sekharb04/text-summarizer/blob/main/textrank.py"
click node_confidence "https://github.com/sekharb04/text-summarizer/blob/main/confidence.py"
click node_confidence_labels "https://github.com/sekharb04/text-summarizer/blob/main/confidence.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_interface,node_web_routes,node_download,node_user toneBlue
class node_abstractive,node_extractive toneAmber
class node_confidence,node_confidence_labels toneMint
```

## Components

### Web experience

- [Summary interface](https://github.com/sekharb04/text-summarizer/blob/main/templates/index.html): `templates/index.html`
- [Flask routes](https://github.com/sekharb04/text-summarizer/blob/main/app.py): `app.py`
- [Summary download](https://github.com/sekharb04/text-summarizer/blob/main/app.py): `app.py`

### Summary generation

- [T5 summarizer](https://github.com/sekharb04/text-summarizer/blob/main/summarizer.py): `summarizer.py`
- [TextRank summarizer](https://github.com/sekharb04/text-summarizer/blob/main/textrank.py): `textrank.py`

### Confidence interpretation

- [Confidence scoring](https://github.com/sekharb04/text-summarizer/blob/main/confidence.py): `confidence.py`
- [Trust labels](https://github.com/sekharb04/text-summarizer/blob/main/confidence.py): `confidence.py`

### Other components

- **User**

## Connections

- User → Summary interface: submits text (evidence: `README.md`)
- Summary interface → Flask routes: posts input (evidence: `app.py`)
- Flask routes → T5 summarizer: generates summary (evidence: `app.py`)
- Flask routes → TextRank summarizer: selects sentences (evidence: `app.py`)
- Flask routes → Confidence scoring: scores summaries (evidence: `app.py`)
- Flask routes → Trust labels: labels scores (evidence: `app.py`)
- Flask routes → Summary interface: renders results (evidence: `app.py`)
- User → Summary download: requests download (evidence: `app.py`)
