Entity extraction methods, apparatus, equipment, storage media and products
By performing text extraction, topic classification, and entity recognition on the profile document, and correcting the topic and entity categories under certain conditions, the problem of low efficiency in extracting key information from the profile document for recruiters is solved, and more efficient entity extraction is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- TENCENT TECHNOLOGY (SHENZHEN) CO LTD
- Filing Date
- 2022-09-23
- Publication Date
- 2026-05-26
AI Technical Summary
During the recruitment process, when recruiters need to extract key information from job seekers' profiles, existing technologies struggle to efficiently and accurately identify and extract entities, resulting in low reading efficiency.
By extracting text from the introduction document, performing topic classification and entity recognition, and correcting when the topic category and entity category meet the conditions, the accuracy of entity extraction is improved.
It improves the accuracy of entity extraction and increases the efficiency for recruiters to extract key information from profile documents.
Smart Images

Figure CN117009504B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of artificial intelligence technology, and in particular to an entity extraction method, apparatus, device, storage medium, and product. Background Technology
[0002] With the development of artificial intelligence technology and online recruitment, recruiters can access job seekers' profiles in various formats such as PDF and DOC online. These profiles are used to introduce job seekers. However, these profiles may contain information from multiple topics, such as basic personal information and educational background. Recruiters may only focus on certain key information within these profiles. Since these profiles often contain a lot of information, reading through every single detail would reduce recruitment efficiency. Therefore, there is an urgent need for a method to accurately extract key information from profiles to improve reading efficiency. Summary of the Invention
[0003] This application provides a method, apparatus, device, storage medium, and product for entity extraction, which can improve the accuracy of entity extraction. The technical solution is as follows:
[0004] On the one hand, an entity extraction method is provided, the method comprising:
[0005] Text extraction is performed on the description file of the target object to obtain description text data, which includes multiple lines of characters. The description file is used to describe the target object.
[0006] For the multi-line characters in the introductory text data, each line of characters is classified into a topic to obtain the topic category to which each line of characters belongs;
[0007] Entity recognition is performed on the characters in each line to obtain the entity category to which the characters in each line belong;
[0008] If the topic category and entity category to which the characters in any row belong meet the target conditions, then the other category is corrected based on one of the topic category and the entity category.
[0009] Based on the corrected topic category and corrected entity category to which the characters in each line belong, the entities in the introductory text data are extracted.
[0010] On the other hand, an entity extraction device is provided, the device comprising:
[0011] The text extraction module is used to extract text from the description file of the target object to obtain description text data. The description text data includes multiple lines of characters. The description file is used to describe the target object.
[0012] The topic classification module is used to classify the topic of each line of characters in the multi-line introductory text data to obtain the topic category to which each line of characters belongs.
[0013] An entity recognition module is used to perform entity recognition on each line of characters to obtain the entity category to which each line of characters belongs;
[0014] The first correction module is used to correct one of the topic category and the entity category based on the target condition, provided that the topic category and the entity category to which the characters in any line belong meet the target conditions.
[0015] The entity extraction module is used to extract entities from the descriptive text data based on the corrected topic category and corrected entity category to which the characters in each line belong.
[0016] In some embodiments, the entity category to which each row of characters belongs includes the entity categories to which multiple characters in each row belong. The first correction module is configured to:
[0017] Match the topic category and entity category to which the line characters belong;
[0018] If the proportion of the target entity category in the entity category to which each of the multiple characters in the row belongs is greater than a preset proportion, the target topic category corresponding to the entity category to which each of the multiple characters belongs is determined, and the topic category to which the row belongs is updated to the target topic category. The target entity category refers to the entity category that does not match the topic category to which the row belongs.
[0019] If the proportion of the target entity category in the entity categories to which multiple characters in the line characters belong is not greater than the preset proportion, the target entity category is corrected based on the topic category to which the line characters belong, to obtain an entity category that matches the topic category to which the line characters belong.
[0020] In some embodiments, the apparatus further includes:
[0021] The first determining module is used to determine the number of characters in each column of the introductory text data when the topic categories to which the multi-line characters belong are interspersed.
[0022] The first execution module is used to re-execute the step of classifying the characters in the multiple lines of the summary text data for each line of characters in the case of N consecutive blank columns, and obtaining the topic category to which each line of characters belongs. The multiple columns of characters are characters other than the characters in the N consecutive columns, and N is an integer greater than 0.
[0023] In some embodiments, the apparatus further includes:
[0024] The second determining module is used to determine the number of characters in each column of the introductory text data;
[0025] The second execution module is used to perform the step of classifying the characters in each line of the summary text data into a topic and obtaining the topic category to which each line of characters belongs, in the absence of N consecutive blank columns, where N is an integer greater than 0.
[0026] In some embodiments, the apparatus further includes:
[0027] The third execution module is used to perform the following steps on the multi-column characters when there are N consecutive blank columns: classify the characters in the multi-line text data into topics and obtain the topic category to which each line of characters belongs. The multi-column characters are characters other than the characters in the N consecutive columns.
[0028] In some embodiments, the apparatus further includes:
[0029] The second correction module is used to correct the topic category and entity category of a target line character based on the topic category to which the character in any line belongs, provided that the topic category to which the character in any line belongs carries a first-line identifier. The target line character includes at least one line of characters arranged after the line character. The first-line identifier is used to indicate that the line character is the first line character of the topic category among multiple lines of characters. The corrected topic category and corrected entity category are used to extract entities from the summary text data.
[0030] In some embodiments, the topic classification module is configured to:
[0031] For each line of characters, the topic category to which the line character belongs is determined based on the line character and auxiliary characters, wherein the auxiliary characters include at least one line of characters adjacent to the line character.
[0032] In some embodiments, the topic category to which each row of characters belongs is obtained based on a topic classification model, wherein the topic classification module is used to:
[0033] The line character and the auxiliary character are concatenated in a preset order to obtain the concatenated character;
[0034] Input the concatenated characters into the topic classification model;
[0035] The text vector of the concatenated characters is determined using the topic classification model.
[0036] Based on the text vector, the topic category to which the line characters belong is obtained.
[0037] In some embodiments, the entity extraction module is configured to:
[0038] Based on the corrected topic category to which each line of characters belongs, the introductory text data is segmented to obtain multiple topic paragraphs, each topic paragraph including at least one line of characters belonging to the same topic category;
[0039] For each topic paragraph, extract the entity corresponding to the corrected entity category to which at least one line of characters in the topic paragraph belongs.
[0040] On the other hand, a computer device is provided, the computer device including a processor and a memory, the memory being used to store at least one computer program, the at least one computer program being loaded and executed by the processor to implement the entity extraction method in the embodiments of this application.
[0041] On the other hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, the at least one computer program being loaded and executed by a processor to implement the entity extraction method as described in the embodiments of this application.
[0042] On the other hand, a computer program product is provided, the computer program product including computer program code stored in a computer-readable storage medium, a processor of a computer device reading the computer program code from the computer-readable storage medium, the processor executing the computer program code, causing the computer device to perform the entity extraction method described in any of the above implementations.
[0043] This application provides an entity extraction method. Because the method extracts text from the description document, it enables topic classification and entity recognition based on the extracted characters. Furthermore, if the topic category and entity category of any line of characters meet the target conditions, one of the topic category and entity category is used to correct the other. This corrected topic category and entity category have higher accuracy, resulting in more accurate entity extraction when extracting entities from the description text data, thus improving the accuracy of entity extraction. Attached Figure Description
[0044] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0045] Figure 1 This is a schematic diagram of an implementation environment provided in an embodiment of this application;
[0046] Figure 2 This is a flowchart of an entity extraction method provided in an embodiment of this application;
[0047] Figure 3 This is a flowchart of another entity extraction method provided in the embodiments of this application;
[0048] Figure 4 This is a schematic diagram of a one-dimensional array provided in an embodiment of this application;
[0049] Figure 5 This is a schematic diagram of a topic classification model provided in an embodiment of this application;
[0050] Figure 6 This is a schematic diagram of an entity label provided in an embodiment of this application;
[0051] Figure 7 This is a schematic diagram of an entity recognition model provided in an embodiment of this application;
[0052] Figure 8 This is a schematic diagram of a subject category provided in an embodiment of this application;
[0053] Figure 9 This is a schematic diagram illustrating an entity extraction method provided in an embodiment of this application;
[0054] Figure 10 This is a schematic diagram of a preset introduction table provided in an embodiment of this application;
[0055] Figure 11 This is a schematic diagram of another preset introduction table provided in the embodiments of this application;
[0056] Figure 12 This is a schematic diagram of another preset introduction table provided in the embodiments of this application;
[0057] Figure 13 This is a flowchart of another entity extraction method provided in the embodiments of this application;
[0058] Figure 14This is a block diagram of an entity extraction device provided in an embodiment of this application;
[0059] Figure 15 This is a block diagram of a terminal provided in an embodiment of this application;
[0060] Figure 16 This is a block diagram of a server provided in an embodiment of this application. Detailed Implementation
[0061] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0062] In this application, the terms "first," "second," etc., are used to distinguish identical or similar items with essentially the same function. It should be understood that there is no logical or temporal dependency between "first," "second," and "nth," nor are there any restrictions on quantity or execution order.
[0063] In this application, the term "at least one" means one or more, and "multiple" means two or more.
[0064] It should be noted that all information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.), and signals involved in this application have been authorized by the user or fully authorized by all parties, and the collection, use, and processing of related data must comply with the relevant laws, regulations, and standards of the relevant countries and regions. For example, the introductory documents involved in this application were obtained with full authorization.
[0065] The following is an explanation of the terms used in this application.
[0066] Artificial intelligence (AI) is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0067] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0068] Artificial intelligence cloud services are generally also known as AIaaS (AI as a Service). This is currently a mainstream service model for artificial intelligence platforms. Specifically, AIaaS platforms break down several common AI services and provide them as independent or packaged services in the cloud. This service model is similar to opening an AI-themed marketplace: all developers can access and use one or more AI services provided by the platform through API interfaces. Some experienced developers can also use the AI frameworks and AI infrastructure provided by the platform to deploy and maintain their own dedicated cloud AI services.
[0069] Natural Language Processing (NLP) is an important field within computer science and artificial intelligence. It studies the theories and methods for enabling effective communication between humans and computers using natural language. NLP is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field involves natural language—the language people use in daily life—and thus it has a close relationship with linguistic research. NLP techniques typically include text processing, semantic understanding, machine translation, question answering, and knowledge graphs.
[0070] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learn-by-doing.
[0071] The following describes the implementation environment involved in this application:
[0072] The entity extraction method provided in this application can be executed by a computer device. In some embodiments, the computer device is at least one of a terminal and a server. The following is a schematic diagram of the implementation environment of the entity extraction method provided in this application. See also... Figure 1 The implementation environment includes terminal 101 and server 102. Terminal 101 and server 102 can be connected directly or indirectly via wired or wireless communication, which is not limited herein.
[0073] In some embodiments, a target application, such as a recruitment application, is installed on terminal 101. This target application can obtain a profile file. After obtaining the profile file, terminal 101 sends it to server 102, which is the backend server of the target application. Server 102 processes the profile file to obtain the entities in the profile file and sends them to terminal 101 for display.
[0074] In some embodiments, terminal 101 can be a smartphone, tablet, laptop, desktop computer, smart voice interaction device, smart home appliance, vehicle terminal, aircraft, etc., but is not limited thereto. In some embodiments, server 102 can be an independent server, a server cluster composed of multiple servers, or a distributed system. It can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. Server 102 is used to provide background services for the target application installed on terminal 101. In some embodiments, server 102 undertakes the main computing work, and terminal 101 undertakes the secondary computing work; or, server 102 undertakes the secondary computing service, and terminal 101 undertakes the main computing work; or, server 102 and terminal 101 use a distributed computing architecture for collaborative computing.
[0075] Figure 2 This is a flowchart of an entity extraction method provided according to an embodiment of this application. See also... Figure 2 In this embodiment of the application, the method is described using a computer device as an example. The method includes the following steps:
[0076] 201. The computer device extracts text from the description file of the target object to obtain description text data, which includes multiple lines of characters. This description file is used to describe the target object.
[0077] In this embodiment of the application, the file format of the introduction file can be DOC (Document), PDF (Portable Document Format), JPG (Joint Photographic Experts Group), etc.
[0078] In this embodiment of the application, the introduction file includes information on multiple subject categories of the target object, such as information on subject categories like education and work. The information on these multiple subject categories is arranged in a preset order in the introduction file, such as the information on multiple subject categories being arranged sequentially from top to bottom.
[0079] In this embodiment, the arrangement of characters in the introduction text data is the same as the arrangement of characters in the introduction file. That is, the number of lines of characters in the introduction file corresponds to the number of lines of characters in the introduction text data; the number of characters in each line of the introduction file corresponds to the number of characters in each line of the introduction text data; and the positions of multiple characters in each line of the introduction file correspond to the positions of multiple characters in each line of the introduction text data.
[0080] In this embodiment of the application, the multi-line characters in the introduction text data include all the characters in the introduction file. That is, the introduction text data includes not only the words in the introduction file, but also any elements in the introduction file such as punctuation, numbers, and formulas that occupy character positions.
[0081] In this embodiment, when extracting text from a description file, the computer device can also remove redundant elements from the description file. These redundant elements refer to elements unrelated to the characters in the description file, such as blank lines between lines. Furthermore, when extracting text from the description file, the computer device can also perform format preprocessing on the characters in the description file to unify characters with different font sizes, font colors, and other formats into characters with a preset format, ensuring that the extracted characters have the same font size, font color, and other formats.
[0082] 202. For multi-line characters in a summary text data, the computer device performs topic classification on each line of characters to obtain the topic category to which each line of characters belongs.
[0083] In this embodiment, the topic category to which each line of characters belongs is used to summarize that line of characters. The computer device sequentially classifies multiple lines of characters according to a layout pattern to obtain the topic category to which each line of characters belongs. This layout pattern can be a top-to-bottom or left-to-right layout pattern.
[0084] 203. The computer equipment performs entity recognition on each line of characters to obtain the entity category to which each line of characters belongs.
[0085] In this embodiment of the application, the computer device performs entity recognition on multiple lines of characters in sequence according to the above-mentioned layout pattern to obtain the entity category to which each of the multiple lines of characters belongs.
[0086] 204. If the subject category and entity category of any line of characters meet the target conditions, the computer device corrects the other based on one of the subject category and the entity category.
[0087] In this embodiment of the application, the target condition is a correction trigger condition, which can be a trigger condition for correcting entity categories based on topic categories, or a trigger condition for correcting topic categories based on entity categories.
[0088] 205. The computer device extracts entities from the introductory text data based on the corrected topic category and corrected entity category to which each line of characters belongs.
[0089] In this embodiment, each line of characters is generally corrected based on either a topic category or an entity category, with the other category being adjusted. When the entity category is corrected based on the topic category of the character line, the topic category remains unchanged; conversely, when the topic category is corrected based on the entity category, the entity category remains unchanged. In this embodiment, there may also be a line of characters that does not meet the target conditions; in this case, no correction for topic category and entity recognition is performed on that line of characters.
[0090] Accordingly, the computer device performs entity extraction based on the corrected entity category when the entity category to which any line of characters belongs is corrected, performs entity extraction based on the corrected topic category when the topic category to which any line of characters belongs is corrected, performs entity extraction based on the uncorrected entity category when the entity category to which any line of characters belongs is not corrected, and performs entity extraction based on the uncorrected topic category when the topic category to which any line of characters belongs is not corrected.
[0091] This application provides an entity extraction method. Because the method extracts text from the description document, it enables topic classification and entity recognition based on the extracted characters. Furthermore, if the topic category and entity category of any line of characters meet the target conditions, one of the topic category and entity category is used to correct the other. This corrected topic category and entity category have higher accuracy, resulting in more accurate entity extraction when extracting entities from the description text data, thus improving the accuracy of entity extraction.
[0092] The above Figure 2 The basic process for entity extraction is as follows, based on... Figure 3The process of entity extraction will be further elaborated. Figure 3 This is a flowchart of an entity extraction method provided according to an embodiment of this application. See also... Figure 3 In this embodiment, the method is described using an example executed by a computer device. The method includes the following steps:
[0093] 301. The computer device extracts text from the description file of the target object to obtain description text data, which includes multiple lines of characters. The description file is used to describe the target object.
[0094] This step is the same as step 201, and will not be repeated here.
[0095] 302. The computer device determines the number of characters in each column of the introductory text data.
[0096] In this embodiment of the application, if the number of characters in a certain column is zero, it means that the column is a blank column. If there are no consecutive N blank columns, it means that the summary text data is a single-column distribution, that is, it only includes one column of characters. If there are consecutive N blank columns, it means that the summary text data is a multi-column distribution, that is, it includes multiple columns of characters, and the multiple columns of characters are the characters in the columns other than the consecutive N blank columns.
[0097] Accordingly, if there are no consecutive N blank columns, the computer device performs step 303 as follows. If there are consecutive N blank columns, the computer device performs step 303 for each of the multiple columns of characters. In this embodiment, N is greater than a preset number, which can be set and changed as needed, such as 15.
[0098] In this embodiment, the multi-column character set has at least two columns. For example, if there is one blank column among the N consecutive columns in the summary text data, then the summary text data includes two columns of characters; if there are two blank columns among the N consecutive columns in the summary text data, then the summary text data includes three columns of characters. The aforementioned multi-column character set is divided by the blank column among the N consecutive columns; that is, characters in the columns preceding the N consecutive columns belong to one column of characters, and characters in the columns following the N consecutive columns belong to another column of characters.
[0099] In some embodiments, after determining the number of characters in each column of the introductory text data, the computer device arranges the character counts of each column into a one-dimensional array, thereby facilitating the determination of whether there are N consecutive blank columns based on the values in the one-dimensional array. See also... Figure 4 , Figure 4 This is a schematic diagram of a one-dimensional array provided in an embodiment of the present application, including one-dimensional arrays corresponding to single-column, two-column, and three-column characters.
[0100] It should be noted that some introductory documents are not laid out in a top-to-bottom order, but rather in a two- or three-column layout. The characters in different columns have different topic categories. If processed in a top-to-bottom order, the topic classification of characters across multiple lines may be inaccurate because each line may contain multiple topic categories, thus affecting subsequent entity extraction. In this embodiment, the introductory text data is detected to determine if it is multi-column. In the case of a multi-column distribution, the introductory text data can be processed column by column, from left to right and from top to bottom, thereby improving the accuracy of topic classification.
[0101] 303. For the multi-line characters in the introductory text data, the computer device performs topic classification on each line of characters to obtain the topic category to which each line of characters belongs.
[0102] In some embodiments, the computer device further performs topic classification by combining contextual information of each line of characters. Accordingly, the process by which the computer device performs topic classification on each line of characters in the multi-line introductory text data to obtain the topic category to which each line of characters belongs includes the following steps: For each line of characters, the computer device determines the topic category to which the line of characters belongs based on the line of characters and auxiliary characters, wherein the auxiliary characters include at least one line of characters adjacent to the line of characters.
[0103] In this embodiment of the application, the auxiliary character is described as including the characters of the two rows above and the next row of the character in the current row.
[0104] In this embodiment, since the topic category to which the line of characters belongs is determined based on the line of characters and its auxiliary characters, the contextual information of the line of characters is fully considered, thereby improving the accuracy of topic classification.
[0105] In this embodiment, the topic category of each line of characters is obtained based on a topic classification model. Accordingly, the process by which the computer device determines the topic category of a line of characters based on the line of characters and auxiliary characters includes the following steps: the computer device concatenates the line of characters and the auxiliary characters in a preset order to obtain concatenated characters; the computer device inputs the concatenated characters into the topic classification model; the computer device determines the text vector of the concatenated characters using the topic classification model; and based on the text vector, the topic category of the line of characters is obtained. This topic classification based on a topic classification model improves the efficiency of topic classification.
[0106] In this embodiment, the text vector of the concatenated characters is used to describe the concatenated characters. The text vector includes feature vectors of each character in the concatenated characters. For example, the text vector can be represented as [v1, v2, v3, ...], where v1, v2, and v3 represent the feature vectors of one character in the concatenated characters, and these feature vectors describe the character. Based on this text vector, the topic classification model can obtain the probability that the line of characters belongs to multiple topic categories. The topic classification model outputs the topic category with the highest probability among these multiple topic categories, thus obtaining the topic category to which the line of characters belongs.
[0107] In this embodiment of the application, the computer device pre-defines multiple topic categories, which are used to describe the target object from different aspects. These multiple topic categories can be, for example, basics, expectations, education, employment, projects, awards, summary, description, and skills.
[0108] In this embodiment, the preset order can be set and changed as needed. For example, if the auxiliary character includes characters from the two lines above and the next line of the current character, the current character can be placed first, followed by characters from the two lines above and the next line. In this embodiment, the character [SEP] is also used to concatenate the current character and the auxiliary character, so the concatenated character can be "characters from the two lines above [SEP] and characters from the next line below [SEP]".
[0109] In this embodiment, the topic classification model is a neural network model, including a first pre-trained language module and a first classification module. The first pre-trained language module is trained based on the RoBERTa (a pre-trained language model) model and is used to obtain text vectors. The first classification module is trained based on the TextCNN (a text classification convolutional model) model and is used to obtain topic categories. Accordingly, the computer device uses the first pre-trained language module to vectorize the concatenated characters to obtain text vectors of the concatenated characters, and then uses the first classification module to perform convolution processing on the text vectors to obtain the topic category to which the characters in that line belong.
[0110] In this embodiment, the first classification module includes multiple types of convolutional kernels. This embodiment uses three types of convolutional kernels as an example, with receptive field heights of 2, 3, and 4, respectively. Each type of convolutional kernel is used in multiples; in this embodiment, 1024 kernels of each type are used as an example.
[0111] In this embodiment of the application, the first pre-trained language module can be pre-trained, so only the first classification module needs to be trained. The first classification module is obtained by iterative training based on multiple first training samples, and the first training samples are concatenated sample characters.
[0112] In some embodiments, the computer device trains the first classification module in batches. That is, in each iteration, the model is trained using multiple first training samples, each carrying a topic category label to describe the true topic category to which it belongs. Correspondingly, in any iteration, the computer device inputs multiple first training samples into a first pre-trained language module, which generates multiple text vectors. These text vectors are then input into the convolutional layer of the first classification module, where they undergo convolution processing using various convolutional kernels to obtain three tensors of sizes [batch_size, length-1, 1024], [batch_size, length-2, 1024], and [batch_size, length-3, 1024]. For any tensor, batch_size represents the number of samples used in each iteration, and length represents the length of the current line of characters. Then, for each tensor, a 1-max-pooling method is used in the pooling layer of the first classification module to perform pooling operations, resulting in three first matrix vectors of size [batch_size, 1024]. Then, the three first matrix vectors are concatenated horizontally to obtain a second matrix vector of size [batch_size, 3072]. This second matrix vector is then sequentially input into the fully connected layer and the dropout layer of the first classification module to obtain a score vector. This score vector includes the score of the first training sample belonging to each topic category, representing the probability that the first training sample belongs to that topic category. The regularization layer is used to prevent overfitting. This score vector is then activated using the softmax function to obtain a probability distribution vector. This probability distribution vector includes the predicted probability that the first training sample belongs to each topic category, and it is also used to determine the loss value for this iteration.
[0113] In this embodiment, the computer device updates the parameters of the first classification module based on the average of the loss values of multiple first training samples. Optionally, the loss function of the first classification module is the cross-entropy loss function, and the loss value of each first training sample can be obtained by the following formula (1).
[0114] y i =exp(x i) / ∑exp(x j (1);
[0115] Where Loss1 represents the loss value of the first training sample x. y represents the true probability that the first training sample x belongs to its true topic category i. i This represents the predicted probability that the first training sample x obtained based on the first classification module belongs to its true topic category i. i This represents the score of the first training sample x obtained based on the first classification module, which belongs to its true topic category i. j This represents the score of the first training sample x obtained based on the first classification module, which belongs to topic category j, where topic category j is any one of multiple topic categories.
[0116] It should be noted that the training process of the first classification module is an iterative training process, which stops when the iteration stopping conditions are met. These stopping conditions include: the number of iterations reaching a preset number, the loss value reaching convergence, and the loss value reaching a preset loss value. In this embodiment, the trained RoBERTa model and TextCNN model are saved to obtain the trained topic classification model. See also... Figure 5 , Figure 5 This is a schematic diagram of a topic classification model provided in an embodiment of the present application, including a first pre-trained language module 501 and a first classification module 502.
[0117] In some embodiments, the computer device does not execute step 302 before executing step 303, but executes the following steps after executing step 303 to re-execute step 303 when the introductory text data includes multiple columns of characters: the computer device determines the number of characters in each column of the introductory text data when the topic categories of the multiple lines of characters are interspersed; the computer device re-executes step 303 for each column of characters when there are N consecutive blank columns.
[0118] In this embodiment, the overlapping distribution of topic categories among multiple lines of characters refers to the fact that multiple lines of characters belonging to the same topic category are not consecutive but spaced out, meaning that the same topic category appears at least once every other line of characters. For example, the topic category of the first line of characters is education, the topic category of the second line of characters is work, the topic category of the third line of characters is also education, and the topic category of the fourth line of characters is also work. As another example, the topic category of the first line of characters is education, the topic category of the second line of characters is work, the topic category of the third line of characters is rewards, and only then is the topic category of education again.
[0119] In the embodiments of this application, multiple consecutive lines of characters generally belong to the same topic category. If the topic categories of the multiple lines of characters are interspersed, there is a high probability that the introductory text data includes multiple columns of characters. Therefore, if it is further determined that the introductory text data includes multiple columns of characters, the topic classification of the multiple columns of characters can be performed separately, which can improve the accuracy of topic classification.
[0120] 304. The computer equipment performs entity recognition on each line of characters to obtain the entity category to which each line of characters belongs.
[0121] In this embodiment of the application, the computer device presets multiple entity categories, which can be 12 entity categories such as date, name, age, birthday, school name, major, company name, address, job position, skill, project name, and certificate.
[0122] In this embodiment, the entity category to which each line of characters belongs includes the entity categories to which multiple characters in that line belong. The computer device can then use a Conditional Random Field (CRF) model to obtain the entity category. Accordingly, the process by which the computer device performs entity recognition on each line of characters to obtain the entity category to which each line belongs includes the following steps: For each line of characters, the computer device determines the score of each character labeled with a preset set of entity tags. The entity tag describes the entity category to which the character belongs and the position of the character in the target word, and the score indicates the probability that the character is labeled with that entity tag. Based on the scores of the multiple characters labeled with multiple entity tags and multiple candidate tag sequences, the computer device determines the total score of each of the multiple candidate tag sequences. The multiple candidate tag sequences are obtained by combining multiple entity tags. The candidate tag sequence with the largest total score among the multiple candidate tag sequences is taken as the predicted target tag sequence. The target tag sequence includes the entity tags labeled with each character in that line of characters.
[0123] In this embodiment, the entity label is a BIOE (Beginning, Inside, Outside, End) label. The first character of each entity word is labeled "B_XX", the last character is labeled "E_XX", and the middle characters are labeled "I_XX". "XX" represents the entity category, and characters not belonging to any entity category are labeled "O". Therefore, if there are 12 preset entity categories, there are a total of 37 preset entity labels. See also... Figure 6 , Figure 6 This is a schematic diagram of an entity label provided in an embodiment of this application.
[0124] In this embodiment, the entity category is obtained based on an entity recognition model. That is, for each line of characters, the computer device inputs the line of characters into the entity recognition model, and obtains the entity category to which the line of characters belongs through the entity recognition model.
[0125] In this embodiment, the entity recognition model is a neural network model, including a second pre-trained language module, a semantic extraction module, and a second classification module. The second pre-trained language module is trained based on the RoBERTa model, the first classification module is trained based on the CRF model, and the semantic extraction module is trained based on the BiLSTM (Bi-directional Long Short-Term Memory) model. The process by which a computer device, for each line of characters, obtains the entity category to which the characters belong through the entity recognition model includes the following steps:
[0126] The computer device uses a first pre-trained semantic module to vectorize the characters in the line, obtaining text vectors for those characters. Then, a semantic extraction module uses these text vectors to obtain semantic vectors for the characters. Finally, a second classification module uses these semantic vectors to determine the entity category to which the characters belong. In this embodiment, the text vectors describe the characters in the line, including feature vectors for each character. The semantic vectors describe the contextual relationships between the character and the line, thus fully considering the influence of context and achieving accurate entity categories.
[0127] In this embodiment, the second pre-trained language module can be pre-trained, or it can be the same pre-trained language module as the first pre-trained language module. In this case, only the semantic extraction module and the second classification module need to be trained. The semantic extraction module and the second classification module are obtained through iterative training based on multiple second training samples, where any second training sample is a line of sample characters.
[0128] In some embodiments, the computer device trains the semantic extraction module and the second classification module in batches. That is, in any iteration, the model is trained using multiple second training samples, and each second training sample carries a sequence of real labels to describe the real entity category to which the second training sample belongs. Accordingly, in any iteration, the computer device inputs multiple second training samples into the second pre-trained language module, which obtains multiple text vectors. Then, the semantic extraction module obtains multiple semantic vectors based on the multiple text vectors. Then, the second classification module obtains a state transition matrix of size [batch_size, length, 37] based on the multiple semantic vectors. Each element in the state transition matrix is the score of a character being labeled as one of the 37 entity labels, representing the probability that the character is labeled as that entity label. Based on the state transition matrix, the total score of each of the multiple candidate label sequences can be obtained.
[0129] In this embodiment, the state transition matrix is used to represent the constraint relationship between entity labels of multiple characters in the text data. Therefore, when training the model, the matrix parameters used to obtain the state transition matrix need to be updated so that the total score of the real label sequence in the state transition matrix is maximized.
[0130] In this embodiment, the computer device updates the parameters of the semantic extraction module and the second classification module based on the mean of the loss values of multiple second training samples. Optionally, the loss function of the second classification module is the maximum likelihood estimation function, and the loss value of each second training sample can be obtained by the following formula (2).
[0131]
[0132] Where Loss2 represents the loss value of the second training sample S, S real S represents the total score of the second training sample S obtained based on the second classification module, which belongs to its true label sequence. i This represents the total score of the second training sample S obtained based on the second classification module, belonging to candidate label sequence i, where candidate label sequence i is any one of multiple candidate label sequences. The total score belonging to its true label sequence is obtained by summing the scores of multiple characters labeled as their true entity labels.
[0133] It should be noted that the training process for the second classification module is an iterative training process, which stops when the iteration stopping conditions are met. These stopping conditions include: the number of iterations reaching a preset number, the loss value reaching convergence, and the loss value reaching a preset loss value. In this embodiment, the trained RoBERTa model, BiLSTM model, and TextCNN model are saved to obtain the trained entity recognition model. See also... Figure 7 , Figure 7 This is a schematic diagram of an entity recognition model provided in an embodiment of the present application, including a second pre-trained language module 701, a semantic extraction module 702, and a second classification module 703.
[0134] In this embodiment, the execution order of steps 303-304 can vary. The step numbers are for ease of description only and do not limit the execution order. Step 303 can be executed before step 304, after step 304, or simultaneously with step 304. In this embodiment, the simultaneous execution of steps 303 and 304 is used as an example. This allows topic classification and entity recognition to be performed simultaneously. Compared to methods that perform entity recognition based on topic classification results or topic classification based on entity recognition results, this avoids information dependency between the two and processes them in parallel, improving processing efficiency.
[0135] 305. If the subject category and entity category of any line of characters meet the target conditions, the computer device corrects the other based on one of the subject category and the entity category.
[0136] In some embodiments, the target condition can be determined based on the matching between the topic category and the entity category. Accordingly, the process described above, where the topic category and entity category to which any line of characters belong meet the target condition, corrects one based on the other, includes the following steps:
[0137] The computer device matches the topic category and entity category to which the characters in the line belong. If the proportion of the target entity category in the entity categories to which multiple characters in the line belong is greater than a preset proportion, the computer device determines the target topic category corresponding to the entity categories to which the multiple characters belong, and updates the topic category to which the characters in the line belong to the target topic category. The target entity category refers to the entity category that does not match the topic category to which the characters in the line belong. If the proportion of the target entity category in the entity categories to which multiple characters in the line belong is not greater than the preset proportion, the computer device corrects the target entity category based on the topic category to which the characters in the line belong, and obtains the entity category that matches the topic category to which the characters in the line belong.
[0138] In this embodiment, the preset ratio can be set as needed, such as 80%. If the proportion of the target entity category is greater than the preset ratio, it indicates that the topic category is likely incorrect. Therefore, the topic category is updated based on the target topic category, improving the accuracy of topic category correction. Conversely, if the proportion of the target entity category is not greater than the preset ratio, it indicates that the topic category is likely correct. Therefore, entity categories that do not match the correct topic category are corrected based on this topic category, improving the accuracy of entity category correction.
[0139] In the embodiments of this application, a correspondence between topic categories and their matching entity categories can be established in advance. One topic category can correspond to multiple entity categories, and different topic categories can correspond to the same entity category. Thus, based on this correspondence, entity categories can be corrected based on topic categories, and topic categories can be corrected based on entity categories.
[0140] For example, when correcting subject categories based on entity categories, if any row of characters contains the entity categories "school" or "major" but its subject category is not "education", the subject category of that row of characters can be corrected to "education"; if any row of characters contains the entity categories "company" or "career" but its subject category is not "job", the subject category of that row of characters can be corrected to "job", thereby improving the accuracy of subject classification.
[0141] In some embodiments, the same entity field can correspond to different entity categories. For example, the entity category of "accounting" can be either "profession" or "career". By correcting the entity category based on the subject category, the entity category of "accounting" in any line of characters with the subject category "education" can be corrected to "profession", and the entity category of "accounting" in any line of characters with the subject category "job" can be corrected to "career", thereby improving the accuracy of entity recognition.
[0142] In some embodiments, if characters in certain lines are heading keywords used to locate the beginning of a topic paragraph and the end of the previous topic paragraph, the topic category to which these characters belong may also carry a first-line identifier. This first-line identifier indicates that the characters in that line are the first characters belonging to that topic category among multiple lines of characters. Accordingly, if any line of characters belongs to a topic category that carries a first-line identifier, the computer device can, based on the topic category to which that line of characters belongs, correct the topic category and entity category to which the target line of characters belongs. The target line of characters includes at least one line of characters arranged after that line of characters. The corrected topic category and corrected entity category are used to extract entities from the summary text data.
[0143] In this embodiment, the title keywords can be basic information, education experience, work experience, skills, certificates, etc. The first-line identifier can be set and changed as needed. For example, if the identifier is "Start," then the corresponding subject category carrying the first-line identifier can be "XX Start," where XX represents the subject category. For instance, if the characters in a line are the title keyword "Education Experience," then its subject category "Education" carrying the first-line identifier could be "Education Start." Correspondingly, the subject categories of other lines containing title keywords carrying the first-line identifier can be "Basics_start," "Expect_start," "Education_start," "Employments_start," "Projects_start," "Awards_start," "Summary_start," and "Skill_start," etc. See also... Figure 8 , Figure 8 This is a schematic diagram of a subject category provided for an embodiment of this application.
[0144] It should be noted that the computer equipment needs to be trained on the topic classification model before it can identify the line containing the title keywords, so that the topic category determined by the characters in that line carries the first line identifier.
[0145] In this embodiment of the application, the target line characters include at least one line of characters arranged after the current line characters. Optionally, the at least one line of characters can be characters arranged after the current line characters and before the next heading keyword, that is, characters arranged before the next line of characters carrying the first-line identifier of the subject category.
[0146] It should be noted that if a line of characters belongs to a topic category with a first-line identifier, it means that the line of characters is the starting line of a topic paragraph. In this case, at least one line of characters following the line of characters should belong to the same topic category as the line of characters, and the entity category should match the topic category. Therefore, the topic category and entity category of the characters following the line of characters can be corrected based on the topic category of the line of characters, thus achieving effective correction of topic category and entity category.
[0147] 306. The computer device segments the introductory text data based on the corrected topic category to which each line of characters belongs, resulting in multiple topic paragraphs. Each topic paragraph includes at least one line of characters belonging to the same topic category.
[0148] In some embodiments, since heading keywords are used to locate the beginning of a topic paragraph and the end of the previous topic paragraph, the computer device can also group the characters between two lines of heading keywords into the same topic paragraph. That is, the characters between two lines of characters belonging to the topic category and carrying the first line identifier are grouped into the same topic paragraph, and the first line of those two lines of characters also belongs to that topic paragraph, serving as the starting line of that topic paragraph. This can improve the efficiency of dividing topic paragraphs.
[0149] For example, see Figure 9 , Figure 9 This is a schematic diagram of an entity extraction method provided in an embodiment of this application. The method involves segmenting multiple lines of characters based on their respective topic categories to obtain multiple topic paragraphs, and then extracting the entities from each of the multiple topic paragraphs.
[0150] 307. For each topic paragraph, the computer device extracts the entity corresponding to the corrected entity category to which at least one line of characters in the topic paragraph belongs.
[0151] In the embodiments of this application, during the process of extracting entities, the computer device can extract entities from multiple topic paragraphs in a top-to-bottom order, and for each topic paragraph, the entities in that topic paragraph are also extracted in a top-to-bottom order.
[0152] In some embodiments, during entity extraction, the computer device organizes entity categories and their corresponding entities into a key-value pair data structure and saves it as a JSON (JavaScript Object Notation) file. For example, see [link to documentation]. Figure 9 Entity categories and their corresponding entities are stored in a one-to-one correspondence.
[0153] In some embodiments, after saving an entity, the computer device populates the entity into a preset profile form. This preset profile form provides more standardized and informative entity information, enabling recruiters to quickly read the profile document based on it. See also... Figure 10 , Figure 11 and Figure 12 , Figure 10 This is a schematic diagram of a preset brief table provided in an embodiment of this application, which has not yet been filled with entities. Figure 11 This is a schematic diagram of another preset introduction table provided in an embodiment of this application, in which the entities to be filled are obtained from the introduction file on its right. Figure 12 This is a schematic diagram of another preset introduction table provided in an embodiment of this application, and the entities filled in it are also obtained from the introduction file on its right.
[0154] It should be noted that a topic paragraph may include sub-paragraphs with different information but similar structures. For example, a topic paragraph with the topic category "work" may include multiple work experience information, and the multiple work experience information have similar structures across multiple lines of characters, such as including entity categories such as "time", "company", and "project" arranged in a similar order. Optionally, the computer device may also segment the topic paragraph.
[0155] The segmentation process of a topic paragraph by a computer device includes the following steps: If the computer device identifies at least two entities with the same entity category in the topic paragraph, and there are multiple types of entity categories with the same entity category, then the computer device segments the topic paragraph based on the at least two entities with the same entity category, resulting in multiple sub-paragraphs. The characters in these multiple sub-paragraphs are different, but their structures are similar. Then, the entity corresponding to the corrected entity category to which at least one line of characters in each of the multiple sub-paragraphs belongs is extracted.
[0156] For example, for a topic paragraph with the subject category "work," if two entities with the entity category of "time" and two entities with the entity category of "company" are identified, it indicates that there are two sub-paragraphs in this topic paragraph. The computer device can then segment the topic paragraph based on entities with the same entity category, resulting in two sub-paragraphs. In this embodiment, because the topic paragraph is further divided, the segmentation of the introductory text data is more refined, thereby enabling more precise extraction of entities.
[0157] It should be noted that for any given topic paragraph, when an entity of the same entity category appears within that paragraph, it indicates the start of a new sub-paragraph. In some embodiments, the computer device groups the characters preceding the target entity into one sub-paragraph, and the target entity and the characters following it into another sub-paragraph. The target entity is the first entity of the same entity category that appears before any previously encountered entity. For example, if two entities of the same entity category (Time) and two entities of the same entity category (Company) are identified, if the Time appears before the Company, then the Time is taken as the target entity; if the Company appears before the Time, then the Company is taken as the target entity.
[0158] See Figure 13 , Figure 13 This is a flowchart of an entity extraction method provided in an embodiment of this application. The execution subject is a computer device, and it includes the following steps: 1301. Extract text to obtain introductory text data. 1302. Determine the order of the introductory text data. 1303. Perform topic classification and entity recognition on the introductory text data. 1304. Correct the topic category and entity category. 1305. Extract entities from the introductory text data.
[0159] In some embodiments, entity extraction is performed on the introduction file based on the method provided in the embodiments of this application and other methods respectively. The entity extraction results are shown in Tables 1 and 2. As can be seen from Tables 1 and 2, the entity extraction accuracy is higher by the method provided in the embodiments of this application.
[0160] Table 1
[0161]
[0162]
[0163] Table 2
[0164]
[0165]
[0166] In some embodiments, the performance of the backend server for entity extraction in this application embodiment is compared with that of the backend server of other methods. The comparison results are shown in Table 3. As can be seen from Table 3, the backend server in this application embodiment outperforms the backend servers of other methods in terms of concurrency, QPS, and average time per request. Here, QPS is used to represent the time required to extract entities from a brief description file.
[0167] Table 3
[0168] Concurrency QPS Average time per request Other methods backend server 100 4.34s 1.4s This application's backend server 400 5.06s 1.2s
[0169] This application provides an entity extraction method. Because the method extracts text from the description document, it enables topic classification and entity recognition based on the extracted characters. Furthermore, if the topic category and entity category of any line of characters meet the target conditions, one of the topic category and entity category is used to correct the other. This corrected topic category and entity category have higher accuracy, resulting in more accurate entity extraction when extracting entities from the description text data, thus improving the accuracy of entity extraction.
[0170] Figure 14 This is a block diagram of an entity extraction apparatus according to an embodiment of this application. The apparatus is used to perform the steps of the entity extraction method described above, see [link to relevant documentation]. Figure 14 The device includes:
[0171] The text extraction module 1401 is used to extract text from the description file of the target object to obtain description text data. The description text data includes multiple lines of characters. The description file is used to describe the target object.
[0172] The topic classification module 1402 is used to classify the topic of each line of characters in the multi-line introductory text data to obtain the topic category to which each line of characters belongs.
[0173] The entity recognition module 1403 is used to perform entity recognition on each line of characters to obtain the entity category to which each line of characters belongs;
[0174] The first correction module 1404 is used to correct one of the topic category and entity category based on the other when the topic category and entity category of any line of characters meet the target conditions.
[0175] The entity extraction module 1405 is used to extract entities from the descriptive text data based on the corrected topic category and corrected entity category to which each line of characters belongs.
[0176] In some embodiments, the entity category to which each line of characters belongs includes the entity categories to which multiple characters in each line of characters belong. The first correction module 1404 is used to:
[0177] Match the topic category and entity category to which the line character belongs;
[0178] If the proportion of the target entity category in the entity category to which multiple characters belong in a line character is greater than a preset proportion, determine the target topic category corresponding to the entity category to which the multiple characters belong, update the topic category to which the line character belongs to the target topic category, and the target entity category refers to the entity category that does not match the topic category to which the line character belongs;
[0179] If the proportion of the target entity category in the entity categories to which multiple characters in a line character belong is not greater than a preset proportion, the target entity category is corrected based on the topic category to which the line character belongs, and an entity category matching the topic category to which the line character belongs is obtained.
[0180] In some embodiments, the apparatus further includes:
[0181] The first determining module is used to determine the number of characters in each column of the introductory text data when the topic categories of the characters in multiple lines are interspersed.
[0182] The first execution module is used to re-execute the steps of classifying the topic of each line of characters in the summary text data for each line of characters in the case of N consecutive blank columns, and obtaining the topic category to which each line of characters belongs. The multi-column characters are characters other than the characters in the N consecutive columns, where N is an integer greater than 0.
[0183] In some embodiments, the apparatus further includes:
[0184] The second determining module is used to determine the number of characters in each column of the descriptive text data;
[0185] The second execution module is used to perform the following steps when there are no consecutive N blank columns: for multiple lines of characters in the summary text data, classify each line of characters into a topic and obtain the topic category to which each line of characters belongs, where N is an integer greater than 0.
[0186] In some embodiments, the apparatus further includes:
[0187] The third execution module is used to perform the following steps for each line of characters in the summary text data when there are N consecutive blank columns: classify the topic of each line of characters and obtain the topic category to which each line of characters belongs. The multi-column characters are characters other than those in the N consecutive blank columns.
[0188] In some embodiments, the apparatus further includes:
[0189] The second correction module is used to correct the topic category and entity category of the target line character based on the topic category to which the line character belongs, when the topic category to which any line character belongs carries a first-line identifier. The target line character includes at least one line of characters arranged after the line character. The first-line identifier is used to indicate that the line character is the first line character of the topic category among multiple lines of characters. The corrected topic category and corrected entity category are used to extract entities from the summary text data.
[0190] In some embodiments, the topic classification module 1402 is used for:
[0191] For each line of characters, the topic category to which the line character belongs is determined based on the line character and auxiliary characters, where auxiliary characters include at least one line of characters adjacent to the line character.
[0192] In some embodiments, the topic category to which each line of characters belongs is obtained based on a topic classification model. The topic classification module 1402 is used for:
[0193] Concatenate the line character and auxiliary character in a preset order to obtain the concatenated character;
[0194] Input the concatenated characters into the topic classification model;
[0195] The text vector of the concatenated characters is determined using a topic classification model;
[0196] Based on the text vector, the topic category to which the line characters belong is obtained.
[0197] In some embodiments, the entity extraction module 1405 is used for:
[0198] Based on the corrected topic category to which each line of characters belongs, the introductory text data is segmented to obtain multiple topic paragraphs. Each topic paragraph includes at least one line of characters belonging to the same topic category.
[0199] For each topic paragraph, extract the entity corresponding to the corrected entity category to which at least one line of characters in the topic paragraph belongs.
[0200] This application provides an entity extraction device. Because it extracts text from a brief description document, it enables topic classification and entity recognition based on the extracted characters. Furthermore, if the topic category and entity category of any line of characters meet the target conditions, it corrects one of the topic category and entity category for the other. This corrected topic category and entity category have higher accuracy, resulting in more accurate entity extraction when extracting entities from the brief description text data, thus improving the accuracy of entity extraction.
[0201] In the embodiments of this application, the computer device can be a terminal or a server. When the computer device is a terminal, the terminal acts as the execution subject to implement the technical solution provided in the embodiments of this application; when the computer device is a server, the server acts as the execution subject to implement the technical solution provided in the embodiments of this application; or, the technical solution provided in this application can be implemented through the interaction between the terminal and the server. The embodiments of this application do not limit this.
[0202] Figure 15 A structural block diagram of a terminal 1500 provided in an exemplary embodiment of this application is shown. The terminal 1500 may be a portable mobile terminal, such as a smartphone, tablet computer, MP3 player (Moving Picture Experts Group Audio Layer III), MP4 player (Moving Picture Experts Group Audio Layer IV), laptop computer, or desktop computer. The terminal 1500 may also be referred to as a user device, portable terminal, laptop terminal, desktop terminal, or other names.
[0203] Typically, terminal 1500 includes a processor 1501 and a memory 1502.
[0204] Processor 1501 may include one or more processing cores, such as a quad-core processor, an octa-core processor, etc. Processor 1501 may be implemented using at least one hardware form selected from DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). Processor 1501 may also include a main processor and a coprocessor. The main processor, also known as a CPU (Central Processing Unit), is used to process data in the wake-up state; the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, processor 1501 may integrate a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content required to be displayed on the screen. In some embodiments, processor 1501 may also include an AI (Artificial Intelligence) processor, which is used to handle computational operations related to machine learning.
[0205] The memory 1502 may include one or more computer-readable storage media, which may be non-transitory. The memory 1502 may also include high-speed random access memory and non-volatile memory, such as one or more disk storage devices or flash memory devices. In some embodiments, the non-transitory computer-readable storage media in the memory 1502 are used to store at least one program code, which is executed by the processor 1501 to implement the entity extraction method provided in the method embodiments of this application.
[0206] In some embodiments, the terminal 1500 may also optionally include a peripheral device interface 1503 and at least one peripheral device. The processor 1501, memory 1502, and peripheral device interface 1503 can be connected via a bus or signal line. Each peripheral device can be connected to the peripheral device interface 1503 via a bus, signal line, or circuit board. Specifically, the peripheral device includes at least one of the following: radio frequency circuitry 1504, display screen 1505, camera assembly 1506, audio circuitry 1507, and power supply 1508.
[0207] Peripheral interface 1503 can be used to connect at least one I / O (Input / Output) related peripheral device to processor 1501 and memory 1502. In some embodiments, processor 1501, memory 1502 and peripheral interface 1503 are integrated on the same chip or circuit board; in some other embodiments, any one or two of processor 1501, memory 1502 and peripheral interface 1503 can be implemented on separate chips or circuit boards, which is not limited in this embodiment.
[0208] The radio frequency (RF) circuit 1504 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The RF circuit 1504 communicates with communication networks and other communication devices via electromagnetic signals. The RF circuit 1504 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals back into electrical signals. Optionally, the RF circuit 1504 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, etc. The RF circuit 1504 can communicate with other terminals through at least one wireless communication protocol. This wireless communication protocol includes, but is not limited to: the World Wide Web, metropolitan area networks, intranets, various generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and / or WiFi (Wireless Fidelity) networks. In some embodiments, the RF circuit 1504 may also include circuitry related to NFC (Near Field Communication), which is not limited in this application.
[0209] Display screen 1505 is used to display a UI (User Interface). This UI may include graphics, text, icons, videos, and any combination thereof. When display screen 1505 is a touch display screen, it also has the ability to collect touch signals on or above its surface. These touch signals can be input as control signals to processor 1501 for processing. In this case, display screen 1505 can also be used to provide virtual buttons and / or a virtual keyboard, also known as soft buttons and / or a soft keyboard. In some embodiments, there may be one display screen 1505, disposed on the front panel of terminal 1500; in other embodiments, there may be at least two display screens, disposed on different surfaces of terminal 1500 or in a folded design; in still other embodiments, display screen 1505 may be a flexible display screen, disposed on a curved or folded surface of terminal 1500. Furthermore, display screen 1505 may be configured as a non-rectangular, irregular shape, i.e., a non-rectangular screen. The display screen 1505 can be made of materials such as LCD (Liquid Crystal Display) and OLED (Organic Light-Emitting Diode).
[0210] The camera assembly 1506 is used to acquire images or videos. Optionally, the camera assembly 1506 includes a front-facing camera and a rear-facing camera. Typically, the front-facing camera is located on the front panel of the terminal, and the rear-facing camera is located on the back of the terminal. In some embodiments, there are at least two rear-facing cameras, which are any one of a main camera, a depth-sensing camera, a wide-angle camera, and a telephoto camera, to achieve background blurring by fusion of the main camera and the depth-sensing camera, panoramic shooting by fusion of the main camera and the wide-angle camera, VR (Virtual Reality) shooting, or other fusion shooting functions. In some embodiments, the camera assembly 1506 may also include a flash. The flash can be a single-color temperature flash or a dual-color temperature flash. A dual-color temperature flash refers to a combination of a warm-light flash and a cool-light flash, which can be used for light compensation at different color temperatures.
[0211] The audio circuit 1507 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, converting the sound waves into electrical signals that are input to the processor 1501 for processing, or input to the radio frequency circuit 1504 for voice communication. For stereo sound acquisition or noise reduction purposes, multiple microphones may be used, each positioned at a different location on the terminal 1500. The microphone may also be an array microphone or an omnidirectional microphone. The speaker is used to convert electrical signals from the processor 1501 or the radio frequency circuit 1504 into sound waves. The speaker may be a conventional diaphragm speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can convert electrical signals not only into audible sound waves but also into inaudible sound waves for purposes such as distance measurement. In some embodiments, the audio circuit 1507 may also include a headphone jack.
[0212] Power supply 1508 is used to power the various components in terminal 1500. Power supply 1508 can be AC power, DC power, a disposable battery, or a rechargeable battery. When power supply 1508 includes a rechargeable battery, the rechargeable battery can be a wired rechargeable battery or a wireless rechargeable battery. A wired rechargeable battery is a battery that is charged via a wired line, and a wireless rechargeable battery is a battery that is charged via a wireless coil. The rechargeable battery can also be used to support fast charging technology.
[0213] In some embodiments, the terminal 1500 further includes one or more sensors 1509. The one or more sensors 1509 include, but are not limited to: an acceleration sensor 1510, a gyroscope sensor 1511, a pressure sensor 1512, an optical sensor 1513, and a proximity sensor 1514.
[0214] Accelerometer 1510 can detect the magnitude of acceleration along the three axes of a coordinate system established by terminal 1500. For example, accelerometer 1510 can be used to detect the components of gravitational acceleration along the three axes. Processor 1501 can control display screen 1505 to display the user interface in either a landscape or portrait view based on the gravitational acceleration signal acquired by accelerometer 1510. Accelerometer 1510 can also be used for games or for acquiring user motion data.
[0215] The gyroscope sensor 1511 can detect the orientation and rotation angle of the terminal 1500. The gyroscope sensor 1511 can work in conjunction with the accelerometer sensor 1510 to collect 3D motion data from the user on the terminal 1500. Based on the data collected by the gyroscope sensor 1511, the processor 1501 can perform the following functions: motion sensing (e.g., changing the UI based on the user's tilt), image stabilization during shooting, game control, and inertial navigation.
[0216] The pressure sensor 1512 can be disposed on the side bezel of the terminal 1500 and / or on the lower layer of the display screen 1505. When the pressure sensor 1512 is disposed on the side bezel of the terminal 1500, it can detect the user's grip signal on the terminal 1500, and the processor 1501 can perform left / right hand recognition or quick operation based on the grip signal collected by the pressure sensor 1512. When the pressure sensor 1512 is disposed on the lower layer of the display screen 1505, the processor 1501 can control the operable controls on the UI interface based on the user's pressure operation on the display screen 1505. The operable controls include at least one of button controls, scroll bar controls, icon controls, and menu controls.
[0217] Optical sensor 1513 is used to collect ambient light intensity. In one embodiment, processor 1501 can control the display brightness of display screen 1505 based on the ambient light intensity collected by optical sensor 1513. Specifically, when the ambient light intensity is high, the display brightness of display screen 1505 is increased; when the ambient light intensity is low, the display brightness of display screen 1505 is decreased. In another embodiment, processor 1501 can also dynamically adjust the shooting parameters of camera assembly 1506 based on the ambient light intensity collected by optical sensor 1513.
[0218] The proximity sensor 1514, also known as a distance sensor, is typically located on the front panel of the terminal 1500. The proximity sensor 1514 is used to detect the distance between the user and the front of the terminal 1500. In one embodiment, when the proximity sensor 1514 detects that the distance between the user and the front of the terminal 1500 is gradually decreasing, the processor 1501 controls the display screen 1505 to switch from a screen-on state to a screen-off state; when the proximity sensor 1514 detects that the distance between the user and the front of the terminal 1500 is gradually increasing, the processor 1501 controls the display screen 1505 to switch from a screen-off state to a screen-on state.
[0219] Those skilled in the art will understand that Figure 15 The structure shown does not constitute a limitation on terminal 1500 and may include more or fewer components than shown, or combine certain components, or use different component arrangements.
[0220] Figure 16This is a schematic diagram of a server structure according to an embodiment of this application. The server 1600 can vary considerably due to different configurations or performance. It may include one or more Central Processing Units (CPUs) 1601 and one or more memories 1602. The memories 1602 are used to store executable program code, and the processors 1601 are configured to execute the executable program code to implement the entity extraction methods provided in the various method embodiments described above. Of course, the server may also have wired or wireless network interfaces, a keyboard, and input / output interfaces for input and output. The server may also include other components for implementing device functions, which will not be elaborated here.
[0221] This application also provides a computer-readable storage medium storing at least one piece of program code, which is loaded and executed by a processor to implement the entity extraction method of any of the above implementations.
[0222] This application also provides a computer program product, which includes computer program code stored in a computer-readable storage medium. The processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to perform the entity extraction method of any of the above implementations.
[0223] In some embodiments, the computer program product involved in the present application can be deployed and executed on a computer device, or on multiple computer devices located in one location, or on multiple computer devices distributed in multiple locations and interconnected through a communication network. Multiple computer devices distributed in multiple locations and interconnected through a communication network can form a blockchain system.
[0224] The above are merely optional embodiments of this application and are not intended to limit this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. An entity extraction method, characterized in that, The method includes: Text extraction is performed on the description file of the target object to obtain description text data, which includes multiple lines of characters. The description file is used to describe the target object. For the multi-line characters in the introductory text data, each line of characters is classified into a topic to obtain the topic category to which each line of characters belongs; Entity recognition is performed on the characters in each line to obtain the entity category to which the characters in each line belong; If the topic category and entity category to which the characters in any row belong meet the target conditions, the other is corrected based on one of the topic category and the entity category, wherein the target conditions are determined based on the matching between the topic category and the entity category; Based on the corrected topic category and corrected entity category to which the characters in each line belong, the entities in the introductory text data are extracted.
2. The method according to claim 1, characterized in that, The entity category to which each line of characters belongs includes the entity categories to which multiple characters in each line belong. If the topic category and entity category to which any line of characters belongs meet the target conditions, then, based on one of the topic category and the entity category, the other is corrected, including: Match the topic category and entity category to which the line characters belong; If the proportion of the target entity category in the entity category to which each of the multiple characters in the row belongs is greater than a preset proportion, the target topic category corresponding to the entity category to which each of the multiple characters belongs is determined, and the topic category to which the row belongs is updated to the target topic category. The target entity category refers to the entity category that does not match the topic category to which the row belongs. If the proportion of the target entity category in the entity categories to which multiple characters in the line characters belong is not greater than the preset proportion, the target entity category is corrected based on the topic category to which the line characters belong, to obtain an entity category that matches the topic category to which the line characters belong.
3. The method according to claim 1, characterized in that, The method further includes: In the case where the topic categories to which the characters in the multiple lines of text belong are interspersed, determine the number of characters in each column of the introductory text data; In the case of N consecutive blank columns, the step of classifying the topic of each line of characters in the summary text data for each column of characters is re-executed for each column of characters. The column of characters refers to the characters in the columns other than the N consecutive blank columns, where N is an integer greater than 0.
4. The method according to claim 1, characterized in that, The method further includes: Determine the number of characters in each column of the introductory text data; In the absence of N consecutive blank columns, the step of classifying the characters in each line of the introductory text data into a topic to obtain the topic category to which each line of characters belongs is performed, where N is an integer greater than 0.
5. The method according to claim 4, characterized in that, The method further includes: In the case of N consecutive blank columns, the steps described above are performed for each line of characters in the summary text data, classifying each line of characters into a topic to obtain the topic category to which each line of characters belongs. The multi-column characters are the characters in columns other than the N consecutive blank columns.
6. The method according to claim 1, characterized in that, The method further includes: If the topic category to which any line of characters belongs carries a first-line identifier, the topic category and entity category to which the target line character belongs are corrected based on the topic category to which the line character belongs. The target line character includes at least one line of characters arranged after the line character. The first-line identifier is used to indicate that the line character is the first line character of the topic category among multiple lines of characters. The corrected topic category and corrected entity category are used to extract entities from the summary text data.
7. The method according to claim 1, characterized in that, For the multi-line characters in the introductory text data, the topic classification of each line of characters is performed to obtain the topic category to which each line of characters belongs, including: For each line of characters, the topic category to which the line character belongs is determined based on the line character and auxiliary characters, wherein the auxiliary characters include at least one line of characters adjacent to the line character.
8. The method according to claim 7, characterized in that, The topic category to which each line of characters belongs is obtained based on a topic classification model. Determining the topic category to which the line characters belong based on the line characters and auxiliary characters includes: The line character and the auxiliary character are concatenated in a preset order to obtain the concatenated character; Input the concatenated characters into the topic classification model; The text vector of the concatenated characters is determined using the topic classification model. Based on the text vector, the topic category to which the line characters belong is obtained.
9. The method according to claim 1, characterized in that, The extraction of entities from the summary text data based on the corrected topic category and corrected entity category to which the characters in each line belong includes: Based on the corrected topic category to which each line of characters belongs, the introductory text data is segmented to obtain multiple topic paragraphs, each topic paragraph including at least one line of characters belonging to the same topic category; For each topic paragraph, extract the entity corresponding to the corrected entity category to which at least one line of characters in the topic paragraph belongs.
10. A solid extraction device, characterized in that, The device includes: The text extraction module is used to extract text from the description file of the target object to obtain description text data. The description text data includes multiple lines of characters. The description file is used to describe the target object. The topic classification module is used to classify the topic of each line of characters in the multi-line introductory text data to obtain the topic category to which each line of characters belongs. An entity recognition module is used to perform entity recognition on each line of characters to obtain the entity category to which each line of characters belongs; The first correction module is used to correct one of the topic category and the entity category based on one of the topic category and the entity category when the topic category and the entity category to which the characters in any line belong meet the target conditions. The target conditions are determined based on the matching between the topic category and the entity category. The entity extraction module is used to extract entities from the descriptive text data based on the corrected topic category and corrected entity category to which the characters in each line belong.
11. The apparatus according to claim 10, characterized in that, The entity category to which each line of characters belongs includes the entity categories to which multiple characters in each line belong. The first correction module is used for: Match the topic category and entity category to which the line characters belong; If the proportion of the target entity category in the entity category to which each of the multiple characters in the row belongs is greater than a preset proportion, the target topic category corresponding to the entity category to which each of the multiple characters belongs is determined, and the topic category to which the row belongs is updated to the target topic category. The target entity category refers to the entity category that does not match the topic category to which the row belongs. If the proportion of the target entity category in the entity categories to which multiple characters in the line characters belong is not greater than the preset proportion, the target entity category is corrected based on the topic category to which the line characters belong, to obtain an entity category that matches the topic category to which the line characters belong.
12. The apparatus according to claim 10, characterized in that, The device further includes: The first determining module is used to determine the number of characters in each column of the introductory text data when the topic categories to which the multi-line characters belong are interspersed. The first execution module is used to re-execute the step of classifying the topic of each line of characters in the summary text data for each line of characters in the case of N consecutive blank columns, and obtaining the topic category to which each line of characters belongs, for the multi-column characters. The multi-column characters are the characters in the columns other than the N consecutive blank columns, and N is an integer greater than 0.
13. The apparatus according to claim 10, characterized in that, The device further includes: The second determining module is used to determine the number of characters in each column of the introductory text data; The second execution module is used to perform the step of classifying the characters in each line of the summary text data into a topic and obtaining the topic category to which each line of characters belongs, in the absence of N consecutive blank columns, where N is an integer greater than 0.
14. The apparatus according to claim 13, characterized in that, The device further includes: The third execution module is used to perform the following steps on the multi-column characters when there are N consecutive blank columns: classify the characters in the multi-line text data into topics and obtain the topic category to which each line of characters belongs. The multi-column characters are the characters in columns other than the N consecutive blank columns.
15. The apparatus according to claim 10, characterized in that, The device further includes: The second correction module is used to correct the topic category and entity category of a target line character based on the topic category to which the character in any line belongs, provided that the topic category to which the character in any line belongs carries a first-line identifier. The target line character includes at least one line of characters arranged after the line character. The first-line identifier is used to indicate that the line character is the first line character of the topic category among multiple lines of characters. The corrected topic category and corrected entity category are used to extract entities from the summary text data.
16. The apparatus according to claim 10, characterized in that, The topic classification module is used for: For each line of characters, the topic category to which the line character belongs is determined based on the line character and auxiliary characters, wherein the auxiliary characters include at least one line of characters adjacent to the line character.
17. The apparatus according to claim 16, characterized in that, The topic category to which each line of characters belongs is obtained based on a topic classification model. The topic classification module is used for: The line character and the auxiliary character are concatenated in a preset order to obtain the concatenated character; Input the concatenated characters into the topic classification model; The text vector of the concatenated characters is determined using the topic classification model. Based on the text vector, the topic category to which the line characters belong is obtained.
18. The apparatus according to claim 10, characterized in that, The entity extraction module is used for: Based on the corrected topic category to which each line of characters belongs, the introductory text data is segmented to obtain multiple topic paragraphs, each topic paragraph including at least one line of characters belonging to the same topic category; For each topic paragraph, extract the entity corresponding to the corrected entity category to which at least one line of characters in the topic paragraph belongs.
19. A computer device, characterized in that, The computer device includes a processor and a memory, the memory being used to store at least one computer program, the at least one computer program being loaded by the processor and executed as the entity extraction method according to any one of claims 1 to 9.
20. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store at least one computer program for performing the entity extraction method according to any one of claims 1 to 9.
21. A computer program product, characterized in that, The computer program product includes computer program code stored in a computer-readable storage medium. A processor of a computer device reads the computer program code from the computer-readable storage medium and executes the computer program code, causing the computer device to perform the entity extraction method as described in any one of claims 1 to 9.