CoolFace
Apppublic

Mintiny/Customer_Review_Audio_Analysis

sourceHugging Faceupdated 2y agoView on Hugging Face
1likes
app.py33 linesDownload Raw Back to root
1import streamlit as st2from transformers import pipeline3import io4from pydub import AudioSegment5 6 7 8 9 10pipe1 = pipeline("automatic-speech-recognition", model="jonatasgrosman/wav2vec2-large-xlsr-53-english")11pipe2 = pipeline("text-classification", model="Mintiny/CustomModel_yelp1.1")12 13st.title("Customer Review Audio Analysis๐Ÿ”๐Ÿฃ๐Ÿ๐Ÿœ")14with st.form(key="my_form"):15    f = st.file_uploader("Upload Recordings", type = ["mp3"])16    submit_button = st.form_submit_button(label="Start")17            18        19if f is not None:20    audio_data =f.getvalue()21    st.audio(f,format="mp3")22    text=pipe1(audio_data)['text']23    label=pipe2(text)[0]['label']24    if label == 'LABEL_1':25        st.write('The review is positive.')26    else:27        st.write('The review is negative.')28        29    30    31 32 33