Spaces:
Runtime error
Runtime error
Commit
·
1455c2a
1
Parent(s):
2103e4a
Update app.py
Browse files
app.py
CHANGED
@@ -1,13 +1,34 @@
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
text = st.text_area('Enter some Text!')
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
if text:
|
8 |
out=pipe(text)
|
9 |
st.json(out)
|
10 |
|
11 |
|
|
|
|
|
|
|
12 |
|
13 |
|
|
|
1 |
import streamlit as st
|
2 |
from transformers import pipeline
|
3 |
|
4 |
+
def load_summarizer():
|
5 |
+
whisper = pipeline('automatic-speech-recognition' , model ='openai/whisper-medium') #audio-to-text
|
6 |
+
summarize = pipeline("summarization", device=0)
|
7 |
+
senti = pipeline("sentiment-analysis",device=0)
|
8 |
+
nameentity = pipeline("ner",device=0)
|
9 |
+
translate = pipeline("translation", device=0)
|
10 |
+
return whisper, summarize, senti, nameentity, translate
|
11 |
+
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
|
16 |
+
#pipe = pipeline("sentiment-analysis")
|
17 |
text = st.text_area('Enter some Text!')
|
18 |
|
19 |
+
|
20 |
+
summarizer = load_summarizer()
|
21 |
+
st.title("Summarize Text")
|
22 |
+
sentence = st.text_area('Please paste your article :', height=30)
|
23 |
+
button = st.button("Click")
|
24 |
+
|
25 |
if text:
|
26 |
out=pipe(text)
|
27 |
st.json(out)
|
28 |
|
29 |
|
30 |
+
|
31 |
+
|
32 |
+
|
33 |
|
34 |
|