Vipul Swarup commited on
Commit
cf2475d
·
1 Parent(s): 2b46c32

refinement

Browse files
Files changed (1) hide show
  1. app.py +10 -1
app.py CHANGED
@@ -66,7 +66,7 @@ def load_answer(question):
66
  passagePrompt+="Generate a 300 word passage on the given area of interest. It should cover the key points being tested in the common core standard specified. It should draw on real life incidents. Make it about one particular incident that highlights various things about "+question['area-of-interest']+"."
67
  #If external research is required, inform the student what to do research on.
68
  if (chatResponseDict['is-research-required']):
69
- passagePrompt+="Also suggest what specific topic or idea the student can do external research on, to be able to answer questions related to the common core standard specified. Use language as if you are speaking to the student directly."
70
 
71
  passagePrompt+="Make sure any passage or topics generated are appropriate in terms of vocabulary and comprehensibility for grade "+chatResponseDict['grade-level']
72
  passagePrompt+="Return the response in JSON format."
@@ -75,6 +75,15 @@ def load_answer(question):
75
  assistant_answer = chat(st.session_state.sessionMessages)
76
  st.session_state.sessionMessages.append(AIMessage(content=assistant_answer.content))
77
 
 
 
 
 
 
 
 
 
 
78
  return json.loads(assistant_answer.content)
79
 
80
 
 
66
  passagePrompt+="Generate a 300 word passage on the given area of interest. It should cover the key points being tested in the common core standard specified. It should draw on real life incidents. Make it about one particular incident that highlights various things about "+question['area-of-interest']+"."
67
  #If external research is required, inform the student what to do research on.
68
  if (chatResponseDict['is-research-required']):
69
+ passagePrompt+="Also suggest what specific topic or idea the student can do external research on, to be able to answer questions related to the common core standard specified. Use language as if you are speaking to the student directly, in the formal tone of a teacher or examiner."
70
 
71
  passagePrompt+="Make sure any passage or topics generated are appropriate in terms of vocabulary and comprehensibility for grade "+chatResponseDict['grade-level']
72
  passagePrompt+="Return the response in JSON format."
 
75
  assistant_answer = chat(st.session_state.sessionMessages)
76
  st.session_state.sessionMessages.append(AIMessage(content=assistant_answer.content))
77
 
78
+ # Based on the above generated passage and research topic, we will now generate 3 FRQs and their grading rubrics
79
+ frqPrompt='Generate 3 questions based on the previously discussed common core standard, and the above generated passage. The answers should be available either in the above passage, or the student should be able to find them with easy web research. Remember, the student is in grade: '+chatResponseDict['grade-level']
80
+ frqPrompt+='Generate a rubric for evaluating the student responses for the above questions. Return the result in JSON format. E.g. { "rubric":[{"question":"..text of the question", "rubric":".. text of the rubric"}] etc.'
81
+ frqPrompt+='In the final response JSON, also incldue the passage and research JSONs created above.'
82
+ # Ask the model
83
+ st.session_state.sessionMessages.append(HumanMessage(content=frqPrompt))
84
+ assistant_answer = chat(st.session_state.sessionMessages)
85
+ st.session_state.sessionMessages.append(AIMessage(content=assistant_answer.content))
86
+
87
  return json.loads(assistant_answer.content)
88
 
89