Update sidebar.py
Browse files- sidebar.py +118 -15
sidebar.py
CHANGED
@@ -1,32 +1,136 @@
|
|
1 |
# import streamlit as st
|
2 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
class Sidebar:
|
4 |
def __init__(self):
|
5 |
self.main_body_logo = "mimtss.png"
|
6 |
-
self.sidebar_logo = "
|
7 |
-
self.image_width =
|
8 |
self.image_path = "mimtss.png"
|
9 |
|
10 |
def display(self):
|
11 |
-
st.logo(self.sidebar_logo, icon_image=self.main_body_logo)
|
12 |
|
13 |
with st.sidebar:
|
14 |
-
# Password input field (commented out)
|
15 |
-
# password = st.text_input("Enter Password:", type="password")
|
16 |
-
|
17 |
# Display the image
|
18 |
st.image(self.image_path, width=self.image_width)
|
19 |
|
20 |
# Toggle for Help and Report a Bug
|
21 |
-
with st.expander("Powered by MTSS.ai
|
22 |
st.write("""
|
23 |
-
**Contact**:
|
24 |
**Email**: [email protected]
|
25 |
""")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
26 |
st.divider()
|
|
|
27 |
st.subheader('User Instructions')
|
28 |
|
29 |
-
#
|
30 |
user_instructions = """
|
31 |
- **Step 1**: Upload your Excel file.
|
32 |
- **Step 2**: Anonymization – student names are replaced with initials for privacy.
|
@@ -40,7 +144,7 @@ class Sidebar:
|
|
40 |
### **Detailed Instructions**
|
41 |
#### **1. Upload Your Excel File**
|
42 |
- Start by uploading an Excel file that contains intervention data.
|
43 |
-
- Click on the
|
44 |
**Note**: Your file should have columns like "Did the intervention happen today?" and "Student Attendance [FirstName LastName]" for the analysis to work correctly.
|
45 |
#### **2. Automated Name Anonymization**
|
46 |
- Once the file is uploaded, the app will **automatically replace student names with initials** in the "Student Attendance" columns.
|
@@ -56,19 +160,18 @@ class Sidebar:
|
|
56 |
- **Intervention Sessions Not Held**
|
57 |
- **Intervention Frequency (%)**
|
58 |
- A **stacked bar chart** will be shown to visualize the number of sessions held versus not held.
|
59 |
-
- If you need to save the visualization, click the
|
60 |
#### **5. Student Metrics Analysis**
|
61 |
- The app will also calculate metrics for each student:
|
62 |
- **Attendance (%)** – The percentage of intervention sessions attended.
|
63 |
- **Engagement (%)** – The level of engagement during attended sessions.
|
64 |
- These metrics will be presented in a **line graph** that shows attendance and engagement for each student.
|
65 |
-
- You can click the
|
66 |
#### **6. Generate AI Analysis and Recommendations**
|
67 |
- The app will prepare data from the student metrics to provide notes, key takeaways, and suggestions for improving outcomes using an **AI language model**.
|
68 |
-
- You will see a **spinner** labeled
|
69 |
- This step may take a little longer, but the spinner ensures you know that the system is working.
|
70 |
-
- Once the analysis is complete, the AI
|
71 |
- Once the analysis is complete, the AI's recommendations will be displayed under **"AI Analysis"**.
|
72 |
-
- You can click the
|
73 |
"""
|
74 |
st.markdown(user_instructions)
|
|
|
1 |
# import streamlit as st
|
2 |
|
3 |
+
# class Sidebar:
|
4 |
+
# def __init__(self):
|
5 |
+
# self.main_body_logo = "mimtss.png"
|
6 |
+
# self.sidebar_logo = "mtss.ai_small.png"
|
7 |
+
# self.image_width = 200
|
8 |
+
# self.image_path = "mimtss.png"
|
9 |
+
|
10 |
+
# def display(self):
|
11 |
+
# # st.logo(self.sidebar_logo, icon_image=self.main_body_logo)
|
12 |
+
# st.logo(self.sidebar_logo, icon_image=self.main_body_logo, size="large")
|
13 |
+
|
14 |
+
# with st.sidebar:
|
15 |
+
# # Password input field (commented out)
|
16 |
+
# # password = st.text_input("Enter Password:", type="password")
|
17 |
+
|
18 |
+
# # Display the image
|
19 |
+
# st.image(self.image_path, width=self.image_width)
|
20 |
+
|
21 |
+
# # Toggle for Help and Report a Bug
|
22 |
+
# with st.expander("Powered by MTSS.ai"):
|
23 |
+
# st.write("""
|
24 |
+
# **Contact**: Cheyne LeVesseur, PhD
|
25 |
+
# **Email**: [email protected]
|
26 |
+
# """)
|
27 |
+
# st.divider()
|
28 |
+
# st.subheader('User Instructions')
|
29 |
+
|
30 |
+
# # Principles text with Markdown formatting
|
31 |
+
# user_instructions = """
|
32 |
+
# - **Step 1**: Upload your Excel file.
|
33 |
+
# - **Step 2**: Anonymization – student names are replaced with initials for privacy.
|
34 |
+
# - **Step 3**: Review anonymized data.
|
35 |
+
# - **Step 4**: View **intervention session statistics**.
|
36 |
+
# - **Step 5**: Review **student attendance and engagement metrics**.
|
37 |
+
# - **Step 6**: Review AI-generated **insights and recommendations**.
|
38 |
+
# ### **Privacy Assurance**
|
39 |
+
# - **No full names** are ever displayed or sent to the AI model—only initials are used.
|
40 |
+
# - This ensures that sensitive data remains protected throughout the entire process.
|
41 |
+
# ### **Detailed Instructions**
|
42 |
+
# #### **1. Upload Your Excel File**
|
43 |
+
# - Start by uploading an Excel file that contains intervention data.
|
44 |
+
# - Click on the **“Upload your Excel file”** button and select your `.xlsx` file from your computer.
|
45 |
+
# **Note**: Your file should have columns like "Did the intervention happen today?" and "Student Attendance [FirstName LastName]" for the analysis to work correctly.
|
46 |
+
# #### **2. Automated Name Anonymization**
|
47 |
+
# - Once the file is uploaded, the app will **automatically replace student names with initials** in the "Student Attendance" columns.
|
48 |
+
# - For example, **"Student Attendance [Cheyne LeVesseur]"** will be displayed as **"Student Attendance [CL]"**.
|
49 |
+
# - If the student only has a first name, like **"Student Attendance [Cheyne]"**, it will be displayed as **"Student Attendance [C]"**.
|
50 |
+
# - This anonymization helps to **protect student privacy**, ensuring that full names are not visible or sent to the AI language model.
|
51 |
+
# #### **3. Review the Uploaded Data**
|
52 |
+
# - You will see the entire table of anonymized data to verify that the information has been uploaded correctly and that names have been replaced with initials.
|
53 |
+
# #### **4. Intervention Session Statistics**
|
54 |
+
# - The app will calculate and display statistics related to intervention sessions, such as:
|
55 |
+
# - **Total Number of Days Available**
|
56 |
+
# - **Intervention Sessions Held**
|
57 |
+
# - **Intervention Sessions Not Held**
|
58 |
+
# - **Intervention Frequency (%)**
|
59 |
+
# - A **stacked bar chart** will be shown to visualize the number of sessions held versus not held.
|
60 |
+
# - If you need to save the visualization, click the **“Download Chart”** button to download it as a `.png` file.
|
61 |
+
# #### **5. Student Metrics Analysis**
|
62 |
+
# - The app will also calculate metrics for each student:
|
63 |
+
# - **Attendance (%)** – The percentage of intervention sessions attended.
|
64 |
+
# - **Engagement (%)** – The level of engagement during attended sessions.
|
65 |
+
# - These metrics will be presented in a **line graph** that shows attendance and engagement for each student.
|
66 |
+
# - You can click the **“Download Chart”** button to download the visualization as a `.png` file.
|
67 |
+
# #### **6. Generate AI Analysis and Recommendations**
|
68 |
+
# - The app will prepare data from the student metrics to provide notes, key takeaways, and suggestions for improving outcomes using an **AI language model**.
|
69 |
+
# - You will see a **spinner** labeled **“Generating AI analysis…”** while the AI processes the data.
|
70 |
+
# - This step may take a little longer, but the spinner ensures you know that the system is working.
|
71 |
+
# - Once the analysis is complete, the AI
|
72 |
+
# - Once the analysis is complete, the AI's recommendations will be displayed under **"AI Analysis"**.
|
73 |
+
# - You can click the **“Download LLM Output”** button to download the AI-generated recommendations as a `.txt` file for future reference.
|
74 |
+
# """
|
75 |
+
# st.markdown(user_instructions)
|
76 |
+
|
77 |
+
|
78 |
class Sidebar:
|
79 |
def __init__(self):
|
80 |
self.main_body_logo = "mimtss.png"
|
81 |
+
self.sidebar_logo = "mtss.ai_small.png"
|
82 |
+
self.image_width = 200
|
83 |
self.image_path = "mimtss.png"
|
84 |
|
85 |
def display(self):
|
86 |
+
st.logo(self.sidebar_logo, icon_image=self.main_body_logo, size="large")
|
87 |
|
88 |
with st.sidebar:
|
|
|
|
|
|
|
89 |
# Display the image
|
90 |
st.image(self.image_path, width=self.image_width)
|
91 |
|
92 |
# Toggle for Help and Report a Bug
|
93 |
+
with st.expander("Powered by MTSS.ai"):
|
94 |
st.write("""
|
95 |
+
**Contact**: Cheyne LeVesseur, PhD
|
96 |
**Email**: [email protected]
|
97 |
""")
|
98 |
+
|
99 |
+
st.divider()
|
100 |
+
|
101 |
+
st.subheader('Spreadsheet Headers')
|
102 |
+
|
103 |
+
headers_info = """
|
104 |
+
Your spreadsheet must include the following headers for proper analysis:
|
105 |
+
|
106 |
+
1. **Date Column**:
|
107 |
+
- "Date of Session" or "Date"
|
108 |
+
|
109 |
+
2. **Intervention Column**:
|
110 |
+
- "Did the intervention happen today?" or
|
111 |
+
- "Did the intervention take place today?"
|
112 |
+
|
113 |
+
3. **Student Attendance Columns**:
|
114 |
+
- Format: "Student Attendance [student name]"
|
115 |
+
- Options: Engaged, Partially Engaged, Not Engaged, Absent
|
116 |
+
- Example: "Student Attendance [Charlie Gordon]"
|
117 |
+
|
118 |
+
#### Important Note on Student Names:
|
119 |
+
- For students with the same initials, you must use a unique identifier to distinguish them.
|
120 |
+
- Best practices for unique identifiers:
|
121 |
+
- Add a middle name: "Charlie Gordon" --> "Charlie A. Gordon"
|
122 |
+
- Use a unique identifier: "Charlie Gordon 1" and "Clarissa Gao 2"
|
123 |
+
|
124 |
+
This ensures that when names are truncated to initials, each student has a unique identifier.
|
125 |
+
"""
|
126 |
+
|
127 |
+
st.markdown(headers_info)
|
128 |
+
|
129 |
st.divider()
|
130 |
+
|
131 |
st.subheader('User Instructions')
|
132 |
|
133 |
+
# Existing user instructions
|
134 |
user_instructions = """
|
135 |
- **Step 1**: Upload your Excel file.
|
136 |
- **Step 2**: Anonymization – student names are replaced with initials for privacy.
|
|
|
144 |
### **Detailed Instructions**
|
145 |
#### **1. Upload Your Excel File**
|
146 |
- Start by uploading an Excel file that contains intervention data.
|
147 |
+
- Click on the **"Upload your Excel file"** button and select your `.xlsx` file from your computer.
|
148 |
**Note**: Your file should have columns like "Did the intervention happen today?" and "Student Attendance [FirstName LastName]" for the analysis to work correctly.
|
149 |
#### **2. Automated Name Anonymization**
|
150 |
- Once the file is uploaded, the app will **automatically replace student names with initials** in the "Student Attendance" columns.
|
|
|
160 |
- **Intervention Sessions Not Held**
|
161 |
- **Intervention Frequency (%)**
|
162 |
- A **stacked bar chart** will be shown to visualize the number of sessions held versus not held.
|
163 |
+
- If you need to save the visualization, click the **"Download Chart"** button to download it as a `.png` file.
|
164 |
#### **5. Student Metrics Analysis**
|
165 |
- The app will also calculate metrics for each student:
|
166 |
- **Attendance (%)** – The percentage of intervention sessions attended.
|
167 |
- **Engagement (%)** – The level of engagement during attended sessions.
|
168 |
- These metrics will be presented in a **line graph** that shows attendance and engagement for each student.
|
169 |
+
- You can click the **"Download Chart"** button to download the visualization as a `.png` file.
|
170 |
#### **6. Generate AI Analysis and Recommendations**
|
171 |
- The app will prepare data from the student metrics to provide notes, key takeaways, and suggestions for improving outcomes using an **AI language model**.
|
172 |
+
- You will see a **spinner** labeled **"Generating AI analysis…"** while the AI processes the data.
|
173 |
- This step may take a little longer, but the spinner ensures you know that the system is working.
|
|
|
174 |
- Once the analysis is complete, the AI's recommendations will be displayed under **"AI Analysis"**.
|
175 |
+
- You can click the **"Download LLM Output"** button to download the AI-generated recommendations as a `.txt` file for future reference.
|
176 |
"""
|
177 |
st.markdown(user_instructions)
|