karthickg12 commited on
Commit
17f5d0b
1 Parent(s): 843b4d7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -9
app.py CHANGED
@@ -1,11 +1,20 @@
1
  import streamlit as st
2
- from transformers import pipeline
3
 
4
- pipe=pipeline("sentiment-analysis")
5
- t=st.text_area("Enter the Text")
6
- summarizer = pipeline("summarization")
7
- t1=st.text_area("Enter the Text for Summarization")
8
- if t:
9
- st.write(pipe(t))
10
- if t1:
11
- st.write(summarizer(t1))
 
 
 
 
 
 
 
 
 
 
1
  import streamlit as st
2
+ from transformers import pipeline
3
 
4
+ col1, col2 = st.columns(2)
5
+
6
+ with col1:
7
+ x=st.button("Sentiment Analysis")
8
+ with col2;
9
+ y=st.button("Text Summarization")
10
+
11
+ if x:
12
+ pipe=pipeline("sentiment-analysis")
13
+ t=st.text_area("Enter the Text")
14
+ st.write(pipe(t))
15
+ if y:
16
+ summarizer = pipeline("summarization", model="t5-base", tokenizer="t5-base", framework="tf")
17
+ t1=st.text_area("Enter the Text for Summarization")
18
+ st.write(summarizer(t1))
19
+
20
+