|
import whisper |
|
import os |
|
from pytube import YouTube |
|
import pandas as pd |
|
import plotly_express as px |
|
import nltk |
|
import plotly.graph_objects as go |
|
from optimum.onnxruntime import ORTModelForSequenceClassification |
|
from transformers import pipeline, AutoTokenizer, AutoModelForSequenceClassification, AutoModelForTokenClassification |
|
|
|
from transformers import WhisperProcessor, WhisperForConditionalGeneration |
|
from sentence_transformers import SentenceTransformer, CrossEncoder, util |
|
import streamlit as st |
|
import en_core_web_lg |
|
|
|
from functions import * |
|
|
|
nltk.download('punkt') |
|
|
|
from nltk import sent_tokenize |
|
|
|
st.sidebar.header("Home") |
|
|
|
asr_model_options = ['base','small'] |
|
asr_model_name = st.sidebar.selectbox("Whisper Model", options=asr_model_options, key='sbox') |
|
|
|
st.markdown("## Earnings Call Analysis Whisperer") |
|
|
|
st.markdown( |
|
""" |
|
This app assists finance analysts with transcribing and analysis Earnings Calls by carrying out the following tasks: |
|
- Transcribing earnings calls using Open AI's [Whisper](https://github.com/openai/whisper). |
|
- Analysing the sentiment of transcribed text using the quantized version of [FinBert-Tone](https://huggingface.co/nickmuchi/quantized-optimum-finbert-tone). |
|
- Summarization of the call with [FaceBook-Bart-Large-CNN](https://huggingface.co/facebook/bart-large-cnn) model with entity extraction |
|
- Semantic search engine with [Sentence-Transformers](https://huggingface.co/sentence-transformers/all-mpnet-base-v2) and reranking results with a Cross-Encoder. |
|
|
|
**π Enter a YouTube Earnings Call URL below and navigate to the sidebar tabs** |
|
|
|
""" |
|
) |
|
|
|
if 'sbox' not in st.session_state: |
|
st.session_state.sbox = '' |
|
|
|
if "url" not in st.session_state: |
|
st.session_state.url = "https://www.youtube.com/watch?v=8pmbScvyfeY" |
|
|
|
if "earnings_passages" not in st.session_state: |
|
st.session_state["earnings_passages"] = '' |
|
|
|
if "sen_df" not in st.session_state: |
|
st.session_state['sen_df'] = '' |
|
|
|
url_input = st.text_input( |
|
label="Enter YouTube URL, example below is Amazon Earnings Call 2021", key="url") |
|
|
|
st.markdown( |
|
"<h3 style='text-align: center; color: red;'>OR</h3>", |
|
unsafe_allow_html=True |
|
) |
|
|
|
upload_wav = st.file_uploader("Upload a .wav sound file ",key="upload") |
|
|
|
auth_token = os.environ.get("auth_token") |
|
|
|
st.markdown("![visitor badge](https://visitor-badge.glitch.me/badge?page_id=nickmuchi-earnings-call-whisperer)") |
|
|