MUmarAlam/ai-text-humanizer
0
๐คโก๏ธ๐จ 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
- `humanizer_app.py` - Advanced version with multiple models and sophisticated techniques
- `humanizer_simple.py` - Simplified version with reliable single model
- `humanizer_batch.py` - Batch processing version for files and multiple texts
๐ ๏ธ Installation
Prerequisites
- Python 3.13 or newer installed
- Internet access for package installation
- Git installed if cloning from GitHub
Clone and run
git clone <your-repo-url>
cd ai-text-humanizer
python -m pip install -r requirements.txt
python app.pyIf 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
run.bat๐ฏ Usage
Basic Usage
- Run
python app.pyorrun.bat - Open your browser to the local URL printed in the terminal
- Paste your AI-generated text
- Select humanization level
- 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:
{ "status": "ok", "service": "AI Text Humanizer API" }POST /api/humanize
- Input:
text- the text to humanizelevel-Light,Medium, orHeavy- Response: the original text, the humanized text, and the selected level
Example request:
{
"text": "The implementation of machine learning algorithms demonstrates significant improvements.",
"level": "Medium"
}Example response:
{ "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 analyzelevel-Light,Medium, orHeavy- 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
- Multi-Model Paraphrasing: Uses multiple AI models to avoid patterns
- Vocabulary Diversification: Replaces words with contextual synonyms
- Sentence Structure Variation: Modifies sentence patterns for natural flow
- Academic Connector Integration: Adds natural transitional phrases
- Hedging Language: Incorporates academic hedging for natural tone
- 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
- Input Quality: Use complete sentences and proper grammar
- Length Considerations: Works best with 50-1000 word chunks
- Context Preservation: Review output to ensure meaning is maintained
- Multiple Passes: For heavy humanization, consider multiple rounds
- Manual Review: Always review output for accuracy and flow
๐ซ Troubleshooting
Common Issues
- Model Loading Errors:
- Ensure protobuf is installed:
pip install protobuf - Check internet connection for model downloads
- Try the simple version if advanced fails
- Memory Issues:
- Reduce text chunk size
- Use lighter humanization levels
- Close other applications
- Performance Issues:
- Use GPU if available
- Process smaller texts
- 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
