ProfessorLeVesseur
commited on
Create sidebar.py
Browse files- sidebar.py +74 -0
sidebar.py
ADDED
@@ -0,0 +1,74 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
class Sidebar:
|
4 |
+
def __init__(self):
|
5 |
+
self.main_body_logo = "mimtss.png"
|
6 |
+
self.sidebar_logo = "mimtss_small.png"
|
7 |
+
self.image_width = 300
|
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("Need help and report a bug"):
|
22 |
+
st.write("""
|
23 |
+
**Contact**: Cheyne LeVesseur, PhD
|
24 |
+
**Email**: [email protected]
|
25 |
+
""")
|
26 |
+
st.divider()
|
27 |
+
st.subheader('User Instructions')
|
28 |
+
|
29 |
+
# Principles text with Markdown formatting
|
30 |
+
user_instructions = """
|
31 |
+
- **Step 1**: Upload your Excel file.
|
32 |
+
- **Step 2**: Anonymization – student names are replaced with initials for privacy.
|
33 |
+
- **Step 3**: Review anonymized data.
|
34 |
+
- **Step 4**: View **intervention session statistics**.
|
35 |
+
- **Step 5**: Review **student attendance and engagement metrics**.
|
36 |
+
- **Step 6**: Review AI-generated **insights and recommendations**.
|
37 |
+
### **Privacy Assurance**
|
38 |
+
- **No full names** are ever displayed or sent to the AI model—only initials are used.
|
39 |
+
- This ensures that sensitive data remains protected throughout the entire process.
|
40 |
+
### **Detailed Instructions**
|
41 |
+
#### **1. Upload Your Excel File**
|
42 |
+
- Start by uploading an Excel file that contains intervention data.
|
43 |
+
- Click on the **“Upload your Excel file”** button and select your `.xlsx` file from your computer.
|
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.
|
47 |
+
- For example, **"Student Attendance [Cheyne LeVesseur]"** will be displayed as **"Student Attendance [CL]"**.
|
48 |
+
- If the student only has a first name, like **"Student Attendance [Cheyne]"**, it will be displayed as **"Student Attendance [C]"**.
|
49 |
+
- This anonymization helps to **protect student privacy**, ensuring that full names are not visible or sent to the AI language model.
|
50 |
+
#### **3. Review the Uploaded Data**
|
51 |
+
- 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.
|
52 |
+
#### **4. Intervention Session Statistics**
|
53 |
+
- The app will calculate and display statistics related to intervention sessions, such as:
|
54 |
+
- **Total Number of Days Available**
|
55 |
+
- **Intervention Sessions Held**
|
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 **“Download Chart”** button to download it as a `.png` file.
|
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 **“Download Chart”** button to download the visualization as a `.png` file.
|
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 **“Generating AI analysis…”** while the AI processes the data.
|
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 **“Download LLM Output”** button to download the AI-generated recommendations as a `.txt` file for future reference.
|
73 |
+
"""
|
74 |
+
st.markdown(user_instructions)
|