Amandeep01 commited on
Commit
160e5f8
·
verified ·
1 Parent(s): e530235

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +34 -0
app.py ADDED
@@ -0,0 +1,34 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ import random
3
+
4
+ # Power words and templates (tu customize bhi kar sakta hai)
5
+ power_words = ["Ultimate", "Proven", "Effective", "Powerful", "Easy", "Best", "Top", "Quick", "Free", "Insane", "Smart"]
6
+ templates = [
7
+ "Top {n} {keyword} Tips for {goal}",
8
+ "{n} {power} Ways to {goal} with {keyword}",
9
+ "How to {goal} Using {keyword}",
10
+ "The {power} Guide to {goal} with {keyword}",
11
+ "{n} Secrets About {keyword} You Should Know"
12
+ ]
13
+
14
+ def generate_title(blog_topic):
15
+ words = blog_topic.lower().split()
16
+ keyword = random.choice(words).capitalize()
17
+ goal = blog_topic.title()
18
+ power = random.choice(power_words)
19
+ n = random.randint(5, 10)
20
+
21
+ template = random.choice(templates)
22
+ title = template.format(n=n, keyword=keyword, goal=goal, power=power)
23
+ return title
24
+
25
+ # Gradio Interface
26
+ iface = gr.Interface(
27
+ fn=generate_title,
28
+ inputs=gr.Textbox(placeholder="Enter your blog topic or short paragraph...", label="Blog Topic"),
29
+ outputs=gr.Textbox(label="SEO-Friendly Blog Title"),
30
+ title="📝 SEO-Friendly Blog Title Generator",
31
+ description="Enter your blog topic or summary, and get a catchy SEO-optimized blog title in one click!"
32
+ )
33
+
34
+ iface.launch()