0
$\begingroup$

I am using regex to extract specific sections from resumes, such as key skills, summary, and work experience. The approach involves:

First, I extract the text from the resume based on predefined sections (e.g., "Skills," "Summary," "Work Experience") which is done through api and gives result in json. This involves identifying the boundaries of each section. There is no problem till here.

I used regex only on for extracting sections and after extracting those sections i am just passing the name of the section to extract relevant details. For instance, if the section is "Skills," the regex will capture all the text under the "Skills" section until the next section begins.

However, this approach has limitations, especially with templates that vary significantly. The regex patterns used to identify and extract sections may not work consistently across different templates, which poses a challenge.

for section:

    def get_section(text, section_name):
    """
    Extract a specific section from the text based on the section name.
    Returns the text belonging to that section until the next section is found.
    """
    pattern = re.compile(
        rf'\b{section_name}\b\s*([\s\S]*?)(?=\b(EDUCATION|WORK EXPERIENCE|EXPERIENCE|SKILLS|SUMMARY)\b|$)',
        re.IGNORECASE
    )
    match = pattern.search(text)
    if match:
        return match.group(1).strip()
    return None

for skills:

def extract_skills(text):
    """Extract the skills section from the text."""
    return get_section(text, 'SKILLS') or "Skills not found" 

for summary:

def extract_summary(text):
    """Extract the summary section from the text."""
    return get_section(text, 'SUMMARY') or "Summary not found"

The sample resume :

Muhammad Arsalan Khan
Karachi, Sindh, Pakistan [email protected] a +923122427609 in/arsalan-khan 57930282
SUMMARY:

To secure a position in a prestigious organization where I can leverage my professional skills to drive business growth and efficiency. My passion for:
automation and process optimization is geared toward making operations more effective and achieving both organizational and personal career goals.
EXPERIENCE:
Branch Manager
Daewoo FastEx
February 2020 - Present, Dawoo Franchise, Paposh, Karachi
• Led a team of 5+ staff members, ensuring smooth daily operations and efficient workflow.
• We have implemented process optimization strategies, resulting in a 20% increase in operational efficiency.
• Managed customer relations and resolved issues to maintain high customer satisfaction.
• Handled inventory management, procurement, and vendor relations to ensure seamless operations.
• Developed and executed marketing strategies that increased sales by 15%.
• Conducted performance evaluations and provided training and development opportunities for team members.
• Implemented a streamlined cargo booking system that increased booking efficiency by 25%, utilizing advanced logistics software and coordinating closely
with freight carriers and clients to ensure timely deliveries.
Cargo Booking Officer
Daewoo FastEx
January 2016 - December 2018, Daewoo Franchise, Hydri, Karachi
• Managed cargo bookings, ensuring accuracy in documentation and timely dispatches.
• Coordinated with vendors and clients to arrange transportation and track shipments.
• Provided excellent customer support by addressing inquiries and resolving issues related to cargo services.
• Developed and maintained relationships with key stakeholders, contributing to repeat business.
• Monitored and reported on cargo performance metrics to senior management.
Garments Outlet Manager
The Fifth Street
January 2015 - December 2015, Franchise, Hyderi, Karachi
• Oversaw day-to-day operations of the garment outlet, managing a team of 10 sales associates.
• Implemented visual merchandising strategies to attract customers and drive sales.
• Managed inventory, ordering, and stock replenishment to ensure product availability.
• Trained staff on sales techniques, product knowledge, and customer service standards.
• Analyzed sales data to identify trends and adjust strategies accordingly, resulting in a 10% increase in sales.
Booking Officer
ASF Pharma, Karachi
• Handled booking of pharmaceutical products, ensuring timely delivery to clients.
• Coordinated with logistics teams to ensure accurate and on-time deliveries.
• Maintained booking records and provided regular updates to clients regarding their orders.
• Assisted in resolving any booking-related issues, maintaining strong client relationships.
• Contributed to process improvements that reduced booking errors by 15%.
EDUCATION:
Bachelor of Business Administration
Virtual University of Pakistan • Karachi, Pakistan • 2028
DAE in Electrical Engineering
Jinnah Polytechnic Institute, Karachi • Karachi, Pakistan • 2020 • B
Matriculation
Prince Public Secondary School, Karachi • Karachi, Pakistan • 2017 • A
CERTIFICATIONS:
MS-Office (Office Automation)
National Institute of Computer Education, Karachi • 2016:
Graphic Designing
National Institute of Computer Education, Karachi •:
2015
SKILLS:
Data Entry Management, Customer Support, Communication, Leadership
January 2014 - December 2014, Karachi, Pakistan 

