Spaces:
Runtime error
Runtime error
Update utility/utils.py
Browse files401 unmodified lines4024034044054064074087 unmodified lines416417418419420421422423424425426427428429401 unmodified lines# Process the model output for parsed resultdef process_resume_data(LLMdata,cont_data,extracted_text):# Initialize the processed data dictionaryprocessed_data = {"name": [],7 unmodified lines}#LLMprocessed_data['name'].extend(LLMdata.get('Name', []))processed_data['contact_number'].extend(LLMdata.get('Contact', []))processed_data['Designation'].extend(LLMdata.get('Designation', []))processed_data['email'].extend(LLMdata.get("Email", []))processed_data['Location'].extend(LLMdata.get('Address', []))processed_data['Link'].extend(LLMdata.get('Link', []))processed_data['Company'].extend(LLMdata.get('Company', []))#Contactprocessed_data['email'].extend(cont_data.get("emails", []))processed_data['contact_number'].extend(cont_data.get("phone_numbers", []))processed_data['Link'].extend(cont_data.get("links_RE", []))return processed_data401 unmodified lines4024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314327 unmodified lines440441442443444445446447448449450451452453454455456457401 unmodified lines# Process the model output for parsed resultdef process_resume_data(LLMdata,cont_data,extracted_text):# Removing duplicate emailsunique_emails = []for email in cont_data['emails']:if email not in LLMdata['Email']:unique_emails.append(email)# Removing duplicate linksunique_links = []for link in cont_data['links_RE']:if link not in LLMdata['Link']:unique_links.append(link)# Removing duplicate phone numbersnormalized_contact = [num[-10:] for num in LLMdata['Contact']]unique_numbers = []for num in cont_data['phone_numbers']:if num[-10:] not in normalized_contact:unique_numbers.append(num)# Add unique emails, links, and phone numbers to the original LLMdataLLMdata['Email'] += unique_emailsLLMdata['Link'] += unique_linksLLMdata['Contact'] += unique_numbers# Initialize the processed data dictionaryprocessed_data = {"name": [],7 unmodified lines}#LLMprocessed_data['name'].extend(LLMdata.get('Name', []))#processed_data['contact_number'].extend(LLMdata.get('Contact', []))processed_data['Designation'].extend(LLMdata.get('Designation', []))#processed_data['email'].extend(LLMdata.get("Email", []))processed_data['Location'].extend(LLMdata.get('Address', []))#processed_data['Link'].extend(LLMdata.get('Link', []))processed_data['Company'].extend(LLMdata.get('Company', []))#Contact#processed_data['email'].extend(cont_data.get("emails", []))#processed_data['contact_number'].extend(cont_data.get("phone_numbers", []))#processed_data['Link'].extend(cont_data.get("links_RE", []))#New_merge_dataprocessed_data['email'].extend(LLMdata['Email'])processed_data['contact_number'].extend(LLMdata['Contact'])processed_data['Link'].extend(LLMdata['Link'])return processed_data
utility/utils.py+34-6