Manojajj commited on
Commit
20d7431
·
verified ·
1 Parent(s): 7ddce15

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +10 -8
app.py CHANGED
@@ -39,14 +39,16 @@ def parse_resume(pdf_file):
39
 
40
  # Example parsing logic based on NER output
41
  for entity in entities:
42
- if entity['label'] == 'PER':
43
- name = entity['word'] # If detected, use the first person name
44
- elif entity['label'] == 'ORG':
45
- experience = entity['word'] # Could be an organization name (e.g., employer)
46
- elif entity['label'] == 'EMAIL':
47
- email = entity['word']
48
- elif entity['label'] == 'MISC':
49
- skills = entity['word'] # Example for skills or qualifications
 
 
50
 
51
  return {
52
  'Name': name,
 
39
 
40
  # Example parsing logic based on NER output
41
  for entity in entities:
42
+ # Check if 'label' key exists in the entity to avoid KeyError
43
+ if 'label' in entity:
44
+ if entity['label'] == 'PER':
45
+ name = entity['word'] # If detected, use the first person name
46
+ elif entity['label'] == 'ORG':
47
+ experience = entity['word'] # Could be an organization name (e.g., employer)
48
+ elif entity['label'] == 'EMAIL':
49
+ email = entity['word']
50
+ elif entity['label'] == 'MISC':
51
+ skills = entity['word'] # Example for skills or qualifications
52
 
53
  return {
54
  'Name': name,