File size: 1,017 Bytes
de7f957
 
 
1455c2a
 
 
 
 
 
 
 
 
 
 
 
 
de7f957
 
1455c2a
 
 
 
 
 
72aa911
 
 
 
 
 
de7f957
 
 
ead954e
72aa911
 
ead954e
1455c2a
 
 
ead954e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
import streamlit as st
from transformers import pipeline

def load_summarizer():
    whisper = pipeline('automatic-speech-recognition' , model ='openai/whisper-medium') #audio-to-text
    summarize = pipeline("summarization", device=0)
    senti = pipeline("sentiment-analysis",device=0)
    nameentity = pipeline("ner",device=0)
    translate = pipeline("translation", device=0)
    return whisper, summarize, senti, nameentity, translate





#pipe = pipeline("sentiment-analysis")
text = st.text_area('Enter some Text!')


summarizer = load_summarizer()
st.title("Summarize Text")
sentence = st.text_area('Please paste your article :', height=30)
button = st.button("Click")

st.subheader("Choose a mp3 file that you extracted from the work site")
uploaded_file = st.file_uploader("Select file from your directory")
if uploaded_file is not None:
    audio_bytes = uploaded_file.read()
    st.audio(audio_bytes, format='audio/mp3')

if text:
    out=pipe(text)
    st.json(out)