Skip to content

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Plagiarism Detector

This project is a web-based Plagiarism Detector application built with Python, Flask, and D3.js. It allows users to upload multiple documents (.docx or .pdf) and analyzes them to detect similarities using the Jaccard Similarity algorithm. The application also visualizes the relationships between documents using an interactive sociogram.

Features

  • Multi-Format Support: Upload and analyze both Word documents (.docx) and PDF files (.pdf).
  • Text Extraction: Efficiently extracts text from uploaded documents using python-docx and PyMuPDF.
  • Shingling & Hashing: Implements shingling (n-grams) and hashing for effective similarity detection.
  • Similarity Calculation: Computes Jaccard Similarity between all pairs of uploaded documents.
  • Similarity Filtering: Highlights document pairs with high similarity (>80%).
  • Interactive Visualization: Displays a sociogram (network graph) of document similarities using D3.js.
  • User-Friendly Interface: Clean and intuitive web interface for uploading files and viewing results.

Technologies Used

  • Backend: Python, Flask
  • Frontend: HTML5, CSS3, JavaScript (D3.js)
  • Libraries:
    • Flask (Web Framework)
    • python-docx (DOCX parsing)
    • PyMuPDF (PDF parsing)
    • itertools (Data processing)
    • hashlib (Hashing)

Project Structure

Plagiarism-Detector/
├── app.py              # Main Flask application
├── requirements.txt    # Python dependencies
├── static/             # Static files (CSS, JS, images)
│   └── styles.css
├── templates/          # HTML templates
│   ├── index.html      # Main upload page
│   └── sociogram.html  # Visualization page
└── README.md           # Project documentation

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/Plagiarism-Detector.git
    cd Plagiarism-Detector
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt

Usage

  1. Run the application:

    python app.py
  2. Access the web interface: Open your web browser and go to http://127.0.0.1:5000/.

  3. Check for Plagiarism:

    • Click on "Select Documents" to choose multiple .docx or .pdf files.
    • Click "Upload Files" to start the analysis.
    • View the "High Similarity Results" table for document pairs with similarity > 80%.
  4. View Sociogram:

    • Click the "View Sociogram" button to see a visual representation of the document relationships.
    • Hover over nodes to highlight connections and view similarity percentages.

How it Works

  1. Preprocessing: The application reads the text content from the uploaded files.
  2. Shingling: The text is broken down into small overlapping sequences of words called "shingles" (size 5).
  3. Hashing: Each shingle is hashed using SHA-256 to create a unique fingerprint.
  4. Comparison: The set of hashed shingles from each document is compared against every other document using the Jaccard Similarity coefficient. $$ J(A, B) = \frac{|A \cap B|}{|A \cup B|} $$
  5. Result: The similarity score (percentage) indicates the degree of overlap between the documents.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages