import streamlit as st import time import json import pandas as pd import plotly.express as px import plotly.graph_objects as go import matplotlib.pyplot as plt import numpy as np import lightgbm as lgb from sklearn.feature_extraction.text import TfidfVectorizer from sklearn.metrics.pairwise import cosine_similarity from sklearn.metrics import mean_absolute_error, mean_squared_error from joblib import dump, load from utils import recomienda_tf from utils import retroalimentacion from streamlit_lottie import st_lottie import requests # Page configuration st.set_page_config(page_title="DeepInsightz", page_icon=":bar_chart:", layout="wide") # Custom CSS for dynamic theme styling # Custom CSS for dynamic theme styling if st.get_option("theme.base") == "dark": background_color = "#282828" text_color = "white" metric_box_color = "#4f4f4f" sidebar_color = "#282828" plot_bgcolor = "rgba(0, 0, 0, 0)" primary_color = '#00FF00' # for positive delta negative_color = '#FF0000' # for negative delta else: background_color = "#f4f4f4" text_color = "#black" metric_box_color = "#dee2e8" sidebar_color = "#dee2e8" plot_bgcolor = "#f4f4f4" primary_color = '#228B22' # for positive delta in light mode negative_color = '#8B0000' # for negative delta in light mode # Load custom CSS for dynamic theme and Lottie animation st.markdown(f""" """, unsafe_allow_html=True) # Function to show Lottie animation as an overlay def display_lottie_animation(show_animation): if show_animation: st.markdown('
', unsafe_allow_html=True) st_lottie(lottie_animation, height=300, width=300) st.markdown('
', unsafe_allow_html=True) else: st.markdown('