Download app.py from ortal12345/Data_Collection_Notebooks: direct link, hf CLI and curl.
- Browser
- Download file 1.46 kB
-
https://huggingface.co/spaces/ortal12345/Data_Collection_Notebooks/resolve/main/app.py
- Command line
-
hf download hf://spaces/ortal12345/Data_Collection_Notebooks/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ortal12345/Data_Collection_Notebooks/resolve/main/app.py
1.46 kB
| # -*- coding: utf-8 -*- | |
| """dashboard | |
| Automatically generated by Colab. | |
| Original file is located at | |
| https://colab.research.google.com/drive/1yT5Jix3VrdcKCeSgH-Gt-NSJnfHzX42H | |
| """ | |
| # π Streamlit Dashboard Code (Save as `dashboard.py`) | |
| import streamlit as st | |
| import pandas as pd | |
| import os | |
| st.title("π Mental Health Datasets Comparison Dashboard") | |
| # Use absolute path if needed, fallback to local folder | |
| results_dir = os.path.abspath("EDA_results") | |
| dataset_dirs = [f for f in os.listdir(results_dir) if os.path.isdir(os.path.join(results_dir, f))] | |
| for ds in dataset_dirs: | |
| st.subheader(f"π Dataset: {ds}") | |
| ds_path = os.path.join(results_dir, ds) | |
| col1, col2 = st.columns(2) | |
| with col1: | |
| plot1 = os.path.join(ds_path, "class_balance_plot.png") | |
| plot2 = os.path.join(ds_path, "avg_text_length_plot.png") | |
| if os.path.exists(plot1): | |
| st.image(plot1, caption="Class Balance") | |
| if os.path.exists(plot2): | |
| st.image(plot2, caption="Avg Text Length by Label") | |
| with col2: | |
| wc = os.path.join(ds_path, "wordcloud.png") | |
| if os.path.exists(wc): | |
| st.image(wc, caption="Word Cloud") | |
| entropy_path = os.path.join(ds_path, "entropy.csv") | |
| if os.path.exists(entropy_path): | |
| entropy = pd.read_csv(entropy_path) | |
| if 'entropy' in entropy.columns: | |
| st.metric(label="π Entropy (Label Diversity)", value=round(entropy['entropy'][0], 3)) |