CoolFace
Apppublic

VinayakMane47/Text_summarization

sourceHugging Faceafl-3.0updated 3y agoView on Hugging Face
0likes
app.py18 linesDownload Raw Back to root
1import streamlit as st2from transformers import pipeline3 4# Define the summarization pipeline5hub_model_id = "VinayakMane47/mt5-small-finetuned-amazon-en-es"6summarizer = pipeline("summarization", model=hub_model_id)7 8# Create the Streamlit app9def main():10    st.title("Text Summarizer")11    text = st.text_area("Enter some text to summarize")12    if st.button("Summarize"):13        summary = summarizer(text, max_length=100, min_length=30, do_sample=False)[0]['summary_text']14        st.write(summary)15 16if __name__ == "__main__":17    main()18