rbuell commited on
Commit
633c9ca
·
1 Parent(s): a5e0414

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +40 -29
app.py CHANGED
@@ -14,14 +14,15 @@ def write_sidebar():
14
  st.sidebar.title("Instructions")
15
  st.sidebar.markdown("**1. Select the student's grade level.**")
16
  st.sidebar.markdown("**2. Select the student's qualifying condition(s).**")
17
- st.sidebar.markdown("**3. Choose a prompt category and prompt to analyze.**")
18
  st.sidebar.markdown("**4. Enter your student data.**")
19
- st.sidebar.markdown("**5. Click the 'Generate' button to generate the selected output.**")
 
20
 
21
  st.sidebar.write("")
22
  st.sidebar.write("")
23
 
24
- st.sidebar.write("Note: This app uses OpenAI's GPT-3 API to generate the PLAAFP statement or IEP goal. Please enter data that is relevant and appropriate for generating the output.")
25
 
26
  def write_iep_assist():
27
  st.title("IEP Assist Premium")
@@ -36,29 +37,39 @@ def write_iep_assist():
36
 
37
  # Define prompts by category
38
  prompt_categories = {
39
- "Behavior": [
40
- "Provide a summary of the student's behavior data and suggest possible interventions to try based on their areas of need.",
41
- "Analyze the student's behavior data to identify trends and suggest possible interventions.",
42
- "Provide a summary of the student's progress towards their behavioral goals."
 
 
 
 
 
 
 
 
 
 
 
43
  ],
44
- "Academic": [
45
- "Analyze the data provided on the student and provide a summary of their strengths and areas of need in regards to their academic performance.",
46
- "Summarize the data provided on the student's academic performance, highlighting their strengths and areas of need, and suggesting possible interventions to try.",
47
- "Please provide a summary of the student's academic performance, highlighting their strengths and areas of need.",
48
- "What is the student's biggest strength and area of need in regards to their academic performance?",
49
- "Based on the student's academic performance data, what recommendations do you have for adjusting their instructional strategies?",
50
- "How can the student's strengths be leveraged to help them improve in areas of need?",
51
- "What barriers to academic success does the student face, and how can they be addressed?"
52
  ],
53
- "IEP Goals": [
54
- "Analyze the data provided on the student and provide a summary of their progress in regards to their IEP goals.",
55
- "Provide a summary of the student's progress towards their academic and behavioral goals."
 
 
 
 
56
  ]
57
  }
58
 
59
  # Choose a category and prompt
60
- st.markdown("<h3>Choose a prompt category and prompt:</h3>", unsafe_allow_html=True)
61
- selected_category = st.selectbox("Category:", options=["Behavior", "Academic", "IEP Goals"], key="category")
62
  prompts = prompt_categories[selected_category]
63
  selected_prompt = st.selectbox("Prompt:", options=prompts, key="prompt")
64
 
@@ -66,18 +77,18 @@ def write_iep_assist():
66
  st.markdown("<h3>Enter student data to be analyzed:</h3>", unsafe_allow_html=True)
67
  student_data = st.text_area("Paste student data here", height=250, key="student-data")
68
 
69
- # Add a button to generate the PLAAFP statement or effective IEP goal
 
 
 
70
  generate_button = st.button("Generate", key="generate-button", help="Click here to generate the selected output.")
71
 
72
  if generate_button:
73
- if selected_category == "IEP Goals":
74
- # Define the characteristics of an effective IEP goal
75
- effective_goal_characteristics = "Measurable, Specific and Clear, Attainable and Realistic, Relevant and Meaningful, Time-Bound, Individualized, Action-Oriented, Aligned with Standards and Curriculum, Collaboratively Developed, Monitored and Adjusted"
76
-
77
  # Call the OpenAI API and generate an effective IEP goal
