Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -65,12 +65,12 @@ def extract_basic_resume_info(text):
|
|
65 |
"Education": None,
|
66 |
}
|
67 |
|
68 |
-
# Extract Name (e.g., "
|
69 |
-
name_match = re.search(r"[
|
70 |
if name_match:
|
71 |
-
info["Name"] = name_match.group(1).
|
72 |
else:
|
73 |
-
|
74 |
potential_names = re.findall(r"\b[A-Z][a-z]+(?:\s+[A-Z][a-z]+){1,2}\b", text)
|
75 |
if potential_names:
|
76 |
info["Name"] = potential_names[0]
|
|
|
65 |
"Education": None,
|
66 |
}
|
67 |
|
68 |
+
# Extract Name (e.g., "CONG, An Dong" from the first line)
|
69 |
+
name_match = re.search(r"^([A-Z]+)[,\s]+([A-Z][a-z]+(?:\s+[A-Z][a-z]+)?)", text, re.MULTILINE)
|
70 |
if name_match:
|
71 |
+
info["Name"] = f"{name_match.group(1)} {name_match.group(2)}"
|
72 |
else:
|
73 |
+
# Fallback heuristic: assume a line with two or three capitalized words might be the candidate's name.
|
74 |
potential_names = re.findall(r"\b[A-Z][a-z]+(?:\s+[A-Z][a-z]+){1,2}\b", text)
|
75 |
if potential_names:
|
76 |
info["Name"] = potential_names[0]
|