Spaces:
Sleeping
Sleeping
sanzanalora
commited on
Commit
•
7f24b74
1
Parent(s):
ae192d1
Update app.py
Browse files
app.py
CHANGED
@@ -44,7 +44,7 @@ examples_translate_en_bn = [
|
|
44 |
|
45 |
examples_translate_bn_en = [
|
46 |
["বাংলাদেশ দক্ষিণ এশিয়ার একটি সার্বভৌম রাষ্ট্র।"],
|
47 |
-
["
|
48 |
["রবীন্দ্রনাথ ঠাকুরের গান বাংলা সংস্কৃতির একটি অবিচ্ছেদ্য অংশ।"]
|
49 |
]
|
50 |
|
@@ -61,7 +61,7 @@ examples_paraphrase = [
|
|
61 |
]
|
62 |
|
63 |
# Enhanced visual layout and interface design
|
64 |
-
with gr.Blocks() as demo:
|
65 |
gr.Markdown("# BanglaT5 Model Hub - Translation, Summarization & Paraphrasing")
|
66 |
gr.Markdown("Explore the power of BanglaT5 with this easy-to-use interface for multiple tasks like translation, summarization, and paraphrasing.")
|
67 |
|
@@ -71,7 +71,7 @@ with gr.Blocks() as demo:
|
|
71 |
en_bn_text = gr.Textbox(label="Enter English Text", lines=5)
|
72 |
en_bn_output = gr.Textbox(label="Bengali Translation")
|
73 |
gr.Examples(examples_translate_en_bn, inputs=en_bn_text)
|
74 |
-
en_bn_button = gr.Button("
|
75 |
en_bn_button.click(translate_text_en_bn, inputs=en_bn_text, outputs=en_bn_output)
|
76 |
|
77 |
# Tab for Bengali to English Translation
|
@@ -79,23 +79,23 @@ with gr.Blocks() as demo:
|
|
79 |
bn_en_text = gr.Textbox(label="Enter Bengali Text", lines=5)
|
80 |
bn_en_output = gr.Textbox(label="English Translation")
|
81 |
gr.Examples(examples_translate_bn_en, inputs=bn_en_text)
|
82 |
-
bn_en_button = gr.Button("
|
83 |
bn_en_button.click(translate_text_bn_en, inputs=bn_en_text, outputs=bn_en_output)
|
84 |
|
85 |
# Tab for Summarization
|
86 |
with gr.Tab("Summarize"):
|
87 |
-
summarize_text_input = gr.Textbox(label="Enter Text to Summarize", lines=5)
|
88 |
summarize_output = gr.Textbox(label="Summary")
|
89 |
gr.Examples(examples_summarize, inputs=summarize_text_input)
|
90 |
-
summarize_button = gr.Button("
|
91 |
summarize_button.click(summarize_text, inputs=summarize_text_input, outputs=summarize_output)
|
92 |
|
93 |
# Tab for Paraphrasing
|
94 |
with gr.Tab("Paraphrase"):
|
95 |
-
paraphrase_text_input = gr.Textbox(label="Enter Text to Paraphrase", lines=5)
|
96 |
paraphrase_output = gr.Textbox(label="Paraphrased Text")
|
97 |
gr.Examples(examples_paraphrase, inputs=paraphrase_text_input)
|
98 |
-
paraphrase_button = gr.Button("
|
99 |
paraphrase_button.click(paraphrase_text, inputs=paraphrase_text_input, outputs=paraphrase_output)
|
100 |
|
101 |
demo.launch()
|
|
|
44 |
|
45 |
examples_translate_bn_en = [
|
46 |
["বাংলাদেশ দক্ষিণ এশিয়ার একটি সার্বভৌম রাষ্ট্র।"],
|
47 |
+
["ফুল মানুষের হৃদয়কে উজ্জীবিত করে। বাংলাদেশের বিভিন্ন অঞ্চলে নানা রকমের ফুল ফুটে থাকে, যেমন গোলাপ, জবা, এবং কৃষ্ণকলি। বিশেষত বসন্তে, ফুলের সৌন্দর্য যেন চারপাশে ছড়িয়ে পড়ে, এবং এর গন্ধ বাতাসে ভাসে। ফুলের উৎসব, যেমন 'বসন্ত উৎসব', এ দেশের সংস্কৃতির একটি গুরুত্বপূর্ণ অংশ।"],
|
48 |
["রবীন্দ্রনাথ ঠাকুরের গান বাংলা সংস্কৃতির একটি অবিচ্ছেদ্য অংশ।"]
|
49 |
]
|
50 |
|
|
|
61 |
]
|
62 |
|
63 |
# Enhanced visual layout and interface design
|
64 |
+
with gr.Blocks(theme="grass") as demo:
|
65 |
gr.Markdown("# BanglaT5 Model Hub - Translation, Summarization & Paraphrasing")
|
66 |
gr.Markdown("Explore the power of BanglaT5 with this easy-to-use interface for multiple tasks like translation, summarization, and paraphrasing.")
|
67 |
|
|
|
71 |
en_bn_text = gr.Textbox(label="Enter English Text", lines=5)
|
72 |
en_bn_output = gr.Textbox(label="Bengali Translation")
|
73 |
gr.Examples(examples_translate_en_bn, inputs=en_bn_text)
|
74 |
+
en_bn_button = gr.Button("Show Output")
|
75 |
en_bn_button.click(translate_text_en_bn, inputs=en_bn_text, outputs=en_bn_output)
|
76 |
|
77 |
# Tab for Bengali to English Translation
|
|
|
79 |
bn_en_text = gr.Textbox(label="Enter Bengali Text", lines=5)
|
80 |
bn_en_output = gr.Textbox(label="English Translation")
|
81 |
gr.Examples(examples_translate_bn_en, inputs=bn_en_text)
|
82 |
+
bn_en_button = gr.Button("Show Output")
|
83 |
bn_en_button.click(translate_text_bn_en, inputs=bn_en_text, outputs=bn_en_output)
|
84 |
|
85 |
# Tab for Summarization
|
86 |
with gr.Tab("Summarize"):
|
87 |
+
summarize_text_input = gr.Textbox(label="Enter Bengali Text to Summarize", lines=5)
|
88 |
summarize_output = gr.Textbox(label="Summary")
|
89 |
gr.Examples(examples_summarize, inputs=summarize_text_input)
|
90 |
+
summarize_button = gr.Button("Show Output")
|
91 |
summarize_button.click(summarize_text, inputs=summarize_text_input, outputs=summarize_output)
|
92 |
|
93 |
# Tab for Paraphrasing
|
94 |
with gr.Tab("Paraphrase"):
|
95 |
+
paraphrase_text_input = gr.Textbox(label="Enter Bengali Text to Paraphrase", lines=5)
|
96 |
paraphrase_output = gr.Textbox(label="Paraphrased Text")
|
97 |
gr.Examples(examples_paraphrase, inputs=paraphrase_text_input)
|
98 |
+
paraphrase_button = gr.Button("Show Output")
|
99 |
paraphrase_button.click(paraphrase_text, inputs=paraphrase_text_input, outputs=paraphrase_output)
|
100 |
|
101 |
demo.launch()
|