import gradio as gr from modules.m_connector import Connector iface = gr.Blocks(css="css/style.css") conn = Connector() with iface: gr.HTML("
πŸ‡ΊπŸ‡Έ πŸ‡¬πŸ‡§ 2Passive Voice (Beta)
") with gr.Row(): with gr.Column(): in_sentence = gr.Textbox( label = "Enter an active sentence", max_lines=2, lines=1, placeholder = "Write here the sentence without contractions...", ) btn_act2pas = gr.Button( value = "Convert to passive sentence!" ) str_out = gr.Markdown( label = "Output in string format", visible=False ) html_out = gr.HTML( label = "Output in HTML format", ) 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", "Michael 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 ) gr.HTML("""
DISCLAIMER: At the moment the application only works well with sentences in the following tense: Simple present, Simple past, Simple future, Present continuous, Past continuous and Present perfect.
""", ) btn_act2pas.click( fn = conn.active2passive, inputs = in_sentence, outputs = [html_out, str_out], api_name="active2passive" ) iface.launch( server_name = "0.0.0.0", # server_port= 9090, # share = True )