Skip to content

Inheritance-2K25/ai-text-detector

Repository files navigation

🧠 AI Text Detector & Analysis System

Python PyTorch FastAPI Next.js License


📌 Overview

An advanced AI-powered text analysis system that detects whether content is AI-generated or human-written using a hybrid architecture combining:

  • 🤖 Transformer-based deep learning
  • ✍️ Stylometric feature analysis
  • 📊 Machine learning classification

It also includes:

  • Grammar checking
  • Style analysis
  • Plagiarism detection

🎯 Key Features

✨ AI vs Human Detection ✨ Hybrid Model (DeBERTa + Stylometry) ✨ Grammar & Writing Feedback ✨ Plagiarism Detection ✨ Long Document Support (Chunking) ✨ Chrome Extension Integration ✨ GPU Acceleration (CUDA)


🏗️ System Architecture

image

🔄 Pipeline

image

🧩 Core Modules

🧠 AI Detection Engine

  • Uses DeBERTa Transformer
  • Extracts contextual embeddings
  • Works as semantic understanding layer

✍️ Stylometric Analysis

  • Captures writing style patterns:

    • Sentence length
    • Word complexity
    • Vocabulary richness
    • Punctuation usage

📊 Grammar Analysis

  • Powered by LanguageTool
  • Detects grammatical errors
  • Suggests corrections

📚 Plagiarism Detection

  • Integrated with external API
  • Detects similarity with online content
  • Returns plagiarism score

⚡ ML Infrastructure

  • Hybrid model:

    • Deep Learning + Traditional ML
  • Supports:

    • GPU (CUDA)
    • Large text processing

🛠️ Tech Stack

🔹 Backend

  • FastAPI
  • PyTorch
  • Hugging Face Transformers
  • scikit-learn
  • spaCy
  • NumPy

🔹 Frontend

  • Next.js
  • React

🔹 Other

  • CUDA (GPU acceleration)
  • LanguageTool (Grammar checking)
  • External API (Plagiarism)

🔮 Future Scope

  • Multilingual support
  • Explainable AI (highlight AI text)
  • Real-time editor integration
  • Improved long-text understanding
  • Continuous model updates

🚀 Steps to Run the Project (Local)

1️⃣ Clone the repository

git clone <repository-url>

🧠 Run Backend (FastAPI)

2️⃣ Go to backend directory

cd backend

3️⃣ Create & activate virtual environment

Windows

python -m venv venv
venv\Scripts\activate

macOS / Linux

python3 -m venv venv
source venv/bin/activate

4️⃣ Install backend dependencies

pip install -r requirements.txt

5️⃣ Start backend server

uvicorn app:app --reload

Backend runs at:

http://127.0.0.1:8000

🌐 Run Frontend (Next.js)

6️⃣ Open new terminal & go to project root

cd ai-text-detector

7️⃣ Install frontend dependencies

npm install

8️⃣ Start frontend server

npm run dev

Frontend runs at:

http://localhost:3000

🔄 Run Summary

Service Command Port
Backend uvicorn app:app --reload 8000
Frontend npm run dev 3000

🧩 Run Chrome Extension (Local)

9️⃣ Go to extensions directory

From the project root:

cd extensions

Ensure this folder contains a manifest.json file.

🔟 Open Chrome Extensions page

Open Google Chrome and navigate to:

chrome://extensions

1️⃣1️⃣ Enable Developer Mode

Turn Developer mode ON (top-right corner).

1️⃣2️⃣ Load the extension

Click Load unpacked

Select the extensions folder

Click Open

✅ The extension will be successfully loaded into Chrome.

1️⃣3️⃣ Use the extension

Click the 🧩 Extensions icon in the Chrome toolbar

Pin your extension

Open any webpage and use the extension features

🔄 Complete Run Summary

Service Command / Action Port
Backend uvicorn app:app --reload 8000
Frontend npm run dev 3000
Chrome Extension Load Unpacked (extensions/)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors