A comprehensive document processing application that extracts text, analyzes content, and generates insights from various document formats.
- Extract text from multiple document formats (PDF, DOCX, TXT, RTF)
- Analyze document content using NLP techniques
- Generate document summaries and key insights
- Identify and extract entities, keywords, and topics
- Assess document sentiment and readability metrics
- Provide a user-friendly web interface for document processing
- Support for batch processing of multiple documents
- Direct text analysis without document upload
doc-processor/
├── data/
│ ├── raw/ # Raw document files
│ └── processed/ # Processed document data
├── src/
│ ├── backend/ # Backend API and processing logic
│ ├── frontend/ # Web interface
│ ├── models/ # ML models for document analysis
│ └── utils/ # Utility functions
├── tests/ # Unit and integration tests
├── run.py # Script to run both backend and frontend
└── README.md # Project documentation
- Python 3.8+
- Node.js 14+
- Required Python packages (see requirements.txt)
- Clone the repository
- Install backend dependencies:
pip install -r requirements.txt - Install frontend dependencies:
cd src/frontend npm install
The easiest way to run the application is to use the provided run script:
python run.py
This will:
- Start the Flask backend server on port 5000
- Start the React frontend development server on port 3000
- Automatically open your browser to the application
- Handle all the necessary environment setup
- Start the backend server:
cd src/backend python -m flask run --port=5000 - Start the frontend development server:
cd src/frontend npm start - Open your browser and navigate to
http://localhost:3000
The backend is built with Flask and provides a RESTful API for document processing:
/api/upload- Upload documents/api/process/<document_id>- Process a document/api/documents- List all documents/api/documents/<document_id>- Get document details/api/text-analysis- Analyze text directly
The React frontend provides an intuitive interface for:
- Document uploading and management
- Viewing document analysis results
- Direct text analysis without document upload
- Batch processing of multiple documents
The application uses various NLP techniques to analyze documents:
- Text Extraction: Extract text from PDF, DOCX, DOC, TXT, and RTF files
- Keyword Extraction: Identify important keywords using TF-IDF
- Entity Recognition: Extract named entities (people, organizations, locations, etc.)
- Summarization: Generate concise summaries of document content
- Topic Modeling: Identify main topics and their relevance
- Sentiment Analysis: Assess the overall sentiment of the document
- Readability Metrics: Calculate readability scores (Flesch Reading Ease, etc.)
To add new document analysis capabilities:
- Update the
DocumentAnalyzerclass insrc/models/document_analyzer.py - Add corresponding API endpoints in
src/backend/app.py - Update the frontend components to display the new analysis results
To add support for new document formats:
- Update the
DocumentExtractorclass insrc/utils/document_extractor.py - Add the new file extension to the allowed extensions list in
src/backend/app.py - Update the file type validation in the frontend dropzone component
This project is licensed under the MIT License - see the LICENSE file for details.