File size: 477 Bytes
dfaa329 7050879 dfaa329 7050879 dfaa329 7050879 dfaa329 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
import streamlit as st
from transformers import pipeline
# from pathlib import Path
st.title("Thai News Summarizer")
st.subheader("Thai News Summarizer")
text = st.text_area('News', '', height=200)
# st.write('This KHAW? -->', text)
if st.button('Summarize'):
summarizer = pipeline("summarization", model = "Saltywan/mt5-base-thaisum-news" )
text = summarizer("summarize: " + text, max_length=256)
desired_text = text[0]['summary_text']
st.write(desired_text) |