comment_review / app.py
kushan98's picture
Update app.py
8a5c7b2
raw
history blame
472 Bytes
import streamlit as st
from transformers import pipeline
def summarize_text(text):
unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
text_input = unmasker(text, do_sample=True)[0]['text_input']
return text_input
def main():
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()