File size: 421 Bytes
656bd99
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import gradio as gr
from transformers import pipeline

summarizer = pipeline("summarization", model="sumedh/t5-base-amazonreviews")

def texto_sum(text):
    summary = summarizer(text, do_sample=False)
    return summary[0]['summary_text']

demo = gr.Interface(
    fn=texto_sum,
    inputs=gr.Textbox(label="Texto a introducir:", placeholder="Introduce el texto a resumir aquí..."),
    outputs="text"
)

demo.launch()