78
  response = openai.Completion.create(
79
  engine="text-davinci-003",
80
- prompt=f"Generate an effective and measurable IEP goal for a student who is in grade {grade_level} and has qualifying conditions of {', '.join(qualifying_condition)}. The goal should be based on the analysis of their data and meet the following characteristics: {effective_goal_characteristics}. Data Analysis: {selected_prompt} {student_data}",
81
  max_tokens=2000,
82
  n=1,
83
  stop=None,
@@ -88,7 +99,7 @@ def write_iep_assist():
88
  # Show the generated effective IEP goal
89
  st.markdown(f"<h3>Effective IEP Goal:</h3>{goal}", unsafe_allow_html=True)
90
  else:
91
- # Call the OpenAI API and generate a PLAAFP statement
92
  response = openai.Completion.create(
93
  engine="text-davinci-003",
94
  prompt=f"{selected_prompt} {student_data} {grade_level} {qualifying_condition}",
@@ -99,8 +110,8 @@ def write_iep_assist():
99
  )
100
  statement = response["choices"][0]["text"]
101
 
102
- # Show the generated PLAAFP statement
103
- st.markdown(f"<h3>Summary of Data entered:</h3>{statement}", unsafe_allow_html=True)
104
 
105
  if __name__ == "__main__":
106
  write_sidebar()
 
14
  st.sidebar.title("Instructions")
15
  st.sidebar.markdown("**1. Select the student's grade level.**")
16
  st.sidebar.markdown("**2. Select the student's qualifying condition(s).**")
17
+ st.sidebar.markdown("**3. Choose a category and prompt to analyze.**")
18
  st.sidebar.markdown("**4. Enter your student data.**")
19
+ st.sidebar.markdown("**5. Check the box to generate an IEP goal.**")
20
+ st.sidebar.markdown("**6. Click the 'Generate' button to generate the selected output.**")
21
 
22
  st.sidebar.write("")
23
  st.sidebar.write("")
24
 
25
+ st.sidebar.write("Note: This app uses OpenAI's GPT-3 API to generate the analysis and IEP goal. Please enter data that is relevant and appropriate for generating the output.")
26
 
27
  def write_iep_assist():
28
  st.title("IEP Assist Premium")
 
37
 
38
  # Define prompts by category
39
  prompt_categories = {
40
+ "Reading": [
41
+ "Analyze the student's reading performance data and provide a summary of their strengths and areas for improvement. Recommend strategies or interventions to enhance their reading skills.",
42
+ "Based on the reading data provided, identify the student's reading level and highlight specific areas where they may need additional support or interventions. Suggest instructional approaches to promote reading fluency and comprehension."
43
+ ],
44
+ "Writing": [
45
+ "Review the student's writing samples or assessments and provide feedback on their strengths and areas for growth. Recommend strategies or interventions to enhance their writing skills, such as organization, grammar, or content development.",
46
+ "Based on the writing data provided, analyze the student's writing proficiency and identify specific areas where they may need support. Suggest instructional techniques to foster their writing abilities and improve overall written expression."
47
+ ],
48
+ "Math": [
49
+ "Analyze the student's math performance data and provide insights into their strengths and areas for improvement. Recommend targeted interventions or instructional strategies to enhance their mathematical skills and problem-solving abilities.",
50
+ "Based on the math data provided, identify the student's math proficiency level and highlight specific areas where they may require additional support. Suggest instructional approaches to strengthen their mathematical understanding and application."
51
+ ],
52
+ "Functional": [
53
+ "Review the student's functional skills data and provide an overview of their abilities and areas that require support in daily living tasks. Recommend strategies, accommodations, or interventions to enhance their independence and functional skills development.",
54
+ "Based on the functional skills data provided, analyze the student's strengths and areas for improvement in various functional domains. Propose interventions or modifications to promote their participation and success in daily activities."
55
  ],
56
+ "Speech": [
57
+ "Analyze the student's speech or language assessments and provide a summary of their communication strengths and areas for development. Recommend interventions or strategies to enhance their speech or language skills.",
58
+ "Based on the speech data provided, identify the student's speech or language challenges and suggest targeted interventions or therapy techniques to support their communication development."
 
 
 
 
 
59
  ],
60
+ "Behavior": [
61
+ "Review the student's behavior data and identify patterns or triggers that influence their behavior. Provide insights into the student's strengths and areas for improvement. Recommend behavior management strategies or interventions to address their specific needs.",
62
+ "Based on the behavior data provided, analyze the student's behavior patterns and provide guidance on effective behavior management techniques. Suggest interventions or supports to promote positive behavior and reduce challenging behaviors."
63
+ ],
64
+ "Other": [
65
+ "Analyze the student's data in the specified area (e.g., social skills, executive functioning, sensory integration) and provide a summary of their strengths and areas for improvement. Recommend strategies, interventions, or accommodations to address their unique needs.",
66
+ "Based on the data provided in the specified area, identify the student's strengths and areas for growth. Provide insights and suggestions to support their development and success in the given domain."
67
  ]
68
  }
69
 
70
  # Choose a category and prompt
71
+ st.markdown("<h3>Choose a category and prompt:</h3>", unsafe_allow_html=True)
72
+ selected_category = st.selectbox("Category:", options=list(prompt_categories.keys()), key="category")
73
  prompts = prompt_categories[selected_category]
74
  selected_prompt = st.selectbox("Prompt:", options=prompts, key="prompt")
75
 
 
77
  st.markdown("<h3>Enter student data to be analyzed:</h3>", unsafe_allow_html=True)
78
  student_data = st.text_area("Paste student data here", height=250, key="student-data")
79
 
80
+ # Checkbox to generate IEP goal
81
+ generate_goal = st.checkbox("Generate IEP Goal", key="generate-goal")
82
+
83
+ # Add a button to generate the analysis and IEP goal
84
  generate_button = st.button("Generate", key="generate-button", help="Click here to generate the selected output.")
85
 
86
  if generate_button:
87
+ if generate_goal:
 
 
 
88
  # Call the OpenAI API and generate an effective IEP goal
89
  response = openai.Completion.create(
90
  engine="text-davinci-003",
91
+ prompt=f"Generate an effective and measurable IEP goal for a student who is in grade {grade_level} and has qualifying conditions of {', '.join(qualifying_condition)}. The goal should be based on the analysis of their data and meet the following characteristics: Measurable, Specific and Clear, Attainable and Realistic, Relevant and Meaningful, Time-Bound, Individualized, Action-Oriented, Aligned with Standards and Curriculum, Collaboratively Developed, Monitored and Adjusted. Data Analysis: {selected_prompt} {student_data}",
92
  max_tokens=2000,
93
  n=1,
94
  stop=None,
 
99
  # Show the generated effective IEP goal
100
  st.markdown(f"<h3>Effective IEP Goal:</h3>{goal}", unsafe_allow_html=True)
101
  else:
102
+ # Call the OpenAI API and generate the analysis
103
  response = openai.Completion.create(
104
  engine="text-davinci-003",
105
  prompt=f"{selected_prompt} {student_data} {grade_level} {qualifying_condition}",
 
110
  )
111
  statement = response["choices"][0]["text"]
112
 
113
+ # Show the generated analysis
114
+ st.markdown(f"<h3>Analysis:</h3>{statement}", unsafe_allow_html=True)
115
 
116
  if __name__ == "__main__":
117
  write_sidebar()