Update pages/2_Earnings_Summarization_π_.py
Browse files
pages/2_Earnings_Summarization_π_.py
CHANGED
@@ -5,3 +5,32 @@ 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 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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=100,max_value=500,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 |
+
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)
|
16 |
+
summarized_text = ' '.join([summ['summary_text'] for summ in summarized_text])
|
17 |
+
|
18 |
+
with st.spinner("Summarizing and matching entities, this takes a few seconds..."):
|
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 |
+
summarized_text = st.text_area(
|
25 |
+
label = '',
|
26 |
+
placeholder="Full summarized text will be displayed here..",
|
27 |
+
height=250,
|
28 |
+
key='summ_area'
|
29 |
+
)
|
30 |
+
|
31 |
+
with st.container:
|
32 |
+
st.write(entity_match_html, unsafe_allow_html=True)
|
33 |
+
|
34 |
+
st.markdown("####")
|
35 |
+
|
36 |
+
summary_downloader(summarized_text)
|