NLP / app.py
krishnasai99's picture
Update app.py
c3105f1
raw
history blame
1 kB
import streamlit as st
from transformers import pipeline
def load_summarizer():
whisper = pipeline('automatic-speech-recognition') #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
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()
text = st.audio(audio_bytes, format='audio/mp3')
pipe = pipeline("automatic-speech-recognition")
#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")
if text:
out=pipe(text)
st.json(out)