Update pages/2_Earnings_Summarization_π_.py
Browse files
pages/2_Earnings_Summarization_π_.py
CHANGED
@@ -5,32 +5,29 @@ st.set_page_config(page_title="Earnings Summarization", page_icon="π")
|
|
5 |
st.sidebar.header("Earnings Summarization")
|
6 |
st.markdown("## Earnings Summarization with FaceBook-Bart")
|
7 |
|
8 |
-
max_len= st.slider("Maximum length of the summarized text",min_value=
|
9 |
min_len= st.slider("Minimum length of the summarized text",min_value=20,max_value=200,step=10)
|
10 |
|
11 |
st.markdown("####")
|
12 |
|
13 |
-
st.subheader("Summarized Earnings Call with matched
|
14 |
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
entity_match_html = highlight_entities(text_to_summarize,summarized_text)
|
20 |
-
st.markdown("####")
|
21 |
-
|
22 |
-
st.session_state.summ_area = summarized_text
|
23 |
|
24 |
-
|
25 |
-
label = '',
|
26 |
-
placeholder="Full summarized text will be displayed here..",
|
27 |
-
height=250,
|
28 |
-
key='summ_area'
|
29 |
-
)
|
30 |
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
st.sidebar.header("Earnings Summarization")
|
6 |
st.markdown("## Earnings Summarization with FaceBook-Bart")
|
7 |
|
8 |
+
max_len= st.slider("Maximum length of the summarized text",min_value=50,max_value=200,step=10)
|
9 |
min_len= st.slider("Minimum length of the summarized text",min_value=20,max_value=200,step=10)
|
10 |
|
11 |
st.markdown("####")
|
12 |
|
13 |
+
st.subheader("Summarized Earnings Call with matched Entities")
|
14 |
|
15 |
+
if earnings_passages:
|
16 |
+
text_to_summarize = chunk_and_preprocess_text(earnings_passages)
|
17 |
+
summarized_text = sum_pipe(text_to_summarize,max_length=max_len,min_length=min_len,clean_up_tokenization_spaces=True,no_repeat_ngram_size=4)
|
18 |
+
summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
|
|
|
|
|
|
|
|
|
19 |
|
20 |
+
with st.spinner("Summarizing and matching entities, this takes a few seconds..."):
|
|
|
|
|
|
|
|
|
|
|
21 |
|
22 |
+
entity_match_html = highlight_entities(text_to_summarize,summarized_text)
|
23 |
+
st.markdown("####")
|
24 |
+
|
25 |
+
with st.expander(label='Summarized Earnings Call',expanded=True):
|
26 |
+
st.write(entity_match_html, unsafe_allow_html=True)
|
27 |
+
|
28 |
+
st.markdown("####")
|
29 |
+
|
30 |
+
summary_downloader(summarized_text)
|
31 |
+
|
32 |
+
else:
|
33 |
+
st.write("No text to summarize detected, please ensure you have entered the YouTube URL on the Sentiment Analysis page")
|