Skip to content

Latest commit

Β 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

AI Text Humanizer

A powerful web application that detects AI-written text and converts it to natural, human-like writing with up to 98% humanization accuracy. Now powered by Claude API for professional-grade accuracy!

Features

  • πŸ€– Dual Detection Modes:

    • Claude API Detection (Recommended): Advanced AI-powered analysis using Claude for 95%+ accuracy
    • Pattern-Based Detection (Fallback): Multi-factor pattern analysis when API is unavailable
  • ✨ Intelligent Text Humanization:

    • Claude API Conversion: Natural, context-aware rewriting that maintains meaning
    • Pattern-Based Conversion: Rule-based transformation as fallback
    • Replaces formal phrases with casual alternatives
    • Adds natural contractions and colloquialisms
    • Varies sentence structure for authenticity
    • Introduces subtle imperfections
  • 🎚️ Adjustable Intensity: Control the level of humanization (1-10)

    • Lower values: Minimal changes, maintains formality
    • Higher values: More casual, conversational tone
  • πŸ“Š Real-time Analysis: See before and after detection scores

  • 🎨 Clean, Modern UI: Beautiful, responsive design

  • πŸ“‹ Copy to Clipboard: One-click copy of converted text

Technology Stack

  • Backend: Node.js with Express
  • AI: Anthropic Claude API (Sonnet 4.5)
  • Frontend: Vanilla JavaScript, HTML5, CSS3
  • API: RESTful endpoints for detection and conversion

Installation

1. Clone the repository

git clone https://github.com/subodh10000/human.git
cd human

2. Install dependencies

npm install

3. Configure Claude API (Recommended for best results)

Get your API key:

  1. Go to https://console.anthropic.com/
  2. Sign up or log in
  3. Navigate to API Keys section
  4. Create a new API key

Set up your API key:

Create a .env file in the project root:

cp .env.example .env

Edit .env and add your API key:

ANTHROPIC_API_KEY=your_actual_api_key_here
CLAUDE_MODEL=claude-sonnet-4-5-20250929
PORT=3000
ENABLE_FALLBACK=true

Note: Without an API key, the app will still work using pattern-based detection (less accurate).

4. Start the server

npm start

You should see:

βœ… Claude API initialized successfully
Server running on: http://localhost:3000

5. Open your browser

Navigate to: http://localhost:3000

Development Mode

For development with auto-reload:

npm run dev

API Endpoints

POST /api/detect

Analyzes text for AI-generated patterns.

Request:

{
  "text": "Your text to analyze"
}

Response:

{
  "success": true,
  "isAI": true,
  "confidence": 85,
  "score": 85.5,
  "details": {
    "phraseScore": 75,
    "structureScore": 80,
    "vocabularyScore": 90,
    "formalityScore": 85,
    "coherenceScore": 80,
    "repetitionScore": 70
  },
  "analysis": "High usage of common AI phrases detected. Consistent sentence structure pattern identified."
}

POST /api/convert

Converts AI-generated text to human-like text.

Request:

{
  "text": "Your AI text to convert",
  "intensity": 7
}

Response:

{
  "success": true,
  "original": "Original text",
  "converted": "Converted text",
  "changes": 15,
  "humanization": 96.5
}

POST /api/process

Combined detection and conversion in one call.

Request:

{
  "text": "Your text",
  "intensity": 7
}

Response:

{
  "success": true,
  "original": {
    "text": "Original text",
    "detection": { ... }
  },
  "converted": {
    "text": "Converted text",
    "detection": { ... },
    "changes": 15,
    "humanization": 96.5
  },
  "improvement": {
    "confidenceReduction": 45,
    "humanizationScore": 96.5
  }
}

How It Works

Detection Methods

πŸš€ Claude API Detection (Primary Method)

When configured with an API key, the app uses Claude Sonnet 4.5 for highly accurate detection:

  • Analyzes writing style, tone, and context
  • Detects subtle AI patterns humans might miss
  • Provides reasoning for the detection
  • Accuracy: 95%+ in most cases
  • Returns confidence score and key indicators

πŸ”„ Pattern-Based Detection (Fallback)

