from transformers import pipeline unmasker = pipeline('fill-mask', model='distilbert-base-uncased') unmasker("Hello I'm a [MASK] model.") import streamlit as st from transformers import pipeline def summarize_text(text): unmasker = pipeline('fill-mask', model='distilbert-base-uncased') unmasker = summarizer(text,do_sample=True)[0]['summary_text'] return unmasker def main(): st.title("Text Summarization App") st.write("Enter your text below:") user_input = st.text_area("Input Text Here") if st.button("Summarize"): summary = summarize_text(user_input) st.write("Summary:") st.write(summary) if __name__ == "__main__": main()