← Back to all products

AI Content Detector

$19

Python AI content detector using perplexity analysis, burstiness scoring, and statistical text analysis.

📁 11 files
MarkdownPython

📄 Product Preview

Try the interactive reader and demo tools below, or get the full product with all content unlocked.

📖 Interactive Reader (Free Preview) ⚙ Try Demo Tools 📦 Download Free Sample

📁 File Structure 11 files

ai-content-detector/ ├── LICENSE ├── README.md ├── examples/ │ ├── basic_usage.py │ └── sample_texts/ │ ├── ai_generated.txt │ └── human_written.txt ├── free-sample.zip ├── guide/ │ ├── 01_features.md │ ├── 02_cli-reference.md │ └── 03_important-disclaimer.md ├── index.html └── src/ └── ai_content_detector.py

📖 Documentation Preview README excerpt

AI Content Detector

Python AI content detector: perplexity analysis, burstiness scoring, vocabulary richness, statistical text analysis, and confidence-scored reports. All math from scratch. Zero dependencies.

Part of the AI Toolkit collection by [CodeVault](https://ai-toolkit.codevault.dev).

Features

  • Perplexity estimation — Bigram language model measures text predictability
  • Burstiness scoring — Sentence length variation analysis (AI text is suspiciously uniform)
  • Vocabulary richness — Type-token ratio detects AI's characteristic word diversity
  • Transition word density — AI overuses words like "Furthermore", "Additionally", "Moreover"
  • Repetition detection — N-gram repetition patterns common in AI output
  • Readability scoring — Flesch reading ease and syllable analysis
  • Confidence reports — Weighted ensemble verdict with per-signal breakdown
  • Batch analysis — Analyze entire directories of text files
  • JSON export — Machine-readable reports for integration into workflows

Quick Start


# Run demo with AI and human text samples
python src/ai_content_detector.py --demo

# Analyze inline text
python src/ai_content_detector.py --text "Your text to analyze goes here..."

# Analyze a file
python src/ai_content_detector.py --file document.txt

# Analyze with JSON export
python src/ai_content_detector.py --file document.txt --export report.json

# Batch analyze a folder
python src/ai_content_detector.py --batch essays/ --export results.json

# Quick verdict only
python src/ai_content_detector.py --file document.txt --quiet

Project Structure


ai-content-detector/
├── README.md
├── LICENSE
├── src/
│   └── ai_content_detector.py    # Core engine (~470 lines)
└── examples/
    ├── basic_usage.py             # Programmatic usage example
    └── sample_texts/              # AI and human text samples
        ├── ai_generated.txt
        └── human_written.txt

CLI Reference

FlagDescription
--demoRun demo with AI and human samples

... continues with setup instructions, usage examples, and more.

📄 Code Sample .py preview

examples/basic_usage.py#!/usr/bin/env python3 """ Basic usage example for the AI Content Detector. Demonstrates: - Analyzing text for AI vs human writing patterns - Inspecting statistical signals - Extracting text features - Batch analysis from files - Comparing AI-generated and human-written samples """ import json import sys from pathlib import Path # Allow running from the examples/ directory sys.path.insert(0, str(Path(__file__).resolve().parent.parent / "src")) from ai_content_detector import ( detect, extract_features, tokenize_sentences, tokenize_words, ) def demo_basic_detection() -> None: """Run detection on two contrasting text samples.""" print("=== Basic Detection ===\n") ai_text = ( "Artificial intelligence has fundamentally transformed the landscape of modern " "technology. Furthermore, the integration of machine learning algorithms into " "various industries has enabled unprecedented levels of automation and efficiency. " "Additionally, natural language processing has made significant strides in recent " "years, enabling computers to understand and generate human language with remarkable " "accuracy. Moreover, the development of large language models has opened new " "possibilities for content creation and data analysis. Consequently, organizations " "across all sectors are increasingly adopting AI-powered solutions to enhance their " "operations and improve decision-making processes." )
Buy Now — $19 Back to Products