Resume identification method and device based on large language model
Through the resume recognition method based on the large language model, the problem of artificial dependence and low accuracy in the resume screening process in the existing technology is solved, and the accurate identification of text and image format resumes and key information extraction is achieved, which significantly reduces the screener work burden.
Patent Information
- Application Number
- CN202410931844.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-12
- Publication Date
- 2024-11-08
AI Technical Summary
The prior art relies on manual understanding and mechanized initial screening in the resume screening process, resulting in large workload and low accuracy in text content extraction, which cannot effectively reduce the burden on screeners.
Using a resume recognition method based on a large language model, we can obtain resume data, judge its format type, convert image recognition to text format, and use pre-trained CNN convolutional neural network and Hugging Face's NER model for text preprocessing and key Information extraction to achieve accurate identification and screening of resumes.
It greatly reduces the workload of resume screeners, improves the accuracy and efficiency of resume recognition, and can effectively extract key information, suitable for resumes in text and image formats.
Smart Images

Figure CN118918600A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field related to automotive electronics and electronic measurement, and in particular to a resume recognition method and device based on a large language model. Background Art
[0002] The Large Language Model (LLM) is a deep learning model trained on massive text data. It can not only generate natural language text, but also deeply understand the meaning of the text and handle various natural language tasks such as text summarization, question answering, translation, etc.
[0003] There are a large number of resumes in the market today that need to be screened. Currently, most methods involve manually understanding the resume content and then screening it. This method places a large amount of manual work on the task and is highly dependent on the experience level of the screener. Some methods also perform automated initial screening, but this method often uses a more mechanized method such as setting sensitive words. This method can hardly reduce the workload of the screener, and due to the problem of accuracy in extracting text content from the resume, some important resumes are screened out in the initial screening. Summary of the invention
[0004] The purpose of the present invention is to solve at least one of the deficiencies of the prior art and to provide a resume recognition method and device based on a large language model.
[0005] In order to achieve the above object, the present invention adopts the following technical solutions:
[0006] Specifically, a resume recognition method based on a large language model is proposed, including the following:
[0007] Get resume related data;
[0008] Determine the format type of resume-related data. If it is in text format, no processing is required. If it is in picture format, perform image recognition and convert it into text format.
[0009] Performing text preprocessing on resume-related data in text format to obtain resume text data;
[0010] The resume text data is subjected to resume recognition through a large language model to obtain a recognition result.
[0011] Further, specifically, the process of converting the resume-related data in the picture format into text format by image recognition includes:
[0012] The resume-related data in the image format is defined as the first image;
[0013] Performing image preprocessing on the first image to obtain a second image with binary denoising;
[0014] Performing an edge detection operation on the second image to obtain a third image where the text area is located;
[0015] Performing text line and character segmentation on the third image to obtain a plurality of characters;
[0016] Extracting features of the plurality of characters to obtain associated features of each character;
[0017] Character recognition is performed based on the associated features of each character to obtain recognition results of all characters;
[0018] The recognition results of all characters are output in sequence and formatted according to preset requirements to obtain resume-related data in text format.
[0019] Further, specifically, the image preprocessing process includes:
[0020] The first image is grayed, and then the grayed image is converted into a binary image. The binary image is then subjected to noise reduction and tilt correction to obtain a binary and noise-reduced second image.
[0021] Further, specifically, performing an edge detection operation on the second image to obtain a third image where the text area is located includes:
[0022] Processing the second image by an edge detection operator to obtain an edge image corresponding to the second image;
[0023] Traversing the edge image, presetting the origin O, determining the coordinates of all pixel points constituting the edge in the edge image and defining the total number of pixel points as n;
[0024] Calculate the angle θn of all pixels according to the coordinates of the pixels;
[0025] Predefine the scaling threshold α, merge the angles θn in [θn-α, θn+α] into θn', and replace the original angle with θn' to update θn;
[0026] Find and record the number of pixels corresponding to different angles θn, preset the number value i, eliminate the angles whose number of pixels corresponding to angle θn is less than the number value i, obtain the remaining angle θi, and then define the variable j, with the initial value of j being 0 and the maximum value being i, and execute the following steps;
[0027] Step 210: Calculate the slope k corresponding to the angle θj n , take k j =1 / k n , project each pixel onto the line y=k j * Get the projection point on x, and then calculate the distance d from the projection point to the coordinate origin O n;
[0028] Step 220: Count each distance d obtained by calculation n The number of times, the preset number of ranking value t, find the distance d before the number of ranking value t t ;
[0029] Step 230: Set each distance d t The corresponding pixel points are selected and used to form a point set, then each distance d t The corresponding point set is marked as an edge location, and finally the edge location marked at t is obtained;
[0030] Step 240, let j = j + 1, determine whether j> i, if so, output all edge locations, if not, repeat steps 210 to 240;
[0031] The image containing the edge location of the mark at position t is the third image of the located text area.
[0032] Furthermore, character recognition is performed based on the associated features of each character to obtain recognition results of all characters, including:
[0033] The pre-trained CNN convolutional neural network is used to perform character recognition on the associated features of each character to obtain the recognition results of all characters.
[0034] Further, the resume text data is subjected to resume recognition through a large language model to obtain a recognition result, including:
[0035] Use Hugging Face's pipeline function to load a pre-trained NER model;
[0036] Input the resume text data into the pre-trained NER model to extract key information and obtain the relevant key information of the resume text data;
[0037] Push the relevant key information of the resume text data to the preset screener IP.
[0038] Further, specifically, the text preprocessing operation includes the following:
[0039] The resume-related data in text format is subjected to noise, punctuation, and special character operations to obtain cleaned text data.
[0040] The present invention also proposes a resume recognition device based on a large language model, comprising the following:
[0041] Data acquisition module, used to obtain resume-related data;
[0042] The judgment module is used to judge the format type of resume-related data. If it is in text format, no processing is required. If it is in picture format, image recognition is performed to convert it into text format.
[0043] A preprocessing module, used for performing text preprocessing on resume-related data in text format to obtain resume text data;
[0044] The resume recognition module is used to perform resume recognition on the resume text data through a large language model to obtain a recognition result.
[0045] The beneficial effects of the present invention are:
[0046] The resume recognition method based on a large language model provided by the present invention can not only recognize and process resumes in text format, but also accurately recognize and convert resumes in image format into resumes in text format for further recognition; secondly, by using a large language model to extract key information from resume files in text format, the key information therein can be accurately extracted, thereby greatly reducing the workload of resume screeners while ensuring accurate extraction of key information of the resume. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The above and other features of the present disclosure will become more obvious by describing in detail the embodiments shown in the accompanying drawings. The same reference numerals in the accompanying drawings of the present disclosure represent the same or similar output voltages. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure. For those skilled in the art, other accompanying drawings can be obtained based on these accompanying drawings without creative work. In the accompanying drawings:
[0048] Figure 1 Shown is a flow chart of the resume recognition method based on a large language model of the present invention. DETAILED DESCRIPTION
[0049] The following will be combined with the embodiments and drawings to clearly and completely describe the concept, specific structure and technical effects of the present invention, so as to fully understand the purpose, scheme and effect of the present invention. It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other without conflict. The same reference numerals used throughout the drawings indicate the same or similar parts.
[0050] Reference Figure 1 , Embodiment 1, the present invention proposes a resume recognition method based on a large language model, comprising the following:
[0051] Step 110, obtaining resume related data;
[0052] Step 120, determine the format type of the resume-related data, if it is in text format, no processing is required, if it is in picture format, perform image recognition and convert it into text format;
[0053] Step 130, performing text preprocessing on the resume-related data in text format to obtain resume text data;
[0054] Step 140: Perform resume recognition on the resume text data using a large language model to obtain a recognition result.
[0055] In this embodiment 1, not only can resumes in text format be recognized and processed, but resumes in image format can also be accurately recognized and converted into resumes in text format, and then recognized; secondly, key information of resume files in text format is extracted through a large language model, and key information therein can be accurately extracted, thereby greatly reducing the workload of resume screeners on the basis of ensuring accurate extraction of key information of the resume.
[0056] As a preferred embodiment of the present invention, specifically, the process of converting resume-related data in picture format into text format by image recognition includes:
[0057] The resume-related data in the image format is defined as the first image;
[0058] Performing image preprocessing on the first image to obtain a second image with binary denoising;
[0059] Performing an edge detection operation on the second image to obtain a third image where the text area is located;
[0060] Performing text line and character segmentation on the third image to obtain a plurality of characters;
[0061] Extracting features of the plurality of characters to obtain associated features of each character;
[0062] Character recognition is performed based on the associated features of each character to obtain recognition results of all characters;
[0063] The recognition results of all characters are output in sequence and formatted according to preset requirements to obtain resume-related data in text format.
[0064] As a preferred embodiment of the present invention, specifically, the image preprocessing process includes:
[0065] The first image is grayed, and then the grayed image is converted into a binary image. The binary image is then subjected to noise reduction and tilt correction to obtain a binary and noise-reduced second image.
[0066] As a preferred embodiment of the present invention, specifically, performing an edge detection operation on the second image to obtain a third image of a located text area includes:
[0067] Processing the second image by an edge detection operator to obtain an edge image corresponding to the second image;
[0068] Traversing the edge image, presetting the origin O, determining the coordinates of all pixel points constituting the edge in the edge image and defining the total number of pixel points as n;
[0069] Calculate the angle θn of all pixels according to the coordinates of the pixels;
[0070] Predefine the scaling threshold α, merge the angles θn in [θn-α, θn+α] into θn', and replace the original angle with θn' to update θn;
[0071] Find and record the number of pixels corresponding to different angles θn, preset the number value i, eliminate the angles whose number of pixels corresponding to angle θn is less than the number value i, obtain the remaining angle θi, and then define the variable j, with the initial value of j being 0 and the maximum value being i, and execute the following steps;
[0072] Step 210: Calculate the slope k corresponding to the angle θj n , take k j =1 / k n , project each pixel onto the line y=k j * Get the projection point on x, and then calculate the distance d from the projection point to the coordinate origin O n ;
[0073] Step 220: Count each distance d obtained by calculation n The number of times, the preset number of ranking value t, find the distance d before the number of ranking value t t ;
[0074] Step 230: Set each distance d t The corresponding pixel points are selected and used to form a point set, then each distance d t The corresponding point set is marked as an edge location, and finally the edge location marked at t is obtained;
[0075] Step 240, let j = j + 1, determine whether j> i, if so, output all edge locations, if not, repeat steps 210 to 240;
[0076] The image containing the edge location of the mark at position t is the third image of the located text area.
[0077] In this preferred embodiment, considering that the basic edges of the text in the resume will appear as straight lines or approximate straight lines during edge detection, the straight line edges are extracted in the above manner, and a scaling threshold α is set. The angles θn in [θn-α, θn+α] are merged and recorded as θn', and θn' replaces the original angle to update θn, ensuring that some strokes with a certain degree of curvature can also be accurately identified. After that, a loop is set to extract different projection point sets. Here, considering the existence of interference edges, namely noise edges, due to the insufficient number of pixels, the distance formed by the projection is obviously insufficient. Therefore, the number of ranking values t is set, and the distance d before the ranking value t is replaced. t The corresponding pixel points are selected and used to form a point set, then each distance d t The corresponding point set is marked as an edge location, and finally the edge location marked at t is obtained, so that an edge detection positioning image with almost no interference edges can be obtained.
[0078] As a preferred embodiment of the present invention, character recognition is performed based on the associated features of each character to obtain recognition results of all characters, including:
[0079] The pre-trained CNN convolutional neural network is used to perform character recognition on the associated features of each character to obtain the recognition results of all characters.
[0080] In this preferred embodiment, character recognition is performed on the associated features of each character through a pre-trained CNN convolutional neural network, which can accurately achieve character recognition.
[0081] As a preferred embodiment of the present invention, the resume text data is subjected to resume recognition by a large language model to obtain a recognition result, including:
[0082] Use Hugging Face's pipeline function to load a pre-trained NER model;
[0083] Input the resume text data into the pre-trained NER model to extract key information and obtain the relevant key information of the resume text data;
[0084] Push the relevant key information of the resume text data to the preset screener IP.
[0085] In this preferred embodiment,
[0086] Using a large language model (LLM) for resume recognition involves parsing and extracting information from the resume text. This task is accomplished using Hugging Face's Transformers library.
[0087] First, you need to install Hugging Face's Transformers library and other dependencies:
[0088] pip install transformers
[0089] pip install torch
[0090] pip install pandas
[0091] Then, you can use the following code to identify and extract key information from the resume:
[0092]
[0093]
[0094]
[0095]
[0096] 1. Load pre-trained model: Use Hugging Face's pipeline function to load a pre-trained named entity recognition (NER) model `dslim / bert-base-NER`. 2. Define resume text: Provide a sample text containing resume information. 3. Extract key information: - Use regular expressions to extract email and phone number. - Use the NER model to extract name. - Segment the resume text and extract education background, work experience, skills, and projects. 4. Output results: Print the extracted resume information.
[0097] This preferred implementation demonstrates how to use a large language model to identify key information in a resume, and can be further optimized and expanded according to actual needs.
[0098] As a preferred embodiment of the present invention, specifically, the text preprocessing operation includes the following:
[0099] The resume-related data in text format is subjected to noise, punctuation, and special character operations to obtain cleaned text data.
[0100] The present invention also proposes a resume recognition device based on a large language model, comprising the following:
[0101] Data acquisition module, used to obtain resume-related data;
[0102] The judgment module is used to judge the format type of resume-related data. If it is in text format, no processing is required. If it is in picture format, image recognition is performed to convert it into text format.
[0103] A preprocessing module, used for performing text preprocessing on resume-related data in text format to obtain resume text data;
[0104] The resume recognition module is used to perform resume recognition on the resume text data through a large language model to obtain a recognition result.
[0105] The modules described as separate components may or may not be physically separated, and the components shown as modules may or may not be physical modules, that is, they may be located in one place or distributed on multiple network modules. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
[0106] In addition, each functional module in each embodiment of the present invention may be integrated into one processing module, or each module may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of software functional modules.
[0107] If the integrated module is implemented in the form of a software function module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present invention implements all or part of the processes in the above-mentioned embodiment method, and can also be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, disk, optical disk, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal and software distribution medium, etc.
[0108] Although the description of the present invention has been quite detailed and specifically describes several described embodiments, it is not intended to be limited to any of these details or embodiments or any particular embodiment, but should be regarded as providing a broad possible interpretation of these claims in view of the prior art by reference to the appended claims, thereby effectively covering the intended scope of the present invention. In addition, the above description of the present invention is based on the embodiments foreseeable by the inventor, and its purpose is to provide a useful description, and those non-substantial changes to the present invention that have not yet been foreseen may still represent equivalent changes to the present invention.
[0109] The above is only a preferred embodiment of the present invention. The present invention is not limited to the above implementation. As long as the technical effect of the present invention is achieved by the same means, it should belong to the protection scope of the present invention. Within the protection scope of the present invention, its technical scheme and / or implementation method can have various modifications and changes.
Claims
1. A resume recognition method based on a large language model, characterized in that: Includes the following: Get resume related data; Determine the format type of resume-related data. If it is in text format, no processing is required. If it is in picture format, perform image recognition and convert it into text format. Performing text preprocessing on resume-related data in text format to obtain resume text data; The resume text data is subjected to resume recognition through a large language model to obtain a recognition result.
2. The resume recognition method based on a large language model according to claim 1, characterized in that: Specifically, the process of converting resume-related data in picture format into text format through image recognition includes: The resume-related data in the image format is defined as the first image; Performing image preprocessing on the first image to obtain a second image with binary denoising; Performing an edge detection operation on the second image to obtain a third image where the text area is located; Performing text line and character segmentation on the third image to obtain a plurality of characters; Extracting features of the plurality of characters to obtain associated features of each character; Character recognition is performed based on the associated features of each character to obtain recognition results of all characters; The recognition results of all characters are output in sequence and formatted according to preset requirements to obtain resume-related data in text format.
3. The resume recognition method based on a large language model according to claim 2, characterized in that: Specifically, the image preprocessing process includes: The first image is grayed, and then the grayed image is converted into a binary image. The binary image is then subjected to noise reduction and tilt correction to obtain a binary and noise-reduced second image.
4. The resume recognition method based on a large language model according to claim 2, characterized in that: Specifically, performing an edge detection operation on the second image to obtain a third image where the text area is located includes: Processing the second image by an edge detection operator to obtain an edge image corresponding to the second image; Traversing the edge image, presetting the origin O, determining the coordinates of all pixel points constituting the edge in the edge image and defining the total number of pixel points as n; Calculate the angle θn of all pixels according to the coordinates of the pixels; Predefine the scaling threshold α, merge the angles θn in [θn-α, θn+α] into θn', and replace the original angle with θn' to update θn; Find and record the number of pixels corresponding to different angles θn, preset the number value i, eliminate the angles whose number of pixels corresponding to angle θn is less than the number value i, obtain the remaining angle θi, and then define the variable j, with the initial value of j being 0 and the maximum value being i, and execute the following steps; Step 210: Calculate the slope k corresponding to the angle θj n , take k j =1 / k n , project each pixel onto the line y=k j * Get the projection point on x, and then calculate the distance d from the projection point to the coordinate origin O n ; Step 220: Count each distance d obtained by calculation n The number of times, the preset number of ranking value t, find the distance d before the number of ranking value t t ; Step 230: Set each distance d t The corresponding pixel points are selected and used to form a point set, then each distance d t The corresponding point set is marked as an edge location, and finally the edge location marked at t is obtained; Step 240, let j = j + 1, determine whether j> i, if so, output all edge locations, if not, repeat steps 210 to 240; The image containing the edge location of the mark at position t is the third image of the located text area.
5. The resume recognition method based on a large language model according to claim 2, characterized in that: Character recognition is performed based on the associated features of each character to obtain the recognition results of all characters, including: The pre-trained CNN convolutional neural network is used to perform character recognition on the associated features of each character to obtain the recognition results of all characters.
6. The resume recognition method based on a large language model according to claim 1, characterized in that: The resume text data is subjected to resume recognition by a large language model to obtain a recognition result, including: Use the pipeline function of HuggingFace to load a pre-trained NER model; Input the resume text data into the pre-trained NER model to extract key information and obtain the relevant key information of the resume text data; Push the relevant key information of the resume text data to the preset screener IP.
7. The resume recognition method based on a large language model according to claim 1, characterized in that: Specifically, the text preprocessing operation includes the following: The resume-related data in text format is subjected to noise, punctuation, and special character operations to obtain cleaned text data.
8. A resume recognition device based on a large language model, characterized in that: Includes the following: Data acquisition module, used to obtain resume-related data; The judgment module is used to judge the format type of resume-related data. If it is in text format, no processing is required. If it is in picture format, image recognition is performed to convert it into text format. A preprocessing module, used for performing text preprocessing on resume-related data in text format to obtain resume text data; The resume recognition module is used to perform resume recognition on the resume text data through a large language model to obtain a recognition result.
