# anurag-agrawal-22/text-summarization-using-nlp architecture

> Architecture diagram of the GitHub repository anurag-agrawal-22/text-summarization-using-nlp, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-20). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/anurag-agrawal-22/text-summarization-using-nlp
- Repository: https://github.com/anurag-agrawal-22/text-summarization-using-nlp

## Overview

##### Project type and purpose
- This is a Python-based data-analysis web application built with Streamlit.
- It fetches BBC news articles via the NewsAPI, processes and summarizes them using spaCy, and also allows users to input custom text for summarization.

##### File structure
- Top-level files:
- app.py      – the Streamlit app entrypoint (UI + orchestration)
- helper.py   – encapsulates the summarization logic and API calls
- requirements.txt – third-party dependencies (Streamlit, spaCy, newsapi, etc.)
- Procfile    – deployment instruction for Heroku (“web: streamlit run app.py”)
- setup.sh    – bootstrap script (e.g., virtualenv, spaCy model download)
- presentation/ – sample data, screenshots, and architecture graphic (for reference)
- We know there’s also a config.ini at runtime for the NewsAPI key (not checked in).

##### README for architecture insights
- It describes a simple client–server web app: the browser hits Streamlit, which calls the helper module.
- It even includes an “Architecture of your Project Home Directory” image (presentation/arc.png) showing a root-level view.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Layers and Components
    Browser["Browser (Client)"]:::external

    subgraph "Frontend Layer"
        Streamlit["Streamlit Web Server\n(app.py)"]:::internal
    end

    subgraph "Backend Layer"
        Helper["Summarization Engine\n(helper.py)"]:::internal
        SpaCy["spaCy NLP Pipeline"]:::internal
    end

    subgraph "External Services"
        NewsAPI["NewsAPI Service"]:::external
    end

    subgraph "Config & Deployment"
        Config["Configuration File\n(config.ini)"]:::config
        ProcfileNode["Procfile"]:::deployment
        Setup["Bootstrap Script\n(setup.sh)"]:::deployment
        Req["Dependencies\n(requirements.txt)"]:::deployment
        Pres["Presentation Assets\n(presentation/)"]:::deployment
        Readme["Project README\n(README.md)"]:::deployment
    end

    %% Data Flows
    Browser -->|"UI events"| Streamlit
    Streamlit -->|"invoke fetch & summarize"| Helper
    Helper -->|"HTTP GET Article"| NewsAPI
    Helper -->|"process text"| SpaCy
    SpaCy -->|"summary text"| Helper
    Helper -->|"summary JSON/text"| Streamlit
    Streamlit -->|"render summary"| Browser

    %% Configuration & Deployment Flows
    Config -->|"API key injection"| Helper
    ProcfileNode -->|"launches"| Streamlit
    Setup -->|"environment setup"| SpaCy
    Req -->|"install deps"| Setup

    %% Click Events
    click Streamlit "https://github.com/anurag-agrawal-22/text-summarization-using-nlp/blob/master/app.py"
    click Helper "https://github.com/anurag-agrawal-22/text-summarization-using-nlp/blob/master/helper.py"
    click ProcfileNode "https://github.com/anurag-agrawal-22/text-summarization-using-nlp/tree/master/Procfile"
    click Setup "https://github.com/anurag-agrawal-22/text-summarization-using-nlp/blob/master/setup.sh"
    click Req "https://github.com/anurag-agrawal-22/text-summarization-using-nlp/blob/master/requirements.txt"
    click Pres "https://github.com/anurag-agrawal-22/text-summarization-using-nlp/tree/master/presentation/"
    click Readme "https://github.com/anurag-agrawal-22/text-summarization-using-nlp/blob/master/README.md"

    %% Styles
    classDef internal fill:#D6EAF8,stroke:#1F618D,color:#1F618D;
    classDef external fill:#D5F5E3,stroke:#239B56,color:#239B56;
    classDef config fill:#F9E79F,stroke:#B7950B,color:#7D6608;
    classDef deployment fill:#FADBD8,stroke:#C0392B,color:#78281F;
```
