CoolFace
Apppublic

MUmarAlam/ai-text-humanizer

sourceHugging Faceupdated 2mo agoView on Hugging Face
0likes
App README

๐Ÿค–โžก๏ธ๐Ÿ‘จ AI Text Humanizer

An advanced tool to transform robotic, AI-generated text into natural, human-like writing.

Build

Built by M Umar Alam

  • โ€”Email: umaralam9002@gmail.com
  • โ€”Portfolio: umardev.me

๐Ÿš€ Features

  • โ€”Multiple AI Models: Uses T5 and Pegasus models for diverse paraphrasing
  • โ€”Advanced Techniques: Vocabulary diversification, sentence restructuring, natural flow enhancement
  • โ€”Batch Processing: Handle multiple texts and files at once
  • โ€”Academic Focus: Preserves academic tone while making text more natural
  • โ€”Undetectable Output: Creates human-like text that passes AI detection tools
  • โ€”Multiple Interfaces: Simple, advanced, and batch processing versions

๐Ÿ“ Files

  1. 1.`humanizer_app.py` - Advanced version with multiple models and sophisticated techniques
  2. 2.`humanizer_simple.py` - Simplified version with reliable single model
  3. 3.`humanizer_batch.py` - Batch processing version for files and multiple texts

๐Ÿ› ๏ธ Installation

Prerequisites

  1. 1.Python 3.13 or newer installed
  2. 2.Internet access for package installation
  3. 3.Git installed if cloning from GitHub

Clone and run

powershell
git clone <your-repo-url>
cd ai-text-humanizer
python -m pip install -r requirements.txt
python app.py

If 7860 is already in use, the app will automatically pick another free local port and print the URL in the terminal.

One-command launcher on Windows

powershell
run.bat

๐ŸŽฏ Usage

Basic Usage

  1. 1.Run python app.py or run.bat
  2. 2.Open your browser to the local URL printed in the terminal
  3. 3.Paste your AI-generated text
  4. 4.Select humanization level
  5. 5.Click "Humanize" and get natural, human-like output

Humanization Levels

  • โ€”Light: Basic paraphrasing with minimal changes
  • โ€”Moderate/Medium: Paraphrasing + vocabulary variations + natural connectors
  • โ€”Heavy: All techniques + sentence structure modifications + advanced variations

Batch Processing

The batch processor (humanizer_batch.py) supports:

  • โ€”.txt files: Processes paragraph by paragraph
  • โ€”.csv files: Adds a 'humanized' column with processed text

๐Ÿ”Œ API Endpoints

Run python app.py to expose the API and UI on the same server.

GET /api/health

  • โ€”Input: none
  • โ€”Response: JSON with service status

Example response:

json
{ "status": "ok", "service": "AI Text Humanizer API" }

POST /api/humanize

  • โ€”Input:
  • โ€”text - the text to humanize
  • โ€”level - Light, Medium, or Heavy
  • โ€”Response: the original text, the humanized text, and the selected level

Example request:

json
{
  "text": "The implementation of machine learning algorithms demonstrates significant improvements.",
  "level": "Medium"
}

Example response:

json
{ "input_text": "...", "humanized_text": "...", "level": "Medium" }

POST /api/detect

  • โ€”Input:
  • โ€”text - the text to analyze
  • โ€”Response: AI probability, confidence, verdict, and detection breakdown

POST /api/combined

  • โ€”Input:
  • โ€”text - the text to humanize and analyze
  • โ€”level - Light, Medium, or Heavy
  • โ€”Response: the humanized text plus the AI detection analysis for that output

The UI is available at http://127.0.0.1:<port>/ui and the Swagger docs are available at http://127.0.0.1:<port>/docs.

๐Ÿ”ง How It Works

Advanced Techniques Used

  1. 1.Multi-Model Paraphrasing: Uses multiple AI models to avoid patterns
  2. 2.Vocabulary Diversification: Replaces words with contextual synonyms
  3. 3.Sentence Structure Variation: Modifies sentence patterns for natural flow
  4. 4.Academic Connector Integration: Adds natural transitional phrases
  5. 5.Hedging Language: Incorporates academic hedging for natural tone
  6. 6.Smart Chunking: Processes long texts in optimal chunks

AI Models Used

  • โ€”T5 Paraphrase (Primary): Vamsi/T5_Paraphrase_Paws
  • โ€”Pegasus (Secondary): tuner007/pegasus_paraphrase
  • โ€”NLTK WordNet: For synonym replacement
  • โ€”Custom Algorithms: For structure and flow optimization

๐Ÿ“Š Example Transformations

Input (AI-generated):

The implementation of machine learning algorithms in data processing systems demonstrates significant improvements in efficiency and accuracy metrics across various benchmark datasets.

Output (Humanized):

Implementing machine learning algorithms within data processing frameworks shows notable enhancements in both efficiency and accuracy measures when evaluated across different benchmark datasets. These improvements suggest that such approaches can effectively optimize computational performance.

๐ŸŽฎ Advanced Features

Multi-Level Processing

  • โ€”Processes texts of any length by intelligent chunking
  • โ€”Maintains context across chunks
  • โ€”Preserves academic integrity

Natural Variations

  • โ€”Dynamic vocabulary replacement
  • โ€”Contextual synonym selection
  • โ€”Academic phrase integration
  • โ€”Sentence flow optimization

Error Handling

  • โ€”Graceful fallbacks if models fail
  • โ€”Multiple backup techniques
  • โ€”Robust error recovery

๐Ÿ” Best Practices

  1. 1.Input Quality: Use complete sentences and proper grammar
  2. 2.Length Considerations: Works best with 50-1000 word chunks
  3. 3.Context Preservation: Review output to ensure meaning is maintained
  4. 4.Multiple Passes: For heavy humanization, consider multiple rounds
  5. 5.Manual Review: Always review output for accuracy and flow

๐Ÿšซ Troubleshooting

Common Issues

  1. 1.Model Loading Errors:
  2. 2.Ensure protobuf is installed: pip install protobuf
  3. 3.Check internet connection for model downloads
  4. 4.Try the simple version if advanced fails
  1. 1.Memory Issues:
  2. 2.Reduce text chunk size
  3. 3.Use lighter humanization levels
  4. 4.Close other applications
  1. 1.Performance Issues:
  2. 2.Use GPU if available
  3. 3.Process smaller texts
  4. 4.Try the simple version

โš–๏ธ Ethical Usage

This tool is designed for:

  • โ€”โœ… Improving writing quality
  • โ€”โœ… Learning natural language patterns
  • โ€”โœ… Enhancing academic writing
  • โ€”โœ… Content optimization

Please use responsibly and:

  • โ€”๐Ÿšซ Don't use for plagiarism
  • โ€”๐Ÿšซ Don't violate academic integrity policies
  • โ€”๐Ÿšซ Don't misrepresent authorship
  • โ€”๐Ÿšซ Don't use for deceptive purposes

๐Ÿค Contributing

Feel free to:

  • โ€”Report bugs
  • โ€”Suggest improvements
  • โ€”Add new models
  • โ€”Enhance techniques

๐Ÿ“„ License

This project is for educational and research purposes. Please respect academic integrity and use responsibly.


Built by M Umar Alam