nxmwxm commited on
Commit
c34b9cf
·
verified ·
1 Parent(s): c84ef23

Create app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -0
app.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ from transformers import pipeline
3
+
4
+ # Initialize the summarization pipeline
5
+ summarizer = pipeline("summarization")
6
+
7
+ st.title("Text Summarization Tool")
8
+
9
+ st.write("Enter the text you want to summarize below:")
10
+
11
+ # Text input
12
+ text = st.text_area("Text Input", "")
13
+
14
+ if st.button("Summarize"):
15
+ if text:
16
+ summary = summarizer(text, max_length=150, min_length=30, do_sample=False)
17
+ st.write("Summary:")
18
+ st.write(summary[0]['summary_text'])
19
+ else:
20
+ st.write("Please enter some text to summarize.")