OUTPUT:

 {
        "file": "resumes/Arsalan Khan (2).pdf",
        "data": {
            "name": "Muhammad Arsalan Khan",
            "phone_number": "+923122427609",
            "email": "[email protected]",
            "summary": "To secure a position in a prestigious organization where I can leverage my professional",
            "experience": "Branch Manager Daewoo FastEx February 2020 - Present, Dawoo Franchise, Paposh, Karachi  Led a team of 5+ staff members, ensuring smooth daily operations and efficient workflow.  We have implemented process optimization strategies, resulting in a 20% increase in operational efficiency.  Managed customer relations and resolved issues to maintain high customer satisfaction.  Handled inventory management, procurement, and vendor relations to ensure seamless operations.  Developed and executed marketing strategies that increased sales by 15%.  Conducted performance evaluations and provided training and development opportunities for team members.  Implemented a streamlined cargo booking system that increased booking efficiency by 25%, utilizing advanced logistics software and coordinating closely with freight carriers and clients to ensure timely deliveries. Cargo Booking Officer Daewoo FastEx January 2016 - December 2018, Daewoo Franchise, Hydri, Karachi  Managed cargo bookings, ensuring accuracy in documentation and timely dispatches.  Coordinated with vendors and clients to arrange transportation and track shipments.  Provided excellent customer support by addressing inquiries and resolving issues related to cargo services.  Developed and maintained relationships with key stakeholders, contributing to repeat business.  Monitored and reported on cargo performance metrics to senior management. Garments Outlet Manager The Fifth Street January 2015 - December 2015, Franchise, Hyderi, Karachi  Oversaw day-to-day operations of the garment outlet, managing a team of 10 sales associates.  Implemented visual merchandising strategies to attract customers and drive sales.  Managed inventory, ordering, and stock replenishment to ensure product availability.  Trained staff on sales techniques, product knowledge, and customer service standards.  Analyzed sales data to identify trends and adjust strategies accordingly, resulting in a 10% increase in sales. Booking Officer ASF Pharma, Karachi  Handled booking of pharmaceutical products, ensuring timely delivery to clients.  Coordinated with logistics teams to ensure accurate and on-time deliveries.  Maintained booking records and provided regular updates to clients regarding their orders.  Assisted in resolving any booking-related issues, maintaining strong client relationships.  Contributed to process improvements that reduced booking errors by 15%.",
            "skills": "to drive business growth and efficiency. My passion for automation and process optimization is geared toward making operations more effective and achieving both organizational and personal career goals.",
            "education": "Bachelor of Business Administration Virtual University of Pakistan  Karachi, Pakistan  2028 DAE in Electrical Engineering Jinnah Polytechnic Institute, Karachi  Karachi, Pakistan  2020  B Matriculation Prince Public Secondary School, Karachi  Karachi, Pakistan  2017  A"
        }

i want to know why is the output of skills showing the contents of the summary ,and summary having half of the contents and an optimize approach to solve this problem.

$\endgroup$
3
  • 1
    $\begingroup$ Welcome at the Data Science StackExchange. Can you please specify what your concrete question is? $\endgroup$
    – Broele
    Commented Sep 1 at 16:26
  • $\begingroup$ @Broele my question is that how through using regex can i find out the skills ,summary ,work experience .my task is to use regex and not any other library and can not predefined skills etc.So the logic i came up with was once i get the skills section i will grab all the content in that skills section until and unless another section comes .This approach doesnt seem to be quite optimisitic . $\endgroup$
    – Arfa Ahsan
    Commented Sep 2 at 15:22
  • $\begingroup$ @Broele as there are different resume templates and sometimes the text is not written in any section like name ,email might not be necessarily defined in the section contact ,so for things like that ,the output also contains skills with the name ,email in it .In another resume ,everything was fine but somehow the summary section was being printed in the skills section ,and skills are not being defined . $\endgroup$
    – Arfa Ahsan
    Commented Sep 2 at 15:23

1 Answer 1

3
$\begingroup$

The reason the text found for the summary section is cut off and the text for the skills section is that the summary section contains the word 'skills' which is also part of your regular expression. There is likely no way to always correctly parse all resumes (probably not even using other more advanced methods), so if you can only use regular expressions you need to decide how much time you want to invest in crafting a regular expression for decreasing marginal gains when trying to look into the edge cases.

$\endgroup$
1
  • $\begingroup$ thank you thank you so much ,it is now showing the correct results ,i just predefined the sections in the list and remove the ignorecase now it is working . $\endgroup$
    – Arfa Ahsan
    Commented Sep 2 at 17:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.