khurrameycon commited on
Commit
aa9bf16
·
verified ·
1 Parent(s): e64ec97

improved prompts

Browse files
Files changed (1) hide show
  1. app.py +15 -5
app.py CHANGED
@@ -195,15 +195,25 @@ def predict_text(text):
195
 
196
 
197
  PROMPT = (
198
- "Extract the following information from the provided text ONLY "
199
- "Course Code, Course Name, Credit, Delivery method, Course description, and Topical outline and do not add anything else except the information available in this text. "
 
 
 
 
 
 
 
 
 
200
  )
 
201
  PROMPT_SKILLS = (
202
- "Extract the Course name and Primary Skills from this text. "
203
  )
204
 
205
  PROMPT_IMAGE = (
206
- "Give me details of this image"
207
  )
208
 
209
  @app.route("/", methods=["GET"])
@@ -227,7 +237,7 @@ def extract_info():
227
  response = predict_text(prompt)
228
 
229
  if data["skills"] == True:
230
- prompt_skills = f"{PROMPT_SKILLS}\n\n{pdf_text}"
231
  response_skills = predict_text(prompt_skills)
232
  else:
233
  response_skills = ''
 
195
 
196
 
197
  PROMPT = (
198
+ "Extract the following information as per this format:\n"
199
+ "'Course Code:'\n"
200
+ "'Course Name:'\n"
201
+ "'Course Description:'\n"
202
+ "'Course Credits:'\n"
203
+ "'Delivery Method:'\n"
204
+ "'Prerequisite(s):'\n"
205
+ "'Co-requisite(s):'\n"
206
+ "'Materials:'\n"
207
+ "'Topical Outline:'\n"
208
+ "Do not add anything else except the required information from this text."
209
  )
210
+
211
  PROMPT_SKILLS = (
212
+ "Provide skills based on the Lightcast Open Skills Taxonomy in categories as "Primary Skills" where the Primary skill is the degree program or certification, "Secondary Skills" and "Tertiary Skills""
213
  )
214
 
215
  PROMPT_IMAGE = (
216
+ "Give me the Student Name, Transferred Credits information from this image"
217
  )
218
 
219
  @app.route("/", methods=["GET"])
 
237
  response = predict_text(prompt)
238
 
239
  if data["skills"] == True:
240
+ prompt_skills = f"{PROMPT_SKILLS} using this information only -- {response}"
241
  response_skills = predict_text(prompt_skills)
242
  else:
243
  response_skills = ''