Pavani2704 commited on
Commit
bfb2729
1 Parent(s): 5efd27e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -3
app.py CHANGED
@@ -6,6 +6,20 @@ from transformers import pipeline
6
 
7
  pipe = pipeline("summarization", model="google/pegasus-xsum")
8
 
9
- text=st.text_input("Write your text")
10
- if st.button("Submit"):
11
- st.write(pipe(text)[0]["summary_text"])
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
6
 
7
  pipe = pipeline("summarization", model="google/pegasus-xsum")
8
 
9
+ st.title("NLP APP")
10
+ option = st.sidebar.selectbox(
11
+ "Choose a task",
12
+ ("Summarization", "Translation", "Emotion Detection", "Image Generation")
13
+ )
14
+ if option == "Summarization":
15
+ st.title("Text Summarization")
16
+ text = st.text_area("Enter text to summarize")
17
+ if st.button("Summarize"):
18
+ if text:
19
+ summary = summarizer(text)[0]["summary_text"]
20
+ st.write("Summary:", summary)
21
+ else:
22
+ st.write("Please enter text to summarize.")
23
+
24
+ else:
25
+ st.title("None")