Spaces:
Running
Running
karthickg12
commited on
Commit
•
17f5d0b
1
Parent(s):
843b4d7
Update app.py
Browse files
app.py
CHANGED
@@ -1,11 +1,20 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import pipeline
|
3 |
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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 |
+
|