π§ Create Your Own Free AI Humanizer with Google Colab
No installation needed β just follow these simple steps to build your own humanizer tool using open-source models and Gradio. Yes, it bypasses Turnitin, ZeroGPT, and sometimes even CopyLeaks. π
π Copied by 729 users
π Step 1: Open Google Colab
Go to Google Colab and click "New Notebook".
β
If available, click on βConnectβ and choose a GPU runtime (preferably T4
).
π¦ Step 2: Install Required Libraries
In the first cell, paste the following and run it:
!pip install gradio transformers sentencepiece
π§ Step 3: Paste the Humanizer Code
In the second cell, paste the entire code below and run it:
from transformers import AutoTokenizer, AutoModelForSeq2SeqLM, pipeline
import re
tokenizer = AutoTokenizer.from_pretrained("Vamsi/T5_Paraphrase_Paws")
model = AutoModelForSeq2SeqLM.from_pretrained("Vamsi/T5_Paraphrase_Paws")
proofread_pipeline = pipeline("text2text-generation", model="vennify/t5-base-grammar-correction")
def clean_output(text):
text = re.sub(r'[\[\]\"]+', '', text)
text = re.sub(r"'", '', text)
text = re.sub(r'\s+', ' ', text).strip()
return text
def split_sentences(text):
return [s.strip() for s in re.split(r'(?= 3]
results = proofread_pipeline(long_sentences, max_new_tokens=256)
return [clean_output(res['generated_text']) for res in results]
def generate_paraphrase(text, temperature=2.0):
input_sentences = split_sentences(text)
paraphrased_sentences = []
for sentence in input_sentences:
inputs = tokenizer(sentence, return_tensors="pt", truncation=True)
outputs = model.generate(
**inputs,
max_new_tokens=256,
do_sample=True,
temperature=temperature,
top_p=0.92,
num_return_sequences=1,
)
decoded = tokenizer.decode(outputs[0], skip_special_tokens=True)
paraphrased_sentences.append(clean_output(decoded))
corrected = proofread_sentences(paraphrased_sentences)
return " ".join(corrected)
import gradio as gr
iface = gr.Interface(
fn=generate_paraphrase,
inputs=gr.Textbox(lines=8, placeholder="Enter text to paraphrase here..."),
outputs=gr.Textbox(label="Paraphrased Output"),
title="π§ AI Paraphraser",
description="Enter your sentence or paragraph and click 'Submit' to get a paraphrased version with grammar correction.",
theme="default",
)
iface.launch()
π Done!
After a few seconds, a link like Running on public URL: https://xxxx.gradio.live
will appear. Click it and start paraphrasing your content live! β¨
Tip: Bookmark your notebook or save it to Google Drive so you donβt lose it.