Skip to content

Commit 91dfcf6

Browse files
authored
Merge pull request #7 from lakshmanaram/master
added util function to fetch name of the applicant
2 parents f7e9af3 + 5a65908 commit 91dfcf6

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed

cvscan/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def extract(self):
3939

4040
def parse(self):
4141
self.URLs = annotations_parser.fetch_pdf_urls(self.path)
42+
self.name = language_parser.fetch_name(self.raw_text)
4243
self.emails = details_parser.fetch_email(self.raw_text)
4344
self.phone_numbers = details_parser.fetch_phone(self.raw_text)
4445
self.address = details_parser.fetch_address(self.raw_text)
@@ -51,6 +52,7 @@ def parse(self):
5152
# TODO: Add more fetch here
5253
def show(self):
5354
return {
55+
"name" : self.name,
5456
"experience" : self.experience,
5557
"address" : self.address,
5658
"phone_numbers" : self.phone_numbers,
-28 Bytes
Binary file not shown.

cvscan/language_parser.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77
import pickle
88
import logging
9+
import nltk
910
from nltk.corpus import stopwords
1011
from nltk.stem.snowball import SnowballStemmer
1112
import dirpath
@@ -66,3 +67,42 @@ def fetch_skills(cleaned_resume):
6667
if skill.lower() in cleaned_resume:
6768
skill_set.append(skill)
6869
return skill_set
70+
71+
72+
"""
73+
74+
Utility function that fetches the current employer from resume
75+
Params: resume_text Type: string
76+
returns: current_employer Type: string
77+
78+
"""
79+
def fetch_emplyer(resume_text, job_positions):
80+
organizations = []
81+
# get all organizations in the resume_text
82+
# if any of this organization is beside a job position, assume it as an emplyer
83+
84+
return current_employer
85+
86+
87+
"""
88+
89+
Utility function that fetches the Person Name from resume
90+
Params: resume_text Type: string
91+
returns: name Type: string
92+
93+
Returns the first Person entity found by tokenizing each sentence
94+
If no such entities are found, returns "Applicant name couldn't be processed"
95+
96+
"""
97+
def fetch_name(resume_text):
98+
tokenized_sentences = nltk.sent_tokenize(resume_text)
99+
100+
for sentence in tokenized_sentences:
101+
for chunk in nltk.ne_chunk(nltk.pos_tag(nltk.word_tokenize(sentence), tagset='universal')):
102+
if hasattr(chunk,'label'):# and chunk.label() == 'PERSON':
103+
chunk = chunk[0]
104+
(name,tag) = chunk
105+
if tag == 'NOUN':
106+
return name
107+
108+
return "Applicant name couldn't be processed"

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ cvscan==0.0.1
22
nltk==3.2.1
33
pdfminer==20140328
44
wheel==0.24.0
5+
numpy==1.11.3

0 commit comments

Comments
 (0)