Update main.py
Browse files
main.py
CHANGED
|
@@ -93,29 +93,29 @@ def get_data(input_file: UploadFile = File(...)):
|
|
| 93 |
print("Extracted Text:\n", extracted_text.strip())
|
| 94 |
|
| 95 |
# Call GPT-4o to structure extracted text into JSON format
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
Example Output:
|
| 101 |
```json
|
| 102 |
-
|
| 103 |
-
"firstname": "
|
| 104 |
-
"lastname": "
|
| 105 |
-
"email": "
|
| 106 |
-
"contact_number": "
|
| 107 |
-
"home_address": "
|
| 108 |
-
"home_town": "
|
| 109 |
-
"total_years_of_experience": "
|
| 110 |
-
"education": "Institution Name, Degree Name",
|
| 111 |
-
"LinkedIn_link": "LinkedIn
|
| 112 |
-
"experience": "
|
| 113 |
"industry": "industry of work",
|
| 114 |
-
"skills": "Skill 1, Skill 2, Skill 3",
|
| 115 |
-
"positions": ["Job
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
|
| 120 |
response = openai.ChatCompletion.create(
|
| 121 |
model="gpt-4o",
|
|
|
|
| 93 |
print("Extracted Text:\n", extracted_text.strip())
|
| 94 |
|
| 95 |
# Call GPT-4o to structure extracted text into JSON format
|
| 96 |
+
# Call GPT-4o to process extracted text into structured JSON
|
| 97 |
+
prompt = f"""This is CV data: {text.strip()}.
|
| 98 |
+
IMPORTANT: The output should be a JSON array! Make Sure the JSON is valid.if you not found data then fill with "none" don't add any extra explaition text
|
| 99 |
+
need only json
|
| 100 |
Example Output:
|
| 101 |
```json
|
| 102 |
+
[
|
| 103 |
+
"firstname": "firstname",
|
| 104 |
+
"lastname": "lastname",
|
| 105 |
+
"email": "email",
|
| 106 |
+
"contact_number": "contact number",
|
| 107 |
+
"home_address": "full home address",
|
| 108 |
+
"home_town": "home town or city",
|
| 109 |
+
"total_years_of_experience": "total years of experience",
|
| 110 |
+
"education": "Institution Name, Country, Degree Name, Graduation Year; Institution Name, Country, Degree Name, Graduation Year",
|
| 111 |
+
"LinkedIn_link": "LinkedIn link",
|
| 112 |
+
"experience": "experience",
|
| 113 |
"industry": "industry of work",
|
| 114 |
+
"skills": "skills(Identify and list specific skills mentioned in both the skills section and inferred from the experience section), formatted as: Skill 1, Skill 2, Skill 3, Skill 4, Skill 5",
|
| 115 |
+
"positions": ["Job title 1, Job title 2, Job title 3"]
|
| 116 |
+
]
|
| 117 |
+
```
|
| 118 |
+
"""
|
| 119 |
|
| 120 |
response = openai.ChatCompletion.create(
|
| 121 |
model="gpt-4o",
|