Information extraction method and device
By obtaining resumes and converting them into images, and using split models and large language models to process the resume content, the problems of identifying and parsing diverse resumes are solved, and efficient and accurate information extraction and system adaptability are achieved.
Patent Information
- Application Number
- CN202510713485.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-29
- Publication Date
- 2025-09-16
AI Technical Summary
When processing diverse and non-standardized resumes, existing technologies have problems such as incomplete entity recognition, biased context understanding, and high rule maintenance costs, making it difficult to adapt to the complex and ever-changing formats and content of modern resumes.
By obtaining the target resume, extracting text blocks and converting them into images, the splitting model is used to split them into linear sub-regions. Combined with the large language model, the target information is extracted from the text content to generate text content in a unified format.
It achieves accurate recognition and parsing of diverse and non-standardized resumes, reduces system maintenance costs, and improves the recognition accuracy of emerging positions and multimodal information.
Smart Images

Figure CN120656195A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to an information extraction method and device. Background Art
[0002] As companies' talent needs become more refined, efficient and accurate "person-job matching" has become a core link in the recruitment process. As the main carrier of job seeker information, the quality of resume analysis directly affects the matching efficiency and accuracy.
[0003] Currently, resume parsing primarily relies on methods such as named entity recognition (NER), rule matching, dictionary-based parsing, and shallow machine learning. These technologies are somewhat effective for processing highly structured resumes, but when faced with the diverse and non-standardized formats of modern resumes, they commonly suffer from issues such as incomplete entity recognition, contextual misinterpretation, and high rule maintenance costs. Summary of the Invention
[0004] In view of this, the purpose of the embodiments of the present invention is to provide an information extraction method and device that can accurately and comprehensively identify various information in a resume, enhance adaptability to diverse and non-standardized resumes, and reduce system maintenance costs.
[0005] In a first aspect, an embodiment of the present invention provides an information extraction method, the method comprising:
[0006] Get targeted resumes;
[0007] extracting a text block from the target resume;
[0008] Convert said target resume into an image;
[0009] Splitting the image using a pre-acquired splitting model to obtain sub-regions, each of the sub-regions being linearly arranged;
[0010] Generating text content corresponding to the target resume according to the sub-region and the text block;
[0011] Target information is extracted from the text content using a pre-acquired text processing model.
[0012] In some embodiments, extracting the text block from the target resume includes:
[0013] In response to the target resume being in a format of a portable document format (PDF), determining a text area in the target resume;
[0014] Determining the image area of the target resume according to the text area;
[0015] Determine the text content and coordinate position in the image area;
[0016] generating a first intermediate file according to the text content and coordinate positions of the text area and the image area;
[0017] A text block in the target resume is obtained from the first intermediate file.
[0018] In some embodiments, determining the text area in the target resume includes:
[0019] Obtaining the coordinate position of each word in the target resume;
[0020] The text area is determined according to the coordinate position of the text in the target resume.
[0021] In some embodiments, determining the image area of the target resume based on the text area includes:
[0022] The area in the target resume except the text area is determined as the picture area.
[0023] In some embodiments, determining the text content and coordinate position in the image area includes:
[0024] Obtaining text content in the image area through optical character recognition (OCR);
[0025] Determine the coordinate position of the text content in the target resume.
[0026] In some embodiments, generating text content corresponding to the target resume based on the sub-region and the text block includes:
[0027] sorting the sub-regions according to a predetermined sub-region sorting rule to obtain a first sorting result;
[0028] sorting the text blocks in each sub-region according to a predetermined text block sorting rule to obtain a second sorting result;
[0029] Generate text content corresponding to the target resume based on the first sorting result and the second sorting result.
[0030] In some embodiments, the method further comprises:
[0031] Generate indexes for fields in the text content.
[0032] In some embodiments, the target information includes a target field and / or an index of a target field.
[0033] In some embodiments, extracting target information from the text content using a pre-acquired text processing model includes:
[0034] extracting the target field in response to the word count of the target field being less than or equal to a predetermined threshold;
[0035] In response to the word count of the target field being greater than a predetermined threshold, an index of the target field is extracted.
[0036] In some embodiments, the text processing model includes multiple threads, each thread is used to extract different types of target information;
[0037] The extracting target information from the text content by using a pre-acquired text processing model includes:
[0038] Each thread extracts target information from the text content in parallel.
[0039] In a second aspect, an embodiment of the present invention provides an information extraction device, the device comprising:
[0040] A target resume obtaining unit, used for obtaining a target resume;
[0041] A text block extraction unit, configured to extract text blocks from the target resume;
[0042] A picture conversion unit, used to convert the target resume into a picture;
[0043] A sub-region splitting unit, configured to split the image using a pre-acquired splitting model to obtain sub-regions, each of the sub-regions being arranged linearly;
[0044] A text content generating unit, configured to generate text content corresponding to the target resume according to the sub-region and the text block;
[0045] The target information extraction unit is configured to extract target information from the text content using a pre-acquired text processing model.
[0046] In a third aspect, an embodiment of the present invention provides an electronic device, comprising a memory and a processor, wherein the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method described in the first aspect.
[0047] In a fourth aspect, an embodiment of the present invention provides a computer program product, which includes a computer program. When the computer program runs on a computer, the computer executes the method described in the first aspect above.
[0048] In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer program instructions, which implement the method described in the first aspect when executed by a processor.
[0049] The technical solution of the embodiment of the present invention obtains a target resume, extracts text blocks from it, converts the target resume into an image, uses a pre-acquired segmentation model to segment the image into linear subregions, generates the text content corresponding to the target resume based on the subregions and text blocks, and extracts target information from the text content using a pre-acquired text processing model. This allows for accurate and comprehensive recognition of various information within a resume, enhances adaptability to diverse and non-standardized resumes, and reduces system maintenance costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] The above and other objects, features and advantages of the present invention will become more apparent through the following description of the embodiments of the present invention with reference to the accompanying drawings, in which:
[0051] Figure 1 is a flow chart of an information extraction method according to an embodiment of the present invention;
[0052] Figure 2 is a schematic diagram of a resume according to an embodiment of the present invention;
[0053] Figure 3 is a schematic diagram of a resume according to another embodiment of the present invention;
[0054] Figure 4 is a flowchart of extracting a text block according to an embodiment of the present invention;
[0055] Figure 5 is a flow chart of obtaining a text area according to an embodiment of the present invention;
[0056] Figure 6 Schematic diagram of the splitting result of an embodiment of the present invention;
[0057] Figure 7 This is a flowchart of obtaining text content according to an embodiment of the present invention;
[0058] Figure 8 is a schematic diagram of a text block according to an embodiment of the present invention;
[0059] Figure 9 is a schematic diagram of text content according to an embodiment of the present invention;
[0060] Figure 10 is a schematic diagram of text content of another embodiment of the present invention;
[0061] Figure 11 is a schematic diagram of an information extraction device according to an embodiment of the present invention;
[0062] Figure 12 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0063] The present application is described below based on the following embodiments, but the present application is not limited to these embodiments. In the detailed description of the present application below, certain specific details are described in detail. Those skilled in the art can fully understand the present application without the description of these details. To avoid obscuring the essence of the present application, well-known methods, processes, procedures, components, and circuits are not described in detail.
[0064] Furthermore, persons of ordinary skill in the art will appreciate that the figures provided herein are for illustration purposes only and are not necessarily drawn to scale.
[0065] Unless the context clearly requires otherwise, words like “include”, “comprising” and the like throughout this application should be interpreted as including rather than exclusive or exhaustive; that is, as meaning “including but not limited to”.
[0066] In the description of this application, it should be understood that the terms "first", "second", etc. are used for descriptive purposes only and should not be understood to indicate or imply relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.
[0067] Where the solutions described in this specification and in the examples involve the processing of personal information, such processing will be conducted with a legitimate basis (e.g., with the consent of the personal information subject or as necessary for the performance of a contract) and only within the prescribed or agreed scope. A user's refusal to process personal information other than that required for basic functions will not affect the user's use of these basic functions.
[0068] In HR (Human Resources) recruitment practices, "matching people to jobs" is the core principle, requiring both "the right person for the job" and "the right person for the job." This is a complex, two-pronged matching process. As the first gatekeeper in the job-person matching process, resume screening and review are the primary and crucial tasks for HR professionals. Searching through vast resume databases is the first step in HR's resume screening process. Whether headhunters or corporate HR, they spend a significant amount of time searching for outstanding resumes and job applications every day. However, resume parsing results are often inaccurate, leading to inaccurate searches.
[0069] Recruiters receive a massive amount of resumes from various channels every day. These resumes vary greatly in format and content, and standardizing and centralizing their storage has become a huge challenge for recruitment teams. Furthermore, the inefficiency and error-prone nature of manual resume processing can lead to missed opportunities for outstanding talent. Furthermore, many corporate recruitments may involve resumes in different languages. The resume parsing system supports resume parsing in multiple languages, including common languages like Chinese, English, Japanese, and Korean, to meet the needs of international recruitment and help companies attract global talent. The resume parsing system plays a vital role in the corporate recruitment process. By accurately identifying resume information, it significantly improves recruitment efficiency and quality for companies, helping them stand out in the fierce competition for talent.
[0070] Traditional resume parsing solutions rely primarily on technologies such as named entity recognition (NER), rule matching, dictionary-based methods, and shallow machine learning. While these methods can be effective in specific scenarios, they often have limitations when faced with the complex and ever-changing formats and content of modern resumes.
[0071] NER-based methods rely on trained NER models to identify key entities in resumes, such as names, company names, and job titles. However, NER has limited ability to recognize newly emerged entities, making it difficult to adapt to the rapidly changing job market and emerging job positions. Furthermore, its limited understanding of context makes it prone to misidentification of entity boundaries and semantic misconceptions. Furthermore, training requires a large amount of labeled data, which is costly and requires a long update cycle.
[0072] Rule-based matching methods extract information from resumes based on predefined rules and patterns, such as regular expressions. However, these methods are costly to maintain and require constant updates to accommodate new resume formats and content. They also lack flexibility and struggle to handle non-standard or innovative resume formats. Furthermore, their ability to understand complex contexts is limited, making them prone to mismatches and missed matches.
[0073] Dictionary-based approaches rely on predefined dictionaries to identify and extract key information from resumes. However, these dictionaries are difficult to update, making it difficult to cover emerging industries and positions. Furthermore, they lack the ability to handle synonyms and near-synonyms, making it easy to miss important information. Furthermore, they struggle to extract context-sensitive information, such as distinguishing similar descriptions from different experiences.
[0074] Shallow machine learning methods rely on traditional machine learning algorithms such as SVM (Support Vector Machine) and CRF (Conditional Random Field) for sequence labeling or classification. However, these methods require complex feature engineering and extensive manual feature design. They also have limited generalization capabilities, making them difficult to adapt to diverse resume formats and content. Furthermore, they lack the ability to understand long-range dependencies and complex contexts.
[0075] These traditional approaches may work well for standardized, uniformly formatted resumes, but they often struggle with the diverse, personalized, and even multimodal resumes of the modern recruitment landscape. They struggle to effectively handle complex layouts, unstructured text, implicit information inference, and lack the ability to understand the overall context.
[0076] Figure 1 FIG. 1 is a flow chart of the information extraction method according to an embodiment of the present invention. Figure 1 As shown, the information extraction method of the embodiment of the present invention is performed by various electronic devices, wherein the electronic device includes a memory and a processor, the memory is used to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the following method steps:
[0077] Step S100: Obtain target resume.
[0078] In this embodiment, the target resume is the resume from which information is to be extracted. The target resume may be retrieved from a storage device such as a local repository or a cloud database, or may be received from another terminal or device, which is not limited in this embodiment of the present invention.
[0079] Among them, the formats of candidates' resumes vary, most of which are concentrated in the formats of pdf, word, and markdown. Some people upload their resumes in the form of pictures or compressed packages. According to statistics, more than 92% of people use resumes in pdf and word formats. Moreover, the layout of a resume is relatively complex. Traditional layout analysis requires the definition of more categories. If problems such as resumes are marked according to traditional layout analysis problems, a large number of resumes need to be marked. At the same time, for privacy and data security reasons, marking a large amount of resume data requires a complex desensitization process. Therefore, for the sake of simplicity, the embodiment of the present invention mainly defines the layout of the resume into two situations, namely linear layout resume and non-linear layout resume.
[0080] Figure 2 Schematic diagram of a resume of an embodiment of the present invention. Figure 2As shown, a resume includes information such as name, job goal, age, contact information, email address, address, self-evaluation, interests and hobbies, educational background and work experience.
[0081] in, Figure 2 The resume shown is a linear layout resume. The text flows linearly, and the reading order of the text blocks follows the order from top to bottom and left to right.
[0082] Figure 3 FIG. 1 is a schematic diagram of a resume according to another embodiment of the present invention. Figure 2 As shown, a resume includes information such as name, job goal, age, contact information, email address, address, self-evaluation, basic skills, interests and hobbies, educational background and work experience.
[0083] in, Figure 3 The resume shown is a non-linear layout, specifically a left-right layout. Each layout is composed of several linear panels. The left panel includes five linear panels. The first linear panel includes a photo, name, and job objectives. The second linear panel includes age, contact information, email address, and address. The next three linear panels are for self-evaluation, basic skills, and interests and hobbies. The right panel includes two linear panels, one for education background and the other for work experience.
[0084] It should be noted that Figure 2 and Figure 3 The layout distribution shown is only a few resume styles provided in the embodiment of the present invention. The resume in the embodiment of the present invention can be arranged in any form of layout.
[0085] Step S200: extracting text blocks from the target resume.
[0086] In this embodiment, as mentioned above, the resume has various formats, including PDF, word, markdown (lightweight markup language), pictures, etc.
[0087] For Word, extracting text blocks from the target resume can include extracting paragraphs, pictures, tables, text boxes, etc. from Word.
[0088] For markdown, extracting text blocks from the target resume can include extracting paragraphs, blockquotes, code blocks, lists, etc.
[0089] For images, you can convert the images to PDF format first, and then extract the text blocks from the PDF format.
[0090] As for PDF (Portable Document Format), PDF files are a common resume format, and their internal structures and content forms are diverse, which brings many challenges to parsing. For example, some candidates will save text screenshots as pictures and embed them into PDF. In this case, the metadata of PDF does not contain these text information, and the complete resume content cannot be obtained by parsing the PDF text alone. For another example, the resume may be a mixed and complex layout. Some resumes use non-linear layout, such as left and right columns, multi-column layout, mixed text and graphics, etc. This layout method makes the traditional reading order from top to bottom and from left to right invalid. For another example, the font encoding problem, some PDF files use custom fonts or special encoding, which may cause garbled characters or lost information when text is extracted. Therefore, the embodiment of the present invention specifically designs a solution for extracting text blocks from PDF to solve the processing problems in resumes in PDF format.
[0091] Figure 4 FIG. 1 is a flowchart of extracting text blocks according to an embodiment of the present invention. Figure 4 As shown, obtaining the text block in the target resume includes the following steps:
[0092] Step S210: In response to the target resume being in the portable document format (PDF), determine a text area in the target resume.
[0093] In this embodiment, a target resume in PDF format is obtained, wherein the target resume in PDF format may be a resume in PDF format itself, or a resume in image format converted into PDF.
[0094] As described above, there may be a resume formed by saving a text screenshot as an image and embedding it into a PDF. Therefore, the embodiment of the present invention determines the text area in the target resume.
[0095] Specifically, Figure 5 This is a flow chart of obtaining a text area according to an embodiment of the present invention. Figure 5 As shown, determining the text area in the target resume includes the following steps:
[0096] Step S211: Obtain the coordinate position of each character in the target resume.
[0097] In this embodiment, the underlying structure of a PDF (Portable Document Format) file is a complex, object-based data structure designed to accurately represent all elements on a document page, including text, images, graphics, and interactive elements. The basic building blocks of a PDF file are "objects," which can be divided into the following categories: strings, arrays, dictionaries, streams, and references. Strings are used to store text content. Arrays are used to organize multiple objects. Dictionaries are collections of key-value pairs used to describe more complex entities, such as pages. Streams are objects that contain large amounts of data, such as images or fonts. Text content is often also specified through streams to specify its location and appearance. References are objects that point to other objects, allowing the creation of complex network relationships.
[0098] Each PDF file contains at least one root object (Catalog), which points to a series of page objects (Pages). Each page object contains a reference to its content stream, which is a sequence of instructions consisting of a series of operators and parameters that describe how to draw each element on the page. The content stream of PDF uses a specific set of operators to define how the elements on the page are placed and presented. For example, the BT and ET operators mark the beginning and end of the text object, respectively, while the operators and parameters between them specify the text to be displayed, its format (font, size, etc.) and position (coordinates). By parsing these content streams, you can identify which instructions are used to place text and extract the specific text content and corresponding coordinate information.
[0099] In some embodiments, text and the coordinate position of the text in the target resume can be extracted from the target resume based on the PyMuPDF (also known as fitz) library. Specifically, the PyMuPDF library loads the specified PDF file and loads the pages of the PDF file. All text and related information on the page are obtained in a dictionary format. The returned data structure contains multiple text blocks (blocks), each text block contains multiple lines (lines), and each line consists of multiple spans (spans). Each span represents a continuous text. The bounding box of a span is represented by span['bbox'], which is a four-tuple (x0, y0, x1, y1), which represents the coordinates of the lower left corner and the upper right corner respectively. The coordinate system of PDF is usually based on the lower left corner of the page as the origin (0, 0), and the right and upward are the positive directions of the x-axis and y-axis respectively. In this way, the text content of the page in the PDF file and its specific position on the page can be accurately extracted.
[0100] Step S212: Determine the text area according to the coordinate position of the text in the target resume.
[0101] In this embodiment, after obtaining the coordinate position of each character in the target resume, the character area can be determined according to the coordinate position of the character in the target resume.
[0102] Step S220: Determine the image area of the target resume based on the text area.
[0103] In this embodiment, the area in the target resume other than the text area is determined as the image area.
[0104] Specifically, the target resume can be converted into an image format (such as PNG or JPEG) first, and the extracted text area can be marked as a rectangle of a specified color in the image. In this way, the part not marked with a color is the image area.
[0105] Step S230: Determine the text content and coordinate position in the image area.
[0106] In this embodiment, for the image area, the text content in the image area is obtained through OCR (Optical Character Recognition), and the coordinate position of the text content in the target resume is determined.
[0107] Specifically, for the detected image area, OCR is used to extract the text content therein. The coordinate position of the text content in the image area is determined, and the coordinate position of the image area in the page of the target resume is determined. Based on these two coordinate positions, the text content in the image area can be mapped back to the page of the target resume.
[0108] Step S240: Generate a first intermediate file according to the text content and coordinate positions of the text area and the image area.
[0109] In this embodiment, after the text content and coordinate positions of the text area and the image area are obtained, they are combined to generate a first intermediate file.
[0110] Specifically, for the detected image area, OCR is used to extract the text content therein. The coordinate position of the text content in the image area is determined, and at the same time, the coordinate position of the image area in the page of the target resume is determined. Based on these two coordinate positions, the text content in the image area can be mapped back to the page in the target resume. In this way, a first intermediate file consisting entirely of text content can be obtained. The page layout of the first intermediate file is the same as that of the target resume, except that the image area in the target resume is converted into a text area for subsequent processing. The first intermediate file is in PDF format.
[0111] Step S250: Obtain the text block in the target resume from the first intermediate file.
[0112] In this embodiment, after obtaining the first intermediate file in PDF format, the PDF file contains at least one root object (Catalog), which points to a series of page objects (Pages). Each page object contains a reference to its content stream, and the content stream is a sequence of instructions consisting of a series of operators and parameters that describe how to draw each element on the page. The content stream of PDF uses a specific set of operators to define how the elements on the page are placed and presented. For example, the BT and ET operators mark the beginning and end of the text object, respectively, while the operators and parameters between them specify the text to be displayed and its format (font, size, etc.) and position (coordinates). By parsing these content streams, it is possible to identify which instructions are used to place text, and extract the specific text content and corresponding coordinate information from them. Therefore, based on the PyMuPDF (also known as fitz) library, text and the coordinate position of the text in the target resume can be extracted from the target resume. Specifically, the PyMuPDF library loads the specified PDF file and loads the pages of the PDF file. All text and related information on the page are obtained in dictionary format. The returned data structure contains multiple text blocks, each of which consists of multiple lines, each of which is composed of multiple spans. Each span represents a continuous section of text. The bounding box of a span is represented by span['bbox'], which is a 4-tuple (x0, y0, x1, y1), representing the coordinates of the lower left and upper right corners, respectively. This method allows you to accurately extract text blocks from PDF files.
[0113] Thus, the text blocks in the resume in PDF format can be obtained.
[0114] Step S300: convert the target resume into a picture.
[0115] In this embodiment, the target resume is converted from its original format to a picture (such as PNG or JPEG). If the original format is a picture, no conversion is required.
[0116] Step S400: split the image using a pre-acquired splitting model to obtain sub-regions, each of the sub-regions being arranged linearly.
[0117] In this embodiment, the segmentation model is a DETR (Detection Transformer) model, an object detection model that directly and concurrently predicts the location and category of all objects using the Transformer architecture. The segmentation model is capable of identifying and segmenting different regions within an image, and is used for document layout analysis to obtain at least one subregion, each of which includes at least one text block.
[0118] In some embodiments, an input layer, an encoder layer, a decoder layer, and an output layer.
[0119] The input layer is a Backbone network, which is a pre-trained convolutional neural network (such as ResNet) used to extract feature maps of the input image. The input image can be obtained by converting the second intermediate file into an image.
[0120] The encoder layer is a Transformer encoder that receives feature maps from the backbone network and encodes them to capture global context. The encoder layer consists of multiple identical layers, each of which contains a multi-head self-attention mechanism and a feed-forward neural network.
[0121] The decoder layer is a Transformer decoder that combines the encoder output with a set of learned positional embeddings to generate the final target prediction. The decoder layer is composed of multiple identical layers, but unlike the encoder layer, it also includes a multi-head attention mechanism to focus on the encoder layer output.
[0122] The output layer is the prediction head, which is used to generate the category and bounding box of each object based on the output of the decoder. The output layer usually consists of two branches, one for classification and the other for regression bounding box.
[0123] In some embodiments, the splitting model can be implemented by fine-tuning an existing splitting model in the prior art. Specifically, obtain an existing splitting model in the prior art, and obtain a data set specifically annotated for resume layout, wherein the data set includes the category and bounding box of each page in the resume layout. The splitting model of the embodiment of the present invention can be obtained by fine-tuning the existing splitting model using the data in the data set. Since the existing splitting model has been trained on a large amount of general data, it has good feature extraction capabilities. By fine-tuning the data set specifically annotated for resume layout, better results can be achieved with limited data. Since the resume structure is fixed but complex, fine-tuning can allow the model to better understand these specific patterns.
[0124] When annotating a dataset, it is necessary to ensure that the layout within the annotated area is a linear layout.
[0125] Figure 6 Schematic diagram of the splitting result of the embodiment of the present invention. Figure 3 Take the resume shown as an example to illustrate. After the resume is split by the splitting model, we can get Figure 6 The sub-area A1 and sub-area A2 are shown. Sub-area A1 is on the left, and sub-area A2 is on the right.
[0126] Among them, after splitting, sub-area A1 is linearly arranged, and sub-area A2 is also linearly arranged.
[0127] Step S500: Generate text content corresponding to the target resume based on the sub-region and the text block.
[0128] In this embodiment, after obtaining the sub-region and the text block, the text content corresponding to the target resume can be generated according to the sub-region and the text block.
[0129] Specifically, Figure 7 This is a flowchart of obtaining text content according to an embodiment of the present invention. Figure 7 As shown, generating the text content corresponding to the target resume according to the sub-region and the text block includes the following steps:
[0130] Step S510: Sort the sub-regions according to a predetermined sub-region sorting rule to obtain a first sorting result.
[0131] In this embodiment, after the sub-regions are obtained by splitting the model, the sub-regions are sorted according to a predetermined sub-region sorting rule. The predetermined sorting rule may be from top to bottom or from left to right. Figure 6 In the example shown, sub-areas A1 and A2 are arranged left to right, not up to down. Therefore, after sorting sub-areas A1 and A2 from left to right, sub-area A1 should be ranked before A2. That is, the first sorting result is A1, A2.
[0132] Step S520: Sort the text blocks in each sub-region according to a predetermined text block sorting rule to obtain a second sorting result.
[0133] In this embodiment, each sub-region may include one or more text blocks, and the text blocks in each sub-region are sorted according to a predetermined text block sorting rule, wherein the predetermined text block sorting rule may be from top to bottom and from left to right.
[0134] Figure 8 Schematic diagram of a text block according to an embodiment of the present invention. Figure 6 The sub-areas shown in the figure are used as an example to illustrate the text blocks in each sub-area. Figure 8 shown.
[0135] The sub-area A1 includes five text blocks, namely C1, C2, C3, C4 and C5.
[0136] Sub-area A2 includes two text blocks, C6 and C7.
[0137] The five text blocks in the sub-area A1 are distributed one by one from top to bottom. Therefore, the order of the five text blocks is C1, C2, C3, C4, and C5.
[0138] For the two text blocks in the sub-area A2, they are distributed one by one from top to bottom. Therefore, the order of the two text blocks is C6 and C7.
[0139] Step S530: Generate text content corresponding to the target resume based on the first sorting result and the second sorting result.
[0140] In this embodiment, after obtaining the first sorting result and the second sorting result, the first sorting result and the second sorting result are combined to obtain text content.
[0141] Specifically, Figure 8 The generated text content is as follows: Figure 9 shown.
[0142] In this way, resumes in different formats and layouts can be converted into text content in a unified format and layout.
[0143] In some embodiments, in order to improve processing efficiency, an index may be generated for the fields in the first intermediate file.
[0144] Specifically, an index can be generated for each paragraph. Figure 10 shown.
[0145] Therefore, for resumes in PDF format, the PDF file is converted to an image format (such as PNG or JPEG) for subsequent image processing and OCR operations. At the same time, metadata is extracted from the PDF, including the text content and its corresponding coordinate locations (bounding box). This metadata can quickly locate text blocks (text objects) in the PDF. To distinguish between text areas and image areas in the PDF, embodiments of the present invention use the text object block coordinates in the metadata to mark these areas as black rectangles in the image. Thus, the unmarked areas are the image areas. For the detected image areas, embodiments of the present invention use OCR (such as OneDoc) to extract the text content and map it back to the corresponding location in the metadata. The OCR-extracted image text is then merged with the text content in the PDF metadata to form a unified content set. This step ensures that all text information in the resume is fully captured. Finally, the split model detects sub-areas and divides the entire page into several sub-areas. Each sub-area can be a paragraph, a table, an image, etc. These sub-areas are sorted from top to bottom and from left to right. Within each sub-area, the text blocks contained within are further sorted. This sorting follows the same top-to-bottom, left-to-right principle. This sorting method forms a recursive tree structure: the sorting between sub-areas forms the first level, and the sorting of text blocks within a sub-area forms the second level. After the layout is rearranged and the text content is generated, the next step is to extract the key elements of the resume.
[0146] Step S600: extract target information from the text content using a pre-acquired text processing model.
[0147] In this embodiment, the text processing model is a Large Language Model (LLM). The target information can be divided into any one or more of basic information, work experience, project experience, and educational experience.
[0148] Among them, basic information includes: name, phone number, age, email address, gender, desired work city, current work location, etc.
[0149] Work experience includes: company name, position title, time frame, job description, etc.
[0150] Project experience includes: project name, time frame, role description, project description, etc.
[0151] Educational experience includes: school name, institution name, major name, time range, academic qualifications, etc.
[0152] In some embodiments, pre-edited prompts and text content can be input into a large language model, which then extracts target information from the text content based on the prompts, wherein the prompts are used to guide the large language model to generate specific content.
[0153] In some embodiments, a large language model may be used to generate an agent, which extracts target information from text content.
[0154] In an optional implementation, the target information includes a target field. In this case, the text content processed by the text processing model can be text content without adding an index, or text content with adding an index.
[0155] For example, if a large language model is needed to extract work experience from a resume, the output of the large language model can be:
[0156] “Company name: xxx;
[0157] Start time: xxx;
[0158] End time: xxx;
[0159] Position: xxx;
[0160] Job Description: xxxx. "
[0161] In another optional implementation, the target information includes a target field and / or an index of the target field. In this case, the text content processed by the text processing model is the indexed text content. Specifically, in response to the number of words in the target field being less than or equal to a predetermined threshold, the target field is extracted. In response to the number of words in the target field being greater than a predetermined threshold, the index of the target field is extracted. For example, if a large language model is required to extract work experience from a resume, the output of the large language model may be:
[0162] “Company name: xxx;
[0163] Start time: xxx;
[0164] End time: xxx;
[0165] Position: xxx;
[0166] Job Description: [27, 30].
[0167] When outputting the index of the target field, the output internally represents the paragraph interval. For example, [27, 30] indicates that the relevant field includes paragraphs 27, 28, 29, and 30. Therefore, for longer fields (such as job descriptions and project descriptions), using an indexing approach and having the large speech model return the index interval instead of directly outputting the full long text can significantly reduce the number of output tokens and improve the efficiency of information extraction.
[0168] It should be noted that the target information output by the large language model shown above is only an example of the embodiment of the present invention, and the format of the target information output by the large language model in the embodiment of the present invention is not limited. For example, the target information output by the large language model can be in JSON format. As an example, the target information is as follows:
[0169]
[0170] In some embodiments, the text processing model includes multiple threads, each thread is used to extract different types of target information. Wherein, extracting the target information from the text content using the pre-acquired text processing model includes: each thread extracting the target information from the text content in parallel.
[0171] Specifically, to further improve efficiency, this embodiment of the present invention separates the four components (basic information, work experience, project experience, and educational history) into four independent threads, each of which uses the large speech model for extraction. Experiments have shown that separate processing yields higher accuracy than combined processing, thereby improving both efficiency and accuracy.
[0172] The embodiments of the present invention adopt a method based on a large language model, combined with layout understanding and multimodal processing technology, which can better meet these challenges and provide more flexible, accurate and intelligent resume parsing capabilities.
[0173] The embodiment of the present invention obtains a target resume, extracts text blocks from the target resume, converts the target resume into an image, and then uses a pre-acquired segmentation model to segment the image into linear sub-regions. Based on the sub-regions and text blocks, the text content corresponding to the target resume is generated. The pre-acquired text processing model is then used to extract target information from the text content. This allows for accurate and comprehensive identification of various information within a resume, improving the accuracy of identifying and parsing emerging positions, complex expressions, and multimodal information. This significantly enhances the system's adaptability to diverse, non-standardized resumes, reduces reliance on manual rule-setting and large-scale annotated data, and reduces system maintenance costs.
[0174] Figure 11 Schematic diagram of an information extraction device according to an embodiment of the present invention. Figure 11As shown, the information extraction device of the embodiment of the present invention includes a target resume acquisition unit 111, a text block extraction unit 112, an image conversion unit 113, a sub-region splitting unit 114, a text content generation unit 115 and a target information extraction unit 116. Among them, the target resume acquisition unit 111 is used to obtain the target resume. The text block extraction unit 112 is used to extract the text blocks in the target resume. The image conversion unit 113 is used to convert the target resume into an image. The sub-region splitting unit 114 is used to split the image into sub-regions using a pre-acquired splitting model, and each sub-region is linearly arranged. The text content generation unit 115 is used to generate text content corresponding to the target resume based on the sub-regions and the text blocks. The target information extraction unit 116 is used to extract target information from the text content using a pre-acquired text processing model.
[0175] The embodiment of the present invention obtains a target resume, extracts text blocks from it, converts the target resume into an image, uses a pre-acquired segmentation model to segment the image into linear subregions, generates text content corresponding to the target resume based on the subregions and text blocks, and extracts target information from the text content using a pre-acquired text processing model. This allows for accurate and comprehensive recognition of various information within a resume, enhances adaptability to diverse and non-standardized resumes, and reduces system maintenance costs.
[0176] Figure 12 Schematic diagram of an electronic device according to an embodiment of the present invention. In this embodiment, the electronic device 12 includes a server, a terminal, etc. Figure 12 As shown, the electronic device 12: includes at least one processor 121; and a memory 122 communicatively connected to the at least one processor 121; and a communication component 123 communicatively connected to the scanning device, and the communication component 123 receives and sends data under the control of the processor 121; wherein the memory 122 stores instructions that can be executed by the at least one processor 121, and the instructions are executed by the at least one processor 121 to implement the above-mentioned information extraction method.
[0177] Specifically, the electronic device includes: one or more processors 121 and a memory 122, Figure 12 In the example, a processor 121 is used. The processor 121 and the memory 122 may be connected via a bus or other means. Figure 12 In the example above, a bus connection is used. Memory 122, as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer executable programs, and modules. Processor 121 executes the non-volatile software programs, instructions, and modules stored in memory 122 to perform various functional applications and data processing of the device, thereby implementing the above-mentioned information extraction method.
[0178] The memory 122 may include a program storage area and a data storage area, wherein the program storage area may store an operating system and applications required for at least one function; the data storage area may store a list of options, etc. In addition, the memory 122 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other non-volatile solid-state storage device. In some embodiments, the memory 122 may optionally include a memory remotely located relative to the processor 121, and these remote memories may be connected to an external device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0179] One or more modules are stored in the memory 122 , and when executed by one or more processors 121 , perform the information extraction method in any of the above method embodiments.
[0180] The above-mentioned product can execute the method provided in the embodiment of this application, and has the functional modules and beneficial effects corresponding to the execution method. For technical details not fully described in this embodiment, please refer to the method provided in the embodiment of this application.
[0181] The embodiment of the present invention obtains a target resume, extracts text blocks from it, converts the target resume into an image, uses a pre-acquired segmentation model to segment the image into linear subregions, generates text content corresponding to the target resume based on the subregions and text blocks, and extracts target information from the text content using a pre-acquired text processing model. This allows for accurate and comprehensive recognition of various information within a resume, enhances adaptability to diverse and non-standardized resumes, and reduces system maintenance costs.
[0182] Another embodiment of the present invention relates to a non-volatile storage medium for storing a computer-readable program, wherein the computer-readable program is used to enable a computer to execute part or all of the above method embodiments.
[0183] That is, those skilled in the art will understand that all or part of the steps in the above-mentioned embodiments can be implemented by instructing the relevant hardware through a program, which is stored in a storage medium and includes a number of instructions for causing a device (which may be a single-chip microcomputer, chip, etc.) or a processor to execute all or part of the steps of the methods described in the embodiments of the present application. The aforementioned storage medium includes: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, etc., various media that can store program code.
[0184] The foregoing is merely a preferred embodiment of the present application and is not intended to limit the present application. Persons skilled in the art will readily appreciate that various modifications and variations are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present application are intended to be within the scope of protection of the present application.
Claims
1. An information extraction method, characterized in that: The method comprises: Get targeted resumes; extracting a text block from the target resume; Convert said target resume into an image; Splitting the image using a pre-acquired splitting model to obtain sub-regions, each of the sub-regions being linearly arranged; Generating text content corresponding to the target resume according to the sub-region and the text block; Target information is extracted from the text content using a pre-acquired text processing model.
2. The method according to claim 1, characterized in that Extracting the text block from the target resume includes: In response to the target resume being in a format of a portable document format (PDF), determining a text area in the target resume; Determining the image area of the target resume according to the text area; Determine the text content and coordinate position in the image area; generating a first intermediate file according to the text content and coordinate positions of the text area and the image area; A text block in the target resume is obtained from the first intermediate file.
3. The method according to claim 2, characterized in that Determining the text area in the target resume includes: Obtaining the coordinate position of each word in the target resume; The text area is determined according to the coordinate position of the text in the target resume.
4. The method according to claim 2, characterized in that Determining the image area of the target resume based on the text area includes: The area in the target resume except the text area is determined as the picture area.
5. The method according to claim 2, characterized in that Determining the text content and coordinate position in the image area includes: Obtaining text content in the image area through optical character recognition (OCR); Determine the coordinate position of the text content in the target resume.
6. The method according to claim 1, wherein Generating text content corresponding to the target resume according to the sub-region and the text block includes: sorting the sub-regions according to a predetermined sub-region sorting rule to obtain a first sorting result; sorting the text blocks in each sub-region according to a predetermined text block sorting rule to obtain a second sorting result; Generate text content corresponding to the target resume based on the first sorting result and the second sorting result.
7. The method according to claim 1, characterized in that The method further comprises: Generate indexes for fields in the text content.
8. The method according to claim 7, characterized in that The target information includes a target field and / or an index of a target field.
9. The method according to claim 8, characterized in that The extracting target information from the text content by using a pre-acquired text processing model includes: extracting the target field in response to the word count of the target field being less than or equal to a predetermined threshold; In response to the word count of the target field being greater than a predetermined threshold, an index of the target field is extracted.
10. The method according to claim 1, characterized in that The text processing model includes multiple threads, each thread is used to extract different types of target information; The extracting target information from the text content by using a pre-acquired text processing model includes: Each thread extracts target information from the text content in parallel.
11. An information extraction device, characterized in that: The device comprises: A target resume obtaining unit, used for obtaining a target resume; A text block extraction unit, configured to extract text blocks from the target resume; A picture conversion unit, used to convert the target resume into a picture; A sub-region splitting unit, configured to split the image using a pre-acquired splitting model to obtain sub-regions, each of the sub-regions being arranged linearly; A text content generating unit, configured to generate text content corresponding to the target resume according to the sub-region and the text block; The target information extraction unit is configured to extract target information from the text content using a pre-acquired text processing model.
12. An electronic device comprising a memory and a processor, characterized in that: The memory is configured to store one or more computer program instructions, wherein the one or more computer program instructions are executed by the processor to implement the method according to any one of claims 1 to 10.
13. A computer program product comprising a computer program, characterized in that When the computer program is run on a computer, the computer executes the method according to any one of claims 1 to 10.
14. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: The computer program instructions implement the method according to any one of claims 1 to 10 when executed by a processor.