Update sidebar.py
Browse files12345678910111213141516171819202122232425262728293031327 unmodified lines404142434445469 unmodified lines56575859606162636465666768697071727374# import streamlit as stclass Sidebar:def __init__(self):self.main_body_logo = "mimtss.png"self.sidebar_logo = "mimtss_small.png"self.image_width = 300self.image_path = "mimtss.png"def display(self):st.logo(self.sidebar_logo, icon_image=self.main_body_logo)with st.sidebar:# Password input field (commented out)# password = st.text_input("Enter Password:", type="password")# Display the imagest.image(self.image_path, width=self.image_width)# Toggle for Help and Report a Bugwith st.expander("Powered by MTSS.ai:Help Center and Bug Reporting"):st.write("""**Contact**: MTSS.ai | Cheyne LeVesseur, PhD**Email**: info@mtss.ai""")st.divider()st.subheader('User Instructions')# Principles text with Markdown formattinguser_instructions = """- **Step 1**: Upload your Excel file.- **Step 2**: Anonymization – student names are replaced with initials for privacy.7 unmodified lines### **Detailed Instructions**#### **1. Upload Your Excel File**- Start by uploading an Excel file that contains intervention data.- Click on the **“Upload your Excel file”** button and select your `.xlsx` file from your computer.**Note**: Your file should have columns like "Did the intervention happen today?" and "Student Attendance [FirstName LastName]" for the analysis to work correctly.#### **2. Automated Name Anonymization**- Once the file is uploaded, the app will **automatically replace student names with initials** in the "Student Attendance" columns.9 unmodified lines- **Intervention Sessions Not Held**- **Intervention Frequency (%)**- A **stacked bar chart** will be shown to visualize the number of sessions held versus not held.- If you need to save the visualization, click the **“Download Chart”** button to download it as a `.png` file.#### **5. Student Metrics Analysis**- The app will also calculate metrics for each student:- **Attendance (%)** – The percentage of intervention sessions attended.- **Engagement (%)** – The level of engagement during attended sessions.- These metrics will be presented in a **line graph** that shows attendance and engagement for each student.- You can click the **“Download Chart”** button to download the visualization as a `.png` file.#### **6. Generate AI Analysis and Recommendations**- The app will prepare data from the student metrics to provide notes, key takeaways, and suggestions for improving outcomes using an **AI language model**.- You will see a **spinner** labeled **“Generating AI analysis…”** while the AI processes the data.- This step may take a little longer, but the spinner ensures you know that the system is working.- Once the analysis is complete, the AI- Once the analysis is complete, the AI's recommendations will be displayed under **"AI Analysis"**.- You can click the **“Download LLM Output”** button to download the AI-generated recommendations as a `.txt` file for future reference."""st.markdown(user_instructions)1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351367 unmodified lines1441451461471481491509 unmodified lines160161162163164165166167168169170171172173174175176177# import streamlit as st# class Sidebar:# def __init__(self):# self.main_body_logo = "mimtss.png"# self.sidebar_logo = "mtss.ai_small.png"# self.image_width = 200# self.image_path = "mimtss.png"# def display(self):# # st.logo(self.sidebar_logo, icon_image=self.main_body_logo)# st.logo(self.sidebar_logo, icon_image=self.main_body_logo, size="large")# with st.sidebar:# # Password input field (commented out)# # password = st.text_input("Enter Password:", type="password")# # Display the image# st.image(self.image_path, width=self.image_width)# # Toggle for Help and Report a Bug# with st.expander("Powered by MTSS.ai"):# st.write("""# **Contact**: Cheyne LeVesseur, PhD# **Email**: info@mtss.ai# """)# st.divider()# st.subheader('User Instructions')# # Principles text with Markdown formatting# user_instructions = """# - **Step 1**: Upload your Excel file.# - **Step 2**: Anonymization – student names are replaced with initials for privacy.# - **Step 3**: Review anonymized data.# - **Step 4**: View **intervention session statistics**.# - **Step 5**: Review **student attendance and engagement metrics**.# - **Step 6**: Review AI-generated **insights and recommendations**.# ### **Privacy Assurance**# - **No full names** are ever displayed or sent to the AI model—only initials are used.# - This ensures that sensitive data remains protected throughout the entire process.# ### **Detailed Instructions**# #### **1. Upload Your Excel File**# - Start by uploading an Excel file that contains intervention data.# - Click on the **“Upload your Excel file”** button and select your `.xlsx` file from your computer.# **Note**: Your file should have columns like "Did the intervention happen today?" and "Student Attendance [FirstName LastName]" for the analysis to work correctly.# #### **2. Automated Name Anonymization**# - Once the file is uploaded, the app will **automatically replace student names with initials** in the "Student Attendance" columns.# - For example, **"Student Attendance [Cheyne LeVesseur]"** will be displayed as **"Student Attendance [CL]"**.# - If the student only has a first name, like **"Student Attendance [Cheyne]"**, it will be displayed as **"Student Attendance [C]"**.# - This anonymization helps to **protect student privacy**, ensuring that full names are not visible or sent to the AI language model.# #### **3. Review the Uploaded Data**# - 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.# #### **4. Intervention Session Statistics**# - The app will calculate and display statistics related to intervention sessions, such as:# - **Total Number of Days Available**# - **Intervention Sessions Held**# - **Intervention Sessions Not Held**# - **Intervention Frequency (%)**# - A **stacked bar chart** will be shown to visualize the number of sessions held versus not held.# - If you need to save the visualization, click the **“Download Chart”** button to download it as a `.png` file.# #### **5. Student Metrics Analysis**# - The app will also calculate metrics for each student:# - **Attendance (%)** – The percentage of intervention sessions attended.# - **Engagement (%)** – The level of engagement during attended sessions.# - These metrics will be presented in a **line graph** that shows attendance and engagement for each student.# - You can click the **“Download Chart”** button to download the visualization as a `.png` file.# #### **6. Generate AI Analysis and Recommendations**# - The app will prepare data from the student metrics to provide notes, key takeaways, and suggestions for improving outcomes using an **AI language model**.# - You will see a **spinner** labeled **“Generating AI analysis…”** while the AI processes the data.# - This step may take a little longer, but the spinner ensures you know that the system is working.# - Once the analysis is complete, the AI# - Once the analysis is complete, the AI's recommendations will be displayed under **"AI Analysis"**.# - You can click the **“Download LLM Output”** button to download the AI-generated recommendations as a `.txt` file for future reference.# """# st.markdown(user_instructions)class Sidebar:def __init__(self):self.main_body_logo = "mimtss.png"self.sidebar_logo = "mtss.ai_small.png"self.image_width = 200self.image_path = "mimtss.png"def display(self):st.logo(self.sidebar_logo, icon_image=self.main_body_logo, size="large")with st.sidebar:# Display the imagest.image(self.image_path, width=self.image_width)# Toggle for Help and Report a Bugwith st.expander("Powered by MTSS.ai"):st.write("""**Contact**: Cheyne LeVesseur, PhD**Email**: info@mtss.ai""")st.divider()st.subheader('Spreadsheet Headers')headers_info = """Your spreadsheet must include the following headers for proper analysis:1. **Date Column**:- "Date of Session" or "Date"2. **Intervention Column**:- "Did the intervention happen today?" or- "Did the intervention take place today?"3. **Student Attendance Columns**:- Format: "Student Attendance [student name]"- Options: Engaged, Partially Engaged, Not Engaged, Absent- Example: "Student Attendance [Charlie Gordon]"#### Important Note on Student Names:- For students with the same initials, you must use a unique identifier to distinguish them.- Best practices for unique identifiers:- Add a middle name: "Charlie Gordon" --> "Charlie A. Gordon"- Use a unique identifier: "Charlie Gordon 1" and "Clarissa Gao 2"This ensures that when names are truncated to initials, each student has a unique identifier."""st.markdown(headers_info)st.divider()st.subheader('User Instructions')# Existing user instructionsuser_instructions = """- **Step 1**: Upload your Excel file.- **Step 2**: Anonymization – student names are replaced with initials for privacy.7 unmodified lines### **Detailed Instructions**#### **1. Upload Your Excel File**- Start by uploading an Excel file that contains intervention data.- Click on the **"Upload your Excel file"** button and select your `.xlsx` file from your computer.**Note**: Your file should have columns like "Did the intervention happen today?" and "Student Attendance [FirstName LastName]" for the analysis to work correctly.#### **2. Automated Name Anonymization**- Once the file is uploaded, the app will **automatically replace student names with initials** in the "Student Attendance" columns.9 unmodified lines- **Intervention Sessions Not Held**- **Intervention Frequency (%)**- A **stacked bar chart** will be shown to visualize the number of sessions held versus not held.- If you need to save the visualization, click the **"Download Chart"** button to download it as a `.png` file.#### **5. Student Metrics Analysis**- The app will also calculate metrics for each student:- **Attendance (%)** – The percentage of intervention sessions attended.- **Engagement (%)** – The level of engagement during attended sessions.- These metrics will be presented in a **line graph** that shows attendance and engagement for each student.- You can click the **"Download Chart"** button to download the visualization as a `.png` file.#### **6. Generate AI Analysis and Recommendations**- The app will prepare data from the student metrics to provide notes, key takeaways, and suggestions for improving outcomes using an **AI language model**.- You will see a **spinner** labeled **"Generating AI analysis…"** while the AI processes the data.- This step may take a little longer, but the spinner ensures you know that the system is working.- Once the analysis is complete, the AI's recommendations will be displayed under **"AI Analysis"**.- You can click the **"Download LLM Output"** button to download the AI-generated recommendations as a `.txt` file for future reference."""st.markdown(user_instructions)
sidebar.py+118-15