-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
27 lines (23 loc) · 831 Bytes
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import streamlit as st
import pandas as pd
import openai_helper
col1, col2 = st.columns([3,2])
financial_data_df = pd.DataFrame({
"Measure": ["Company Name", "Stock Symbol", "Revenue", "Net Income", "EPS"],
"Value": ["", "", "", "", ""]
})
with col1:
st.title("Data Extraction Tool")
news_article = st.text_area("Paste your financial news article here", height=300)
if st.button("Extract"):
financial_data_df = openai_helper.extract_financial_data(news_article)
with col2:
st.markdown("<br/>" * 5, unsafe_allow_html=True) # Creates 5 lines of vertical space
st.dataframe(
financial_data_df,
column_config={
"Measure": st.column_config.Column(width=150),
"Value": st.column_config.Column(width=150)
},
hide_index=True
)