Jahadu commited on
Commit
58fc7a9
·
verified ·
1 Parent(s): 33c1a3c

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +13 -0
app.py ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from transformers import pipeline
3
+
4
+ def humanize(text):
5
+ # Step 1: Paraphrase AI text
6
+ paraphraser = pipeline("text2text-generation", model="facebook/bart-large-cnn")
7
+ paraphrased = paraphraser(text, max_length=1000)[0]['generated_text']
8
+
9
+ # Step 2: Make it sound human
10
+ human_text = paraphrased.replace(" however", " but hey").replace(". ", ". Seriously, ") + " 😊"
11
+ return human_text
12
+
13
+ gr.Interface(fn=humanize, inputs="textbox", outputs="textbox").launch()