texthumanizer 📝
Offline AI-text humanizer & plagiarism reducer for students and researchers. No internet needed after model download. Preserves research context, citations, and semantic meaning.
project
name: "texthumanizer"
version: "1.1.3"
description: "An offline, lightweight AI-text humanizer built with Python and HuggingFace T5. It seamlessly bypasses AI detectors while preserving essential document formatting, including images, tables, citations, and research terminology in .docx files"
✨ Features
| Feature | Detail |
|---|---|
| Humanize AI text | Rewrites ChatGPT / Claude / Gemini output to sound natural |
| Plagiarism reduction | Paraphrase-based, not just synonym swap |
| Semantic preservation | Meaning, tone, and argument structure kept intact |
| Research-aware | Citations [1], abbreviations DNA, units 95%, et al. — all preserved |
| DOCX support | Paragraph-level processing; headings untouched |
| 100% offline | T5-based model runs locally after first download (~250 MB) |
| Lightweight | CPU-friendly, no GPU required |
📦 Installation
Full install (recommended)
pip install texthumanizer[all]
Minimal (text only, no docx)
pip install texthumanizer[ml]
With DOCX support only
pip install texthumanizer[ml,docx]
First run downloads the T5 model (~250 MB) from HuggingFace once and caches it locally.
🚀 Quick Start
1. Humanize pasted text
from texthumanizer import TextHumanizer
th = TextHumanizer()
ai_text = """
Artificial intelligence has rapidly transformed numerous sectors of society,
demonstrating unprecedented capabilities in natural language processing,
computer vision, and decision-making systems.
"""
result = th.humanize_text(ai_text)
print(result)
2a. Humanize a .docx → save new .docx
from texthumanizer import TextHumanizer
th = TextHumanizer()
# Saves "humanized_my_essay.docx" next to the original
output_path = th.humanize_doc("my_essay.docx", output="doc")
print(f"Saved: {output_path}")
# Custom output path
th.humanize_doc("my_essay.docx", output="doc", output_path="D:/final_essay.docx")
2b. Humanize a .docx → get plain text back
from texthumanizer import TextHumanizer
th = TextHumanizer()
text = th.humanize_doc("my_essay.docx", output="text")
print(text)
⚙️ Configuration
th = TextHumanizer(
diversity=0.7, # 0.0 = minimal changes, 1.0 = maximum rewriting (default: 0.7)
device=-1, # -1 = CPU, 0 = GPU (default: -1)
verbose=True, # Show progress (default: True)
)
| Parameter | Range | Effect |
|---|---|---|
diversity=0.3 |
Low | Light rewording, very safe for technical papers |
diversity=0.7 |
Medium | Balanced — good for essays and reports ✅ |
diversity=0.9 |
High | Heavy rewriting — good for blog posts or general text |
🖥️ CLI Usage
Interactive mode
python -m texthumanizer.cli
Direct text
python -m texthumanizer.cli text "Your AI-generated text here" --diversity 0.7
Pipe from file
cat essay.txt | python -m texthumanizer.cli text
DOCX → humanized DOCX
python -m texthumanizer.cli doc essay.docx --output doc
DOCX → print text
python -m texthumanizer.cli doc essay.docx --output text
🔬 How It Works
Input Text
│
▼
[Mask technical terms] ← citations, abbreviations, units, years
│
▼
[Split into sentences] ← smart splitter (handles abbreviations)
│
▼
[T5 Paraphrasing model] ← humarin/chatgpt_paraphraser_on_T5_base
│ temperature + top-k + top-p sampling
▼
[Restore masked terms] ← [1], DNA, 2023 put back exactly
│
▼
Output Text
Why T5 and not GPT-style? T5 is an encoder–decoder model trained specifically on paraphrase tasks. It is:
- Much smaller (~250 MB vs multi-GB GPT models)
- CPU-friendly and fast
- Better at preserving meaning than decoder-only models
📋 What Gets Preserved
| Type | Example | Preserved? |
|---|---|---|
| Academic citations | [1], [1,2,3] |
✅ |
| Author citations | (Smith et al., 2021) |
✅ |
| Abbreviations | DNA, AI, COVID, LSTM |
✅ |
| Years | 2023, 1990 |
✅ |
| Percentages | 95%, 3.5% |
✅ |
| Scientific units | kg, MHz, nm, kcal |
✅ |
| Figure/Table refs | Fig. 3, Table 1 |
✅ |
| DOIs / URLs | doi:10.xxx, https://... |
✅ |
| Latin abbreviations | et al., e.g., i.e. |
✅ |
| Headings (in .docx) | Section titles | ✅ untouched |
🧪 Example Output
Input (AI-generated):
The utilization of machine learning algorithms has demonstrated significant efficacy in the domain of medical diagnosis, achieving accuracy rates exceeding 95% in several clinical trials [1,2].
Output (humanized):
Using machine learning methods has shown strong results in medical diagnosis, reaching accuracy levels above 95% in a number of clinical studies [1,2].
💡 Tips for Best Results
- Research papers: Use
diversity=0.4–0.6to keep technical accuracy - Essays / assignments: Use
diversity=0.7(default) - Blog posts / creative writing: Use
diversity=0.8–0.9 - Process section-by-section for long papers for best control
- GPU users: set
device=0for ~5× speed improvement
🔬 How It Works (In-place Replacement)
Unlike other humanizers that strip away formatting, texthumanizer uses an "In-place run-level replacement" strategy:
- It creates a temporary copy of your
.docx. - It identifies text-bearing "runs" within each paragraph.
- It humanizes the text while skipping runs that contain images or drawings.
- It injects the new text back into the original XML structure, keeping your layout 100% intact.
📄 License
MIT License — free for personal and academic use.
Author : Rejaul Karim ; Email: reja86305@gmail.com
⚠️ Disclaimer & Ethics
This tool is designed to assist researchers in improving the readability of their own writing. It is NOT intended for academic dishonesty or bypassing plagiarism checks for unoriginal work. Use responsibly and always cite your AI assistance if required by your institution.
Release files for texthumanizer 1.1.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| texthumanizer-1.1.3.tar.gz | 15.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| texthumanizer-1.1.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 28.6 kB
Release files / texthumanizer-1.1.3.tar.gz
| Download URL | texthumanizer-1.1.3.tar.gz |
|---|---|
| Size | 15.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f4544184e7781630d94c5f83eb455b3951a202f46432756aff11a124beeb7838
|
|
BLAKE2b-256 checksum How to use checksums |
4d7627f0a4511af4873a948b5c4cc108a21fbfba3291f893a5e2afa3aad67d8f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|
Release files / texthumanizer-1.1.3-py3-none-any.whl
| Download URL | texthumanizer-1.1.3-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
331642b42c19279d6dd34bb40c87e5fd701daad11553d68fe8dca7a4fe7caf5c
|
|
BLAKE2b-256 checksum How to use checksums |
73d6202b51f3aa639e22a1e8546ba196449d400e39d623bc9062af07deec5a13
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.7
|