Data processing method and device, electronic equipment, storage medium and program product
By filtering and matching the format feature information of text lines in layout analysis, the problem that rule-based layout analysis technology cannot identify all sections is solved, thus improving the accuracy of entity relationship extraction and the accuracy of text information.
Patent Information
- Application Number
- CN202310081628.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-01-13
- Publication Date
- 2025-11-18
- Estimated Expiration
- 2043-01-13
AI Technical Summary
Rule-based layout analysis techniques struggle to fully identify all sections of text, leading to the omission of some sections and affecting the accuracy of subsequent entity relation extraction.
By obtaining the first text line in the text to be processed that matches the target information, the second text line that meets the preset conditions is filtered out, the third text line is matched based on its format feature information, and the fourth text line is further filtered out as an information extraction condition through the second preset conditions, and supplementary rules are used to extract unrecognizable section information.
This improved the accuracy of the subsequent entity relationship extraction process, ensuring the accuracy of the final extracted text information.
Smart Images

Figure CN115965002B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a data processing method and device, electronic equipment, storage medium and program product. BACKGROUND
[0002] Layout analysis is applied in text analysis, and through layout analysis, text lines representing the same type of content can be divided into a block. At present, a rule-based layout analysis technology is usually used to realize layout analysis of text.
[0003] However, due to the various writing formats of text, the names of the same block in different texts are also different, and the rule-based layout analysis technology is difficult to comprehensively identify all block information, and some blocks are easily missed. SUMMARY
[0004] Therefore, the present disclosure aims to provide a data processing method and device, electronic equipment, storage medium and program product.
[0005] To achieve the above purpose, a first aspect of the present disclosure provides a data processing method, comprising:
[0006] obtaining at least one first text line in the to-be-processed text matching target information;
[0007] obtaining a second text line meeting a first preset condition from the at least one first text line, and obtaining format feature information of the second text line;
[0008] obtaining at least one third text line in the to-be-processed text matching the format feature information of the second text line;
[0009] obtaining a fourth text line meeting a second preset condition in the at least one third text line, and determining an information extraction condition of the to-be-processed text based on the fourth text line and the first text line.
[0010] In some embodiments, the obtaining at least one first text line in the to-be-processed text matching target information comprises:
[0011] matching any text line in the to-be-processed text with the target information obtained in advance, and when any text line is the same as the target information, the text line is confirmed as the first text line.
[0012] In some embodiments, the first preset condition comprises a confidence level, and the obtaining a second text line meeting a first preset condition from the at least one first text line comprises:
[0013] Confirm at least one text line with the highest confidence in the at least one first text line as the second text line.
[0014] In some embodiments, the format feature information of the second text line includes at least one of a font color, a font name, a font size, whether the font is bold, whether the font is italic, and whether the font has an underline.
[0015] In some embodiments, obtaining at least one third text line in the to-be-processed text that matches the format feature information of the second text line includes:
[0016] Obtaining format feature information of each text line in the to-be-processed text;
[0017] Matching the format feature information of each text line with the format feature information of the second text line to determine whether the format feature information of each text line is the same as the format feature information of the second text line;
[0018] When the format feature information of the text line is the same as the format feature information of the second text line, the text line is confirmed as the third text line.
[0019] In some embodiments, the obtaining of the fourth text line in the third text line that satisfies a second preset condition includes:
[0020] Determining a text line in the third text line with text content that meets a preset condition as the fifth text line;
[0021] Determining a text line in the fifth text line with a relationship between the text lines that meets a preset condition as the fourth text line.
[0022] In some embodiments, the text content of the third text line meets a preset condition, including at least one of:
[0023] The text content of the third text line does not include a preset named entity;
[0024] The text length of the third text line is less than or equal to a first preset value;
[0025] The alignment of the third text line is the same as that of the first text line;
[0026] The third text line does not include a punctuation symbol, or the third text line and the first text line include the same punctuation symbol;
[0027] The text content of the third text line is of a preset language type, and the text content of the third text line includes at least one of the following: a word quantity less than or equal to a second preset value, including a character or a letter matching the preset language type, and not including a character, a letter, or a number not matching the preset language type.
[0028] In some embodiments, the relationship between each text line in the fifth text line meets a preset condition, including at least one of the following:
[0029] There is no first text line within a preset number of lines away from any of the fifth text lines;
[0030] The text content of any two text lines in the fifth text line is different;
[0031] The total number of the fifth text lines is less than or equal to a third preset value.
[0032] A second aspect of the present disclosure provides a data processing apparatus, comprising:
[0033] A reference information acquisition module configured to acquire at least one first text line matching target information in a to-be-processed text;
[0034] A format feature acquisition module configured to acquire a second text line meeting a first preset condition from the at least one first text line, and obtain format feature information of the second text line;
[0035] A feature matching module configured to acquire at least one third text line matching the format feature information of the second text line in the to-be-processed text;
[0036] A determination module configured to acquire a fourth text line meeting a second preset condition in the at least one third text line, and determine an information extraction condition of the to-be-processed text based on the fourth text line and the first text line.
[0037] A third aspect of the present disclosure provides an electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of the first aspect of the present disclosure when executing the program.
[0038] A fourth aspect of the present disclosure provides a non-transitory computer readable storage medium, which stores computer instructions for causing the computer to execute the method of the first aspect.
[0039] The fifth aspect of the present disclosure provides a computer program product comprising computer program instructions, characterized in that the computer program instructions, when executed on a computer, cause the computer to perform the method of the first aspect.
[0040] As can be seen from the above, the data processing method, device, electronic device, storage medium and program product provided by the present disclosure, after obtaining the to-be-processed text, first filter out the first text line based on the preset target information, that is, the rule-based section title, obtain the second text line which best represents the section title, match each text line of the to-be-processed text based on the format feature information of the second text line, thereby selecting the text line, that is, the third text line, which matches the format feature information of the second text line, and then removing the text line in the third text line which does not meet the requirement to obtain the fourth text line, and then combining the fourth text line and the first text line as the subsequent entity relationship extraction condition, thereby effectively supplementing the section information which cannot be recognized by rule extraction, ensuring the accuracy of the subsequent entity relationship extraction process, and making the accuracy of the finally extracted text information higher. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the present disclosure or the related art, the drawings needed to be used in the embodiments or the related art description will be briefly introduced. Obviously, the drawings in the following description are only embodiments of the present disclosure, and other drawings can be obtained by those skilled in the art without creative labor.
[0042] Figure 1A A schematic diagram of an example to-be-processed text is shown.
[0043] Figure 1B A schematic diagram of an example to-be-processed text is shown.
[0044] Figure 2 A flowchart of an example method is shown.
[0045] Figure 3 A schematic diagram of an example device provided by an embodiment of the present disclosure is shown.
[0046] Figure 4 A hardware structure schematic diagram of an example computer device provided by an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below with reference to specific embodiments and drawings.
[0048] It should be noted that, unless otherwise defined, technical terms or scientific terms used in the embodiments of the present disclosure shall have the common meaning understood by one of ordinary skill in the art to which the present disclosure belongs. The terms "first", "second", and similar terms used in the embodiments of the present disclosure do not denote any order, quantity, or importance, but are used to distinguish different components. The terms "include", "contain", and similar terms mean that the elements or objects before the terms encompass the elements or objects listed after the terms and their equivalents, and do not exclude other elements or objects. The terms "connect" or "connected" and similar terms are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. The terms "upper", "lower", "left", "right", and the like are used only to represent relative positional relationships, and when the absolute positions of the described objects are changed, the relative positional relationships can also be changed accordingly.
[0049] Information extraction (IE) is an important work in natural language processing (NLP). Information extraction can be understood as: according to user needs, through certain technical means, extracting shorter content meeting the needs from longer text. For example, the user needs to extract "desired position content" from a resume, and the process of using certain technical means to achieve this requirement is called information extraction.
[0050] Alternatively, a text format resume can also be converted into a structured resume through information extraction, thereby facilitating the management and use of the resume.
[0051] As a link in the parsing process of a resume and the like, layout analysis can divide text lines representing the same type of content into a block, for example, text lines describing education experience are divided into an education block, text lines describing work experience are divided into a career block, and text lines describing personal information are divided into a basic_info block. Such division greatly helps the final entity relation extraction.
[0052] At present, a rule-based layout blocking technology is usually used to identify various block information. The core is to collect a large number of block titles, and then identify the titles in the resume and the like based on the collected block titles, and divide the text between the title and the next title into a block, thereby realizing layout analysis.
[0053] However, since the writing format and title naming of the resume vary from person to person, it is difficult to collect all possible title names, which will lead to missed identification of part of the blocks based on the rule-based layout blocking technology, so that an independent block is divided into another block. For example, in the following text, the "education" block is divided into the "career" block.Figure 1A As shown in the resume, the title of each section is named normally, and a rule-based manner can correctly divide the resume into sections. However, as shown in the resume, the title name of the education experience "Education Stage Introduction" does not appear in the pre-collected rule titles, which will lead to the failure of the education experience module recognition, and further divide the education experience into the work experience module, which will greatly affect the subsequent entity relationship extraction. Figure 1B As shown in the resume, the title of each section is named normally, and a rule-based manner can correctly divide the resume into sections. However, as shown in the resume, the title name of the education experience "Education Stage Introduction" does not appear in the pre-collected rule titles, which will lead to the failure of the education experience module recognition, and further divide the education experience into the work experience module, which will greatly affect the subsequent entity relationship extraction.
[0054] Therefore, the embodiment of the present disclosure provides a data processing method to solve the above problems. As shown in the method, the method comprises the steps of: Figure 2 As shown in the method, the method comprises the steps of:
[0055] In step S101, at least one first text line matching target information in the to-be-processed text is obtained.
[0056] The to-be-processed text can be any text with information extraction requirements. The type of the to-be-processed text can include a resume, an air transport single, an invoice, etc. The to-be-processed text can have a template, and the template of the to-be-processed text can be determined by the title name and specific content of each section in the text, such as Figure 1A As shown in the title name, the title name can be substrate information, work experience, education experience, etc., and the specific content can be the content corresponding to each title name, for example, the specific content corresponding to the substrate information can include name, phone, email, etc., and the specific content corresponding to the work experience can include the company, the position, the working time, etc. The embodiment is not limited in this regard.
[0057] The to-be-processed text belonging to the same type can have different templates. For example, different countries usually use different templates for air transport single. For example, a resume can have different templates. The embodiment of the present application does not limit the type of the to-be-processed text, nor does it limit the template of the to-be-processed text.
[0058] In one example, for a paper resume, the user can use the terminal to take a picture of the paper resume, and obtain a picture. The terminal performs character recognition on the picture, and thus translates the information on the paper resume into computer text. For example, the terminal can use optical character recognition (OCR) technology to translate the information on the paper resume into computer text. The text containing the computer text can be used as the to-be-processed text in step S101.
[0059] The target information can be information pre-acquired by the user, for example, a large number of section titles pre-collected by the user. Taking a resume as an example, the user can pre-collect the title names of each section in various resume templates as target information, including: basic information, work experience, education experience, skills, etc.
[0060] When the text to be processed is obtained, each text line of the text to be processed can be matched with the target information, so as to obtain one or more first text lines matched with the target information. These first text lines are the rule-based section titles.
[0061] In step S103, a second text line satisfying a first preset condition is obtained from at least one of the first text lines, and format feature information of the second text line is obtained.
[0062] In this embodiment, the rule-based extracted section titles are not necessarily all correct, that is, there can be text lines that are not title names in the first text lines obtained in step S101, so it is necessary to select text lines that are most likely to be title names from the rule-based extracted section titles, that is, the first text lines. Therefore, after the first text lines are obtained, a second text line satisfying a first preset condition can be selected from the first text lines, and the first preset condition is used to select text lines that are most likely to be title names from the first text lines.
[0063] Generally, in the text to be processed such as a resume, the format of the title name is usually different from that of the specific content, so the title name and the specific content can be distinguished based on the format, and then the extraction of the section title name is realized. Therefore, in this embodiment, the format feature information of the second text line can be obtained by feature extraction and the like.
[0064] The second text line can be selected from the first text lines, and then the format feature information of each second text line is obtained; or the format feature information of each first text line can be obtained first, and then the second text line and the format feature information of the second text line are selected, and this embodiment does not limit this.
[0065] In step S105, at least one third text line in the text to be processed that matches the format feature information of the second text line is obtained.
[0066] Since the format of the title name is usually different from that of the specific content, and the second text line is the text line that is most likely to be a title name in the first text lines, the text line in the text to be processed that matches the format feature information of the second text line is very likely to be a text line where the title name is located.
[0067] Therefore, in this step, the format feature information of each text line in the text to be processed can be obtained, the format feature information of each text line is matched with the format feature information of the second text line, and a third text line that matches successfully is obtained, and the text content of the third text line is very likely to be a title name.
[0068] In step S107, a fourth text line satisfying a second preset condition is obtained from the at least one third text line, and an information extraction condition of the to-be-processed text is determined based on the fourth text line and the first text line.
[0069] In this embodiment, since there are still text lines in the third text lines that may not be title names, the third text lines can be further screened based on the second preset condition. The second preset condition can be used to determine whether the text content of the third text line conforms to the naming rules of the title, and / or the second preset condition is used to determine whether the relationship between the third text lines or the relationship between the third text line and the first text line (i.e., the rule-based section title) conforms to the naming rules of the title.
[0070] Therefore, based on the second preset condition, the text lines whose text content does not conform to the naming rules of the title can be excluded, and the text line satisfying the second preset condition, i.e., the fourth text line, is obtained. Finally, the fourth text line and the first text line can be used as the information extraction condition of the to-be-processed text, and the to-be-processed text is further divided based on the information extraction condition, and then the subsequent entity relationship extraction is realized.
[0071] In this embodiment, after obtaining the to-be-processed text, the first text line (i.e., the rule-based section title) is screened based on the preset target information, the second text line that best represents the section title is obtained, each text line of the to-be-processed text is matched based on the format feature information of the second text line, and the text line (i.e., the third text line) matching the format feature information of the second text line is selected. The fourth text line is obtained by removing the text line in the third text line that does not conform to the requirement, and the combination of the fourth text line and the first text line is used as the subsequent entity relationship extraction condition, so that the rule extraction cannot identify the section information, the accuracy of the subsequent entity relationship extraction process is ensured, and the accuracy of the finally extracted text information is higher.
[0072] In some embodiments, the obtaining, in step S101, of the at least one first text line matching the target information in the to-be-processed text comprises: matching any text line in the to-be-processed text with the target information obtained in advance, and when the text line is the same as the target information, the text line is confirmed as the first text line.
[0073] In this embodiment, the user can collect a large number of section titles in advance and store them as target information. In this way, when the to-be-processed text is obtained, each text line in the to-be-processed text can be identified, and each text line can be matched with the target information. If the text line is the same as any section title in the target information, the text line is confirmed as the first text line, so that the rule-based section title is obtained.
[0074] For example, when the target information includes the title names of the four sections of basic information, work experience, education experience, and skills, as shown in Figure 1A The title names of the four sections in the to-be-processed resume text shown in Figure 1B The title names of the three sections of basic information, work experience, and skills in the to-be-processed resume text shown in
[0075] In some embodiments, the first preset condition includes a confidence level. The step S101 of obtaining the second text line satisfying the first preset condition from the at least one first text line includes: confirming at least one text line with the highest confidence level in the at least one first text line as the second text line.
[0076] In this embodiment, the section title extracted based on the rules is not necessarily correct in all aspects, and therefore the confidence levels of the first text lines are calculated, and the N first text lines with the highest confidence levels are found as the reference basis, i.e., the second text line. The N can be selected as needed.
[0077] When the to-be-processed text is a to-be-processed resume text, the title names of the education experience section and the work experience section can be selected as the second text line, and the title names of the education experience section and the work experience section are used as the reference basis to obtain the format feature information thereof, so as to realize the subsequent title name screening.
[0078] In some embodiments, the format feature information of the second text line includes at least one of the font color, the font name, the font size, whether the font is bold, whether the font is italic, whether the font has an underline, and the like.
[0079] In this embodiment, a template can be generated based on the format feature information of the second text line. In some specific embodiments, the format of the template can be fontColor_fontName_fontSize_bold_form, where fontColor represents the font color, fontName represents the font name, fontSize represents the font size, bold represents whether the font is bold, and form represents the category. For example, as shown in Figure 1B The title name "work experience" of the work experience section can be used as the reference basis, and a template is generated based on the format feature information of "work experience".
[0080] After the template of the second text line is generated, each text line in the to-be-processed text can be judged based on the template to determine whether it matches the template.
[0081] In some embodiments, step S105, obtaining at least one third text line in the text to be processed that matches the format feature information of the second text line, includes:
[0082] Step S201: Obtain the format feature information of each text line in the text to be processed.
[0083] Step S203: Match the format feature information of each text line with the format feature information of the second text line to determine whether the format feature information of each text line is the same as the format feature information of the second text line.
[0084] Step S205: When the format feature information of the text line is the same as the format feature information of the second text line, the text line is confirmed as the third text line.
[0085] In this embodiment, the format feature information of each text line in the text to be processed is extracted, and the format feature information of each text line is matched with the format feature information of the second text line. When the format feature information of a text line is the same as that of the second text line, it means that the format of the text line is the same as that of the second text line, and the text line is very likely a title; when the format feature information of a text line is different from that of the second text line, it means that the format of the text line is different from that of the second text line, and the text line is most likely not a title.
[0086] like Figure 1B As shown, when the format characteristics of "Introduction to Education Stages" are the same as those of "Work Experience" which serves as a reference, then "Introduction to Education Stages" is likely to be the title.
[0087] Optionally, in this embodiment, a template for each text line can be generated based on the format feature information of each text line in the text to be processed, and then the templates of each text line can be compared with the template of the second text line, and the text line with the same template can be selected as the third text line.
[0088] In this embodiment, if a third text line with the same format as the text line already identified as the title can be obtained from the text to be processed, then the third text line is very likely the title.
[0089] In some embodiments, since there may still be text lines in the third text line that are not title names, the third text lines can be further filtered based on the second preset conditions. Specifically, it can be determined whether the text content of the third text line conforms to the naming rules for title names, and / or whether the relationship between multiple third text lines or the relationship between the third text line and the first text line (i.e., the rule-based section title) conforms to the naming rules, in order to determine whether each third text line is a title name.
[0090] In the embodiment, the obtaining the fourth text line satisfying the second preset condition in the third text line in step S107 comprises: determining a text line with text content in the third text line meeting a preset condition as the fifth text line; and determining a text line with a relationship between each text line in the fifth text line meeting a preset condition as the fourth text line.
[0091] In the embodiment, the text content in the third text line meeting the preset condition comprises at least one of the following: the text content of the third text line does not include a preset named entity; a text length of the third text line is less than or equal to a first preset value; an alignment mode of the third text line is the same as that of the first text line; the third text line does not include a punctuation symbol or the third text line and the first text line include the same punctuation symbol; and the text content of the third text line is a preset language type, and the text content of the third text line includes at least one of a word number less than or equal to a second preset value, a letter or a character matching the preset language type, a character, a letter or a number not matching the preset language type.
[0092] The named entity refers to an entity with specific meaning in the text, or a thing that can be identified by a proper noun (or name). One named entity generally represents a unique specific thing individual, which can include a person name, a place name, an organization name or other proper nouns, and the like. In addition, the title name generally does not have a named entity, so when the text content of a third text line includes a named entity, it is definitely not a title name.
[0093] The text length of the third text line is obtained based on a difference between left and right boundary coordinate values of the text line, rather than being determined according to the number of words. Generally, the text length of the title name is relatively short. When the number of words of a text line is small, but there are a series of spaces in the middle, the text length of the third text line is relatively long. In this case, the text line is generally not a title name. Therefore, when the text length of the third text line is greater than a first preset value, it is not a title name, and thus the third text line needs to be deleted. The value of the first preset value can be set based on the type of the text to be processed and the like, which is not limited in the embodiment.
[0094] In the same text to be processed, the alignment mode of the title name is generally the same. For example, under the premise that the text to be processed is not left-right layout, if the determined title name (i.e., the first text line) is left-aligned, other title names should also be left-aligned. Therefore, it is necessary to determine whether the third text line is left-aligned. If the third text line is left-aligned, it can be a title name. If the third text line is not left-aligned, it is not a title name, and thus the third text line needs to be deleted.
[0095] Normally, titles do not contain punctuation. In such cases, if a third text line contains punctuation, it is not a title. However, in some situations, titles may contain punctuation, such as "I. Basic Information". When titles contain punctuation, the punctuation in titles within the same text file should be identical. In this case, if the third text line contains the same punctuation as the first text line, it is likely a title; however, if the third text line contains different punctuation, it is not a title and should be deleted.
[0096] When a title is named in a preset language type, its text content also follows preset rules. Taking English as an example, since each English word (e.g., experience, education, etc.) may correspond to multiple Chinese characters, the number of words in an English title will not be too large. If the number of words exceeds a second preset value (e.g., 5), then the third text line is likely not a title. If the third text line does not contain characters or letters matching the preset language type—for example, if the title is named in English but the third text line does not contain letters—then it is not a title. If the third text line includes characters, letters, or numbers that do not match the preset language type—for example, if the title is named in English but the third text line contains numbers—then it is likely not a title and should be deleted.
[0097] In this embodiment, after deleting text lines that do not meet the above preset conditions, the remaining text line in the third text line (i.e., the fifth text line) may be the title name. In this embodiment, the above preset conditions can be set according to actual needs. For example, the text content of the third text line can be set to meet one or more of the preset conditions to be used as the fifth text line, or the text content of the third text line can be set to meet all the preset conditions to be used as the fifth text line. This embodiment does not impose any restrictions on this.
[0098] In some embodiments, the relationship between the text lines in the fifth text line meets preset conditions, including at least one of the following: the first text line does not exist within a preset number of lines separated from any of the fifth text lines; the text content of any two text lines in the fifth text line is different; the total number of the fifth text lines is less than or equal to a third preset value.
[0099] The preset number of lines can be 2. The fifth text line is not a title if the fifth text line is not located between two lines of title. In this embodiment, each section usually includes a title and specific content. Therefore, if the fifth text line is adjacent to a title, the fifth text line is not a title, and thus the fifth text line needs to be deleted.
[0100] The same section and title do not exist in the same text. Therefore, if the text content of any two text lines in the fifth text line is the same, the fifth text line is not a title, and thus the fifth text line needs to be deleted.
[0101] The number of sections in the same text is usually not too large. After the above operation, if the fifth text line is still greater than the third preset value (for example, 4), the remaining fifth text line is not a title, and thus all the remaining fifth text lines are deleted.
[0102] In this embodiment, after the text lines that do not meet the preset conditions are deleted, the remaining text lines in the fifth text line (that is, the fourth text line) can be a title. In this embodiment, the preset conditions can be set according to actual needs. For example, the text content of the fifth text line needs to meet one or more conditions to be a fourth text line, or the text content of the fifth text line needs to meet all the preset conditions to be a fourth text line. This embodiment does not limit this.
[0103] After the fourth text line is determined, the fourth text line and the first text line are used as a title, which is used as a condition for subsequent entity relation extraction. This can effectively supplement the sections missed by the rules, so that the final division of the entire text is more accurate, and the accuracy of the extracted structured text is further ensured.
[0104] It should be noted that the method of the embodiment of the present disclosure can be executed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scenario and completed by multiple devices cooperating with each other. In this distributed scenario, one of the multiple devices can only execute one or more steps in the method of the embodiment of the present disclosure, and the multiple devices interact with each other to complete the method.
[0105] It is to be noted that some embodiments of the present disclosure have been described above. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in a different order and still achieve desirable results. Additionally, the processes depicted in the figures do not necessarily require the particular order shown, or sequential order to achieve desirable results. In certain implementations, multitasking and parallel processing can be advantageous.
[0106] Based on the same inventive concept, the present disclosure also provides a data processing apparatus corresponding to any of the above-mentioned embodiment methods.
[0107] Reference Figure 3 , the apparatus comprises:
[0108] The reference information obtaining module 11 is configured to obtain at least one first text line in the to-be-processed text that matches the target information;
[0109] The format feature obtaining module 13 is configured to obtain a second text line that satisfies a first preset condition from the at least one first text line, and obtain format feature information of the second text line;
[0110] The feature matching module 15 is configured to obtain at least one third text line in the to-be-processed text that matches the format feature information of the second text line;
[0111] The determination module 17 is configured to obtain a fourth text line that satisfies a second preset condition from the at least one third text line, and determine an information extraction condition of the to-be-processed text based on the fourth text line and the first text line.
[0112] In some embodiments, the reference information obtaining module 11 is further configured to match any text line in the to-be-processed text with the target information obtained in advance, and when any text line is the same as the target information, the text line is confirmed as the first text line.
[0113] In some embodiments, the first preset condition includes a confidence level; and the format feature obtaining module 13 is further configured to confirm at least one text line with the highest confidence level in the at least one first text line as the second text line.
[0114] In some embodiments, the format feature information of the second text line includes at least one of a font color, a font name, a font size, whether the font is bold, whether the font is italic, and whether the font has an underline.
[0115] In some embodiments, the feature matching module 15 is further configured to: acquire format feature information of each text line in the text to be processed; match the format feature information of each text line with the format feature information of the second text line, and determine whether the format feature information of each text line is same as the format feature information of the second text line; and when the format feature information of the text line is same as the format feature information of the second text line, confirm the text line as the third text line.
[0116] In some embodiments, the determining module 17 is further configured to: determine a text line with text content of the third text line meeting a preset condition as a fifth text line; and determine a text line with a relationship between each text line in the fifth text line meeting a preset condition as a fourth text line.
[0117] In some embodiments, the text content of the third text line meeting the preset condition comprises at least one of the following:
[0118] The text content of the third text line does not include a preset named entity;
[0119] The text length of the third text line is less than or equal to a first preset value;
[0120] The alignment mode of the third text line is same as that of the first text line;
[0121] The third text line does not include a punctuation symbol, or the third text line and the first text line include same punctuation symbols;
[0122] The text content of the third text line is of a preset language type, and the text content of the third text line includes at least one of the following: a word number less than or equal to a second preset value, including a character or letter matching the preset language type, and not including a character, letter or number not matching the preset language type.
[0123] In some embodiments, the relationship between each text line in the fifth text line meeting the preset condition comprises at least one of the following:
[0124] There is no first text line within a preset line number range from any fifth text line;
[0125] The text content of any two text lines in the fifth text line is different;
[0126] The total number of the fifth text lines is less than or equal to a third preset value.
[0127] For the convenience of description, the above apparatus is described in various modules respectively according to functions. Of course, the functions of the modules can be implemented in one or more software and / or hardware when implementing the present disclosure.
[0128] The apparatus of the above embodiments is used to implement the corresponding method of any of the preceding embodiments, and has the beneficial effects of the corresponding method embodiments, which are not repeated here.
[0129] Based on the same inventive concept, the disclosure also provides an electronic device corresponding to the method of any of the above embodiments, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any of the above embodiments when executing the program.
[0130] Figure 4 A more specific hardware structure of an electronic device is shown in this embodiment, which can include a processor 1010, a memory 1020, an input / output interface 1030, a communication interface 1040, and a bus 1050. The processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040 are connected to each other through the bus 1050 for communication within the device.
[0131] The processor 1010 can be implemented in the form of a general-purpose CPU (Central Processing Unit), a microprocessor, an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits, etc., for executing related programs to implement the technical solutions provided by the embodiments of the present specification.
[0132] The memory 1020 can be implemented in the form of a ROM (Read Only Memory), a RAM (Random Access Memory), a static storage device, a dynamic storage device, etc. The memory 1020 can store an operating system and other application programs, and when the technical solutions provided by the embodiments of the present specification are implemented by software or firmware, the related program codes are stored in the memory 1020 and executed by the processor 1010.
[0133] The input / output interface 1030 is used to connect input / output modules to realize information input and output. The input / output modules can be configured as components in the device (not shown in the figure), or can be externally connected to the device to provide corresponding functions. The input device can include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output device can include a display, a speaker, a vibrator, an indicator light, etc.
[0134] The communication interface 1040 is configured to connect a communication module (not shown in the figure) to realize the communication interaction between the device and other devices. The communication module can realize communication through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.).
[0135] The bus 1050 includes a path for transmitting information between the various components (such as the processor 1010, the memory 1020, the input / output interface 1030, and the communication interface 1040) of the device.
[0136] It should be noted that although the above device only shows the processor 1010, the memory 1020, the input / output interface 1030, the communication interface 1040, and the bus 1050, in the specific implementation process, the device can also include other components necessary for normal operation. In addition, those skilled in the art can understand that the above device can also only contain the components necessary for the implementation of the embodiments of the present specification, and does not have to contain all the components shown in the figure.
[0137] The electronic device of the above embodiment is used to realize the corresponding method in any of the above embodiments, and has the beneficial effects of the corresponding method embodiments, which are not described here.
[0138] Based on the same inventive concept, the disclosure also provides a non-transitory computer readable storage medium storing computer instructions for causing the computer to execute the method of any of the above embodiments.
[0139] The computer readable medium of the present embodiment includes permanent and non-permanent, removable and non-removable media, which can be realized by any method or technology to store information. The information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile disc (DVD) or other optical storage, magnetic cassette, magnetic tape, magnetic disk storage or other magnetic storage device, or any other non-transmission medium that can be used to store information accessible by a computing device.
[0140] The computer instructions stored in the storage medium of the above embodiment are used to cause the computer to execute the method of any of the above embodiments, and have the beneficial effects of the corresponding method embodiments, which are not described here.
[0141] Based on the same inventive concept, the disclosure also provides a computer program product comprising a computer program corresponding to any of the above described method embodiments. In some embodiments, the computer program is executable by one or more processors to cause the processor(s) to perform the method. The processor(s) performing the respective steps of the method can be the processor(s) belonging to the respective performing subject corresponding to the respective steps of the method embodiments.
[0142] The computer program product of the above described embodiments is used to cause the processor(s) to perform the method of any of the above described embodiments, and has the beneficial effects of the respective method embodiments, which are not repeated here.
[0143] It should be understood by those of ordinary skill in the art that the above discussion of any of the embodiments is merely exemplary and is not intended to be limiting to the scope of the disclosure (including the claims) to these examples; the above embodiments or technical features among different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of the disclosure as described above, which are not provided in detail for the sake of brevity. It should be understood by those of ordinary skill in the art that the above discussion of any of the embodiments is merely exemplary and is not intended to be limiting to the scope of the disclosure (including the claims) to these examples; the above embodiments or technical features among different embodiments can also be combined, the steps can be implemented in any order, and there are many other variations of different aspects of the embodiments of the disclosure as described above, which are not provided in detail for the sake of brevity.
[0144] In addition, to simplify the description and discussion, and so as not to make the embodiments of the disclosure difficult to understand, the known power / ground connections of integrated circuit (IC) chips and other components can or can not be shown in the provided drawings. In addition, the devices can be shown in the form of block diagrams in order to avoid making the embodiments of the disclosure difficult to understand, and this also takes into account the fact that the details of the implementation of these block diagram devices are highly dependent on the platform to be implemented to implement the embodiments of the disclosure (i.e., these details should be fully within the understanding of those skilled in the art). Where specific details (e.g., circuitry) are set forth in order to describe an illustrative embodiment of the disclosure, it will be apparent to those skilled in the art that the embodiments of the disclosure can be practiced without these specific details or with variations on these specific details. Therefore, these descriptions should be considered as illustrative rather than limiting.
[0145] Although the disclosure has been described in conjunction with specific embodiments thereof, many alternatives, modifications and variations will be apparent to those skilled in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic RAM (DRAM)) can use the embodiments discussed.
[0146] Embodiments of the present disclosure are intended to cover all such alternatives, modifications, and variations as fall within the broad scope of the appended claims. Accordingly, any one or more of the omitted, modified, equivalently replaced, improved, and the like, as long as within the spirit and principle of the embodiments of the present disclosure, should be included in the scope of protection of the present disclosure.
Claims
1. A data processing method, characterized in that, include: Obtain at least one first text line in the text to be processed that matches the target information; Obtain a second text line that satisfies a first preset condition from at least one of the first text lines, and obtain the format feature information of the second text line; Obtain at least one third text line in the text to be processed that matches the format feature information of the second text line; Obtain at least one fourth text line from the third text line that satisfies the second preset condition, and determine the information extraction conditions of the text to be processed based on the fourth text line and the first text line; The step of obtaining the fourth text line in the third text line that satisfies the second preset condition includes: determining the text line in the third text line whose text content meets the fourth preset condition as the fifth text line; and determining the text line in the fifth text line whose relationship between each text line meets the fifth preset condition as the fourth text line. The text content of the third text line meets a fourth preset condition, which includes at least one of the following: the text content of the third text line does not include preset named entities; the text length of the third text line is less than or equal to a first preset value; the third text line has the same alignment as the first text line; the third text line does not include punctuation marks, or the third text line includes the same punctuation marks as the first text line; the text content of the third text line is a preset language type, and the text content of the third text line includes at least one of the following: the number of words is less than or equal to a second preset value, including characters or letters that match the preset language type, and excluding characters, letters, or numbers that do not match the preset language type; The relationships between the text lines in the fifth text line meet a fifth preset condition, which includes at least one of the following: the first text line does not exist within a preset number of lines away from any of the fifth text lines; the text content of any two text lines in the fifth text line is different; and the total number of the fifth text lines is less than or equal to a third preset value.
2. The method according to claim 1, characterized in that, The step of obtaining at least one first text line in the text to be processed that matches the target information includes: Each line of text in the text to be processed is matched with the pre-acquired target information. When a line of text matches the target information, the line of text is identified as the first line of text.
3. The method according to claim 1, characterized in that, The first preset condition includes a confidence level; obtaining a second text line that satisfies the first preset condition from at least one of the first text lines includes: At least one text line with the highest confidence among at least one of the first text lines is identified as the second text line.
4. The method according to claim 1, characterized in that, The formatting features of the second text line include at least one of the following: font color, font name, font size, whether the font is bold, whether the font is italic, and whether the font has an underline.
5. The method according to claim 1, characterized in that, Obtaining at least one third text line in the text to be processed that matches the format feature information of the second text line includes: Obtain the format feature information of each line of text in the text to be processed; The format feature information of each text line is matched with the format feature information of the second text line to determine whether the format feature information of each text line is the same as the format feature information of the second text line. When the format feature information of the text line is the same as that of the second text line, the text line is identified as the third text line.
6. A data processing apparatus, characterized in that, include: The reference information acquisition module is configured to: acquire at least one first text line in the text to be processed that matches the target information; The format feature acquisition module is configured to: acquire a second text line that satisfies a first preset condition from at least one first text line, and obtain the format feature information of the second text line; The feature matching module is configured to: acquire at least one third text line in the text to be processed that matches the format feature information of the second text line; The determination module is configured to: obtain at least one fourth text line from the third text line that satisfies the second preset condition, and determine the information extraction conditions of the text to be processed based on the fourth text line and the first text line; The determining module is further configured to: determine the text line in the third text line whose text content meets the fourth preset condition as the fifth text line; and determine the text line in the fifth text line whose relationship between each text line meets the fifth preset condition as the fourth text line; The text content of the third text line meets a fourth preset condition, which includes at least one of the following: the text content of the third text line does not include preset named entities; the text length of the third text line is less than or equal to a first preset value; the third text line has the same alignment as the first text line; the third text line does not include punctuation marks, or the third text line includes the same punctuation marks as the first text line; the text content of the third text line is a preset language type, and the text content of the third text line includes at least one of the following: the number of words is less than or equal to a second preset value, including characters or letters that match the preset language type, and excluding characters, letters, or numbers that do not match the preset language type; The relationships between the text lines in the fifth text line meet a fifth preset condition, which includes at least one of the following: the first text line does not exist within a preset number of lines away from any of the fifth text lines; the text content of any two text lines in the fifth text line is different; and the total number of the fifth text lines is less than or equal to a third preset value.
7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 5.
8. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1 to 5.
9. A computer program product comprising computer program instructions, characterized in that, When the computer program instructions are executed on a computer, the computer causes the computer to perform the method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
An intelligent resume evaluation method
CN109165295A
Word document key information extraction method
CN112668316A