Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -14,14 +14,15 @@ def write_sidebar():
|
|
14 |
st.sidebar.title("Instructions")
|
15 |
st.sidebar.write("1. Select the student's grade level.")
|
16 |
st.sidebar.write("2. Select the student's qualifying condition(s).")
|
17 |
-
st.sidebar.write("3. Choose a
|
18 |
-
st.sidebar.write("4.
|
19 |
-
st.sidebar.write("5.
|
|
|
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. Please enter data that is relevant and appropriate for generating the
|
25 |
|
26 |
def write_iep_assist():
|
27 |
st.title("IEP Assist Premium")
|
@@ -34,67 +35,78 @@ def write_iep_assist():
|
|
34 |
st.write("Select the student's qualifying condition(s):")
|
35 |
qualifying_condition = st.multiselect("Qualifying Condition(s):", ["Specific Learning Disability", "Emotional Disturbance", "Autism", "Intellectual Disability", "Speech/Language Impairment", "Other Health Impairment", "Orthopedic Impairment", "Auditory Impairment", "Traumatic Brain Injury", "Deafness", "Blindness", "Developmental Delay"], key="qualifying-condition")
|
36 |
|
37 |
-
#
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
"
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
selected_prompt = st.selectbox("Prompt:", options=prompts, key="prompt")
|
53 |
|
|
|
54 |
st.write("Enter student data to be analyzed:")
|
55 |
student_data = st.text_area("Paste student data here", height=250, key="student-data")
|
56 |
|
57 |
-
# Add a button to generate the PLAAFP statement
|
58 |
-
if st.button("
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
stop=None,
|
91 |
-
temperature=0.85,
|
92 |
-
)
|
93 |
-
goal = response["choices"][0]["text"]
|
94 |
-
# Show the generated goal
|
95 |
-
st.write("IEP Goal:", goal)
|
96 |
|
97 |
if __name__ == "__main__":
|
98 |
write_sidebar()
|
99 |
write_iep_assist()
|
100 |
-
write_iep_goal_generator()
|
|
|
14 |
st.sidebar.title("Instructions")
|
15 |
st.sidebar.write("1. Select the student's grade level.")
|
16 |
st.sidebar.write("2. Select the student's qualifying condition(s).")
|
17 |
+
st.sidebar.write("3. Choose a category to analyze.")
|
18 |
+
st.sidebar.write("4. Select whether you want to generate a PLAAFP statement or an effective IEP goal.")
|
19 |
+
st.sidebar.write("5. Enter your student data.")
|
20 |
+
st.sidebar.write("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 PLAAFP statement or 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")
|
|
|
35 |
st.write("Select the student's qualifying condition(s):")
|
36 |
qualifying_condition = st.multiselect("Qualifying Condition(s):", ["Specific Learning Disability", "Emotional Disturbance", "Autism", "Intellectual Disability", "Speech/Language Impairment", "Other Health Impairment", "Orthopedic Impairment", "Auditory Impairment", "Traumatic Brain Injury", "Deafness", "Blindness", "Developmental Delay"], key="qualifying-condition")
|
37 |
|
38 |
+
# Define prompts by category
|
39 |
+
prompt_categories = {
|
40 |
+
"Behavior": [
|
41 |
+
"Provide a summary of the student's behavior data and suggest possible interventions to try based on their areas of need.",
|
42 |
+
"Analyze the student's behavior data to identify trends and suggest possible interventions.",
|
43 |
+
"Provide a summary of the student's progress towards their behavioral goals."
|
44 |
+
],
|
45 |
+
"Academic": [
|
46 |
+
"Analyze the data provided on the student and provide a summary of their strengths and areas of need in regards to their academic performance.",
|
47 |
+
"Summarize the data provided on the student's academic performance, highlighting their strengths and areas of need, and suggesting possible interventions to try.",
|
48 |
+
"Please provide a summary of the student's academic performance, highlighting their strengths and areas of need.",
|
49 |
+
"What is the student's biggest strength and area of need in regards to their academic performance?",
|
50 |
+
"Based on the student's academic performance data, what recommendations do you have for adjusting their instructional strategies?",
|
51 |
+
"How can the student's strengths be leveraged to help them improve in areas of need?",
|
52 |
+
"What barriers to academic success does the student face, and how can they be addressed?"
|
53 |
+
],
|
54 |
+
"IEP Goals": [
|
55 |
+
"Analyze the data provided on the student and provide a summary of their progress in regards to their IEP goals.",
|
56 |
+
"Provide a summary of the student's progress towards their academic and behavioral goals."
|
57 |
+
]
|
58 |
+
}
|
59 |
+
|
60 |
+
# Choose a category
|
61 |
+
st.write("Choose a category to analyze:")
|
62 |
+
selected_category = st.selectbox("Category:", options=list(prompt_categories.keys()), key="category")
|
63 |
+
|
64 |
+
# Choose the output type
|
65 |
+
generate_goal = st.checkbox("Generate Effective IEP Goal")
|
66 |
+
|
67 |
+
# Choose a prompt from the selected category
|
68 |
+
st.write("Choose a prompt:")
|
69 |
+
prompts = prompt_categories[selected_category]
|
70 |
selected_prompt = st.selectbox("Prompt:", options=prompts, key="prompt")
|
71 |
|
72 |
+
# Enter student data to be analyzed
|
73 |
st.write("Enter student data to be analyzed:")
|
74 |
student_data = st.text_area("Paste student data here", height=250, key="student-data")
|
75 |
|
76 |
+
# Add a button to generate the PLAAFP statement or effective IEP goal
|
77 |
+
if st.button("Generate", key="generate-button"):
|
78 |
+
if generate_goal:
|
79 |
+
# Define the characteristics of an effective IEP goal
|
80 |
+
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"
|
81 |
+
|
82 |
+
# Call the OpenAI API and generate an effective IEP goal
|
83 |
+
response = openai.Completion.create(
|
84 |
+
engine="text-davinci-003",
|
85 |
+
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}",
|
86 |
+
max_tokens=2000,
|
87 |
+
n=1,
|
88 |
+
stop=None,
|
89 |
+
temperature=0.85,
|
90 |
+
)
|
91 |
+
goal = response["choices"][0]["text"]
|
92 |
+
|
93 |
+
# Show the generated effective IEP goal
|
94 |
+
st.write("Effective IEP Goal:", goal)
|
95 |
+
else:
|
96 |
+
# Call the OpenAI API and generate a PLAAFP statement
|
97 |
+
response = openai.Completion.create(
|
98 |
+
engine="text-davinci-003",
|
99 |
+
prompt=f"{selected_prompt} {student_data} {grade_level} {qualifying_condition}",
|
100 |
+
max_tokens=2000,
|
101 |
+
n=1,
|
102 |
+
stop=None,
|
103 |
+
temperature=0.9,
|
104 |
+
)
|
105 |
+
statement = response["choices"][0]["text"]
|
106 |
+
|
107 |
+
# Show the generated PLAAFP statement
|
108 |
+
st.write("Summary of Data entered:", statement)
|
|
|
|
|
|
|
|
|
|
|
|
|
109 |
|
110 |
if __name__ == "__main__":
|
111 |
write_sidebar()
|
112 |
write_iep_assist()
|
|