proKBD commited on
Commit
52c4b49
·
verified ·
1 Parent(s): 8fecdd5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +11 -0
app.py CHANGED
@@ -8,12 +8,23 @@ import plotly.express as px
8
  import altair as alt
9
  from utils import analyze_company_data # Import the analysis function directly
10
 
 
11
  st.set_page_config(
12
  page_title="News Summarization App",
13
  page_icon="📰",
14
  layout="wide"
15
  )
16
 
 
 
 
 
 
 
 
 
 
 
17
  def process_company(company_name):
18
  """Process company data directly."""
19
  try:
 
8
  import altair as alt
9
  from utils import analyze_company_data # Import the analysis function directly
10
 
11
+ # Set page config
12
  st.set_page_config(
13
  page_title="News Summarization App",
14
  page_icon="📰",
15
  layout="wide"
16
  )
17
 
18
+ # Show loading message
19
+ with st.spinner("Initializing the application... Please wait while we load the models."):
20
+ # Initialize components
21
+ try:
22
+ from utils import NewsExtractor, SentimentAnalyzer, TextSummarizer, TextToSpeechConverter
23
+ st.success("Application initialized successfully!")
24
+ except Exception as e:
25
+ st.error(f"Error initializing application: {str(e)}")
26
+ st.info("Please try refreshing the page.")
27
+
28
  def process_company(company_name):
29
  """Process company data directly."""
30
  try: