From ed8d70b3fc557023201a018d183c837938bd3fda Mon Sep 17 00:00:00 2001 From: Xitang Date: Mon, 3 Jul 2023 16:09:46 -0700 Subject: [PATCH] Add summary to section title keyword to help parse LinkedIn resume - #5 --- .../extract-resume-from-sections/extract-profile.ts | 11 +++++++++-- .../group-lines-into-sections.ts | 1 + 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/lib/parse-resume-from-pdf/extract-resume-from-sections/extract-profile.ts b/src/app/lib/parse-resume-from-pdf/extract-resume-from-sections/extract-profile.ts index 2c0e5ac..b627688 100644 --- a/src/app/lib/parse-resume-from-pdf/extract-resume-from-sections/extract-profile.ts +++ b/src/app/lib/parse-resume-from-pdf/extract-resume-from-sections/extract-profile.ts @@ -150,8 +150,14 @@ export const extractProfile = (sections: ResumeSectionToLines) => { textItems, SUMMARY_FEATURE_SETS ); + + const summaryLines = getSectionLinesByKeywords(sections, ["summary"]); + const summarySection = summaryLines + .flat() + .map((textItem) => textItem.text) + .join(" "); const objectiveLines = getSectionLinesByKeywords(sections, ["objective"]); - const objective = objectiveLines + const objectiveSection = objectiveLines .flat() .map((textItem) => textItem.text) .join(" "); @@ -163,7 +169,8 @@ export const extractProfile = (sections: ResumeSectionToLines) => { phone, location, url, - summary: objective || summary, + // Dedicated section takes higher precedence over profile summary + summary: summarySection || objectiveSection || summary, }, // For debugging profileScores: { diff --git a/src/app/lib/parse-resume-from-pdf/group-lines-into-sections.ts b/src/app/lib/parse-resume-from-pdf/group-lines-into-sections.ts index 6cce0ce..117b085 100644 --- a/src/app/lib/parse-resume-from-pdf/group-lines-into-sections.ts +++ b/src/app/lib/parse-resume-from-pdf/group-lines-into-sections.ts @@ -52,6 +52,7 @@ const SECTION_TITLE_SECONDARY_KEYWORDS = [ "course", "extracurricular", "objective", + "summary", // LinkedIn generated resume has a summary section "award", "honor", "project",