Spaces:
Sleeping
Sleeping
improved prompts
Browse files
app.py
CHANGED
|
@@ -195,15 +195,25 @@ def predict_text(text):
|
|
| 195 |
|
| 196 |
|
| 197 |
PROMPT = (
|
| 198 |
-
"Extract the following information
|
| 199 |
-
"Course Code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 200 |
)
|
|
|
|
| 201 |
PROMPT_SKILLS = (
|
| 202 |
-
"
|
| 203 |
)
|
| 204 |
|
| 205 |
PROMPT_IMAGE = (
|
| 206 |
-
"Give me
|
| 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}
|
| 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 = ''
|