# vivekn5500/-ai-duplicate-detection architecture

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

- Interactive diagram: https://gitdiagram.com/vivekn5500/-ai-duplicate-detection
- Repository: https://github.com/vivekn5500/-ai-duplicate-detection

## Overview

DupDetector AI is a Streamlit dashboard for finding semantically similar text records. Users provide manual text, a CSV, or a PDF; the app extracts records, translates and cleans them, then embeds them and calculates pairwise cosine similarity. A configurable threshold drives duplicate grouping and match diagnostics. The dashboard also presents keyword extraction, summary metrics, a similarity matrix, and a network visualization. The implementation is concentrated in app.py; the README documents capabilities consistent with that workflow. The graph reflects the shown app code; it does not assume persistence or other future-scope features.

Main entry points: [`app.py`](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py) (Streamlit app)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_dashboard["Dashboard"]
  node_app["Streamlit app<br/>[app.py]"]
end

subgraph group_ingestion["Record ingestion"]
  node_manual["Manual text input<br/>[app.py]"]
  node_csv["CSV upload<br/>[app.py]"]
  node_pdf["PDF extraction<br/>[app.py]"]
  node_preprocess["Translate and clean<br/>[app.py]"]
  node_translator["Google Translator"]
end

subgraph group_analysis["Similarity analysis"]
  node_embeddings["Sentence embeddings<br/>[app.py]"]
  node_sentencebert["Sentence Transformer"]
  node_similarity["Cosine similarity<br/>[app.py]"]
  node_threshold["Threshold matching<br/>[app.py]"]
end

subgraph group_results["Results and visualization"]
  node_clusters["Duplicate clusters<br/>[app.py]"]
  node_diagnostics["Match diagnostics<br/>[app.py]"]
  node_keywords["Keyword extraction<br/>[app.py]"]
  node_metrics["Insights metrics<br/>[app.py]"]
  node_network["Similarity network<br/>[app.py]"]
  node_matrix["Similarity matrix<br/>[app.py]"]
end

node_user(("User"))

node_user -->|"uses"| node_app
node_app -->|"collects text"| node_manual
node_app -->|"loads records"| node_csv
node_app -->|"extracts text"| node_pdf
node_app -->|"translates and cleans"| node_preprocess
node_preprocess -->|"translates via"| node_translator
node_app -->|"encodes records"| node_embeddings
node_embeddings -->|"uses model"| node_sentencebert
node_app -->|"calculates scores"| node_similarity
node_app -->|"applies cutoff"| node_threshold
node_app -->|"groups matches"| node_clusters
node_app -->|"renders pair details"| node_diagnostics
node_app -->|"extracts keywords"| node_keywords
node_app -->|"renders counts"| node_metrics
node_app -->|"builds graph"| node_network
node_app -->|"renders scores"| node_matrix

click node_app "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_manual "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_csv "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_pdf "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_preprocess "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_embeddings "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_similarity "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_threshold "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_clusters "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_diagnostics "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_keywords "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_metrics "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_network "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py"
click node_matrix "https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.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_app,node_user toneBlue
class node_manual,node_csv,node_pdf,node_preprocess,node_translator toneAmber
class node_embeddings,node_sentencebert,node_similarity,node_threshold toneMint
class node_clusters,node_diagnostics,node_keywords,node_metrics,node_network,node_matrix toneRose
```

## Components

### Dashboard

- [Streamlit app](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`

### Record ingestion

- [Manual text input](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- [CSV upload](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- [PDF extraction](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- [Translate and clean](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- **Google Translator**

### Similarity analysis

- [Sentence embeddings](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- **Sentence Transformer**
- [Cosine similarity](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- [Threshold matching](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`

### Results and visualization

- [Duplicate clusters](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- [Match diagnostics](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- [Keyword extraction](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- [Insights metrics](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- [Similarity network](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`
- [Similarity matrix](https://github.com/vivekn5500/-ai-duplicate-detection/blob/main/app.py): `app.py`

### Other components

- **User**

## Connections

- User → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → Manual text input: collects text (evidence: `app.py`)
- Streamlit app → CSV upload: loads records (evidence: `app.py`)
- Streamlit app → PDF extraction: extracts text (evidence: `app.py`)
- Streamlit app → Translate and clean: translates and cleans (evidence: `app.py`)
- Translate and clean → Google Translator: translates via (evidence: `app.py`)
- Streamlit app → Sentence embeddings: encodes records (evidence: `app.py`)
- Sentence embeddings → Sentence Transformer: uses model (evidence: `app.py`)
- Streamlit app → Cosine similarity: calculates scores (evidence: `app.py`)
- Streamlit app → Threshold matching: applies cutoff (evidence: `app.py`)
- Streamlit app → Duplicate clusters: groups matches (evidence: `app.py`)
- Streamlit app → Match diagnostics: renders pair details (evidence: `app.py`)
- Streamlit app → Keyword extraction: extracts keywords (evidence: `app.py`)
- Streamlit app → Insights metrics: renders counts (evidence: `app.py`)
- Streamlit app → Similarity network: builds graph (evidence: `app.py`)
- Streamlit app → Similarity matrix: renders scores (evidence: `app.py`)
