File size: 781 Bytes
c888ee1
 
 
8719562
 
4189555
d2c9fdb
8719562
 
 
 
 
 
 
d2c9fdb
8719562
 
3cd61f5
c888ee1
 
3cd61f5
d2c9fdb
c888ee1
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import streamlit as st
from transformers import pipeline

st.set_page_config(page_title='πŸ–ŠπŸ“„ Chat Summarization WebApp')
st.title('πŸ–ŠπŸ“„ Chat Summarization WebApp')

predefined_text = """Nico: the moon is very beautiful tonight.
Demo: I agree with you.
Nico: My dream is to go to the moon one day.
Demo: Are you serious? I'm scared about the space.
Nico: So won't you come?
Demo: I prefer to go to Lido Le Canne in Pulsano.
Nico: Ahahah
"""
progress_text = "Summarization in progress on CPU. Please wait."

text = st.text_area("Enter your chat", value=predefined_text, height=200)
button = st.button('Summarize')
pipe = pipeline("summarization", model="nicoladisabato/pegasus-samsum")

if button:
    st.progress(0, text=progress_text)
    out = pipe(text)
    st.json(out)