A modular, full-stack system for detecting AI-generated text in news and academic essays.
Supports API, dashboards, web apps, and a Chrome extension for real-time scanning and explainability.
- FastAPI Backend with a fine-tuned RoBERTa model for high-accuracy inference.
- LIME Explainability highlights which words influenced each prediction.
- Plotly Dash Dashboard for interactive EDA, model evaluation, and inference.
- React Web App for single-text and batch-file analysis with a responsive UI.
- Chrome Extension enabling on-page scanning of any web content.
- Python 3.10 or higher
- Node.js 14.x or higher + npm
- Optional: Docker & Docker Compose (for containerized setup)
-
Clone the repo
git clone https://github.com/MichaelShpyl/AI-Text-Detection-Tool.git cd AI-Text-Detection-Tool
-
Create & activate a Python virtual environment
python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate.bat # Windows
-
Install Python dependencies
pip install --upgrade pip pip install -r requirements.txt
-
Install frontend dependencies
cd frontend npm install cd ..
-
.env
file (optional): You can create a.env
in the project root with:BACKEND_HOST=127.0.0.1 BACKEND_PORT=8000 MODEL_PATH=./models/roberta_ai_detector.pt
-
Dash settings: By default, the Dash app will connect to
http://127.0.0.1:8000
. Adjust inscripts/dashboard_app.py
if needed.
cd scripts
python api_server.py
- Starts FastAPI at
http://127.0.0.1:8000
- Loads the trained model into memory
- Option A – Notebook
Opennotebooks/06_dashboard_dash.ipynb
in Jupyter and Run All. - Option B – Script
python scripts/dashboard_app.py
- Dashboard runs at
http://localhost:8050
- Tabs: EDA, Evaluation, Inference (API-backed)
- Dashboard runs at
cd frontend
npm start
- Opens at
http://localhost:3000
- Sidebar: Single Text Analysis | Batch Upload
- Go to
chrome://extensions/
, enable Developer mode - Click Load unpacked, select the
extension/
folder - Visit any webpage, click Scan this article
- View predictions & highlights (ensure API is running)
# Single-text inference
curl -X POST http://127.0.0.1:8000/predict -H "Content-Type: application/json" -d '{"text": "Sample input text to analyze."}'
{
"prediction": "AI-generated",
"confidence": 0.97
}
AI-Text-Detection-Tool/
├── scripts/ # Backend API & Dash launcher
│ ├── api_server.py
│ └── dashboard_app.py
├── notebooks/ # Jupyter analysis & Dash notebook
├── frontend/ # React single/batch analysis app
├── extension/ # Chrome extension source code
├── data/ # Sample datasets for batch testing
├── models/ # Trained model weights
├── requirements.txt # Python dependencies
├── package.json # Frontend dependencies
├── README.md # This file
└── LICENSE # MIT license
- Fork the repo
- Create a feature branch:
git checkout -b feature/awesome-new
- Commit your changes:
git commit -m "feat: add awesome feature"
- Push to your branch:
git push origin feature/awesome-new
- Open a Pull Request
Please follow the Contributing Guidelines if available.
- Add automated unit tests & CI via GitHub Actions
- Containerize with Docker & Docker Compose
- Publish Python package to PyPI
- Enhance Chrome extension UI with dark mode toggle
- API errors? Check
scripts/api_server.py
logs for stack traces. - Model loading issues? Verify
MODEL_PATH
points to the correct.pt
file. - Port conflicts? Change ports via
.env
or command-line flags.
This project is licensed under the MIT License – see the LICENSE file for details.
Michael Shpyl – michael.shpyl@gmail.com
Project repo: https://github.com/MichaelShpyl/AI-Text-Detection-Tool
- Built with ❤ using FastAPI, Plotly Dash, React, and LIME
- Thanks to DSP Sligo Business Improvement Team for guidance