Spaces:
Runtime error
Runtime error
import gradio as gr | |
from gradio.mix import Parallel, Series | |
title = "Extractive Text Summarizer" | |
description = "Past an article text or other text. Submit the text and the machine will create four summaries based on words in the text. Which sentences in the text are the most important for the summaries? Which summaries are better for your case?" | |
examples = [ | |
[""""""""" | |
Hong Kong health authorities on Wednesday began a city-wide search for the contacts of a Covid-19 patient from a suspected dance cluster and ordered a Royal Caribbean "cruise to nowhere" ship with 3,700 people onboard to return to port early. | |
The latest hunt was sparked by a 62-year-old woman who danced with some 20 friends at Victoria Park and the Causeway Bay Community Centre on New Year's Eve. Two of the fellow dancers, one of whom was a domestic helper, came up positive in preliminary tests. | |
The 62-year-old was said to have contracted the virus from her 28-year-old flight attendant daughter, who returned to Hong Kong on December 27 and had onset of symptoms on December 29. | |
It was only on January 1 that the 62-year-old was classified as a close contact and being brought to a quarantine facility. | |
The helper's employer and eight other of her close contacts then went on a "cruise to nowhere" journey on January 2, which was due to return on January 6. | |
As part of its coronavirus restrictions, Hong Kong has restricted cruises to short trips in nearby waters, with ships asked to operate at reduced capacity and to only allow vaccinated passengers who test negative for the virus. | |
The "Spectrum of the Seas" ship had about 2,500 passengers and 1,200 staff on board. The nine close contact passengers were isolated from the rest of the people on board and preliminary tests taken during the journey returned negative results, authorities said. | |
"Spectrum of the Seas is taking appropriate measures under guidelines by the Department of Health," Royal Caribbean said in a statement. | |
The ship was on early Wednesday ordered to return to the Kai Tak Cruise Terminal. The nine close contacts will be sent to a quarantine center, while the rest of the passengers and staff will have to undergo several compulsory tests in the coming days, the government said. | |
"""""""""], | |
["""""""" | |
Good morning form six students. | |
Today I would like to share with you about studying in mainland China. Studying in mainland China will bring us a lot of benefits. I believe that you will be interested in it ,let me share with you more information about studying in Mainland China. | |
There are many benefits of studying in mainland China. First,Mainland China University is cheaper than studying at the University of Hong Kong. Usually, tuition fee of universities in Mainland China is about 3,000 to 4,000 for a year.Also the cost of living in China is much cheaper than that in Hong Kong.So I believe most families can afford it. | |
The second benefit is that Hong Kong students can know more about Mainland China. Many young people in Hong Kong have never been to the mainland, and going to university in mainland China is a good opportunity for them to know more about our country. Guangzhou is a much larger city than Hong Kong. When students in Hong Kong understand more about Guangzhou, they may choose to live in Guangzhou or find a job there. What's more? They can also learn about the famous e-sports culture in Mainland China. Timi , a famous e-sports company in China, was founded in Guangzhou. Choosing an e-sports career is a good chance for young people in Hong Kong to understand this career . | |
Besides,Mainland China is very close to Hong Kong. Take Shenzhen as an example. If you want to go from Hong Kong to Shenzhen, you only need to take a one-hour bus trip. So for Hong Kong students, who are studying in mainland China can return to their hometown anytime quickly. | |
I believe this must be very attractive to everyone. Don’t hesitate anymore. If you plan to study in Mainland China, please contact me. | |
This is the end of my sharing. | |
Thank you for your listening and coming. | |
""""""""] | |
] | |
io1 = gr.Interface.load('huggingface/sshleifer/distilbart-cnn-12-6') | |
io2 = gr.Interface.load("huggingface/facebook/bart-large-cnn") | |
io3 = gr.Interface.load("huggingface/google/pegasus-xsum") | |
io4 = gr.Interface.load("huggingface/sshleifer/distilbart-cnn-6-6") | |
iface = Parallel(io1, io2, io3, io4, | |
theme='huggingface', | |
inputs = gr.inputs.Textbox(lines = 10, label="Text"), title=title, description=description, examples=examples) | |
iface.launch(share=True) |