import gradio as gr
from modules.m_connector import Connector
iface = gr.Blocks(css="css/style.css")
conn = Connector()
with iface:
gr.HTML("
Active to Passive Voice (Beta)
")
with gr.Row():
with gr.Column():
in_sentence = gr.Textbox(
label = "Active sentence",
max_lines=2,
lines=1,
placeholder = "Enter here the sentence without contractions...",
)
btn_act2pas = gr.Button(
value = "Pass to passive!"
)
out = gr.HTML(
label = "Out. Pasive sentences:",
)
with gr.Column(variant='panel'):
gr.Examples(
inputs = in_sentence,
examples = [
"The teacher corrected the exams in less than an hour",
"Christopher Columbus discovered America in 1492",
"Mchael Jackson sings Billy Jean",
"They are painting the house" ,
"My mom has prepared the dinner",
"The man has not found the farm",
"He closes the doors"
],
examples_per_page=10
)
btn_act2pas.click(
fn = conn.active2passive,
inputs = in_sentence,
outputs = out
)
iface.launch(
server_name = "0.0.0.0",
# server_port= 9090,
# share = True
)