def __get_basic_details(self): name = utils.extract_name(self.__resume) email = utils.extract_email(self.__text) mobile = utils.extract_mobile_number(self.__text) skills = utils.extract_skills(self.__nlp, self.__noun_chunks) edu = utils.extract_education( [sent.string.strip() for sent in self.__nlp.sents]) experience = utils.extract_experience(self.__text) entities = utils.extract_entity_sections(self.__text_raw) self.__details['name'] = name self.__details['email'] = email self.__details['mobile_number'] = mobile self.__details['skills'] = skills # self.__details['education'] = entities['education'] self.__details['education'] = edu self.__details['experience'] = experience try: self.__details['competencies'] = utils.extract_competencies( self.__text_raw, entities['experience']) self.__details[ 'measurable_results'] = utils.extract_measurable_results( self.__text_raw, entities['experience']) except KeyError: self.__details['competencies'] = [] self.__details['measurable_results'] = [] return
def get_details(self, resume_name): resume_path = "Resumes/" + resume_name ext = "pdf" nlp = spacy.load('en_core_web_sm') matcher = Matcher(nlp.vocab) text_raw = utils.extract_text(resume_path, '.' + ext) text = ' '.join(text_raw.split()) array = text.split() topics = [] field_list = [ 'OVERVIEW / CAREER OBJECTIVE / SUMMARY', 'KEY EXPERTISE / SKILLS', 'EDUCATION', 'AWARDS AND SCHOLARSHIPS', 'INTERNSHIPS', 'PROJECTS', 'ACHIEVEMENTS', 'SEMINARS / TRAININGS / WORKSHOPS', 'CO-CURRICULAR ACTIVITIES', 'EXTRA CURRICULAR ACTIVITIES', 'PERSONAL INTERESTS / HOBBIES', 'WEB LINKS', 'PERSONAL DETAILS' ] for word in field_list: if (text.find(word) >= 0): topics.append(word) content = {} total_topics = len(topics) for i in range(total_topics - 1): string_to_find = topics[i] + '(.*)' + topics[i + 1] result = re.search(string_to_find, text) content[topics[i]] = result.group(1) temp = topics[total_topics - 1] + '(.*)' temp_res = re.search(temp, text) content[topics[total_topics - 1]] = temp_res.group(1) __full_text = nlp(text) actual_marks = "CGPA: " + '(.*)' + "/ 10.00" cgpa = re.search(actual_marks, content['EDUCATION']) # DOMAIN RANKING rank_text = content['KEY EXPERTISE / SKILLS'] + content['PROJECTS'] project_text = ResumeParse().clean_project(rank_text) file_name = "rank/" + resume_name.split('.')[0] + ".txt" f = open(file_name, "w+") f.write(project_text) f.close() #FOR SKILLS skills = ResumeParse().get_skills(content['KEY EXPERTISE / SKILLS']) # name=utils.extract_name(__full_text,matcher) email = utils.extract_email(text) mobile = utils.extract_mobile_number(text) details = {} # details['name']=name details['email'] = email details['mobile'] = mobile details['skills'] = skills details['cgpa'] = cgpa.group(1) return details, content
def __get_basic_details(self): name = utils.extract_name(self.__nlp, matcher=self.__matcher) email = utils.extract_email(self.__text) mobile = utils.extract_mobile_number(self.__text) skills = utils.extract_skills(self.__nlp, self.__noun_chunks) edu = utils.extract_education([sent.string.strip() for sent in self.__nlp.sents]) entities = utils.extract_entity_sections_grad(self.__text_raw) self.__details['name'] = name self.__details['email'] = email self.__details['mobile_number'] = mobile self.__details['skills'] = skills self.__details['education'] = edu try: self.__details['experience'] = entities['experience'] except KeyError: self.__details['total_experience'] = 0 self.__details['no_of_pages'] = utils.get_number_of_pages(self.__resume) return
def __get_basic_details(self): name = utils.extract_name(self.__nlp, matcher=self.__matcher) full_name = utils.get_first_name(name, self.__nlp) gender = utils.get_gender(self.__nlp) maritial_status = utils.get_maritial_status(self.__nlp) passport_number = utils.get_passport_number(self.__text_raw) date_of_birth = utils.extract_date_of_birth(self.__nlp, self.__text) email = utils.extract_email(self.__text) mobile = utils.extract_mobile_number(self.__text) skills = utils.extract_skills(self.__nlp, self.__noun_chunks) nationality = utils.get_nationality(self.__nlp) languages = utils.extract_language(self.__nlp, self.__noun_chunks, self.__languages_file) num_of_companies = utils.extract_no_of_companies_worked_for( self.__nlp, self.__noun_chunks, self.__companies_file) hobbies = utils.extract_hobbies(self.__nlp, self.__noun_chunks, self.__hobbies_file) edu = utils.extract_education( [sent.string.strip() for sent in self.__nlp.sents], self.__nlp, self.__resume, date_of_birth) entities = utils.extract_entity_sections_grad(self.__text_raw) address = utils.extract_address(self.__nlp, self.__noun_chunks) states = utils.extract_state(self.__nlp, self.__noun_chunks) pincodes = utils.extract_pin(self.__nlp, self.__noun_chunks) cities = utils.extract_cities(self.__nlp, self.__noun_chunks) experience = utils.extract_experience_exceptional( self.__nlp, self.__noun_chunks) self.__details['name'] = name self.__details['full_name'] = full_name self.__details['gender'] = gender self.__details['maritial_status'] = maritial_status self.__details['passport_number'] = passport_number self.__details['date_of_birth'] = date_of_birth self.__details['email'] = email self.__details['mobile_number'] = mobile self.__details['skills'] = skills self.__details['nationality'] = nationality self.__details['languages'] = languages self.__details['No. of companies'] = num_of_companies self.__details['hobbies'] = hobbies self.__details['education'] = edu self.__details['address'] = address self.__details['state'] = states self.__details['pin'] = pincodes self.__details['city'] = cities self.__details['experience'] = experience try: #self.__details['experience'] = entities['experience'] try: self.__details['competencies'] = 'none' utils.extract_competencies(self.__text_raw, entities['experience']) self.__details['measurable_results'] = 'none' utils.extract_measurable_results(self.__text_raw, entities['experience']) self.__details['total_experience'] = round( utils.get_total_experience(entities['experience']) / 12, 2) except KeyError: self.__details['competencies'] = {} self.__details['measurable_results'] = {} self.__details['total_experience'] = 0 except KeyError: self.__details['competencies'] = {} self.__details['measurable_results'] = {} self.__details['total_experience'] = 0 self.__details['no_of_pages'] = { } #utils.get_number_of_pages(self.__resume) #comented by vishal sharma 11/8/2019 ''' if len( self.__details['city'])>1: cities = utils.extract_cities_exceptional(self.__nlp, self.__noun_chunks,self.__details['city']) self.__details['city'] = cities ''' if len(self.__details['pin']) > 1: pincodes = utils.extract_pin_exceptional(self.__nlp, self.__noun_chunks, self.__details['pin']) self.__details['pin'] = pincodes return
import json if not os.path.exists('./out'): os.makedirs('./out') fname = sys.argv[1] utils.resume_file_name = fname.split('/')[-1] print('Reading: %s' % fname) print('Output will be written to: %s' % ('./out/' + utils.resume_file_name + '.json')) content = utils.fread(fname, clean=True) raw_content = utils.fread(fname, clean=False) phone_numbers = utils.extract_phone_number(content) emails = utils.extract_email(content) names = utils.extract_names(content) education = utils.get_education(raw_content) skills = utils.get_skills(raw_content) res = { 'name': names, 'email': emails, 'phone': phone_numbers, 'education': education, 'skills': skills }
def __get_basic_details(self): custom_entities = utils.extract_entities_wih_custom_model( self.__custom_nlp) name = utils.extract_name(self.__nlp, matcher=self.__matcher) email = utils.extract_email(self.__text) mobile = utils.extract_mobile_number(self.__text) skills = utils.extract_skills(self.__nlp, self.__noun_chunks, self.__skills_file) edu = utils.extract_education( [sent.string.strip() for sent in self.__nlp.sents]) entities = utils.extract_entity_sections_grad(self.__text_raw) print(name) # extract name try: self.__details['name'] = custom_entities['Name'][0] except (IndexError, KeyError): self.__details['name'] = name #extract email self.__details['email'] = email # extract mobile number self.__details['mobile_number'] = mobile # extract skills self.__details['skills'] = skills # extract college name try: self.__details['college_name'] = entities['College Name'] except KeyError: pass # extract education Degree try: self.__details['degree'] = custom_entities['Degree'] except KeyError: pass # extract designation try: self.__details['designation'] = custom_entities['Designation'] except KeyError: pass # extract company names try: self.__details['company_names'] = custom_entities[ 'Companies worked at'] except KeyError: pass try: self.__details['experience'] = entities['experience'] try: self.__details['total_experience'] = round( utils.get_total_experience(entities['experience']) / 12, 2) except KeyError: self.__details['total_experience'] = 0 except KeyError: self.__details['total_experience'] = 0 self.__details['no_of_pages'] = utils.get_number_of_pages( self.__resume) return