kushan98 commited on
Commit
d2fcec4
1 Parent(s): d6de876

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +21 -0
app.py CHANGED
@@ -1,3 +1,24 @@
1
  from transformers import pipeline
2
  unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
3
  unmasker("Hello I'm a [MASK] model.")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  from transformers import pipeline
2
  unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
3
  unmasker("Hello I'm a [MASK] model.")
4
+
5
+
6
+ import streamlit as st
7
+ from transformers import pipeline
8
+
9
+ def summarize_text(text):
10
+ unmasker = pipeline('fill-mask', model='distilbert-base-uncased')
11
+ unmasker = summarizer(text,do_sample=True)[0]['summary_text']
12
+ return unmasker
13
+
14
+ def main():
15
+ st.title("Text Summarization App")
16
+ st.write("Enter your text below:")
17
+ user_input = st.text_area("Input Text Here")
18
+ if st.button("Summarize"):
19
+ summary = summarize_text(user_input)
20
+ st.write("Summary:")
21
+ st.write(summary)
22
+
23
+ if __name__ == "__main__":
24
+ main()