Spaces:
Running on Zero
Running on Zero
Update app.py
Browse files1969 unmodified lines19701971197219731974197519761977197819791980198119821983198419851986198719884 unmodified lines1993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820191969 unmodified lines}"""with gr.Blocks(title="Syntactic Sentence Simplifier",css=custom_css,) as demo:gr.Markdown("# Syntactic Sentence Simplifier")gr.Markdown("Paste or type your text below. Uses Hugging Face models + simplification logic.")input_text = gr.Textbox(lines=10,label="Original text",placeholder="Paste your text here...",elem_classes=["input-text"],)4 unmodified lines)btn = gr.Button("Process & Simplify", variant="primary")btn.click(fn=process_text,inputs=input_text,outputs=output_text,)print(" Gradio interface ready. Starting web server...")if __name__ == "__main__":demo.launch(server_name="0.0.0.0",server_port=7860,css=custom_css, # your pink/green CSS string)'''test = ("Joshua told me that John, who lives in London, is going to Wolverhampton, Jack loves Norwich, and Mary, who is a bit nervous, adores Birmingham, just as Fred predicted.")print(process_text(test))'''1969 unmodified lines1970197119721973197419751976197719781979198019811982198319844 unmodified lines1989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420151969 unmodified lines}"""with gr.Blocks(title="Syntactic Sentence Simplifier") as demo:gr.Markdown("# Syntactic Sentence Simplifier")gr.Markdown("Paste text or pick an example, then click Process & Simplify.")# βββ THIS BLOCK GOES HERE βββinput_text = gr.Textbox(lines=10,label="Original text",placeholder="Paste your text here, or pick an example below...",elem_classes=["input-text"],)4 unmodified lines)btn = gr.Button("Process & Simplify", variant="primary")btn.click(fn=process_text, inputs=input_text, outputs=output_text)gr.Examples(examples=[["John kicked the ball and walked to Leeds."],["John is one test, Mary, who lives in London, loves exams, and Bill eats bread."],["John went to Wolverhampton, Bill set out for Coventry, and Mary returned from Birmingham."],["John, who lives in London, is going to Wolverhampton, and Mary, who is a bit nervous, adores Birmingham."],["The Environment Agency said record winter rainfall had helped to replenish reservoirs and groundwater, but reservoir storage has now fallen to 7.4% below the average for this time of year."],],inputs=input_text,label="Try an example",)# βββ END OF UI βββprint("Gradio interface ready. Starting web server...")if __name__ == "__main__":demo.launch(server_name="0.0.0.0",server_port=7860,css=custom_css, # if you use custom_css)
app.py+18-22