Messigoat's picture
Update app.py
7c2407c
from transformers import pipeline
import gradio as gr
model_checkpoint = "Messigoat/covid19_news_summarization_finetuned"
summarizer = pipeline("summarization", model=model_checkpoint)
title = 'Covid-19 News Summarization'
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'
def text_summarizer(text):
summary = summarizer(text)[0]["summary_text"]
return summary
demo = gr.Interface(fn = text_summarizer,
inputs = gr.Textbox(placeholder="Enter News here...",label = "News"),
outputs = gr.Textbox(label="Generated Summary"),
title = title,
examples=[examples],
allow_flagging = False)
demo.launch()