SummerTime / app.py
Ahsen Khaliq
Update app.py
a64d3c8
raw
history blame
1.24 kB
import model as st_model
import gradio as gr
import os
os.system('pip install gradio --upgrade')
model = st_model.summarizer()
def inference(text):
documents = [text]
model.summarize(documents)
return model.summarize(documents)[0]
title = "SummerTime"
description = "Gradio demo for SummerTime: An open-source text summarization toolkit for non-experts. To use it, simply add your text, or click one of the examples to load them. Read more at the links below."
article = "<p style='text-align: center'><a href='https://arxiv.org/abs/2108.12738'>SummerTime: Text Summarization Toolkit for Non-experts</a> | <a href='https://github.com/Yale-LILY/SummerTime'>Github Repo</a></p>"
gr.Interface(
inference,
[gr.inputs.Textbox(label="Input", lines=20)],
gr.outputs.Textbox(label="Output"),
title=title,
description=description,
article=article,
examples=[["""PG&E stated it scheduled the blackouts in response to forecasts for high winds amid dry conditions.
The aim is to reduce the risk of wildfires. Nearly 800 thousand customers were scheduled to be affected
by the shutoffs which were expected to last through at least midday tomorrow."""]],
enable_queue=True
).launch(debug=True)