rbuell commited on
Commit
3db8a14
1 Parent(s): d676d51

Upload iep_app.py

Browse files
Files changed (1) hide show
  1. iep_app.py +46 -0
iep_app.py ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import openai
2
+ import streamlit as st
3
+ import config
4
+
5
+ st.markdown(
6
+ """
7
+ <style>
8
+ /* Add your CSS code here */
9
+ </style>
10
+ """,
11
+ unsafe_allow_html=True,
12
+ )
13
+ # Set OpenAI API key
14
+ api_key = config
15
+
16
+ def write_iep():
17
+ st.title("IEP Assist")
18
+
19
+ def write_sidebar():
20
+ st.sidebar.title("What is IEP Assist?")
21
+ st.sidebar.info(
22
+ "IEP Assist generates responses using OpenAI's language generation technology. The technology uses machine learning algorithms trained on large amounts of text data to generate new text based on a given prompt. In the case of IEP Assist, the prompt consists of the student data entered by the user (academic, functional, behavioral information), and the technology generates a Present Levels of Academic Achievement and Functional Performance (PLAAFP) for the student based on the data.")
23
+
24
+ # Add a text area
25
+ user_query = st.text_area("Enter student data (ie. academic, functional, behavioral). To ensure that the generated PLAAFP statement accurately reflects the student's needs and abilities, it is important to provide as much relevant information as possible:", height=250)
26
+
27
+ # Add a submit button
28
+ if st.button("Analyze"):
29
+ # Use OpenAI to generate IEP based on student
30
+ response = openai.Completion.create(
31
+ engine="text-davinci-003",
32
+ prompt= "You are a special education case manager, the following data has been collected. Analyze and summarize this data into a cohesive PLAAFP statement, make it clear and concise and provide areas of strength and areas of need and strageties to improve areas of need: \n" + user_query,
33
+ max_tokens=2048,
34
+ n=1,
35
+ stop=None,
36
+ temperature=0.8
37
+ )
38
+ iep = response["choices"][0]["text"]
39
+ st.write(iep)
40
+
41
+ def main():
42
+ write_iep()
43
+ write_sidebar()
44
+
45
+ if __name__ == "__main__":
46
+ main()