Update cv_prompt.py
Browse files- cv_prompt.py +29 -54
cv_prompt.py
CHANGED
|
@@ -1,54 +1,29 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
prompt = f"""<s>[INST] Analyze the following CV text for the '{section}' section. Identify all subsections (if any) and verify the presence of specific elements in each subsection.
|
| 32 |
-
|
| 33 |
-
CV text:
|
| 34 |
-
{text}
|
| 35 |
-
|
| 36 |
-
For the '{section}' section, determine if the following elements are present in each subsection. Consider variations and synonyms of these elements. Respond with a JSON object where the key is '{section}', and the value is an array of objects, each representing a subsection with the following structure:
|
| 37 |
-
|
| 38 |
-
{{
|
| 39 |
-
"subsection_number": 1,
|
| 40 |
-
"elements": [
|
| 41 |
-
{{"name": "element_name", "present": true/false, "content": "extracted content if present"}}
|
| 42 |
-
]
|
| 43 |
-
}}
|
| 44 |
-
|
| 45 |
-
Elements to verify for each subsection of {section}:
|
| 46 |
-
"""
|
| 47 |
-
|
| 48 |
-
section_data = next((s for s in cv_completeness_data['sections'] if s['name'] == section), None)
|
| 49 |
-
if section_data:
|
| 50 |
-
for element in section_data['elements']:
|
| 51 |
-
prompt += f"- {element['name']}\n"
|
| 52 |
-
|
| 53 |
-
prompt += "\nProvide your response as a valid JSON object. Ensure to identify all subsections present in the CV text, even if there's only one. [/INST]"
|
| 54 |
-
return prompt
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"sections": [
|
| 3 |
+
{
|
| 4 |
+
"name": "Summary and objective",
|
| 5 |
+
"elements": [
|
| 6 |
+
{"name": "Brief overview of professional background", "score": 1.5},
|
| 7 |
+
{"name": "Career goals or objectives", "score": 1.5}
|
| 8 |
+
]
|
| 9 |
+
},
|
| 10 |
+
{
|
| 11 |
+
"name": "Education",
|
| 12 |
+
"elements": [
|
| 13 |
+
{"name": "Degree(s) obtained", "score": 1},
|
| 14 |
+
{"name": "Institution name(s)", "score": 1},
|
| 15 |
+
{"name": "Graduation date(s)", "score": 1}
|
| 16 |
+
]
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"name": "Work Experience",
|
| 20 |
+
"elements": [
|
| 21 |
+
{"name": "Job title(s)", "score": 0.8},
|
| 22 |
+
{"name": "Company name(s)", "score": 0.8},
|
| 23 |
+
{"name": "Employment dates", "score": 0.8},
|
| 24 |
+
{"name": "Key responsibilities", "score": 0.8},
|
| 25 |
+
{"name": "Achievements or notable projects", "score": 0.8}
|
| 26 |
+
]
|
| 27 |
+
}
|
| 28 |
+
]
|
| 29 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|