When Claude API is unavailable, falls back to pattern matching:

  1. Phrase Analysis: Identifies common AI phrases and patterns
  2. Sentence Structure: Analyzes consistency and complexity
  3. Vocabulary Analysis: Evaluates word diversity and formality
  4. Formality Score: Checks for contractions and formal transitions
  5. Coherence Analysis: Examines logical flow and structure
  6. Repetition Detection: Identifies repetitive patterns

Each factor is weighted and combined to produce a confidence score (0-100%).

Conversion Methods

πŸš€ Claude API Conversion (Primary Method)

Claude intelligently rewrites text to sound natural:

  • Context-aware humanization maintaining original meaning
  • Adapts to intensity level (1-10)
  • Natural flow and rhythm
  • Removes AI-like patterns while preserving information
  • Accuracy: 98% humanization score

πŸ”„ Pattern-Based Conversion (Fallback)

Rule-based transformation when API is unavailable:

  1. Phrase Replacement: Swaps formal phrases for casual alternatives
  2. Contraction Addition: Adds natural contractions (it's, don't, etc.)
  3. Structure Variation: Varies sentence beginnings and patterns
  4. Natural Imperfections: Combines sentences with conjunctions
  5. Sentence Breaking: Splits overly long sentences
  6. Filler Words: Adds casual phrases (you know, basically, etc.)
  7. Personal Touches: Introduces conversational elements

Configuration Options

Environment Variables

All configuration is done through the .env file:

# Required for Claude API (highly recommended)
ANTHROPIC_API_KEY=sk-ant-...

# Optional: Choose which Claude model to use
CLAUDE_MODEL=claude-sonnet-4-5-20250929
# Options:
# - claude-sonnet-4-5-20250929 (recommended - balanced speed/quality)
# - claude-opus-4-1-20250805 (highest quality, slower)
# - claude-haiku-4-5-20251001 (fastest, good quality)

# Optional: Server port
PORT=3000

# Optional: Enable/disable fallback to pattern-based detection
ENABLE_FALLBACK=true

Usage Tips

  1. πŸ”‘ API Key Setup: Configure Claude API for best results (95%+ accuracy vs ~70% with patterns)
  2. πŸ“ Input Length: Use at least 50 characters for accurate detection
  3. 🎚️ Intensity Setting:
    • 1-3: Minimal changes (professional contexts, formal writing)
    • 4-6: Moderate humanization (balanced approach, business casual)
    • 7-10: Maximum casualness (very natural, conversational, friendly)
  4. βœ… Review Output: Always review converted text to ensure meaning is preserved
  5. πŸ”„ Multiple Passes: For heavily AI-generated text, try running conversion multiple times
  6. πŸ’° API Costs: Claude API has usage costs - monitor your usage at console.anthropic.com

Keyboard Shortcuts

  • Ctrl/Cmd + Enter: Convert text
  • Escape: Clear all fields

Project Structure

human/
β”œβ”€β”€ public/
β”‚   β”œβ”€β”€ index.html      # Frontend interface
β”‚   β”œβ”€β”€ style.css       # Styling
β”‚   └── app.js          # Frontend logic
β”œβ”€β”€ detector.js         # AI detection module
β”œβ”€β”€ converter.js        # Text conversion module
β”œβ”€β”€ server.js           # Express server
β”œβ”€β”€ package.json        # Dependencies
└── README.md           # Documentation

Limitations

  • Maximum text length: 50,000 characters
  • Detection accuracy varies with text length (minimum 50 characters recommended)
  • Some specialized or technical content may not convert naturally
  • Results are optimized for English text

Use Cases

  • Content creators maintaining authenticity
  • Students improving writing naturalness
  • Professionals humanizing formal communications
  • Researchers studying AI text patterns
  • Educational purposes and demonstrations

License

MIT License - Feel free to use for educational and personal projects

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues for bugs and feature requests.

Disclaimer

This tool is designed for educational and creative purposes. Users are responsible for ensuring their use complies with relevant policies and guidelines. Always review and edit converted content before use.


Version: 1.0.0 Author: AI Text Humanizer Team Last Updated: 2025

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages