Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -14,6 +14,10 @@ import praw
|
|
| 14 |
from googleapiclient.discovery import build
|
| 15 |
from sklearn.linear_model import Ridge
|
| 16 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
| 17 |
|
| 18 |
# --------------------------
|
| 19 |
# Initial Setup
|
|
@@ -104,10 +108,6 @@ def initialize_resources():
|
|
| 104 |
|
| 105 |
return True
|
| 106 |
|
| 107 |
-
if not initialize_resources():
|
| 108 |
-
st.error("Critical initialization failed. Check error messages above.")
|
| 109 |
-
st.stop()
|
| 110 |
-
|
| 111 |
# --------------------------
|
| 112 |
# Core Functions
|
| 113 |
# --------------------------
|
|
@@ -319,6 +319,10 @@ def sidebar_controls():
|
|
| 319 |
# --------------------------
|
| 320 |
|
| 321 |
def main():
|
|
|
|
|
|
|
|
|
|
|
|
|
| 322 |
st.title("📊 SentimentSync Pro")
|
| 323 |
st.caption("Advanced sentiment analysis across multiple platforms")
|
| 324 |
|
|
@@ -380,7 +384,7 @@ def analyze_text_input():
|
|
| 380 |
|
| 381 |
sent_df = pd.DataFrame(sent_data)
|
| 382 |
|
| 383 |
-
# Fixed
|
| 384 |
styled_df = sent_df.style.background_gradient(
|
| 385 |
cmap='RdYlGn',
|
| 386 |
subset=['VADER', 'BERT', 'TextBlob', 'Average'],
|
|
|
|
| 14 |
from googleapiclient.discovery import build
|
| 15 |
from sklearn.linear_model import Ridge
|
| 16 |
import os
|
| 17 |
+
import warnings
|
| 18 |
+
|
| 19 |
+
# Suppress the ScriptRunContext warning
|
| 20 |
+
warnings.filterwarnings("ignore", message="missing ScriptRunContext")
|
| 21 |
|
| 22 |
# --------------------------
|
| 23 |
# Initial Setup
|
|
|
|
| 108 |
|
| 109 |
return True
|
| 110 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 111 |
# --------------------------
|
| 112 |
# Core Functions
|
| 113 |
# --------------------------
|
|
|
|
| 319 |
# --------------------------
|
| 320 |
|
| 321 |
def main():
|
| 322 |
+
if not initialize_resources():
|
| 323 |
+
st.error("Critical initialization failed. Check error messages above.")
|
| 324 |
+
return
|
| 325 |
+
|
| 326 |
st.title("📊 SentimentSync Pro")
|
| 327 |
st.caption("Advanced sentiment analysis across multiple platforms")
|
| 328 |
|
|
|
|
| 384 |
|
| 385 |
sent_df = pd.DataFrame(sent_data)
|
| 386 |
|
| 387 |
+
# Fixed dataframe display with proper parenthesis closure
|
| 388 |
styled_df = sent_df.style.background_gradient(
|
| 389 |
cmap='RdYlGn',
|
| 390 |
subset=['VADER', 'BERT', 'TextBlob', 'Average'],
|