SummerTime / app.py
Ahsen Khaliq
Update app.py
b19937b
import os
os.system('pip install gradio==2.3.0a0')
import model as st_model
import gradio as gr
model = st_model.summarizer()
def inference(text):
documents = [text]
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' target='_blank'>SummerTime: Text Summarization Toolkit for Non-experts</a> | <a href='https://github.com/Yale-LILY/SummerTime' target='_blank'>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."""]]
).launch(debug=True)