CR7CAD commited on
Commit
89f5ee9
·
verified ·
1 Parent(s): 3661e7e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -65,12 +65,12 @@ def extract_basic_resume_info(text):
65
  "Education": None,
66
  }
67
 
68
- # Extract Name (e.g., "Name: John Doe" or from heuristics)
69
- name_match = re.search(r"[Nn]ame[:\-]\s*([A-Za-z\s,]+)", text)
70
  if name_match:
71
- info["Name"] = name_match.group(1).strip()
72
  else:
73
- # 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]
 
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]