Nassira commited on
Commit
b95a58b
·
verified ·
1 Parent(s): 0c7faab

Create cv_prompt.py

Browse files
Files changed (1) hide show
  1. cv_prompt.py +24 -0
cv_prompt.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import json
2
+
3
+ # Load the JSON file
4
+ with open('cv_sections.json', 'r') as f:
5
+ cv_sections_data = json.load(f)
6
+
7
+ def get_cv_prompt(text):
8
+ sections_list = "\n".join(f"- {section}" for section in cv_sections_data["sections"].keys())
9
+ return f"""<s>[INST] Analyze the following CV text and identify the present sections.
10
+ Respond with a JSON object containing only the present sections.
11
+
12
+ Important instructions:
13
+ 1. Sections can be in any language.
14
+ 2. A section is considered present if its content is identifiable, even without an explicit title.
15
+ 3. Look for synonyms or alternative phrasings for each section.
16
+ 4. Do not make broad interpretations. Focus on the specific content for each section.
17
+
18
+ Possible sections:
19
+ {sections_list}
20
+
21
+ CV text:
22
+ {text}
23
+
24
+ Respond with a JSON object containing only the present sections, without any additional explanation. [/INST]"""