A modern web application for detecting and visualizing duplicate content across .docx documents using React + TypeScript frontend and FastAPI backend.
- 📊 Document Dashboard - View all documents ranked by similarity score
- 🔍 Three Detection Methods:
- Exact Match - Identical sentences (red highlights)
- Near-Duplicate - SimHash similarity (orange highlights)
- Semantic Match - Embedding-based meaning (yellow highlights)
- 📄 Document Viewer - View documents with color-coded duplicate highlights
- 🔄 Comparison View - Side-by-side duplicate sentence pairs
- ⚙️ Interactive Analysis - Run analysis with configurable parameters
- 🚀 Real-time Updates - Background analysis with status polling
- Python 3.8+ (with uv package manager)
- Node.js 16+ and npm
.docxfiles in thedocs/folder
1. Install Backend Dependencies:
cd backend
uv pip install --system -r requirements.txt
cd ..2. Install Frontend Dependencies:
cd frontend
npm install
cd ..Terminal 1 - Backend:
# Windows
start_backend.bat
# Linux/Mac
chmod +x start_backend.sh
./start_backend.shTerminal 2 - Frontend:
# Windows
start_frontend.bat
# Linux/Mac
chmod +x start_frontend.sh
./start_frontend.sh- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- API Docs: http://localhost:8000/docs
- Place
.docxfiles in thedocs/folder (2 sample files included) - Open http://localhost:3000 in your browser
- Click "Run New Analysis" in the left panel
- Wait 10-30 seconds for completion
- Explore results:
- View similarity scores in the dashboard
- Click "View Duplicates" for detailed matches
- Click "View Document" to see highlighted content
├── backend/ # FastAPI Python backend
│ ├── main.py # API server with endpoints
│ ├── analyzer.py # Analysis runner and result parser
│ ├── converter.py # DOCX to HTML converter
│ └── requirements.txt # Python dependencies
│
├── frontend/ # React TypeScript frontend
│ ├── src/
│ │ ├── components/ # React components
│ │ ├── api.ts # API client
│ │ ├── App.tsx # Main application
│ │ └── main.tsx # Entry point
│ └── package.json # Node dependencies
│
├── docs/ # Place .docx files here
├── dedup_out/ # Analysis output (auto-generated)
└── corpus_dedup_runner.py # Core analysis script
GET /api/analysis/status- Check analysis statusPOST /api/analysis/run- Trigger new analysisGET /api/documents- List documents with metricsGET /api/document/{doc_name}- Get document HTMLGET /api/duplicates/{doc_name}- Get duplicates for documentGET /api/highlights/{doc_name}- Get highlight informationGET /api/similarity-matrix- Get document similarity matrix
Configure in the UI or modify defaults in backend/main.py:
min_sentence_words: Minimum words per sentence (default: 8)sim_hamming_strict: Strict Hamming distance threshold (default: 6)sim_hamming_moderate: Moderate Hamming distance threshold (default: 8)use_embeddings: Enable semantic matching (slower, more comprehensive)
Edit frontend/src/index.css to customize highlight colors:
.highlight-exact { background-color: rgba(239, 68, 68, 0.3); }
.highlight-simhash { background-color: rgba(249, 115, 22, 0.3); }
.highlight-embedding { background-color: rgba(234, 179, 8, 0.3); }- FastAPI - Modern Python web framework
- Pandas - Data manipulation
- python-docx - Document parsing
- sentence-transformers - Embeddings (optional)
- React 18 - UI framework
- TypeScript - Type safety
- Vite - Build tool
- TailwindCSS - Styling
- Axios - HTTP client
Port already in use:
- Stop other applications using ports 8000 or 3000
- Or change port numbers in config files
"Module not found":
- Run
uv pip install --system -r backend/requirements.txt - Run
npm installin frontend folder
"No documents found":
- Add
.docxfiles to thedocs/folder - Run the analysis
Analysis not completing:
- Check both servers are running
- Check browser console (F12) for errors
- Check backend terminal for Python errors
- Detailed Documentation: See
README_FRONTEND.mdfor comprehensive guide - Analysis Tool: See
README_corpus_dedup_runner.mdfor analysis details - Quick Reference: See
QUICKSTART.mdfor fast setup
Internal use - adapt as needed.
Built on top of the corpus_dedup_runner.py sentence-level duplicate detection system.