Spaces:
Sleeping
Sleeping
Create app.py
Browse files
app.py
ADDED
@@ -0,0 +1,23 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from transformers import pipeline
|
2 |
+
import gradio as gr
|
3 |
+
|
4 |
+
model_checkpoint = "Messigoat/covid19_news_summarization_finetuned"
|
5 |
+
summarizer = pipeline("summarization", model=model_checkpoint)
|
6 |
+
|
7 |
+
|
8 |
+
title = 'Text Summarization'
|
9 |
+
examples = 'china central bank said it will inject 1 2 trillion yuan worth of liquidity into the markets via reverse repo operations on monday as the country prepares to reopen its stock markets amid a new coronavirus outbreak file photo a woman walks out of the headquarters of the people bank of china the central bank in beijing november 20 2013 reuters jason lee file photo 02 feb 2020 04 40pm share this content bookmark shanghai china central bank said it will inject 1 2 trillion yuan worth of liquidity into the markets via reverse repo operations on monday as the country prepares to reopen its stock markets amid a new coronavirus outbreak china authorities have pledged to use various monetary policy tools to ensure liquidity remains reasonably ample and to support firms affected by the virus epidemic which has so far claimed 305 lives all but one in china the people bank of china made the announcement in a statement published on its website on sunday adding the total liquidity in the banking system will be 900 billion yuan higher than the same period in 2019 after the injection according to reuters calculations based on official central bank data 1 05 trillion yuan worth of reverse repos are set to mature on monday meaning that 150 billion yuan in net cash will be injected investors are bracing for a volatile session in chinese markets when onshore trades resume on monday after a break for the lunar new year which was extended by the government china stock currency and bond markets have all been closed since jan 23 and had been due to re open last friday there will be no further delays to the reopening the country securities market regulator said in an interview published by the state backed people daily newspaper on sunday the china securities regulatory commission said it had taken the decision after balancing various factors and believed the outbreak impact on the market would be short term to support firms affected by the epidemic the csrc said companies that had expiring stock pledge agreements could apply for extensions with securities firms and it would urge corporate bond investors to extend the maturity dates of debt the csrc is also considering launching hedging tools for the a share market to help alleviate market panic and will suspend evening sessions of futures trading starting from monday it said we believe that the successive introduction and implementation of policy measures will play a better role in improving market expectations and preventing irrational behavior it told the people daily newspaper china is facing mounting isolation as other countries introduce travel curbs airlines suspend flights and governments evacuate their citizens risking worsening a slowdown in the world second largest economy on sunday the philippines reported the growing epidemic of a coronavirus has claimed its first fatality outside of china where new confirmed infections jumped by a daily record to top 14 000 cases source reuters'
|
10 |
+
|
11 |
+
def text_summarizer(text):
|
12 |
+
summary = summarizer(text)[0]["summary_text"]
|
13 |
+
return summary
|
14 |
+
|
15 |
+
demo = gr.Interface(fn = text_summarizer,
|
16 |
+
inputs = gr.Textbox(placeholder="Enter News here...",label = "News"),
|
17 |
+
outputs = gr.Textbox(label="Generated Summary"),
|
18 |
+
title = title,
|
19 |
+
examples=[examples],
|
20 |
+
allow_flagging = False)
|
21 |
+
|
22 |
+
|
23 |
+
demo.launch()
|