Resume identification method based on large model
Through large-scale model technology, key information is extracted and converted into structured data, the problems of inefficiency and subjectivity of traditional resume screening are solved, and efficient and accurate automatic identification and screening of resumes are achieved.
Patent Information
- Application Number
- CN202410986898.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-23
- Publication Date
- 2024-11-29
AI Technical Summary
Traditional resume screening methods are inefficient and subjective, making it difficult to accurately extract key information from resumes.
The resume recognition method based on the big model is adopted to process and structure the resume content, define the extracted information format, and use the big model to perform multiple rounds of dialogue to extract key information and convert it into structured data.
It realizes automatic identification and screening of resumes, improves identification efficiency, reduces the time and energy of manual identification of human resources managers, reduces the impact of subjectivity, and improves the accuracy of identification.
Smart Images

Figure CN119047569A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of large models, and in particular to a resume recognition method based on large models. Background Art
[0002] In the human resources industry, resume identification and screening is an important and tedious task. Traditional resume screening methods often rely on manual reading and analysis, which is not only inefficient, but also prone to inaccurate screening results due to human subjectivity. In addition, due to the non-fixed format of resume content, it is difficult to extract key information from resumes through traditional programming alone, and the accuracy is not high.
[0003] In order to solve the problems of low efficiency and high subjectivity in the traditional resume screening process, the present invention proposes a resume recognition method based on a large model. Summary of the invention
[0004] In order to make up for the defects of the prior art, the present invention provides a simple and efficient resume recognition method based on a large model.
[0005] The present invention is achieved through the following technical solutions:
[0006] A resume recognition method based on a large model includes the following steps:
[0007] Step S1, processing the resume document and extracting the original content in the resume;
[0008] Step S2, structuring the resume content to facilitate subsequent original text annotation;
[0009] Step S3, defining the information to be extracted from the resume and the corresponding structured format;
[0010] Step S4, evaluate the resume content length. If the total length of the resume exceeds the context length supported by the large model to be selected, return the message "The resume content is too long and cannot be recognized"; estimate the supported model parameters based on the resume length and hardware resources, select the large model, load and initialize the inference task to avoid the problem that the environment cannot run the model inference task;
[0011] Step S5, constructing prompts and multiple rounds of dialogues to ask questions to the big model to obtain resume information;
[0012] Step S6, fill the results returned by the large model multi-round dialogue into the structured data and return it.
[0013] In step S1, the resume document format is determined:
[0014] If the resume document is in docx format, use the open source library python-docx to extract the resume content in docx format, use line breaks \n to connect each paragraph, and return the entire text;
[0015] If the resume document is in PDF format, use the open source library PyPDF2 to extract the resume content in PDF format, use the line break character \n to connect each page content, and return the entire text;
[0016] If the resume document is in a format other than docx or pdf, the result that the corresponding document format is not supported is returned.
[0017] In step S2, the steps of structuring the resume content are as follows:
[0018] Step S2.1, split the resume content extracted in step S1 into a string array according to the line break character \n, and name the split string array line_array;
[0019] Step S2.2, create an array for storing paragraphs, named para_array; create a temporary array for concatenating multiple rows into a paragraph, named row_array;
[0020] Step S2.3, traverse the array line_array, and for each element therein, that is, each line in the resume, use the temporary array row_array to process it into paragraphs, and finally save it into the array para_array;
[0021] Step S2.4, after the traversal of step S2.3 is completed, check whether the temporary array row_array is empty:
[0022] If it is empty, continue to execute;
[0023] If it is not empty, use the line break character \n to connect each element in the temporary array row_array into a string, that is, the last paragraph, and add the paragraph to the array para_array.
[0024] In step S2.3, the steps for implementing paragraph processing are as follows:
[0025] Step S2.3.1, for the line of string in the resume currently being traversed, remove all tabs and line breaks, including \t, \r, and \n, and then determine its length:
[0026] If the length is greater than 0, it is added to the temporary array row_array, and steps S2.3.2 and S2.3.3 are skipped, and the processing flow ends;
[0027] Otherwise, continue to step S2.3.2;
[0028] Step S2.3.2, determine whether the temporary array row_array is empty:
[0029] If it is empty, skip step S2.3.3 and proceed to the next traversal;
[0030] Otherwise, use the line break character \n to concatenate each element in the temporary array row_array into a string, i.e., a paragraph, and then add the paragraph to the array para_array, and then continue to execute step S2.3.3;
[0031] Step S2.3.3, clear the temporary array row_array and continue with the next traversal.
[0032] In step S3, the information to be extracted from the resume is first determined, including but not limited to the following fields: age, first degree, first degree school, first degree graduation time, highest degree, highest degree school, highest degree graduation time, years of work and work experience;
[0033] Then, define a structured format template for resume information. The specific format is json. The following is its template: {"age": age, "first_degree": first degree, "first_degree_school": first degree school, "first_degree_year": first degree graduation time, "highest_degree": highest degree, "highest_degree_school": highest degree school, "highest_degree_year": highest degree graduation time, "work_years": working years, "work_experience": work experience}; name the json format template json_template.
[0034] In step S4, if the resume length is within 2000 words and the hardware resource is a single A800 graphics card with 80G video memory, the open source Baichuan2-13B-Chat large model is selected; and the open source transformers library is used to load and run the Baichuan2-13B-Chat large model.
[0035] In step S5, the steps for asking the big model questions to obtain resume information are as follows:
[0036] Step S5.1, get the current date, named current_date, so that the big model can calculate the age based on the date of birth in the resume;
[0037] Step S5.2, create a hash table named field_dict to store the extracted resume field information;
[0038] The keys of the hash table field_dict are string types, corresponding one-to-one to the field names of the json format template json_template; the values corresponding to the keys are the values corresponding to the field names;
[0039] Step S5.3, create a hash table named from_dict to store the paragraph of the original text from which each extracted resume field comes;
[0040] The keys of the hash table from_dict are string types, corresponding to the field names of the json format template json_template one by one; the values corresponding to the keys are array types, which are used to save the subscripts in the array para_array, which means that the resume fields come from the original paragraphs corresponding to one or more subscripts in the array para_array;
[0041] Step S5.4, traverse the array para_array, name each element, that is, each paragraph, para, and then construct the following prompt prompt: "You are an interviewer. The current date is: current_date. The following is part of the resume of an interviewee. Please strictly follow the resume content and do not make up. Only strictly return the json string in the following format and fill in the actual answer. Do not answer additional information. If a field cannot be obtained from the resume content, the field value is set to empty. \n json string: json_template\n resume content: para";
[0042] Step S5.5, ask each of the prompts constructed in step S5.4 to the big model in turn, and use the string matching function to check whether the answer returned by the big model contains data in the json format template json_template:
[0043] If not, skip this traversal and continue to the next traversal;
[0044] If included, traverse the fields in the corresponding data, save the fields whose values are not empty into the hash table field_dict as described in step S5.2, and save them into the hash table from_dict as described in step S5.3, using the field name as the key and the traversed array index as the value.
[0045] The implementation steps of step S6 are as follows:
[0046] Step S6.1, constructing the structured data format to be returned, specifically the json format, which is based on the json format template json_template, adding the from attribute and the paras attribute; and naming the json format template return_template;
[0047] The value of the from attribute is the source subscript array of each field, and the paras attribute is the paragraphed original resume text;
[0048] Step S6.2, fill the values of the hash table field_dict, the hash table from_dict and the array para_array into the json format template return_template. The keys of the hash table field_dict correspond to the field names in the json format template return_template; after the hash table from_dict is serialized into json format, it is filled into the from attribute; after the array para_array is serialized into json format, it is filled into the paras attribute;
[0049] Step S6.3, return the json format template return_template that has been filled with data.
[0050] A resume recognition device based on a large model, characterized in that it includes a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the above-mentioned method steps when executing the computer program.
[0051] A readable storage medium, characterized in that: a computer program is stored on the readable storage medium, and the computer program implements the above method steps when executed by a processor.
[0052] The beneficial effect of the present invention is that the resume recognition method based on the big model can use the big model technology to automatically and accurately identify the key information in the resume, and convert it into a structured data representation, while indicating the original text corresponding to the data in the resume, so as to assist human resource managers in efficient resume screening and candidate evaluation, and provide the necessary conditions for the development of automated resume screening functions. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0054] AttachedFigure 1 It is a schematic diagram of the resume recognition method based on a large model of the present invention. DETAILED DESCRIPTION
[0055] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0056] With the development of artificial intelligence technology, especially the rise of big model technology, its powerful text content understanding and generation capabilities provide new solutions for the automatic recognition and screening of resumes.
[0057] The resume recognition method based on the large model includes the following steps:
[0058] Step S1, processing the resume document and extracting the original content in the resume;
[0059] Step S2, structuring the resume content to facilitate subsequent original text annotation;
[0060] Step S3, defining the information to be extracted from the resume and the corresponding structured format;
[0061] Step S4, evaluate the resume content length. If the total length of the resume exceeds the context length supported by the large model to be selected, return the message "The resume content is too long and cannot be recognized"; estimate the supported model parameters based on the resume length and hardware resources, select the large model, load and initialize the inference task to avoid the problem that the environment cannot run the model inference task;
[0062] Step S5, constructing prompts and multiple rounds of dialogues to ask questions to the big model to obtain resume information;
[0063] Step S6, fill the results returned by the large model multi-round dialogue into the structured data and return it.
[0064] In step S1, the resume document format is determined:
[0065] If the resume document is in docx format, use the open source library python-docx to extract the resume content in docx format, use line breaks \n to connect each paragraph, and return the entire text;
[0066] If the resume document is in PDF format, use the open source library PyPDF2 to extract the resume content in PDF format, use the line break character \n to connect each page content, and return the entire text;
[0067] If the resume document is in a format other than docx or pdf, the result that the corresponding document format is not supported is returned.
[0068] In step S2, the steps of structuring the resume content are as follows:
[0069] Step S2.1, split the resume content extracted in step S1 into a string array according to the line break character \n, and name the split string array line_array;
[0070] Step S2.2, create an array for storing paragraphs, named para_array; create a temporary array for concatenating multiple rows into a paragraph, named row_array;
[0071] Step S2.3, traverse the array line_array, and for each element therein, that is, each line in the resume, use the temporary array row_array to process it into paragraphs, and finally save it into the array para_array;
[0072] Step S2.4, after the traversal of step S2.3 is completed, check whether the temporary array row_array is empty:
[0073] If it is empty, continue to execute;
[0074] If it is not empty, use the line break character \n to connect each element in the temporary array row_array into a string, that is, the last paragraph, and add the paragraph to the array para_array.
[0075] In step S2.3, the steps for implementing paragraph processing are as follows:
[0076] Step S2.3.1, for the line of string in the resume currently being traversed, remove all tabs and line breaks, including \t, \r, and \n, and then determine its length:
[0077] If the length is greater than 0, it is added to the temporary array row_array, and steps S2.3.2 and S2.3.3 are skipped, and the processing flow ends;
[0078] Otherwise, continue to step S2.3.2;
[0079] Step S2.3.2, determine whether the temporary array row_array is empty:
[0080] If it is empty, skip step S2.3.3 and proceed to the next traversal;
[0081] Otherwise, use the line break character \n to concatenate each element in the temporary array row_array into a string, i.e., a paragraph, and then add the paragraph to the array para_array, and then continue to execute step S2.3.3;
[0082] Step S2.3.3, clear the temporary array row_array and continue with the next traversal.
[0083] In step S3, the information to be extracted from the resume is first determined, including but not limited to the following fields: age, first degree, first degree school, first degree graduation time, highest degree, highest degree school, highest degree graduation time, years of work and work experience;
[0084] Then, define a structured format template for resume information. The specific format is json. The following is its template: {"age": age, "first_degree": first degree, "first_degree_school": first degree school, "first_degree_year": first degree graduation time, "highest_degree": highest degree, "highest_degree_school": highest degree school, "highest_degree_year": highest degree graduation time, "work_years": working years, "work_experience": work experience}; name the json format template json_template.
[0085] In step S4, if the resume length is within 2000 words and the hardware resource is a single A800 graphics card with 80G video memory, the open source Baichuan2-13B-Chat large model is selected; and the open source transformers library is used to load and run the Baichuan2-13B-Chat large model.
[0086] In step S5, the steps for asking the big model questions to obtain resume information are as follows:
[0087] Step S5.1, get the current date, named current_date, so that the big model can calculate the age based on the date of birth in the resume;
[0088] Step S5.2, create a hash table named field_dict to store the extracted resume field information;
[0089] The keys of the hash table field_dict are string types, corresponding one-to-one to the field names of the json format template json_template; the values corresponding to the keys are the values corresponding to the field names;
[0090] Step S5.3, create a hash table named from_dict to store the paragraph of the original text from which each extracted resume field comes;
[0091] The keys of the hash table from_dict are string types, corresponding to the field names of the json format template json_template one by one; the values corresponding to the keys are array types, which are used to save the subscripts in the array para_array, which means that the resume fields come from the original paragraphs corresponding to one or more subscripts in the array para_array;
[0092] Step S5.4, traverse the array para_array, name each element, that is, each paragraph, para, and then construct the following prompt prompt: "You are an interviewer. The current date is: current_date. The following is part of the resume of an interviewee. Please strictly follow the resume content and do not make up. Only strictly return the json string in the following format and fill in the actual answer. Do not answer additional information. If a field cannot be obtained from the resume content, the field value is set to empty. \n json string: json_template\n resume content: para";
[0093] Step S5.5, ask each of the prompts constructed in step S5.4 to the big model in turn, and use the string matching function to check whether the answer returned by the big model contains data in the json format template json_template:
[0094] If not, skip this traversal and continue to the next traversal;
[0095] If included, traverse the fields in the corresponding data, save the fields whose values are not empty into the hash table field_dict as described in step S5.2, and save them into the hash table from_dict as described in step S5.3, using the field name as the key and the traversed array index as the value.
[0096] The implementation steps of step S6 are as follows:
[0097] Step S6.1, constructing the structured data format to be returned, specifically the json format, which is based on the json format template json_template, adding the from attribute and the paras attribute; and naming the json format template return_template;
[0098] The value of the from attribute is the source subscript array of each field, and the paras attribute is the paragraphed original resume text;
[0099] Step S6.2, fill the values of the hash table field_dict, the hash table from_dict and the array para_array into the json format template return_template. The keys of the hash table field_dict correspond to the field names in the json format template return_template; after the hash table from_dict is serialized into json format, it is filled into the from attribute; after the array para_array is serialized into json format, it is filled into the paras attribute;
[0100] Step S6.3, return the json format template return_template that has been filled with data.
[0101] The resume recognition device based on a large model includes a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the above method steps when executing the computer program.
[0102] The readable storage medium stores a computer program, and when the computer program is executed by a processor, the above method steps are implemented.
[0103] This resume recognition method based on a large model improves recognition efficiency through automated processing. It can not only quickly identify key information in resumes, but also reduce the time and effort of human resource managers to manually identify resumes. At the same time, after being trained with a large amount of data, the large model can accurately understand the resume text and extract key information such as age, education, and work experience, avoiding the influence of human subjectivity and improving recognition accuracy. In addition, the identified key information is converted into a structured data representation. Business developers can judge whether the resume is qualified based on the structured data and actual recruitment rules, realizing automated resume screening.
[0104] The embodiment described above is only one specific implementation of the present invention. Common changes and substitutions made by those skilled in the art within the scope of the technical solution of the present invention should be included in the protection scope of the present invention.
Claims
1. A resume recognition method based on a large model, characterized by: The following steps are involved: Step S1, processing the resume document and extracting the original content in the resume; Step S2, structuring the resume content to facilitate subsequent original text annotation; Step S3, defining the information to be extracted from the resume and the corresponding structured format; Step S4, evaluate the resume content length. If the total length of the resume exceeds the context length supported by the large model to be selected, return the message "The resume content is too long and cannot be recognized"; estimate the supported model parameters based on the resume length and hardware resources, select the large model, load and initialize the inference task to avoid the problem that the environment cannot run the model inference task; Step S5, constructing prompts and multiple rounds of dialogues to ask questions to the big model to obtain resume information; Step S6, fill the results returned by the large model multi-round dialogue into the structured data and return it.
2. The resume recognition method based on a large model according to claim 1 is characterized in that: In step S1, the resume document format is determined: If the resume document is in docx format, use the open source library python-docx to extract the resume content in docx format, use line breaks \n to connect each paragraph, and return the entire text; If the resume document is in PDF format, use the open source library PyPDF2 to extract the resume content in PDF format, use the line break character \n to connect each page content, and return the entire text; If the resume document is in a format other than docx or pdf, the result that the corresponding document format is not supported is returned.
3. The resume recognition method based on a large model according to claim 1 is characterized in that: In step S2, the steps of structuring the resume content are as follows: Step S2.1, split the resume content extracted in step S1 into a string array according to the line break character \n, and name the split string array line_array; Step S2.2, create an array for storing paragraphs, named para_array; create a temporary array for concatenating multiple rows into a paragraph, named row_array; Step S2.3, traverse the array line_array, and for each element therein, that is, each line in the resume, use the temporary array row_array to process it into paragraphs, and finally save it into the array para_array; Step S2.4, after the traversal of step S2.3 is completed, check whether the temporary array row_array is empty: If it is empty, continue to execute; If it is not empty, use the line break character \n to connect each element in the temporary array row_array into a string, that is, the last paragraph, and add the paragraph to the array para_array.
4. The resume recognition method based on a large model according to claim 3 is characterized in that: In step S2.3, the steps for implementing paragraph processing are as follows: Step S2.3.1, for the line of string in the resume currently being traversed, remove all tabs and line breaks, including \t, \r, and \n, and then determine its length: If the length is greater than 0, it is added to the temporary array row_array, and steps S2.3.2 and S2.3.3 are skipped, and the processing flow ends; Otherwise, continue to step S2.3.2; Step S2.3.2, determine whether the temporary array row_array is empty: If it is empty, skip step S2.3.3 and proceed to the next traversal; Otherwise, use the line break character \n to concatenate each element in the temporary array row_array into a string, i.e., a paragraph, and then add the paragraph to the array para_array, and then continue to execute step S2.3.3; Step S2.3.3, clear the temporary array row_array and continue with the next traversal.
5. The resume recognition method based on a large model according to claim 1 is characterized in that: In step S3, the information to be extracted from the resume is first determined, including but not limited to the following fields: age, first degree, first degree school, first degree graduation time, highest degree, highest degree school, highest degree graduation time, years of work and work experience; Then, define a structured format template for resume information. The specific format is json. The following is its template: {"age": age, "first_degree": first degree, "first_degree_school": first degree school, "first_degree_year": first degree graduation time, "highest_degree": highest degree, "highest_degree_school": highest degree school, "highest_degree_year": highest degree graduation time, "work_years": working years, "work_experience": work experience}; name the json format template json_template.
6. The resume recognition method based on a large model according to claim 1 is characterized in that: In step S4, if the resume length is within 2000 words and the hardware resource is a single A800 graphics card with 80G video memory, the open source Baichuan2-13B-Chat large model is selected; and the open source transformers library is used to load and run the Baichuan2-13B-Chat large model.
7. The resume recognition method based on a large model according to claim 4 is characterized in that: In step S5, the steps for asking the big model questions to obtain resume information are as follows: Step S5.1, get the current date, named current_date, so that the big model can calculate the age based on the date of birth in the resume; Step S5.2, create a hash table named field_dict to store the extracted resume field information; The keys of the hash table field_dict are string types, corresponding one-to-one to the field names of the json format template json_template; the values corresponding to the keys are the values corresponding to the field names; Step S5.3, create a hash table named from_dict to store the paragraph of the original text from which each extracted resume field comes; The keys of the hash table from_dict are string types, corresponding to the field names of the json format template json_template one by one; the values corresponding to the keys are array types, which are used to save the subscripts in the array para_array, which means that the resume fields come from the original paragraphs corresponding to one or more subscripts in the array para_array; Step S5.4, traverse the array para_array, name each element, that is, each paragraph, para, and then construct the following prompt: "You are an interviewer. The current date is: current_date. The following is part of the resume of an interviewee. Please strictly follow the resume content and do not make up. Only strictly return the json string in the following format and fill in the actual answer. Do not answer additional information. If a field cannot be obtained from the resume content, the field value is set to empty. \n json string is: json_template\n resume content is: para"; Step S5.5, ask each of the prompts constructed in step S5.4 to the big model in turn, and use the string matching function to check whether the answer returned by the big model contains data in the json format template json_template: If not, skip this traversal and continue to the next traversal; If included, traverse the fields in the corresponding data, save the fields whose values are not empty into the hash table field_dict as described in step S5.2, and save them into the hash table from_dict as described in step S5.3, using the field name as the key and the traversed array index as the value.
8. The resume recognition method based on a large model according to claim 7 is characterized in that: The implementation steps of step S6 are as follows: Step S6.1, constructing the structured data format to be returned, that is, adding the from attribute and the paras attribute on the basis of the json format template json_template; and naming the constructed json format template return_template; The value of the from attribute is the source subscript array of each field, and the paras attribute is the paragraphed original resume text; Step S6.2, fill the values of the hash table field_dict, the hash table from_dict and the array para_array into the json format template return_template. The keys of the hash table field_dict correspond to the field names in the json format template return_template; after the hash table from_dict is serialized into json format, it is filled into the from attribute; after the array para_array is serialized into json format, it is filled into the paras attribute; Step S6.3, return the json format template return_template that has been filled with data.
9. A resume recognition device based on a large model, characterized in that: The method comprises a memory and a processor; the memory is used to store a computer program, and the processor is used to implement the method according to any one of claims 1 to 8 when executing the computer program.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Method and device for document segmentation based on text lines
CN107391457A
Text tagging method based on artificial intelligence, electronic device and storage medium
CN111639480A
Document-level resume analysis method based on large-scale pre-training generation model
CN116205211A
Resume matching degree scoring method and system based on large language model
CN118071320A
Cited By
Large model-based resume analysis and scoring method, apparatus and device, and storage medium
CN120564215A
