Data processing methods, device, computer-readable storage medium, and computer program product

By introducing adjustable general training parameters and associated node edges into the text recognition model, and directly using node initial vectors for relationship prediction, it solves the problems of low model scalability and waste of computing resources in the existing technology, and achieves efficient text recognition. and production efficiency.

WO2024179035A1PCT designated stage expired Publication Date: 2024-09-06TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/130985
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-02-27
Filing Date
2023-11-10
Publication Date
2024-09-06

AI Technical Summary

Technical Problem

Existing text recognition models have low scalability, serious waste of computing resources, and low model parameter update efficiency, resulting in reduced generation efficiency.

Method used

By introducing adjustable general training parameters, associated node edges are generated, and node initial vectors are directly used for relationship prediction, avoiding the inference layer, improving the model's ability to handle different graph structures, and simplifying the training process.

Benefits of technology

It improves the ductility and generation efficiency of the text recognition model, reduces the consumption of computing resources, and simplifies the model parameter update process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023130985_06092024_PF_FP
    Figure CN2023130985_06092024_PF_FP
Patent Text Reader

Abstract

Disclosed in the embodiments of the present application are data processing methods, a device, and a computer-readable storage medium. A method comprises: inputting a training sample set into a text recognition initial model, and, by means of the text recognition initial model, generating node initial vectors respectively corresponding to at least two nodes, the at least two nodes comprising A sentence nodes and at least two entity nodes; according to the at least two nodes, generating an associated node edge, and according to universal training parameters of the associated node edge and the two node initial vectors of the associated node edge, determining an edge initial vector of the associated node edge; and, according to the node initial vectors corresponding to each two entity nodes respectively, a tag entity word pair and a graph initial structure, adjusting the parameters in the text recognition initial model.
Need to check novelty before this filing date? Find Prior Art

Description

Data processing method, device, computer-readable storage medium, and computer program product

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application is based on the Chinese patent application with application number 202310215937.X and application date of February 27, 2023, and claims the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field

[0003] The present application relates to the field of Internet technology, and in particular to a data processing method, device, computer-readable storage medium, and computer program product. Background Art

[0004] In business scenarios such as text recognition, text classification, and text recommendation, accurately identifying the entity relationships between entities in the text is crucial.

[0005] The entity relationship recognition method in the related art is based on a machine learning method. Therefore, it is necessary to train an initial text recognition model using a training sample set to obtain a text recognition model applied in the business scenario. In the related art, the training process of the initial text recognition model mainly includes four steps: 1. Generate a word segmentation encoding vector corresponding to each word segmentation in the sample text; 2. Construct a graph initial structure including node initial vectors and edge initial vectors through multiple word segmentation encoding vectors, and the initial edge vector is generated only through the node initial vector; 3. Infer the edge initial vector and use the inferred edge vector to generate the entity edge vector of the entity pair; 4. Predict the relationship between the entity pair through the entity edge vector. Obviously, in the related art, since the initial edge vector is generated only through the node initial vector, the scalability of the initial text recognition model is low. In addition, the related art needs to infer the edge initial vector before adjusting the model parameters each time. However, the inference process of the edge initial vector not only consumes a lot of computing resources, but also reduces the update efficiency of the model parameters, thereby reducing the generation efficiency of the text recognition model.

[0006] Summary of the Invention

[0007] The embodiments of the present application provide a data processing method, device, computer-readable storage medium, and computer program product, which can not only improve the scalability of the initial text recognition model, but also reduce the waste of computing resources and improve the generation efficiency of the text recognition model.

[0008] The present invention provides a data processing method, including:

[0009] Obtaining a training sample set; the training sample set includes a sample text, at least two label entity words in the sample text, and a label entity word pair carrying a label relationship;

[0010] Input the training sample set into the text recognition initial model, and generate node initial vectors corresponding to at least two nodes through the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences belonging to the sample text, and entity nodes corresponding to at least two label entity words; A is a positive integer;

[0011] Generate an associated node edge based on at least two nodes, and determine an edge initialization vector corresponding to the associated node edge based on a universal training parameter of the associated node edge and node initialization vectors corresponding to two nodes connected by the associated node edge;

[0012] Generate a graph initial structure including at least two node initial vectors and edge initial vectors, adjust the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to each two entity nodes, and obtain a text recognition model for determining entity word pairs with label relationships in the text; the parameters in the text recognition initial model include general training parameters.

[0013] The present invention provides a data processing method, including:

[0014] Obtain text and input the text into a text recognition model; the text includes K entity words to be recognized; K is a positive integer greater than 1; the text recognition model is obtained by adjusting the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to each two entity nodes; the graph initial structure includes node initial vectors and edge initial vectors corresponding to at least two nodes respectively; the at least two node initial vectors are generated by inputting a training sample set including sample text, at least two label entity words in the sample text and label entity word pairs carrying label relationships into the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences in the sample text and entity nodes corresponding to at least two label entity words respectively; A is a positive integer; the edge initial vector is determined according to the general training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge; the associated node edge is generated based on at least two nodes; the parameters in the text recognition initial model include general training parameters;

[0015] Through the text recognition model, determine the entity word pairs with label relationships among the K entity words to be identified.

[0016] An embodiment of the present application provides a data processing device, including:

[0017] A sample acquisition module is configured to acquire a training sample set; the training sample set includes a sample text, at least two label entity words in the sample text, and a label entity word pair carrying a label relationship;

[0018] A first generation module is configured to input the training sample set into the text recognition initial model, and generate node initial vectors corresponding to at least two nodes respectively through the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences belonging to the sample text, and entity nodes corresponding to at least two label entity words respectively; A is a positive integer;

[0019] A second generating module is configured to generate an associated node edge based on at least two nodes, and determine an edge initialization vector corresponding to the associated node edge based on a universal training parameter of the associated node edge and node initialization vectors corresponding to two nodes connected by the associated node edge;

[0020] The third generation module is configured to generate a graph initial structure including at least two node initial vectors and edge initial vectors, and adjust the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to each two entity nodes to obtain a text recognition model for determining entity word pairs with label relationships in the text; the parameters in the text recognition initial model include general training parameters.

[0021] An embodiment of the present application provides a data processing device, including:

[0022] A text input module is configured to obtain text and input the text into a text recognition model; the text includes K entity words to be recognized; K is a positive integer greater than 1; the text recognition model is obtained by adjusting the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to each two entity nodes; the graph initial structure includes node initial vectors and edge initial vectors corresponding to at least two nodes respectively; the at least two node initial vectors are generated by inputting a training sample set including sample text, at least two label entity words in the sample text and label entity word pairs carrying label relationships into the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences in the sample text and entity nodes corresponding to at least two label entity words respectively; A is a positive integer; the edge initial vector is determined according to the general training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge; the associated node edge is generated based on at least two nodes; the parameters in the text recognition initial model include general training parameters;

[0023] The relationship determination module is configured to determine entity word pairs with label relationships among K entity words to be identified through a text recognition model.

[0024] An embodiment of the present application provides a computer device, including: a processor, a memory, and a network interface;

[0025] The above-mentioned processor is connected to the above-mentioned memory and the above-mentioned network interface, wherein the above-mentioned network interface is used to provide data communication function, the above-mentioned memory is used to store computer programs, and the above-mentioned processor is used to call the above-mentioned computer program so that the computer device executes the method in the embodiment of the present application.

[0026] An embodiment of the present application provides a computer-readable storage medium, in which a computer program is stored. The computer program is suitable for being loaded by a processor and executing the method in the embodiment of the present application.

[0027] An embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium; a processor of a computer device reads the computer program from the computer-readable storage medium, and the processor executes the computer program, so that the computer device executes the method in the embodiment of the present application.

[0028] The embodiment of the present application introduces adjustable universal training parameters on the associated node edges, so that the model can better handle different graph structures during training, thereby improving the scalability of the initial model of text recognition, thereby improving the processing effect of the initial model of text recognition for different graph structures; in addition, the embodiment of the present application does not need to infer the initial vectors of the edges, so it can reduce the waste of computing resources, and compared with related technologies, since the inference layer is abandoned, the processing process of inferring the initial vectors of the edges is avoided, the training process is simplified, the model parameters can be quickly updated, and the generation efficiency of the text recognition model can be improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the following briefly introduces the drawings required for use in the embodiments or related technical descriptions. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0030] FIG1 is a schematic diagram of a system architecture provided by an embodiment of the present application;

[0031] FIG2 is a schematic diagram of a data processing scenario provided by an embodiment of the present application;

[0032] FIG3 is a second schematic diagram of a data processing scenario provided by an embodiment of the present application;

[0033] FIG4 is a flowchart of a data processing method according to an embodiment of the present application;

[0034] FIG5 is a second flow chart of a data processing method provided in an embodiment of the present application;

[0035] FIG6 is a third flow chart of a data processing method provided in an embodiment of the present application;

[0036] FIG7 is a first structural diagram of a data processing device provided in an embodiment of the present application;

[0037] FIG8 is a second structural diagram of a data processing device provided in an embodiment of the present application;

[0038] FIG9 is a schematic structural diagram of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0039] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0040] To facilitate understanding, we first provide a brief explanation of some nouns:

[0041] Artificial Intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to 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 seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also involves studying the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.

[0042] Artificial intelligence (AI) technology is a comprehensive discipline encompassing a wide range of fields, encompassing both hardware and software technologies. Foundational AI technologies generally include sensors, specialized AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, as well as machine learning / deep learning, autonomous driving, and smart transportation.

[0043] Computer vision technology (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to machine vision such as using cameras and computers to replace human eyes to identify and measure targets, and further perform graphic processing so that computer processing becomes an image that is more suitable for human eye observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multidimensional data. Computer vision technology generally includes image processing, image recognition, image semantic understanding, image retrieval, optical character recognition (OCR), video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and mapping, autonomous driving, smart transportation and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition. In the embodiment of the present application, computer vision technology can be used to construct the initial structure of the graph.

[0044] Natural language processing (NLP) is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can enable effective communication between humans and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language people use in daily life, so it is closely related to the study of linguistics. Natural language processing technology generally includes text processing, semantic understanding, machine translation, robot question answering, knowledge graphs and other technologies. In the embodiment of the present application, natural language processing can be used to generate word segmentation encoding vectors corresponding to each word in the text.

[0045] Machine Learning (ML) is a multi-disciplinary interdisciplinary subject involving probability theory, statistics, approximation theory, convex analysis, algorithmic complexity theory and other disciplines. It specializes in studying how computers simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their own performance. Machine learning is the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications are spread across all areas of artificial intelligence. Machine learning and deep learning generally include artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning. In an embodiment of the present application, the text recognition model is an AI model based on machine learning, and the text recognition model can be used to identify and process text and generate entity pairs with label relationships.

[0046] Please refer to Figure 1, which is a schematic diagram of a system architecture provided by an embodiment of the present application. As shown in Figure 1, the system may include a service server 100 and a terminal device cluster. The terminal device cluster may include: terminal device 200a, terminal device 200b, terminal device 200c, ..., terminal device 200n. It is understood that the above system may include one or more terminal devices, and this application does not limit the number of terminal devices.

[0047] Among them, there can be communication connections between terminal device clusters, for example, there is a communication connection between terminal device 200a and terminal device 200b, and there is a communication connection between terminal device 200a and terminal device 200c. At the same time, any terminal device in the terminal device cluster can have a communication connection with the business server 100, for example, there is a communication connection between terminal device 200a and business server 100. The above-mentioned communication connection is not limited to the connection method, and can be directly or indirectly connected through wired communication, directly or indirectly connected through wireless communication, or through other methods, and the embodiments of the present application do not limit this.

[0048] It should be understood that each terminal device in the terminal device cluster shown in FIG1 may be installed with an application client. When the application client is running in each terminal device, it can respectively exchange data with the service server 100 shown in FIG1, i.e., the aforementioned communication connection. The application client may be a video application, live broadcast application, social application, instant messaging application, game application, music application, shopping application, novel application, browser, or other application client with text recognition function.

[0049] The application client can be an independent client or an embedded sub-client integrated into a client (e.g., a social client, an educational client, a multimedia client, etc.), which is not limited here. Taking the novel application as an example, the business server 100 can be a collection of multiple servers including a background server corresponding to the novel application, a data processing server, etc. Therefore, each terminal device can transmit data with the business server 100 through the application client corresponding to the novel application. For example, each terminal device can upload text to the business server 100 through the application client of the novel application, and then the business server 100 can determine the text type of the text or recommend similar texts.

[0050] It is understandable that in the specific implementation of this application, related data such as user information (such as training sample sets) is involved. When the embodiments in this application are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0051] To facilitate subsequent understanding and explanation, in the embodiment of the present application, a terminal device can be selected from the terminal device cluster shown in FIG1 as a target terminal device, for example, terminal device 200a is selected as the target terminal device. Upon receiving a model training instruction for the text recognition initial model, terminal device 200a can send a model training request for the text recognition initial model to the business server 100 through the application client. The text recognition initial model refers to a neural network model used to recognize text and generate entity relationships between entity words in the text.

[0052] After receiving the model training request sent by the terminal device 200a, the business server 100 can obtain a training sample set and an initial text recognition model, wherein the training sample set includes sample text, entity words marked in the sample text, and label entity word pairs carrying label relationships. In the embodiment of the present application, the marked entity words are referred to as label entity words. The embodiment of the present application does not limit the type and source of the sample text, and can be set according to the actual training scenario. The sample text can be a sentence text, a paragraph text, or an article text. It is understandable that there may be mentions of label entity words in the sample text (especially article text), such as abbreviations of label entity words, pronouns, etc., so the training sample set can also include mentioned words marked in the sample text. In the embodiment of the present application, the mentioned words marked are referred to as label mentions. The embodiments of the present application do not limit label relationships and label entity word pairs, and can be set according to actual training scenarios. For example, if the label relationship is a position relationship, the label entity word pair can include location a and location b, and the position relationship can indicate that location a is located at location b. For another example, if the label relationship is an ownership relationship, the label entity word pair can include object a and object b, and the ownership relationship can indicate that object a belongs to object b. The embodiments of the present application do not limit the manner in which the business server 100 obtains the training sample set and the initial text recognition model, and can be set according to actual training scenarios. For example, the model training request sent by the terminal device 200a carries the training sample set and / or the initial text recognition model, for example, the business server 100 obtains the training sample set and / or the initial text recognition model from a database, for example, obtains the training sample set and / or the initial text recognition model from a blockchain network.

[0053] The business server 100 inputs the training sample set into the text recognition initial model. Through the text recognition initial model, the business server 100 can generate node initial vectors corresponding to at least two nodes respectively, wherein the at least two nodes include sentence nodes corresponding to A sample sentences belonging to the sample text, and entity nodes corresponding to at least two label entity words respectively; A is a positive integer. In some embodiments, if the sample text also includes label mention words, the at least two nodes also include mention nodes corresponding to the label mention words. The embodiment of the present application does not limit the total number of sample sentences and label mention words respectively, and should be set according to the actual training scenario. Based on at least two nodes, the business server 100 can generate associated node edges. The associated node edges are generated based on the association between the various elements in the sample text (i.e., sample sentences, label entity words, and label mention words). For example, the generation process will not be described in detail here. Please refer to the description of step S103 in the embodiment corresponding to Figure 4 below.

[0054] In an embodiment of the present application, universal training parameters are added to the associated node edges. Based on the universal training parameters of the associated node edges and the node initial vectors corresponding to the two nodes connected by the associated node edges, the business server 100 can determine the edge initial vector corresponding to the associated node edges. The business server 100 can generate a graph initial structure including at least two node initial vectors and edge initial vectors. Based on the node initial vectors corresponding to each two entity nodes, the label entity word pairs, and the graph initial structure, the parameters in the text recognition initial model can be adjusted to obtain a text recognition model for determining entity word pairs with label relationships in text, wherein the parameters in the text recognition initial model include universal training parameters.

[0055] Subsequently, the business server 100 may generate a model training completion message for the text recognition model and send the model training completion message to the terminal device 200a. After receiving the model training completion message sent by the business server 100, the terminal device 200a may obtain the text recognition model. The embodiment of the present application does not limit the manner in which the terminal device 200a obtains the text recognition model, and may be set according to the actual application scenario. For example, the model training completion message may carry the text recognition model, or the text recognition model may be obtained from a database or a blockchain network.

[0056] In some embodiments, if the terminal device 200a locally stores the above-mentioned text recognition initial model and training sample set, and the terminal device 200a has offline computing capabilities, then when the terminal device 200a receives a model training instruction for the text recognition initial model, it can locally train the text recognition initial model through the training sample set to obtain a text recognition model. It can be understood that the process of the terminal device 200a locally training the text recognition initial model through the training sample set is the same as the process of the business server 100 training the text recognition initial model through the training sample set. Therefore, the specific process of the terminal device 200a locally training the text recognition initial model is not repeated here. Please refer to the above description.

[0057] It should be noted that the above-mentioned business server 100, terminal device 200a, terminal device 200b, terminal device 200c..., terminal device 200n can all be blockchain nodes in the blockchain network, and the data of the full text description (such as the training sample set and the text recognition initial model) can be stored. The storage method can be that the blockchain node generates blocks based on the data and adds the blocks to the blockchain for storage.

[0058] Blockchain is a novel application model of computer technologies, integrating distributed data storage, peer-to-peer transmission, consensus mechanisms, and encryption algorithms. It primarily organizes data in chronological order and encrypts it into a ledger, rendering it tamper-proof and forgery-proof. It also enables data verification, storage, and updates. A blockchain is essentially a decentralized database, in which each node stores an identical blockchain. A blockchain network can categorize nodes into core nodes, data nodes, and light nodes. Core nodes, data nodes, and light nodes collectively constitute blockchain nodes. Core nodes are responsible for consensus across the entire blockchain network; in other words, they serve as consensus nodes within the blockchain network. The process by which transaction data is written to the ledger in a blockchain network involves data nodes or light nodes acquiring transaction data and passing it around the network (in a relay-like fashion) until a consensus node receives the transaction data. The consensus node then packages the transaction data into a block, performs consensus on the block, and writes the transaction data to the ledger after consensus is complete. Here, transaction data of the training sample set and the initial text recognition model are used as examples. After reaching a consensus on the transaction data, the business server 100 (blockchain node) generates a block based on the transaction data and stores the block in the blockchain network. As for reading the transaction data (i.e., the training sample set and the initial text recognition model), the blockchain node can obtain the block containing the transaction data in the blockchain network and obtain the transaction data in the block.

[0059] It is understandable that the method provided in the embodiments of the present application can be executed by a computer device, including but not limited to a terminal device or a business server. Among them, the business server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud databases, cloud services, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. Terminal devices include but are not limited to mobile phones, computers, intelligent voice interaction devices, smart home appliances, vehicle-mounted terminals, aircraft, etc. Among them, the terminal device and the business server can be directly or indirectly connected by wired or wireless means, and the embodiments of the present application are not limited here.

[0060] Please refer to Figure 2, which is a schematic diagram of a data processing scenario provided by an embodiment of the present application. The embodiment of the present application can be applied to various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving, audio and video, etc. The embodiment of the present application can be applicable to business scenarios such as text recognition scenarios, text search scenarios, text recommendation scenarios, and text classification scenarios. For example, business scenarios will not be listed one by one here. Among them, the implementation process of the data processing scenario can be carried out in a business server, or in a terminal device, or interactively in a terminal device and a business server, and there is no restriction here. Among them, the terminal device can be any terminal device in the terminal device cluster of the embodiment corresponding to Figure 1 above, and the business server can be the business server 100 of the embodiment corresponding to Figure 1 above. For the convenience of description and understanding, the embodiment of the present application is described by taking the operation in the business server as an example.

[0061] As shown in Figure 2, the business server 100 can obtain a training sample set 20a and a text recognition initial model 20b, wherein the training sample set 20a can include a sample text 201a and a label entity word pair 202a with a label relationship. For the convenience of description and understanding, the sample text 201a of the embodiment of the present application includes 3 sample sentences, that is, A is equal to 3, as shown in Figure 2 as the first sample sentence "XXX1............", the second sample sentence ".........SS1,...XXX2", and the third sample sentence ".........XXX3,......SS2". The sample text 201a may include at least two label entity words and a label mention word set. The total number of label entity words in the example in Figure 2 is 3, namely, label entity word XXX1, label entity word XXX2 and label entity word XXX3. The label mention word set in the example in Figure 2 includes 2 label mention words, namely, label mention word SS1 and label mention word SS2. For ease of understanding and description, FIG2 illustrates a total of two tag entity word pairs 202a. The first tag entity word pair is (XXX1, position relationship, XXX2), and the second tag entity word pair is (XXX1, position relationship, XXX3). FIG2 illustrates a tag relationship using position relationships. It is understandable that the tag entity words in tag entity word pair 202a all belong to the tag entity words in sample text 201a.

[0062] The business server 100 inputs the training sample set 20a into the text recognition initial model 20b. As shown in FIG2 , the text recognition initial model 20b may include a text encoding initial layer 201b, a graph construction initial layer 202b, and a relationship prediction initial layer 203b. Through the text encoding initial layer 201b, the business server 100 can generate word segmentation encoding vectors corresponding to at least two word segments in the sample text 201a, such as the at least two word segmentation encoding vectors 20c shown in FIG2 . The specific generation process of the at least two word segmentation encoding vectors 20c will not be described in detail here. Please refer to the description of step S102 in the embodiment corresponding to FIG4 below. The business server 100 inputs at least two word segmentation encoding vectors 20c into the graph construction initial layer 202b. Through the graph construction initial layer 202b, the entity nodes corresponding to the three label entity words shown in Figure 2 and the sentence nodes corresponding to the three sample sentences can be constructed. The three entity nodes are the three black circular nodes shown in Figure 2 (including the entity node 201d in Figure 2), and the three sentence nodes are the three dotted circular nodes shown in Figure 2 (including the sentence node 202d in Figure 2). In addition, the sample text 201a also includes two label mention words (i.e., the label mention word SS1 and the label mention word SS2 in Figure 2). Therefore, the business server 100 can also construct the mention nodes corresponding to the two label mention words shown in Figure 2 through the graph construction initial layer 202b. The two mention nodes are the two white circular nodes shown in Figure 2 (including the mention node 203d in Figure 2).

[0063] Therefore, the business server 100 can determine the above-mentioned three entity nodes (including entity node 201d in Figure 2), three sentence nodes (including sentence node 202d in Figure 2), and two mention nodes (including mention node 203d in Figure 2) as at least two nodes 20d. Based on the at least two word segmentation encoding vectors 20c, in the graph construction encoding initial layer 202c, the business server 100 can generate node initialization vectors corresponding to the at least two nodes 20d, such as the at least two node initialization vectors 20e shown in Figure 2, specifically including the node initialization vectors corresponding to the three entity nodes in Figure 2, such as the node initialization vector 201e corresponding to the entity node 201d, the node initialization vectors corresponding to the three sentence nodes in Figure 2, such as the node initialization vector 202e corresponding to the sentence node 202d, and the node initialization vectors corresponding to the two mention nodes in Figure 2, such as the node initialization vector 203e corresponding to the mention node 203d. The specific process of generating at least two node initial vectors 20e is not described in detail here. Please refer to the description of step S102 in the embodiment corresponding to FIG. 4 below.

[0064] In this embodiment of the present application, the text recognition initial model 20b does not include an inference layer, so the service server 100 can directly input at least two entity nodes (i.e., the three black circular nodes in Figure 2, such as entity node 201e) into the relationship prediction initial layer 203b. Through the relationship prediction initial layer 203b, the service server 100 processes the node initial vectors corresponding to each two entity nodes to generate a predicted relationship corresponding to each two entity nodes, that is, a predicted relationship corresponding to each two label entity words. As shown in FIG2 , through the initial relationship prediction layer 203b, the business server 100 processes the node initial vectors 201e and 202e and determines that the tag entity word XXX1 and the tag entity word XXX2 are predicted as relationship 1. Through the initial relationship prediction layer 203b, the business server 100 processes the node initial vectors 201e and 203e and determines that the tag entity word XXX1 and the tag entity word XXX3 are predicted as relationship 2. Through the initial relationship prediction layer 203b, the business server 100 processes the node initial vectors 202e and 203e and determines that the tag entity word XXX2 and the tag entity word XXX3 are predicted as relationship 3. Based on the predicted relationships 1, 2, and 3, as well as the tag entity word pairs 202a with tag relationships, the business server 100 can determine the model loss value of the initial text recognition model 20b.

[0065] In addition, the business server 100 needs to determine the initial structure of the graph corresponding to the sample text 201a, so in the initial graph construction layer 202b, an associated node edge is generated based on at least two nodes 20d. Please refer to Figure 3, which is a second schematic diagram of a data processing scenario provided in an embodiment of the present application. As shown in Figure 3, because the label entity word XXX1 belongs to the first sample sentence, there is a node edge between the entity node used to represent the label entity word XXX1 (equivalent to the entity node 201d in Figure 2) and the sentence node used to represent the first sample sentence (equivalent to the sentence node 202d in Figure 2), and the type of the node edge belongs to the entity-sentence edge type; similarly, because the label entity word XXX2 belongs to the second sample sentence, there is a node edge between the entity node used to represent the label entity word XXX2 (equivalent to the entity node 204d in Figure 2) and the sentence node used to represent the second sample sentence (equivalent to the sentence node 205d in Figure 2), and the type of the node edge belongs to the entity-sentence edge type; similarly, because the label entity word XXX3 belongs to the third sample sentence, there is a node edge between the entity node used to represent the label entity word XXX3 (equivalent to the entity node 207d in Figure 2) and the sentence node used to represent the third sample sentence (equivalent to the sentence node 208d in Figure 2), and the type of the node edge belongs to the entity-sentence edge type.

[0066] The business server 100 constructs a node edge between the sentence node used to represent the first sample sentence and the sentence node used to represent the second sample sentence, and the type of the node edge belongs to the sentence-sentence edge type; constructs a node edge between the sentence node used to represent the first sample sentence and the sentence node used to represent the third sample sentence, and the type of the node edge belongs to the sentence-sentence edge type; constructs a node edge between the sentence node used to represent the second sample sentence and the sentence node used to represent the third sample sentence, and the type of the node edge belongs to the sentence-sentence edge type.

[0067] Please refer to the sample text 201a in Figure 2 again. Since the label mention word SS1 belongs to the second sample sentence, there is a node edge between the mention node used to represent the label mention word SS1 (equivalent to the actual mention node 203d in Figure 2) and the sentence node used to represent the second sample sentence (equivalent to the sentence node 202d in Figure 2), and the type of this node edge belongs to the mention-sentence edge type; similarly, since the label mention word SS2 belongs to the third sample sentence, there is a node edge between the mention node used to represent the label mention word SS2 (equivalent to the mention node 206d in Figure 2) and the sentence node used to represent the third sample sentence (equivalent to the sentence node 208d in Figure 2), and the type of this node edge belongs to the mention-sentence edge type.

[0068] For the sake of understanding, the example tag mention word SS1 in the embodiment of the present application is a mention word of the tag entity word XXX1, and the tag mention word SS2 is a mention word of the tag entity word XXX3. Therefore, the business server 100 constructs a node edge between the mention node used to represent the tag mention word SS1 and the entity node used to represent the tag entity word XXX1, and the type of the node edge belongs to the mention-entity edge type; and constructs a node edge between the mention node used to represent the tag mention word SS2 and the entity node used to represent the tag entity word XXX3, and the type of the node edge belongs to the mention-entity edge type.

[0069] Since the two label mention words (i.e., label mention word SS1 and label mention word SS2) in the sample text 201a do not belong to the same sample sentence, there is no node edge between the mention nodes corresponding to the two label mention words. If there is a node pair between the two mention nodes, the type of the node edge belongs to the mention-mention edge type.

[0070] In summary, the business server 100 can generate the associated node edge 20f in Figure 3 by constructing the initial layer 202b through the graph. In order to improve the scalability of the model, the embodiment of the present application adds a general training parameter to each associated node edge. The general training parameter is associated with the type of node edge. As shown in Figure 3, a general training parameter β1 is added to the node edge belonging to the entity-sentence edge type, that is, the general training parameter β1 is added to the node edge between the entity node 201d and the sentence node 202d, the general training parameter β1 is added to the node edge between the entity node 204d and the sentence node 205d, and the general training parameter β1 is added to the node edge between the entity node 207d and the sentence node 203d. The business server 100 adds a general training parameter ε1 to the node edge belonging to the entity-mention edge type, that is, the general training parameter ε1 is added to the node edge between the entity node 201d and the mention node 203d, that is, the general training parameter ε1 is added to the node edge between the entity node 207d and the mention node 206d. The service server 100 adds a universal training parameter α1 to the node edges of the sentence-mention edge type, i.e., adds a universal training parameter α1 to the node edge between sentence node 205d and mention node 203d, and adds a universal training parameter α1 to the node edge between sentence node 208d and mention node 206d. The service server 100 adds a universal training parameter σ1 to the node edges of the sentence-sentence edge type, i.e., adds a universal training parameter σ1 to the node edge between sentence node 202d and sentence node 205d, adds a universal training parameter σ1 to the node edge between sentence node 202d and sentence node 208d, and adds a universal training parameter σ1 to the node edge between sentence node 208d and sentence node 205d.

[0071] In the graph construction initial layer 202b, the business server 100 can determine the edge initial vector corresponding to the associated node edge 20f based on the general training parameters of the associated node edge 20f and the node initial vectors corresponding to the two nodes connected by the associated node edge 20f, such as the edge initial vector 20g shown in FIG3, which includes the edge initial vector 201 of the node edge between the entity node for representing the label entity word XXX1 (equivalent to the entity node 201d in FIG2) and the sentence node for representing the first sample sentence (equivalent to the sentence node 202d in FIG2). 1g, the edge initialization vector 202g of the node edge between the entity node used to represent the label entity word XXX1 and the mention node used to represent the label mention word SS1 (equivalent to the mention node 203d in Figure 2), the edge initialization vector 203g of the node edge between the sentence node used to represent the first sample sentence and the sentence node used to represent the second sample sentence (equivalent to the sentence node 205d in Figure 2), and the edge initialization vector 204g of the node edge between the sentence node used to represent the second sample sentence and the mention node used to represent the label mention word SS1.

[0072] The service server 100 can generate an initial graph structure including at least two node initial vectors 20e and edge initial vectors 20g. Based on the model loss value and the initial graph structure, the parameters in the initial text recognition model 20b can be adjusted. As shown in FIG3 , the parameters in the initial text recognition model 20b include universal training parameters β1, universal training parameters ε1, universal training parameters α1, and universal training parameters σ1. By adjusting the model parameters, the service server 100 can obtain a text recognition model 201b. In this case, the universal training parameter β1 is updated to the universal training parameter β2, the universal training parameter ε1 is updated to the universal training parameter ε2, the universal training parameter α1 is updated to the universal training parameter α2, and the universal training parameter σ1 is updated to the universal training parameter σ2.

[0073] From the above, it can be seen that the embodiment of the present application adds common training parameters to the connecting edges between each node, so that the model can better handle different graph structures during the training and testing stages; in addition, in the process of predicting the relationship between entity nodes, the embodiment of the present application abandons the inference layer (Inference Layer) and adopts the node initial vector fusion method corresponding to the entity node to predict the relationship between nodes, so the relationship prediction can be achieved without jumping, which can greatly improve the prediction effect of entity relationships.

[0074] Please refer to Figure 4, which is a flow chart of a data processing method provided by an embodiment of the present application. The data processing method can be executed by a business server (for example, the business server 100 shown in Figure 1 above), or by a terminal device (for example, the terminal device 200a shown in Figure 1 above), or by the business server and the terminal device interacting with each other. For ease of understanding, the embodiment of the present application is described by taking the method being executed by a business server as an example. As shown in Figure 4, the data processing method can at least include the following steps S101-S104.

[0075] Step S101: obtaining a training sample set; the training sample set includes a sample text, at least two label entity words in the sample text, and a label entity word pair carrying a label relationship.

[0076] For example, the embodiment of the present application does not limit the text type and text content of the sample text. For example, it can be an email text, a physical examination text, a poetry text, etc. It should be noted that all data mentioned in the embodiment of the present application (such as sample text) are processed only after obtaining the granted permission.

[0077] Entity relationship extraction in related technologies often focuses on a single sentence and only attempts to dig out the entity relationship within each sentence. However, in many real scenarios such as medical and financial documents, there are many relational facts contained in the entity pairs of different sentences in the document, and there are often complex relationships between multiple entities in the document. At this time, it is necessary to read and reason on multiple sentences in the document, which obviously exceeds the capabilities of the sentence-level relationship extraction method. Therefore, it is necessary to advance the relationship extraction from the sentence level to the document level. The embodiment of the present application can not only realize entity relationship extraction at the sentence level, but also realize entity relationship extraction at the document level. For the specific implementation process, please refer to steps S102-S104 below.

[0078] The business server obtains the initial text recognition model. The embodiment of the present application does not limit the model type of the initial text recognition model. It can be composed of any one or more neural networks, such as Convolutional Neural Networks (CNN), Residual Networks (ResNet), Convolutional Neural Networks based on extended channel number learning mechanism (Wide Residual Networks, Wide-ResNet), High-Resolution Net (HRNet), etc.

[0079] Step S102: Input the training sample set into the text recognition initial model, and generate node initial vectors corresponding to at least two nodes through the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences belonging to the sample text, and entity nodes corresponding to at least two label entity words; A is a positive integer.

[0080] For example, the text recognition initial model includes an initial text encoding layer and an initial graph construction layer; the sample text is segmented through the initial text encoding layer to obtain at least two word segmentations, and vector conversion processing is performed on the at least two word segmentations to generate initial word segmentation vectors corresponding to the at least two word segmentations; the at least two initial word segmentation vectors are encoded to generate word segmentation encoding vectors corresponding to the at least two word segmentations, and the at least two word segmentation encoding vectors are input into the initial graph construction layer; the entity nodes corresponding to the at least two label entity words and the sentence nodes corresponding to the A sample sentences are constructed through the initial graph construction layer; at least two nodes are generated based on the at least two entity nodes and the A sentence nodes, and node initial vectors corresponding to the at least two nodes are generated based on the at least two word segmentation encoding vectors.

[0081] Among them, at least two label entity words include label entity word C d ; d is a positive integer, and d is less than or equal to the total number of at least two label entity words; Step S102 may also include: if there is a label entity word C in the sample text d The corresponding tag mention word E d , then construct the label mention word E d Corresponding mention node; then according to at least two entity nodes and A sentence nodes, the specific process of generating at least two nodes may include: at least two entity nodes, A sentence nodes and label mention word E d The corresponding mentioned nodes are determined to be at least two nodes.

[0082] Among them, at least two nodes include node F g ; g is a positive integer, and g is less than or equal to the total number of at least two nodes; based on at least two word segmentation encoding vectors, the specific process of generating the node initial vectors corresponding to at least two nodes may include: if the node F g Used to represent the tag mention word E d , then in at least two participles, get the label mention word E d The first word segmentation included in the at least two word segmentation encoding vectors is obtained, and the first word segmentation encoding vector corresponding to the first word segmentation is processed by the mean to obtain the node F g The corresponding node initial vector; if the node F g Used to represent the label entity word C d, then the tag mentions word E d The corresponding node initial vector is processed by mean to obtain node F g The corresponding node initial vector; if the node F g Belongs to A sentence nodes, then in at least two participles, get node F g The second word segmentation contained in the corresponding sample sentence is obtained from at least two word segmentation encoding vectors, and the second word segmentation encoding vector is averaged to obtain the node F. g The corresponding node initial vector.

[0083] The embodiment of the present application does not limit the type of word segmentation, which can be a character. For example, if the sample text includes "patients have a fever", then at least two word segmentations can be four word segmentations, namely "suffer", "person", "fever", and "fever"; word segmentation can also be sub-words. For example, if the sample text includes "advertising is the department of company", then at least two word segmentations can include ad, ver, tis, ing, is, the, de, pa, rt, ment, of, com, and pany; word segmentation can also be a phrase. For example, if the sample text includes "artificial intelligence is a comprehensive technology of computer science", then at least two word segmentations can include artificial intelligence, is, computer science, of, one, comprehensive, and technology. Therefore, the attributes of word segmentation can be set according to the actual training scenario. The embodiment of the present application does not limit the method of generating the word segmentation initial vector, and can be set according to the needs of the actual training scenario, including but not limited to the matrix singular value decomposition method (Singular Value Decomposition Based Methods) and the word embedding method (Word2vec). The embodiment of the present application does not limit the encoding method of the word segmentation initial vector, and can be set according to the needs of the actual training scenario, including but not limited to the word vector network based on the language model (Embedding from Language Models, ELMO), the bidirectional encoder representation network (Bidirectional Encoder Representation from Transformers, BERT), and the bidirectional long short-term memory network (Bi-directional Long Short-Term Memory, Bi-LSTM).

[0084] In some embodiments, the sample text only includes sample sentences (one or more) and at least two label entity words, so the at least two nodes include entity nodes corresponding to the at least two label entity words, and sentence nodes corresponding to the sample sentences. In other embodiments, the sample text includes sample sentences (one or more), at least two label entity words, and one or more label mention words, so the at least two nodes include entity nodes corresponding to the at least two label entity words, one or more mention nodes, and sentence nodes corresponding to the sample sentences. It can be understood that the nodes and the elements in the sample text (i.e., sample sentences, label entity words, and label mention words) are in a one-to-one correspondence.

[0085] As can be seen from the above, the business server can construct three different types of nodes, namely, the Mention node (n m ), used to represent the entity node of the label entity word (Entity node, referred to as n e ) and sentence nodes (Sentencenode, referred to as n s The business server calculates the representation of each node (i.e., the node initialization vector) as the average of the embeddings of different elements. Mentions are different mentions of an entity, including the entity's abbreviation, pronouns, etc. The node initialization vector of a mention node is the average of the words contained in the label mention word, which can be expressed by the following formula (1).

[0086] Among them, in formula (1) Represents the node initial vector of the mentioned node, the symbol avg means the mean processing, m represents the label mention word, W i Indicates the first participle contained in the tag mention word, i indicates the number of first participles, Represents the encoding vector of the first word. For example, if the tag mentions word m as a referent "this company", then the first word W i It can include "this" and "company", the first word encoding vector It can include the word segmentation encoding vector corresponding to "this" and the word segmentation encoding vector corresponding to "company", the node initial vector is the average of the word segmentation encoding vector corresponding to "this" and the word segmentation encoding vector corresponding to "company".

[0087] An entity node represents a unique entity concept, and the node initial vector of an entity node is the average of the node initial vectors of the mention nodes associated with the entity. This can be expressed by the following formula (2).

[0088] Among them, in formula (2) Represents the node initial vector of the entity node, the symbol avg means the mean processing, e represents the label entity word, m i Indicates the tag mention words corresponding to the tag entity word (for the sake of convenience, the tag mention words here are called associated tag mention words), i represents the total number of associated tag mention words, Indicates the node initial vector corresponding to the associated label mention word. For example, if the label entity word e is a company, and the sample text contains the company's abbreviation name, such as SS, including the pronoun "this company", then the associated label mention word m i It can include the name abbreviation "SS" and the pronoun "this company", and the node initial vector corresponding to the associated label mention word This can include the abbreviation "node initialization vector corresponding to SS" and the node initialization vector corresponding to the pronoun "this company". is the average value of the initial vectors of the two nodes mentioned above.

[0089] The node initial vector of a sentence node is the average value of the second word encoding vector corresponding to the second word in the sample sentence. It can be expressed by the following formula (3).

[0090] Among them, in formula (3) Represents the node initial vector of the sentence node, the symbol avg means the mean processing, s represents the sample sentence, W i represents the second participle contained in the sample sentence, i represents the total number of second participles, Represents the second word segmentation encoding vector.

[0091] Step S103 : generating an associated node edge based on at least two nodes, and determining an edge initialization vector corresponding to the associated node edge based on the universal training parameters of the associated node edge and the node initialization vectors corresponding to the two nodes connected by the associated node edge.

[0092] For example, at least two entity nodes include entity node H i ; i is a positive integer, and i is less than or equal to the total number of at least two entity nodes; among A sentence nodes, get the sentence nodes corresponding to entity node H i The first associated sentence node is generated including the entity node H i And the first associated node edge of the first associated sentence node; the sample sentence corresponding to the first associated sentence node contains the entity node H iThe corresponding label entity word; if A is a positive integer greater than 1, then a second associated node edge is generated based on every two sentence nodes in the A sentence nodes; an associated node edge is generated based on the first associated node edge and the second associated node edge.

[0093] Among them, there are J mention nodes in at least two nodes, J is a positive integer; the label mention words corresponding to the J mention nodes belong to the sample text; the specific process of generating the associated node edge according to the first associated node edge and the second associated node edge may include: if there is a reference to the entity node H in the J mention nodes, i The associated associated mention node generates a node including the associated mention node and the entity node H i The third associated node edge; the label mention word corresponding to the associated mention node is the entity node H i The mention word of the corresponding label entity word; among A sentence nodes, obtain the second associated sentence node associated with the associated mention node, and generate a fourth associated node edge including the associated mention node and the second associated sentence node; the sample sentence corresponding to the second associated sentence node contains the label mention word corresponding to the associated mention node; if J is a positive integer greater than 1 and there is an associated mention node pair in the J mention nodes, then generate a fifth associated node edge including the associated mention node pair; the two label mention words corresponding to the associated mention node pair are in the same sample sentence; the first associated node edge, the second associated node edge, the third associated node edge, the fourth associated node edge and the fifth associated node edge are determined as associated node edges.

[0094] For example, based on the general training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge, the edge vector to be normalized corresponding to the associated node edge is determined; the edge vector to be normalized corresponding to the associated node edge is normalized to obtain the edge initial vector corresponding to the associated node edge.

[0095] Among them, the specific process of determining the edge vector to be normalized corresponding to the associated node edge based on the universal training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge can include: determining the universal training parameters and the set of vectors to be processed corresponding to the associated node edge based on the node types corresponding to the two nodes connected by the associated node edge; the set of vectors to be processed includes the node initial vectors corresponding to the two nodes connected by the associated node edge; the universal training parameters include universal weight parameters and universal scaling parameters; weighting the set of vectors to be processed is performed through the universal weight parameters to obtain a weighted vector set; splicing the weighted vectors in the weighted vector set is performed to obtain a vector to be scaled, and scaling the scaled vector is performed through the universal scaling parameters to obtain an edge vector to be normalized corresponding to the associated node edge.

[0096] Among them, the specific process of determining the general training parameters and the set of vectors to be processed corresponding to the associated node edge according to the node types corresponding to the two nodes connected by the associated node edge can include: if the node types corresponding to the two nodes connected by the associated node edge are different, then the composite general training parameters are determined as the general training parameters, and the node initial vectors corresponding to the two nodes connected by the associated node edge are determined as the set of vectors to be processed.

[0097] Among them, the associated node edge includes a first node edge; the two nodes connected by the first node edge include a first node and a second node; the edge vector to be normalized corresponding to the associated node edge is normalized, and the specific process of obtaining the edge initial vector corresponding to the associated node edge may include: if the node type corresponding to the first node is different from the node type corresponding to the second node, then the second node edge is obtained in the associated node edge; among them, if the first node belongs to at least two entity nodes and the second node belongs to A sentence nodes, the two nodes connected by the second node edge include a first node and a third node; the third node belongs to A sentence nodes; if the first node belongs to a mention node set, the two nodes connected by the second node edge include a first node and a fourth node; the node type corresponding to the fourth node is the same as the node type corresponding to the second node; the label mention word corresponding to the mention node in the mention node set belongs to the sample text; in the edge vector to be normalized corresponding to the associated node edge, the edge vector to be normalized corresponding to the second node edge is obtained; the vector to be normalized corresponding to the first node edge is normalized by the edge vector to be normalized corresponding to the second node edge to obtain the edge initial vector corresponding to the first node edge.

[0098] Among them, the specific process of normalizing the to-be-normalized vector corresponding to the first node edge through the to-be-normalized edge vector corresponding to the second node edge to obtain the edge initial vector corresponding to the first node edge may include: activating the to-be-normalized edge vector corresponding to the first node edge to obtain the activation vector corresponding to the first node edge, activating the to-be-normalized edge vector corresponding to the second node edge to obtain the activation vector corresponding to the second node edge; exponentially processing the activation vector corresponding to the first node edge to obtain the exponential vector corresponding to the first node edge, exponentially processing the activation vector corresponding to the second node edge to obtain the exponential vector corresponding to the second node edge; summing the exponential vectors corresponding to the second node edge to obtain the total exponential vector corresponding to the second node edge; and determining the ratio of the exponential vector corresponding to the first node edge to the total exponential vector corresponding to the second node edge as the edge initial vector corresponding to the first node edge.

[0099] If a sample sentence includes a label mention word, the business server will not only construct a node edge between the sentence node corresponding to the sample sentence and the mention node corresponding to the label mention word (i.e., the fourth associated node edge mentioned above), but will also determine the label entity word associated with the label mention word, and then construct a node edge between the sentence node corresponding to the sample sentence and the entity node corresponding to the label entity word (i.e., the first associated node edge mentioned above).

[0100] In summary, undirected edges are constructed between each node. This rule originates from the natural association between text elements (i.e., mentions, entities, and sentences). Since it is impossible to know in advance whether two entities are related, the embodiment of the present application does not directly connect two entity nodes. The connection between each node is based on predefined document-level interactions. The goal of the embodiment of the present application is to use the associated node edges to predict the entity edge representation of each two entity nodes, and thereby infer the predicted relationship between each two entity nodes.

[0101] After generating the associated node edges, the business server generates an edge initialization vector for each associated node edge. To improve model scalability, the model parameters include universal training parameters. These universal training parameters refer to the common training parameters for the same edge type. Please refer to Figure 3 and Figure 2 again. There is a second associated node edge between sentence node 202d and sentence node 205d, and another second associated node edge between sentence node 202d and sentence node 208d. However, when generating the edge initialization vectors corresponding to these two second associated node edges, they are both generated using the universal training parameter σ1 corresponding to the sentence-sentence edge type. Similarly, there is a first associated node edge between entity node 201d and sentence node 202d, and another first associated node edge between entity node 204d and sentence node 205d. However, when generating the edge initialization vectors corresponding to these two first associated node edges, they are both generated using the universal training parameter β1 corresponding to the entity-sentence edge type.

[0102] The embodiment of the present application can provide five types of node edges, namely entity-sentence edge (abbreviated as ES edge), mention-entity edge (abbreviated as ME edge), mention-sentence edge (abbreviated as MS edge), mention-mention edge (abbreviated as MM edge), sentence-sentence edge (abbreviated as SS edge), and the corresponding types are entity-sentence edge type (abbreviated as ES edge type), mention-entity edge type (abbreviated as ME edge type), mention-sentence edge type (abbreviated as MS edge type), mention-mention edge type (abbreviated as MM edge type), sentence-sentence edge type (abbreviated as SS edge type). The general training parameters corresponding to different edge types can be the same or different, and can be determined according to the needs of the actual training scenario.

[0103] Therefore, the business server first determines the edge type of the associated node edge and then obtains the universal training parameters associated with the edge type (equivalent to the node types corresponding to the two nodes connected by the associated node edge). This situation can be divided into three cases. In case 1, if the node types corresponding to the two nodes connected by the associated node edge are different, the business server determines the composite universal training parameters as the universal training parameters and the node initial vectors corresponding to the two nodes connected by the associated node edge as the set of vectors to be processed. In case 1, it can be further refined into the following three cases.

[0104] In case 1.1, if the two nodes connected by the associated node edge correspond to the mention node type and the sentence node type, respectively, that is, the edge type is the MS edge type, then the service server calls the associated node edge an MS node edge. The set of vectors to be processed for the MS node edge includes the node initialization vector of the mention node connected by the MS node edge and the node initialization vector of the sentence node connected to it. In this case, the composite universal training parameter is a universal training parameter for the MS edge type, such as the universal training parameter α1 shown in Figure 3. The edge vector to be normalized for the MS node edge can be described by the following formula (4).

[0105] Among them, M in formula (4) i represents the i-th mentioned node, S j Representing and mentioning node M i The j-th sentence node connected, M i S represents the node M mentioned i A set of connected sentence nodes of sentence node type, Indicates the mention of node M i The node initial vector, Represents sentence node S j The node initial vector, W ms represents the universal weight parameter in the universal training parameter α1, a ms represents the universal scaling parameter in the universal training parameter α1, Represents node edge M i S j The edge vector to be normalized.

[0106] The service server normalizes the edge vector to be normalized corresponding to the MS node edge to obtain the initial edge vector corresponding to the MS node edge. The specific process can be implemented by the following formula (5).

[0107] Wherein, LeakyReLU in formula (5) represents the activation function, exp represents the exponential function, ∑ represents the summation symbol, and K represents the sentence node set M iAny sentence node in S, Represents node edge M i S j The initial vector of the edge.

[0108] In case 1.2, if the two nodes connected by the associated node edge correspond to the mentioned node type and the entity node type, respectively, that is, the edge type is the ME edge type, then the service server calls the associated node edge an ME node edge. The set of vectors to be processed for the ME node edge includes the node initialization vector of the mentioned node connected by the ME node edge and the node initialization vector of the entity node connected to it. In this case, the composite universal training parameter is a universal training parameter for the ME edge type, such as the universal training parameter ε1 shown in Figure 3. The edge vector to be normalized for the ME node edge can be described by the following formula (6).

[0109] Among them, M in formula (6) i represents the i-th mentioned node, E j Representing and mentioning node M i The j-th entity node connected, M i E represents the node M mentioned i A set of entity nodes that are connected and whose node type is entity node type, Indicates the mention of node M i The node initial vector, Represents entity node E j The node initial vector, W me represents the universal weight parameter in the universal training parameter ε1, a me represents the universal scaling parameter in the universal training parameter ε1, Represents node edge M i E j The edge vector to be normalized.

[0110] The service server normalizes the edge vector to be normalized corresponding to the ME node edge to obtain the initial edge vector corresponding to the ME node edge. The specific process can be implemented by the following formula (7).

[0111] Where K in formula (7) represents the entity node set M i Any entity node in E, Represents node edge M i E j The initial vector of the edge.

[0112] In case 1.3, if the two nodes connected by the associated node edge correspond to a sentence node type and an entity node type, respectively, that is, the edge type is an ES edge type, then the service server calls the associated node edge an ES node edge. The set of vectors to be processed for the ES node edge includes the node initialization vector of the sentence node connected by the ES node edge and the node initialization vector of the entity node connected to it. In this case, the composite universal training parameter is a universal training parameter for the ES edge type, such as the universal training parameter β1 shown in Figure 3. The edge vector to be normalized for the ME node edge can be described by the following formula (8).

[0113] Among them, E in formula (8) i represents the i-th entity node, S j Represents the entity node E i The j-th sentence node connected, E i S represents the entity node E i A set of connected sentence nodes of sentence node type, Represents entity node E i The node initial vector, Represents sentence node S j The node initial vector, W es represents the universal weight parameter in the universal training parameter β1, a es represents the universal scaling parameter in the universal training parameter β1, Represents node edge E i S j The edge vector to be normalized.

[0114] The business server normalizes the edge vector to be normalized corresponding to the ES node edge to obtain the initial edge vector corresponding to the ES node edge. The specific process can be implemented by the following formula (9).

[0115] Where K in formula (9) represents the sentence node set E i Any sentence node in S, Represents node edge E i S j The initial vector of the edge.

[0116] The above describes the case where the two nodes connected by the associated node edge correspond to different node types. This step does not describe the case where the two nodes connected by the associated node edge correspond to the same node type. Please refer to the description of step S203 in the embodiment corresponding to Figure 5 below.

[0117] Step S104: Generate a graph initial structure including at least two node initial vectors and edge initial vectors. Adjust the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to each two entity nodes to obtain a text recognition model for determining entity word pairs with label relationships in the text; the parameters in the text recognition initial model include general training parameters.

[0118] For example, based on the label entity word pair with a label relationship, the business server can take the label of the corresponding entity node edge as the positive sample label. Please refer to Figure 2 again. Because the label entity word pair 202a includes two label entity word pairs, the first label entity word pair is (XXX1, XXX2). Therefore, based on the position relationship, the label edge between the entity node corresponding to the label entity word XXX1 and the entity node corresponding to the label entity word XXX2 can be determined as the positive sample label edge; therefore, based on the position relationship, the label edge between the entity node corresponding to the label entity word XXX1 and the entity node corresponding to the label entity word XXX3 can be determined as the positive sample label edge. In order to improve the accuracy of relationship prediction, the business server determines the label edge between the entity node corresponding to the label entity word XXX2 and the entity node corresponding to the label entity word XXX3 as the negative sample label edge. In this way, each node edge has a label. Then, when obtaining the node initial vector corresponding to each two entity nodes, the loss value of the node edge can be determined in combination with the label of the corresponding node edge. According to the loss values ​​of all node edges, the model loss value can be determined. The business server adjusts the parameters in the initial text recognition model according to the model loss value and the initial structure of the graph to obtain a text recognition model.

[0119] Combining step S103 and step S104, it can be seen that the embodiment of the present application greatly improves the scalability of the trained model by introducing a new updateable weight variable, namely a universal training parameter, on the edge of the associated node; at the same time, through the fusion of entity node features and negative samples, the relationship prediction between entity nodes can be achieved without jumping, so the entity relationship prediction effect can be greatly improved.

[0120] The embodiment of the present application introduces adjustable universal training parameters on the associated node edges, thereby improving the scalability of the initial model of text recognition, that is, improving the processing effect of the initial model of text recognition for different graph structures; in addition, the embodiment of the present application does not require inference on the initial vectors of the edges, thereby reducing the waste of computing resources, and by avoiding inference on the initial vectors of the edges, the model parameters can be updated quickly, thereby improving the generation efficiency of the text recognition model.

[0121] Please refer to Figure 5, which is a second flow chart of a data processing method provided by an embodiment of the present application. The method can be executed by a business server (for example, the business server 100 shown in Figure 1 above), or by a terminal device (for example, the terminal device 200a shown in Figure 1 above), or can be executed interactively by a business server and a terminal device. For ease of understanding, the embodiment of the present application is described using the method executed by a business server as an example. As shown in Figure 5, the method may include at least the following steps.

[0122] Step S201: obtaining a training sample set; the training sample set includes a sample text, at least two label entity words in the sample text, and a label entity word pair carrying a label relationship.

[0123] Step S202: Input the training sample set into the text recognition initial model, and generate node initial vectors corresponding to at least two nodes through the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences belonging to the sample text, and entity nodes corresponding to at least two label entity words; A is a positive integer;

[0124] For the specific implementation process of step S201 - step S202 , please refer to step S101 - step S102 in the embodiment corresponding to FIG4 above, which will not be described in detail here.

[0125] Step S203: generating an associated node edge based on at least two nodes, and determining an edge initialization vector corresponding to the associated node edge based on a universal training parameter of the associated node edge and node initialization vectors corresponding to two nodes connected by the associated node edge;

[0126] For example, if the node types corresponding to the two nodes connected by the associated node edge are the same, and the two nodes connected by the associated node edge both belong to A sentence nodes, then the sentence-general training parameters are determined as general training parameters, and the node initial vectors corresponding to the two nodes connected by the associated node edge, and the distance vector between the two nodes connected by the associated node edge are determined as the set of vectors to be processed; if the node types corresponding to the two nodes connected by the associated node edge are the same, and the two nodes connected by the associated node edge both belong to the mention node set, then the mention-general training parameters are determined as general training parameters, and the node initial vectors corresponding to the two nodes connected by the associated node edge, the context vectors of the two nodes connected by the associated node edge, and the distance vector between the two nodes connected by the associated node edge are determined as the set of vectors to be processed; the label mention words corresponding to the mention nodes in the mention node set belong to the sample text.

[0127] For example, the associated node edge includes the third node edge; the two nodes connected by the third node edge include the fifth node and the sixth node; the specific process of normalizing the edge vector to be normalized corresponding to the associated node edge to obtain the edge initial vector corresponding to the associated node edge may include: if the node type corresponding to the fifth node is the same as the node type corresponding to the sixth node, then obtaining the fourth node edge and the fifth node edge in the associated node edge; wherein, if the fifth node and the sixth node both belong to A sentence nodes, then the two nodes connected by the fourth node edge include the fifth node and the seventh node, and the two nodes connected by the fifth node edge include the sixth node and the eighth node; the seventh node and the eighth node both belong to A sentence nodes; if the fifth node and the sixth node both belong to the mentioned node set, then the two nodes connected by the fourth node edge include the fifth node and the ninth node. Node, the two nodes connected by the fifth node edge include the sixth node and the tenth node; the ninth node and the tenth node both belong to the mentioned node set; the label mention word corresponding to the mentioned node in the mentioned node set belongs to the sample text; in the edge vector to be normalized corresponding to the associated node edge, obtain the edge vector to be normalized corresponding to the fourth node edge, and the edge vector to be normalized corresponding to the fifth node edge; through the edge vector to be normalized corresponding to the fourth node edge, the vector to be normalized corresponding to the third node edge is normalized to obtain the first edge initial vector corresponding to the third node edge; through the edge vector to be normalized corresponding to the fifth node edge, the vector to be normalized corresponding to the third node edge is normalized to obtain the second edge initial vector corresponding to the third node edge; the first edge initial vector and the second edge initial vector are determined as the edge initial vector corresponding to the third node edge.

[0128] Step S103 in the embodiment corresponding to Figure 4 above describes the situation where the two nodes connected by the associated node edge correspond to different node types, that is, situation 1. This step will describe the situation where the two nodes connected by the associated node edge correspond to the same node type, that is, situation 2 and situation 3.

[0129] In case 2, if the node types corresponding to the two nodes connected by the associated node edge are both sentence node types, that is, the edge type is an SS edge type, then the service server calls the associated node edge an SS node edge. The set of vectors to be processed for the SS node edge includes the node initialization vectors corresponding to the two sentence nodes connected by the SS node edge, and the distance vector between the two sentence nodes. In this case, the sentence-general training parameters are general training parameters for the SS edge type, such as the general training parameter σ1 shown in Figure 3. The edge vector to be normalized for the SS node edge can be described by the following formula (10).

[0130] Among them, S in formula (10) i represents the i-th sentence node, Sj Represents the sentence node S i The j-th sentence node connected, S i S represents the sentence node S i A set of connected sentence nodes of sentence node type, Represents sentence node S i The node initial vector, Represents sentence node S j The node initial vector, W ss represents the universal weight parameter in the universal training parameter σ1, a ss represents the universal scaling parameter in the universal training parameters σ1, Represents node edge S i S j The edge vector to be normalized, Represents sentence node S i and sentence node S j The distance between them.

[0131] The business server normalizes the edge vector to be normalized corresponding to the SS node edge to obtain the initial edge vector corresponding to the SS node edge. The specific process can be implemented by the following formula (11).

[0132] Where K in formula (11) represents the sentence node set S i Any sentence node in S, Represents node edge S i S j The initial vector of the edge.

[0133] In case 3, if the node types corresponding to the two nodes connected by the associated node edge are both entity node types, that is, the edge type is MM edge type, then the business server calls the associated node edge an MM node edge. The set of vectors to be processed for the MM node edge includes the node initialization vectors corresponding to the two mentioned nodes connected by the MM node edge, the context vectors of the two mentioned nodes connected by the MM node edge, and the distance vector between the two mentioned nodes. In this case, the general training parameters mentioned are general training parameters for the MM edge type. The edge vector to be normalized for the MM node edge can be described by the following formula (12).

[0134] Among them, M in formula (12) i represents the i-th mentioned node, M j Representing and mentioning node M i The j-th mentioned node connected, M i M represents the node M mentioned iThe set of connected mention nodes whose node type is the mention node type, Indicates the mention of node M i The node initial vector, Indicates the mention of node M j The node initial vector, W mm Indicates the universal weight parameter in the universal training parameter, a mm Indicates the universal scaling parameters mentioned in the universal training parameters. Represents node edge M i M j The edge vector to be normalized, Indicates the mention of node M i and mention node M j The distance between Indicates the mention of node M i and mention node M j The context vector of , which can be determined by the following formula (13).

[0135] Where, f in formula (13) is equivalent to i and j in formula (12), m f Indicates the two mentioned nodes (i.e., the mentioned node M) in formula (12) i and mention node M j ), symbol T represents transposition processing, Indicates the mention of node m f The transposed node initial vector, y z represents the remaining participles in the sample sentence to which the two mentioned nodes belong, excluding the participles corresponding to the two mentioned nodes. r represents the number of remaining participles. Represents the word encoding vector of the remaining word, y g represents the gth remaining participle, A represents the word encoding vector corresponding to the g-th residual word. 1,g A represents the attention weight of the g-th residual word for the first mentioned node, 2,g represents the attention weight of the g-th residual word for the second mentioned node, A g H represents the attention weight of the g-th residual word for the two mentioned nodes. T represents the matrix vector of the sample sentences to which the two mentioned nodes belong, and B represents the attention weight matrix.

[0136] The business server normalizes the edge vector to be normalized corresponding to the MM node edge to obtain the initial edge vector corresponding to the MM node edge. The specific process can be implemented by the following formula (14).

[0137] Where K in formula (14) represents the mentioned node set M i Any mention node in M, Represents node edge M i M j The initial vector of the edge.

[0138] Step S204 : generating a prediction relationship corresponding to every two entity nodes according to the node initial vectors corresponding to every two entity nodes.

[0139] For example, the text recognition initial model includes an initial layer of relationship prediction; every two entity nodes include a first entity node and a second entity node; through the initial layer of relationship prediction, the node initial vector corresponding to the first entity node and the node initial vector corresponding to the second entity node are spliced ​​to obtain a spliced ​​vector; the spliced ​​vector is weighted to obtain a vector to be activated, and the vector to be activated is activated to obtain a predicted relationship corresponding to the first entity node and the second entity node.

[0140] The above process can be expressed by the following formula (15):

[0141] Among them, in formula (15) Indicates the node initial vector corresponding to the first entity node, represents the node initial vector corresponding to the second entity node, concat represents the concatenation function, softmax represents the activation function, W c and b c Represents the adjustable parameters in the initial layer of relationship prediction used to predict relationships between entities.

[0142] Step S205: Generate a label edge corresponding to every two entity nodes based on the label entity word pair.

[0143] For example, every two entity nodes include a first entity node and a second entity node; the entity nodes corresponding to the two label entity words in the label entity word pair are determined as the first entity node pair; a second entity node pair including the first entity node and the second entity node is generated; if there is an entity node pair in the first entity node pair that is the same as the second entity node pair, the positive sample label edge is determined as the label edge corresponding to the second entity node pair; if there is no entity node pair in the first entity node pair that is the same as the second entity node pair, the negative sample label edge is determined as the label edge corresponding to the second entity node pair.

[0144] Step S206, generate an initial graph structure including at least two node initial vectors and edge initial vectors, adjust the parameters in the text recognition initial model according to the predicted relationship corresponding to every two entity nodes, the label edge corresponding to every two entity nodes, and the initial graph structure, and obtain a text recognition model; the text recognition model is used to determine entity word pairs with label relationships in the text; the parameters in the text recognition initial model include general training parameters.

[0145] For example, the model loss value is determined based on the predicted relationship corresponding to each two entity nodes and the label edge corresponding to each two entity nodes; based on the model loss value and the initial structure of the graph, the parameters in the initial text recognition model are adjusted to obtain the text recognition model.

[0146] The embodiment of the present application introduces adjustable universal training parameters on the associated node edges, thereby improving the scalability of the initial model of text recognition, that is, improving the processing effect of the initial model of text recognition for different graph structures; in addition, the embodiment of the present application does not require inference on the initial vectors of the edges, thereby reducing the consumption of computing resources, and by avoiding inference on the initial vectors of the edges, the model parameters can be updated quickly, thereby improving the generation efficiency of the text recognition model.

[0147] Please refer to Figure 6, which is a flow chart of a data processing method provided in an embodiment of the present application. The method can be executed by a business server (for example, the business server 100 shown in Figure 1 above), or by a terminal device (for example, the terminal device 200a shown in Figure 1 above), or can be executed interactively by a business server and a terminal device. For ease of understanding, the embodiment of the present application is described by taking the execution of the method by a business server as an example. As shown in Figure 6, the method may include at least the following steps.

[0148] Step S301, obtain text and input the text into a text recognition model; the text includes K entity words to be recognized; K is a positive integer greater than 1; the text recognition model is obtained by adjusting the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to each two entity nodes; the graph initial structure includes node initial vectors and edge initial vectors corresponding to at least two nodes respectively; at least two node initial vectors are generated by inputting a training sample set including sample text, at least two label entity words in the sample text and label entity word pairs carrying label relationships into the text recognition initial model; at least two nodes include sentence nodes corresponding to A sample sentences in the sample text, and entity nodes corresponding to at least two label entity words respectively; A is a positive integer; the edge initial vector is determined according to the general training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge; the associated node edge is generated based on at least two nodes; the parameters in the text recognition initial model include general training parameters.

[0149] For example, the embodiment of the present application does not limit the text type and text content of the text. For example, it can be email text, physical examination text, poetry text, etc. It should be noted that all data (such as text) mentioned in the embodiment of the present application is processed only after obtaining the granted permission.

[0150] In addition, for the generation of the text recognition model, please refer to the description in the embodiments corresponding to Figures 4 and 5 above, which will not be repeated here.

[0151] Step S302: Determine entity word pairs having a label relationship among the K entity words to be identified through a text recognition model.

[0152] For example, a text recognition model includes a text encoding layer, a graph construction layer, and a relationship prediction layer; through the text encoding layer, word segmentation encoding vectors corresponding to B word segmentations in the text are generated, and the B word segmentation encoding vectors are all input into the graph construction layer; B is a positive integer greater than 1; through the graph construction layer, entity nodes corresponding to K entity words to be identified are constructed, and node vectors corresponding to K entity nodes are generated according to the B word segmentation encoding vectors, and the K node vectors are all input into the relationship prediction layer; the K entity words to be identified include a first entity word to be identified and a second entity word to be identified; the K node vectors include a first node vector corresponding to the first entity word to be identified and a second node vector corresponding to the second entity word to be identified; through the relationship prediction layer, the first node vector and the second node vector are spliced ​​to obtain a target splicing vector; the target splicing vector is weighted to obtain a target vector to be activated, and the target vector to be activated is activated to obtain a target prediction relationship between the first entity word to be identified and the second entity word to be identified; according to the target prediction relationship corresponding to each two entity words to be identified, an entity word pair with a label relationship is generated.

[0153] It is understandable that the process of the business server determining entity word pairs through the text recognition model is the same as the process of determining the predicted relationship between each two entity nodes through the text recognition initial model, so it will not be repeated here.

[0154] It is understandable that the model structures corresponding to the text recognition model and the initial text recognition model are identical, the only difference being that the model parameters of the latter require adjustment, while the model parameters of the former have already been adjusted. Similarly, the structure of the text encoding layer is identical to that of the initial text encoding layer described above, also differing only in the parameter adjustments. The structure of the graph construction layer is identical to that of the initial graph construction layer, and the structure of the relationship prediction layer is identical to that of the initial relationship prediction layer.

[0155] From the above, it can be seen that the embodiment of the present application introduces adjustable universal training parameters in the associated node edges, so the scalability of the initial model of text recognition can be improved, that is, the processing effect of the initial model of text recognition for different graph structures can be improved; in addition, the embodiment of the present application does not need to infer the initial vectors of the edges, so the waste of computing resources can be reduced, and by avoiding inference on the initial vectors of the edges, the model parameters can be updated quickly, thereby improving the generation efficiency of the text recognition model.

[0156] Please refer to Figure 7, which is a schematic diagram of the structure of a data processing device provided in an embodiment of the present application. The above-mentioned data processing device 1 can be configured to perform the corresponding steps of the method provided in an embodiment of the present application. As shown in Figure 7, the data processing device 1 may include: a sample acquisition module 11, a first generation module 12, a second generation module 13, and a third generation module 14.

[0157] The sample acquisition module 11 is configured to acquire a training sample set; the training sample set includes a sample text, at least two label entity words in the sample text, and a label entity word pair carrying a label relationship;

[0158] The first generation module 12 is configured to input the training sample set into the text recognition initial model, and generate node initial vectors corresponding to at least two nodes respectively through the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences belonging to the sample text, and entity nodes corresponding to at least two label entity words respectively; A is a positive integer;

[0159] The second generating module 13 is configured to generate an associated node edge based on at least two nodes, and determine an edge initialization vector corresponding to the associated node edge based on a universal training parameter of the associated node edge and node initialization vectors corresponding to two nodes connected by the associated node edge.

[0160] The third generation module 14 is configured to generate a graph initial structure including at least two node initial vectors and edge initial vectors, and adjust the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to each two entity nodes to obtain a text recognition model for determining entity word pairs with label relationships in the text; the parameters in the text recognition initial model include general training parameters.

[0161] Among them, the specific functional implementation of the sample acquisition module 11, the first generation module 12, the second generation module 13 and the third generation module 14 can be found in steps S101 to S104 in the embodiment corresponding to Figure 4 above, and will not be repeated here.

[0162] Referring again to FIG. 7 , the second generating module 13 may include: a vector determining unit 131 and a first processing unit 132 .

[0163] The vector determining unit 131 is configured to determine the edge vector to be normalized corresponding to the associated node edge according to the universal training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge;

[0164] The first processing unit 132 is configured to perform normalization processing on the to-be-normalized edge vector corresponding to the associated node edge to obtain an initial edge vector corresponding to the associated node edge.

[0165] The specific functional implementation of the vector determination unit 131 and the first processing unit 132 can be found in step S103 in the embodiment corresponding to FIG4 , and will not be described in detail here.

[0166] Referring again to FIG. 7 , the vector determining unit 131 may include: a set determining subunit 1311 , a first processing subunit 1312 , and a second processing subunit 1313 .

[0167] The set determination subunit 1311 is configured to determine the general training parameters and the set of vectors to be processed corresponding to the associated node edge according to the node types corresponding to the two nodes connected by the associated node edge; the set of vectors to be processed includes the node initial vectors corresponding to the two nodes connected by the associated node edge; the general training parameters include the general weight parameters and the general scaling parameters; the first processing subunit 1312 is configured to perform weighted processing on the set of vectors to be processed through the general weight parameters to obtain a weighted vector set; the second processing subunit 1313 is configured to perform splicing processing on the weighted vectors in the weighted vector set to obtain the vector to be scaled, and scale the vector to be scaled through the general scaling parameters to obtain the edge vector to be normalized corresponding to the associated node edge.

[0168] Among them, the specific functional implementation of the set determination subunit 1311, the first processing subunit 1312 and the second processing subunit 1313 can be found in step S103 of the embodiment corresponding to Figure 4 above, and will not be repeated here.

[0169] Please refer to Figure 7 again, the set determining subunit 1311 may include: a first determining subunit 13111, a second determining subunit 13112 and a third determining subunit 13113.

[0170] The first determining subunit 13111 is configured to determine the composite universal training parameter as the universal training parameter if the node types corresponding to the two nodes connected by the associated node edge are different, and the node initial vectors corresponding to the two nodes connected by the associated node edge are determined as the set of vectors to be processed; the second determining subunit 13112 is configured to determine the sentence universal training parameter as the universal training parameter if the node types corresponding to the two nodes connected by the associated node edge are the same, and the two nodes connected by the associated node edge both belong to A sentence nodes, and the node initial vectors corresponding to the two nodes connected by the associated node edge, and the node initial vectors corresponding to the two nodes connected by the associated node edge, and the node initial vectors corresponding to the associated node edge, are determined as the set of vectors to be processed. The distance vector between the two connected nodes is determined as the set of vectors to be processed; the third determination subunit 13113 is configured to determine the general training parameters of the mentions as the general training parameters if the node types corresponding to the two nodes connected by the associated node edge are the same, and the two nodes connected by the associated node edge both belong to the mentioned node set, and the node initial vectors corresponding to the two nodes connected by the associated node edge, the context vectors of the two nodes connected by the associated node edge, and the distance vector between the two nodes connected by the associated node edge are determined as the set of vectors to be processed; the label mention words corresponding to the mentioned nodes in the mentioned node set belong to the sample text.

[0171] Among them, the specific functional implementation of the first determining subunit 13111, the second determining subunit 13112 and the third determining subunit 13113 can refer to step S103 in the embodiment corresponding to Figure 4 above, and will not be repeated here.

[0172] Please refer to Figure 7 again. The associated node edge includes a first node edge; the two nodes connected by the first node edge include a first node and a second node; the first processing unit 132 may include: a first acquisition subunit 1321, a second acquisition subunit 1322 and a third processing subunit 1323.

[0173] The first acquisition subunit 1321 is configured to acquire a second node edge in the associated node edge if the node type corresponding to the first node is different from the node type corresponding to the second node; wherein, if the first node belongs to at least two entity nodes and the second node belongs to A sentence nodes, the two nodes connected by the second node edge include the first node and the third node; the third node belongs to A sentence nodes; if the first node belongs to the mention node set, the two nodes connected by the second node edge include the first node and the fourth node; the node type corresponding to the fourth node is the same as the node type corresponding to the second node; the label mention word corresponding to the mention node in the mention node set belongs to the sample text;

[0174] The second acquisition sub-unit 1322 is configured to obtain the to-be-normalized edge vector corresponding to the second node edge from the to-be-normalized edge vector corresponding to the associated node edge; the third processing sub-unit 1323 is configured to normalize the to-be-normalized vector corresponding to the first node edge through the to-be-normalized edge vector corresponding to the second node edge to obtain the edge initial vector corresponding to the first node edge.

[0175] The specific functional implementation of the first acquisition subunit 1321 , the second acquisition subunit 1322 and the third processing subunit 1323 can be found in step S103 in the embodiment corresponding to FIG4 , which will not be described in detail here.

[0176] Please refer to Figure 7 again, the third processing sub-unit 1323 may include: a vector activation sub-unit 13231, a vector index sub-unit 13232, a vector summation sub-unit 13233 and a fourth determination sub-unit 13234.

[0177] The vector activation subunit 13231 is configured to perform activation processing on the to-be-normalized edge vector corresponding to the first node edge to obtain the activation vector corresponding to the first node edge, and to perform activation processing on the to-be-normalized edge vector corresponding to the second node edge to obtain the activation vector corresponding to the second node edge; the vector index subunit 13232 is configured to perform index processing on the activation vector corresponding to the first node edge to obtain the index vector corresponding to the first node edge, and to perform index processing on the activation vector corresponding to the second node edge to obtain the index vector corresponding to the second node edge; the vector summation subunit 13233 is configured to perform summation processing on the index vectors corresponding to the second node edge to obtain the total index vector corresponding to the second node edge;

[0178] The fourth determining subunit 13234 is configured to determine the ratio of the exponential vector corresponding to the first node edge to the total exponential vector corresponding to the second node edge as the edge initialization vector corresponding to the first node edge.

[0179] Among them, the specific functional implementation of the vector activation subunit 13231, the vector index subunit 13232, the vector summation subunit 13233 and the fourth determination subunit 13234 can be found in step S103 in the embodiment corresponding to Figure 4 above, and will not be repeated here.

[0180] Please refer to Figure 7 again. The associated node edge includes the third node edge; the two nodes connected by the third node edge include the fifth node and the sixth node; the first processing unit 132 may include: a third acquisition subunit 1324, a fourth acquisition subunit 1325, a fourth processing subunit 1326, a fifth processing subunit 1327 and a vector determination subunit 1328.

[0181] The third acquisition sub-unit 1324 is configured to obtain the fourth node edge and the fifth node edge in the associated node edge if the node type corresponding to the fifth node is the same as the node type corresponding to the sixth node; wherein, if the fifth node and the sixth node both belong to A sentence nodes, the two nodes connected by the fourth node edge include the fifth node and the seventh node, and the two nodes connected by the fifth node edge include the sixth node and the eighth node; the seventh node and the eighth node both belong to A sentence nodes; if the fifth node and the sixth node both belong to the mentioned node set, the two nodes connected by the fourth node edge include the fifth node and the ninth node, and the two nodes connected by the fifth node edge include the sixth node and the tenth node; the ninth node and the tenth node both belong to the mentioned node set; the label mentions corresponding to the mentioned nodes in the mentioned node set The word belongs to the sample text; the fourth acquisition sub-unit 1325 is configured to obtain the to-be-normalized edge vector corresponding to the fourth node edge and the to-be-normalized edge vector corresponding to the fifth node edge from the to-be-normalized edge vector corresponding to the associated node edge; the fourth processing sub-unit 1326 is configured to normalize the to-be-normalized vector corresponding to the third node edge through the to-be-normalized edge vector corresponding to the fourth node edge, and obtain the first edge initial vector corresponding to the third node edge; the fifth processing sub-unit 1327 is configured to normalize the to-be-normalized vector corresponding to the third node edge through the to-be-normalized edge vector corresponding to the fifth node edge, and obtain the second edge initial vector corresponding to the third node edge; the vector determination sub-unit 1328 is configured to determine the first edge initial vector and the second edge initial vector as the edge initial vector corresponding to the third node edge.

[0182] Among them, the specific functional implementation methods of the third acquisition subunit 1324, the fourth acquisition subunit 1325, the fourth processing subunit 1326, the fifth processing subunit 1327 and the vector determination subunit 1328 can be referred to step S103 in the corresponding embodiment of Figure 4 above, and will not be repeated here.

[0183] Referring again to FIG. 7 , the third generating module 14 may include: a first generating unit 141 , a second generating unit 142 , and a parameter adjusting unit 143 .

[0184] The first generation unit 141 is configured to generate a predicted relationship corresponding to each two entity nodes based on the node initial vectors corresponding to each two entity nodes; the second generation unit 142 is configured to generate a label edge corresponding to each two entity nodes based on the label entity word pair; the parameter adjustment unit 143 is configured to adjust the parameters in the text recognition initial model based on the predicted relationship corresponding to each two entity nodes, the label edge corresponding to each two entity nodes and the initial structure of the graph to obtain a text recognition model; the text recognition model is used to determine the entity word pairs with label relationships in the text.

[0185] The specific functional implementation of the first generating unit 141 , the second generating unit 142 and the parameter adjusting unit 143 can be found in steps S204 to S206 in the embodiment corresponding to FIG5 , which will not be described in detail here.

[0186] Please refer to Figure 7 again. The text recognition initial model includes an initial relationship prediction layer; every two entity nodes include a first entity node and a second entity node; the first generation unit 141 may include: a sixth processing subunit 1411 and a seventh processing subunit 1412.

[0187] The sixth processing sub-unit 1411 is configured to perform splicing processing on the node initial vector corresponding to the first entity node and the node initial vector corresponding to the second entity node through the relationship prediction initial layer to obtain a splicing vector; the seventh processing sub-unit 1412 is configured to perform weighted processing on the splicing vector to obtain a vector to be activated, and perform activation processing on the vector to be activated to obtain a predicted relationship corresponding to the first entity node and the second entity node.

[0188] The specific functional implementation of the sixth processing sub-unit 1411 and the seventh processing sub-unit 1412 can be found in step S204 of the embodiment corresponding to FIG5 , and will not be described in detail here.

[0189] Referring again to FIG7 , every two entity nodes include a first entity node and a second entity node;

[0190] The second generating unit 142 may include a node determining subunit 1421 , a first generating subunit 1422 , and a label determining subunit 1423 .

[0191] The node determination subunit 1421 is configured to determine the entity nodes corresponding to the two label entity words in the label entity word pair as the first entity node pair; the first generation subunit 1422 is configured to generate a second entity node pair including the first entity node and the second entity node; the label determination subunit 1423 is configured to determine the positive sample label edge as the label edge corresponding to the second entity node pair if there is an entity node pair in the first entity node pair that is the same as the second entity node pair; the label determination subunit 1423 is further configured to determine the negative sample label edge as the label edge corresponding to the second entity node pair if there is no entity node pair in the first entity node pair that is the same as the second entity node pair.

[0192] Among them, the specific functional implementation of the node determination subunit 1421, the first generation subunit 1422 and the label determination subunit 1423 can be found in step S205 of the embodiment corresponding to Figure 5 above, and will not be repeated here.

[0193] Please refer to FIG. 7 again, the parameter adjustment unit 143 may include: a loss determination subunit 1431 and a parameter adjustment subunit 1432 .

[0194] The loss determination subunit 1431 is configured to determine the model loss value based on the prediction relationship corresponding to each two entity nodes and the label edge corresponding to each two entity nodes; the parameter adjustment subunit 1432 is configured to adjust the parameters in the initial text recognition model based on the model loss value and the initial structure of the graph to obtain a text recognition model.

[0195] The specific functional implementation of the loss determination subunit 1431 and the parameter adjustment subunit 1432 can be found in step S206 of the embodiment corresponding to FIG5 above, and will not be described in detail here.

[0196] Please refer to FIG7 again, at least two entity nodes include entity node H i ; i is a positive integer, and i is less than or equal to the total number of at least two entity nodes; the second generation module 13 may include: a third generation unit 133, a fourth generation unit 134 and a fifth generation unit 135.

[0197] The third generating unit 133 is configured to obtain the sentence nodes corresponding to the entity node H in A sentence nodes. i The first associated sentence node is generated including the entity node H i And the first associated node edge of the first associated sentence node; the sample sentence corresponding to the first associated sentence node contains the entity node H i The corresponding label entity word; the fourth generation unit 134 is configured to generate a second association node edge based on every two sentence nodes in the A sentence nodes if A is a positive integer greater than 1; the fifth generation unit 135 is configured to generate an association node edge based on the first association node edge and the second association node edge.

[0198] The specific functional implementation of the third generation unit 133 , the fourth generation unit 134 and the fifth generation unit 135 can be found in step S103 in the embodiment corresponding to FIG4 , which will not be described in detail here.

[0199] Please refer to Figure 7 again. There are J mention nodes in at least two nodes, where J is a positive integer; the label mention words corresponding to the J mention nodes belong to the sample text; the fifth generation unit 135 may include: a second generation subunit 1351, a third generation subunit 1352, a fourth generation subunit 1353 and an association determination subunit 1354.

[0200] The second generating subunit 1351 is configured to: if there is a reference node in the J mentioned nodes that is related to the entity node H iThe associated associated mention node generates a node including the associated mention node and the entity node H i The third associated node edge; the label mention word corresponding to the associated mention node is the entity node H i The mentioned word of the corresponding label entity word; the third generating subunit 1352 is configured to obtain the second associated sentence node associated with the associated mention node in A sentence nodes, and generate a fourth associated node edge including the associated mention node and the second associated sentence node; the sample sentence corresponding to the second associated sentence node contains the label mentioned word corresponding to the associated mention node; the fourth generating subunit 1353 is configured to generate a fifth associated node edge including the associated mention node pair if J is a positive integer greater than 1 and there is an associated mention node pair in the J mention nodes; the two label mention words corresponding to the associated mention node pair are in the same sample sentence; the association determining subunit 1354 is configured to determine the first associated node edge, the second associated node edge, the third associated node edge, the fourth associated node edge and the fifth associated node edge as associated node edges.

[0201] Among them, the specific functional implementation methods of the second generation subunit 1351, the third generation subunit 1352, the fourth generation subunit 1353 and the association determination subunit 1354 can be found in step S103 in the corresponding embodiment of Figure 4 above, and will not be repeated here.

[0202] Please refer to Figure 7 again. The text recognition initial model includes an initial text encoding layer and an initial graph construction layer; the first generation module 12 may include: a second processing unit 121, a third processing unit 122, a first construction unit 123 and a sixth generation unit 124.

[0203] The second processing unit 121 is configured to segment the sample text through the text encoding initial layer to obtain at least two word segmentations, perform vector conversion processing on the at least two word segmentations respectively, and generate word segmentation initial vectors corresponding to the at least two word segmentations respectively; the third processing unit 122 is configured to encode the at least two word segmentation initial vectors respectively to generate word segmentation encoding vectors corresponding to the at least two word segmentations respectively, and input the at least two word segmentation encoding vectors into the graph construction initial layer; the first construction unit 123 is configured to construct entity nodes corresponding to at least two label entity words and sentence nodes corresponding to A sample sentences through the graph construction initial layer; the sixth generation unit 124 is configured to generate at least two nodes based on the at least two entity nodes and A sentence nodes, and generate node initial vectors corresponding to the at least two nodes based on the at least two word segmentation encoding vectors.

[0204] The specific functional implementation of the second processing unit 121, the third processing unit 122, the first construction unit 123 and the sixth generation unit 124 can be found in step S102 of the embodiment corresponding to FIG4 above, which will not be described again here.

[0205] Please refer to Figure 7 again, at least two label entity words include label entity word C d ; d is a positive integer, and d is less than or equal to the total number of at least two tag entity words; the first generation module 12 may further include: a second construction unit 125.

[0206] The second construction unit 125 is configured to: if there is a label entity word C in the sample text d The corresponding tag mention word E d , then construct the label mention word E d The corresponding mention node; the sixth generation unit 124 is specifically configured to generate at least two entity nodes, A sentence nodes and label mention word E d The corresponding mentioned nodes are determined to be at least two nodes.

[0207] The specific functional implementation of the second construction unit 125 and the sixth generation unit 124 can be found in step S102 of the embodiment corresponding to FIG4 , and will not be described in detail here.

[0208] Referring again to FIG. 7 , at least two nodes include node F g ; g is a positive integer, and g is less than or equal to the total number of at least two nodes; the sixth generation unit 124 may include: a fifth acquisition subunit 1241, a sixth processing subunit 1242 and a sixth acquisition subunit 1243.

[0209] The fifth acquisition subunit 1241 is configured to: g Used to represent the tag mention word E d , then in at least two participles, get the label mention word E d The first word segmentation included in the at least two word segmentation encoding vectors is obtained, and the first word segmentation encoding vector corresponding to the first word segmentation is processed by the mean value to obtain the node F. The corresponding node initial vector; the sixth processing sub-unit 1242 is configured to: if the node F g Used to represent the label entity word C d , then the tag mentions word E d The corresponding node initial vector is processed by mean to obtain node F g The corresponding node initial vector; the sixth acquisition subunit 1243 is configured as follows: g Belongs to A sentence nodes, then in at least two participles, get node F gThe second word segmentation contained in the corresponding sample sentence is obtained from at least two word segmentation encoding vectors, and the second word segmentation encoding vector is averaged to obtain the node F. g The corresponding node initial vector.

[0210] The specific functional implementation of the fifth acquisition subunit 1241 , the sixth processing subunit 1242 and the sixth acquisition subunit 1243 can be found in step S102 in the embodiment corresponding to FIG4 , which will not be described in detail here.

[0211] From the above, it can be seen that the embodiment of the present application introduces adjustable universal training parameters in the associated node edges, so the scalability of the initial model of text recognition can be improved, that is, the processing effect of the initial model of text recognition for different graph structures can be improved; in addition, the embodiment of the present application does not need to infer the initial vectors of the edges, so the waste of computing resources can be reduced, and by avoiding inference on the initial vectors of the edges, the model parameters can be updated quickly, thereby improving the generation efficiency of the text recognition model.

[0212] Please refer to Figure 8, which is a second structural diagram of a data processing device provided in an embodiment of the present application. The above-mentioned data processing device 2 can be configured to perform the corresponding steps of the method provided in an embodiment of the present application. As shown in Figure 8, the data processing device 2 may include: a text input module 21 and a relationship determination module 22.

[0213] The text input module 21 is configured to obtain text and input the text into the text recognition model; the text includes K entity words to be recognized; K is a positive integer greater than 1; the text recognition model is obtained by adjusting the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to each two entity nodes; the graph initial structure includes node initial vectors and edge initial vectors corresponding to at least two nodes respectively; the at least two node initial vectors are generated by inputting a training sample set including sample text, at least two label entity words in the sample text and label entity word pairs carrying label relationships into the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences in the sample text and entity nodes corresponding to at least two label entity words respectively; A is a positive integer; the edge initial vector is determined according to the general training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge; the associated node edge is generated based on at least two nodes; the parameters in the text recognition initial model include general training parameters;

[0214] The relationship determination module 22 is configured to determine entity word pairs having a label relationship among the K entity words to be identified through a text recognition model.

[0215] The specific functional implementation of the text input module 21 and the relationship determination module 22 can be found in steps S301 to S302 in the embodiment corresponding to FIG6 , and will not be described in detail here.

[0216] Please refer to Figure 8 again. The text recognition model includes a text encoding layer, a graph construction layer and a relationship prediction layer; the relationship determination module 22 may include: a first generation unit 221, a second generation unit 222, a first processing unit 223, a second processing unit 224 and a third generation unit 225.

[0217] The first generating unit 221 is configured to generate word segmentation encoding vectors corresponding to B word segmentations in the text through the text encoding layer, and input the B word segmentation encoding vectors into the graph construction layer; B is a positive integer greater than 1; the second generating unit 222 is configured to construct entity nodes corresponding to K entity words to be identified through the graph construction layer, generate node vectors corresponding to K entity nodes according to the B word segmentation encoding vectors, and input the K node vectors into the relationship prediction layer; the K entity words to be identified include the first entity word to be identified and the second entity word to be identified; the K node vectors include the entity nodes corresponding to the first entity word to be identified The first node vector and the second node vector corresponding to the second entity word to be identified; the first processing unit 223 is configured to perform splicing processing on the first node vector and the second node vector through the relationship prediction layer to obtain a target splicing vector; the second processing unit 224 is configured to perform weighted processing on the target splicing vector to obtain a target vector to be activated, and perform activation processing on the target vector to obtain a target prediction relationship between the first entity word to be identified and the second entity word to be identified; the third generating unit 225 is configured to generate an entity word pair with a label relationship according to the target prediction relationship corresponding to each two entity words to be identified.

[0218] Among them, the specific functional implementation methods of the first generation unit 221, the second generation unit 222, the first processing unit 223, the second processing unit 224 and the third generation unit 225 can be found in step S302 of the embodiment corresponding to Figure 6 above, and will not be repeated here.

[0219] From the above, it can be seen that the embodiment of the present application introduces adjustable universal training parameters in the associated node edges, so the scalability of the initial model of text recognition can be improved, that is, the processing effect of the initial model of text recognition for different graph structures can be improved; in addition, the embodiment of the present application does not need to infer the initial vectors of the edges, so the waste of computing resources can be reduced, and by avoiding inference on the initial vectors of the edges, the model parameters can be updated quickly, thereby improving the generation efficiency of the text recognition model.

[0220] Please refer to Figure 9, which is a structural diagram of a computer device provided in an embodiment of the present application. As shown in Figure 9, the computer device 1000 may include: at least one processor 1001, such as a CPU, at least one network interface 1004, a user interface 1003, a memory 1005, and at least one communication bus 1002. Among them, the communication bus 1002 is used to realize the connection and communication between these components. Among them, in some embodiments, the user interface 1003 may include a display screen (Display), a keyboard (Keyboard), and the network interface 1004 may optionally include a standard wired interface, a wireless interface (such as a WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (non-volatile memory), such as at least one disk storage. The memory 1005 may optionally also be at least one storage device located away from the aforementioned processor 1001. As shown in Figure 9, the memory 1005 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a device control application.

[0221] In the computer device 1000 shown in FIG9 , the network interface 1004 can provide a network communication function; the user interface 1003 is mainly used to provide an input interface for the user; and the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve: obtaining a training sample set; the training sample set includes a sample text, at least two label entity words in the sample text, and a label entity word pair carrying a label relationship; inputting the training sample set into the text recognition initial model, and generating node initial vectors corresponding to at least two nodes respectively through the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences belonging to the sample text, and to At least two entity nodes corresponding to the label entity words respectively; A is a positive integer; based on the at least two nodes, an associated node edge is generated, and the edge initial vector corresponding to the associated node edge is determined according to the universal training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge; a graph initial structure including at least two node initial vectors and edge initial vectors is generated, and according to the node initial vectors corresponding to each two entity nodes, the label entity word pairs and the graph initial structure, the parameters in the text recognition initial model are adjusted to obtain a text recognition model for determining entity word pairs with label relationships in the text; the parameters in the text recognition initial model include universal training parameters.

[0222] Alternatively, the processor 1001 can be used to call the device control application stored in the memory 1005 to achieve: obtaining text and inputting the text into the text recognition model; the text includes K entity words to be recognized; K is a positive integer greater than 1; the text recognition model is obtained by adjusting the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to each two entity nodes; the graph initial structure includes node initial vectors and edge initial vectors corresponding to at least two nodes; the at least two node initial vectors are the sample text, at least two label entity words in the sample text and the edge initial vectors. and a training sample set of label entity word pairs carrying label relationships are input into the text recognition initial model; at least two nodes include sentence nodes corresponding to A sample sentences in the sample text, and entity nodes corresponding to at least two label entity words respectively; A is a positive integer; the edge initial vector is determined according to the universal training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge; the associated node edge is generated based on at least two nodes; the parameters in the text recognition initial model include universal training parameters; through the text recognition model, determine the entity word pairs with label relationships among the K entity words to be recognized.

[0223] It should be understood that the computer device 1000 described in the embodiments of the present application can execute the description of the data processing method or device in the above embodiments, which will not be repeated here. In addition, the description of the beneficial effects of using the same method will not be repeated.

[0224] The present application also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements the data processing methods or apparatuses described in the preceding embodiments, which are not described in detail here. Furthermore, the description of the beneficial effects of the same methods is not described in detail here.

[0225] The computer-readable storage medium may be the data processing device provided in any of the aforementioned embodiments or the internal storage unit of the computer device, such as the hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the computer device. The computer-readable storage medium may also include both the internal storage unit of the computer device and an external storage device. The computer-readable storage medium is used to store the computer program and other programs and data required by the computer device. The computer-readable storage medium may also be used to temporarily store data that has been output or is to be output.

[0226] The present application also provides a computer program product, comprising a computer program stored in a computer-readable storage medium. A processor of a computer device reads the computer program from the computer-readable storage medium and executes the computer program, enabling the computer device to perform the data processing methods or apparatuses described in the preceding embodiments, which are not further detailed here. Furthermore, the beneficial effects of the same methods are not further detailed here.

[0227] The terms "first", "second", etc. in the description, claims, and drawings of the embodiments of the present application are used to distinguish different objects, rather than to describe a specific order. In addition, the terms "comprising" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or device comprising a series of steps or units is not limited to the listed steps or modules, but may optionally include steps or modules not listed, or may optionally include other step units inherent to these processes, methods, apparatuses, products, or devices.

[0228] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0229] The above disclosure is only a preferred embodiment of the present application, and certainly cannot be used to limit the scope of rights of the present application. Therefore, equivalent changes made according to the claims of the present application are still within the scope covered by the present application.

Claims

1. A data processing method, comprising: Obtain a training sample set; The training sample set includes sample text, at least two label entity words in the sample text, and label entity word pairs carrying label relations; The training sample set is input into the text recognition initial model, and a node initial vector corresponding to at least two nodes is generated through the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences belonging to the sample text, and entity nodes corresponding to the at least two label entity words; A is a positive integer; Generate an associated node edge according to the at least two nodes, and determine an edge initialization vector corresponding to the associated node edge according to a common training parameter of the associated node edge and node initialization vectors corresponding to two nodes connected by the associated node edge, respectively; Generate a graph initial structure including at least two node initial vectors and the edge initial vector, adjust the parameters in the text recognition initial model according to the node initial vectors corresponding to every two entity nodes, the label entity word pairs and the graph initial structure, and obtain a text recognition model for determining the entity word pairs with the label relationship in the text; the parameters in the text recognition initial model include the general training parameters.

2. The method according to claim 1, wherein: The determining the edge initialization vector corresponding to the associated node edge according to the universal training parameters of the associated node edge and the node initialization vectors corresponding to two nodes connected by the associated node edge, respectively, comprises: Determine the edge vector to be normalized corresponding to the associated node edge according to the universal training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge; The edge vector to be normalized corresponding to the associated node edge is normalized to obtain an edge initial vector corresponding to the associated node edge.

3. The method according to claim 2, wherein: The step of determining the edge vector to be normalized corresponding to the associated node edge according to the universal training parameters of the associated node edge and the node initial vectors corresponding to two nodes connected by the associated node edge, respectively, includes: Determine the general training parameters and a set of to-be-processed vectors corresponding to the associated node edge according to the node types corresponding to the two nodes connected by the associated node edge; the set of to-be-processed vectors includes node initial vectors corresponding to the two nodes connected by the associated node edge; the general training parameters include a general weight parameter and a general scaling parameter; By using the universal weight parameter, weighted processing is performed on the set of vectors to be processed to obtain a set of weighted vectors; The weighted vectors in the weighted vector set are concatenated to obtain the vector to be scaled, and the vector to be scaled is scaled using the universal scaling parameter to obtain the edge vector to be normalized corresponding to the associated node edge.

4. The method according to claim 3, wherein: The determining, according to the node types respectively corresponding to the two nodes connected by the associated node edge, the general training parameter and the set of vectors to be processed corresponding to the associated node edge comprises: If the node types corresponding to the two nodes connected by the associated node edge are different, the composite universal training parameter is determined as the universal training parameter, and the node initial vectors corresponding to the two nodes connected by the associated node edge are determined as the vector set to be processed; If the node types corresponding to the two nodes connected by the associated node edge are the same, and the two nodes connected by the associated node edge belong to A sentence nodes, the sentence general training parameter is determined as the general training parameter, and the node initial vectors corresponding to the two nodes connected by the associated node edge and the distance vector between the two nodes connected by the associated node edge are determined as the vector set to be processed; If the node types corresponding to the two nodes connected by the associated node edge are the same, and the two nodes connected by the associated node edge both belong to the mentioned node set, the general training parameters of the mention are determined as the general training parameters, and the node initial vectors corresponding to the two nodes connected by the associated node edge, the context vectors of the two nodes connected by the associated node edge, and the distance vector between the two nodes connected by the associated node edge are determined as the set of vectors to be processed; the label mention words corresponding to the mentioned nodes in the mentioned node set belong to the sample text.

5. The method according to any one of claims 2 to 4, wherein: The associated node edge includes a first node edge; the two nodes connected by the first node edge include a first node and a second node; The normalizing the edge vector to be normalized corresponding to the associated node edge to obtain the edge initial vector corresponding to the associated node edge includes: If the node type corresponding to the first node is different from the node type corresponding to the second node, the second node edge is obtained in the associated node edge; wherein, if the first node belongs to at least two entity nodes, and the second node belongs to A sentence nodes point, the two nodes connected by the second node edge include the first node and the third node; the third node belongs to the A sentence nodes; if the first node belongs to the mention node set, the two nodes connected by the second node edge include the first node and the fourth node; the node type corresponding to the fourth node is the same as the node type corresponding to the second node; the label mention word corresponding to the mention node in the mention node set belongs to the sample text; From the edge vectors to be normalized corresponding to the associated node edges, obtaining the edge vectors to be normalized corresponding to the second node edges; The vector to be normalized corresponding to the first node edge is normalized by using the edge vector to be normalized corresponding to the second node edge to obtain an initial edge vector corresponding to the first node edge.

6. The method according to claim 5, wherein: The step of normalizing the vector to be normalized corresponding to the first node edge by using the edge vector to be normalized corresponding to the second node edge to obtain the initial edge vector corresponding to the first node edge includes: Performing activation processing on the edge vector to be normalized corresponding to the first node edge to obtain an activation vector corresponding to the first node edge, and performing activation processing on the edge vector to be normalized corresponding to the second node edge to obtain an activation vector corresponding to the second node edge; Performing exponential processing on the activation vector corresponding to the first node edge to obtain an exponential vector corresponding to the first node edge, and performing exponential processing on the activation vector corresponding to the second node edge to obtain an exponential vector corresponding to the second node edge; Summing the exponential vectors corresponding to the second node edges to obtain a total exponential vector corresponding to the second node edges; The ratio of the exponential vector corresponding to the first node edge to the total exponential vector corresponding to the second node edge is determined as the edge initial vector corresponding to the first node edge.

7. The method according to any one of claims 2 to 4, wherein: The associated node edge includes a third node edge; the two nodes connected by the third node edge include a fifth node and a sixth node; The normalizing the edge vector to be normalized corresponding to the associated node edge to obtain the edge initial vector corresponding to the associated node edge includes: If the node type corresponding to the fifth node is the same as the node type corresponding to the sixth node, a fourth node edge and a fifth node edge are obtained in the associated node edge; wherein, if the fifth node and the sixth node both belong to A sentence nodes, the two nodes connected by the fourth node edge include the fifth node and the seventh node, and the two nodes connected by the fifth node edge include the sixth node and the eighth node; the seventh node and the eighth node both belong to the A sentence nodes; if the fifth node and the sixth node both belong to the mentioned node set, the two nodes connected by the fourth node edge include the fifth node and the ninth node, and the two nodes connected by the fifth node edge include the sixth node and the tenth node; the ninth node and the tenth node both belong to the mentioned node set; the label mention words corresponding to the mentioned nodes in the mentioned node set belong to the sample text; From the edge vectors to be normalized corresponding to the associated node edges, obtain the edge vector to be normalized corresponding to the fourth node edge and the edge vector to be normalized corresponding to the fifth node edge; Normalizing the vector to be normalized corresponding to the third node edge by using the edge vector to be normalized corresponding to the fourth node edge, to obtain the first edge initial vector corresponding to the third node edge; The vector to be normalized corresponding to the third node edge is normalized by using the edge vector to be normalized corresponding to the fifth node edge to obtain a second edge initial vector corresponding to the third node edge; The first edge initialization vector and the second edge initialization vector are determined as edge initialization vectors corresponding to the third node edge.

8. The method according to any one of claims 1 to 7, wherein: The method adjusts the parameters in the text recognition initial model according to the node initial vectors corresponding to each two entity nodes, the label entity word pairs and the graph initial structure to obtain a text recognition model for determining the entity word pairs having the label relationship in the text, including: Generate a prediction relationship corresponding to each two entity nodes according to the node initial vectors respectively corresponding to each two entity nodes; According to the label entity word pair, generate a label edge corresponding to each two entity nodes; According to the predicted relationship corresponding to every two entity nodes, the label edge corresponding to every two entity nodes and the initial structure of the graph, the parameters in the initial text recognition model are adjusted to obtain a text recognition model; the text recognition model is used to determine the entity word pairs with the label relationship in the text.

9. The method according to claim 8, wherein: The text recognition initial model includes an initial layer of relationship prediction; each of the two entity nodes includes a first entity node and a second entity node; The generating, according to the node initial vectors respectively corresponding to each two entity nodes, the prediction relationship corresponding to each two entity nodes comprises: Through the relationship prediction initial layer, a node initial vector corresponding to the first entity node and a node initial vector corresponding to the second entity node are concatenated to obtain a concatenated vector; The concatenated vector is weighted to obtain a vector to be activated, and the vector to be activated is activated to obtain a predicted relationship corresponding to the first entity node and the second entity node.

10. The method according to claim 8 or 9, wherein: Each of the two entity nodes includes a first entity node and a second entity node; Generating the label edge corresponding to each two entity nodes according to the label entity word pair includes: Determine the entity nodes corresponding to the two label entity words in the label entity word pair as a first entity node pair; generating a second entity node pair including the first entity node and the second entity node; If there is an entity node pair in the first entity node pair that is the same as the second entity node pair, determining the positive sample label edge as the label edge corresponding to the second entity node pair; If there is no entity node pair identical to the second entity node pair in the first entity node pair, the negative sample label edge is determined as the label edge corresponding to the second entity node pair.

11. The method according to claim 8, wherein: The method of adjusting the parameters in the initial text recognition model according to the predicted relationship corresponding to each two entity nodes, the label edge corresponding to each two entity nodes, and the initial graph structure to obtain the text recognition model includes: Determine a model loss value according to the predicted relationship corresponding to each two entity nodes and the label edge corresponding to each two entity nodes; According to the model loss value and the initial structure of the graph, the parameters in the initial text recognition model are adjusted to obtain a text recognition model.

12. The method according to any one of claims 1 to 11, wherein: At least two entity nodes include entity node H i ; i is a positive integer, and i is less than or equal to the total number of the at least two entity nodes; The step of generating an associated node edge according to the at least two nodes includes: In A sentence nodes, get the entity node H i The first associated sentence node is associated with the entity node H. i and the first associated node edge of the first associated sentence node; the sample sentence corresponding to the first associated sentence node includes the entity node H i The corresponding label entity word; If A is a positive integer greater than 1, a second associated node edge is generated according to every two sentence nodes in the A sentence nodes; An associative node edge is generated according to the first associative node edge and the second associative node edge.

13. The method according to claim 12, wherein: There are J mention nodes among the at least two nodes, where J is a positive integer; the label mention words corresponding to the J mention nodes belong to the sample text; The step of generating an associated node edge according to the first associated node edge and the second associated node edge includes: If there is any node among the J mentioned nodes that is related to the entity node H i The associated associated mentioned node is generated including the associated mentioned node and the entity node H i The third associated node edge of the associated mention node is the label mentioned word corresponding to the entity node H i The corresponding mention words of the tag entity word; Among the A sentence nodes, a second associated sentence node associated with the associated mention node is obtained, and a fourth associated node edge including the associated mention node and the second associated sentence node is generated; the sample sentence corresponding to the second associated sentence node includes a label mention word corresponding to the associated mention node; If J is a positive integer greater than 1 and there is an associated mention node pair among the J mention nodes, a fifth associated node edge including the associated mention node pair is generated; and the two label mention words corresponding to the associated mention node pair are located in the same sample sentence; The first association node edge, the second association node edge, the third association node edge, the fourth association node edge, and the fifth association node edge are determined as association node edges.

14. The method according to any one of claims 1 to 13, wherein: The text recognition initial model includes a text encoding initial layer and a graph construction initial layer; The step of generating node initial vectors corresponding to at least two nodes respectively through the text recognition initial model includes: The sample text is segmented through the initial text encoding layer to obtain at least two segmented words, and the at least two segmented words are respectively vectorized to generate initial segmented word vectors corresponding to the at least two segmented words; Encoding at least two word segmentation initial vectors respectively to generate word segmentation encoding vectors corresponding to the at least two word segmentations respectively, and inputting the at least two word segmentation encoding vectors into the initial layer of graph construction; Constructing an initial layer through the graph, constructing entity nodes corresponding to the at least two label entity words, and sentence nodes corresponding to the A sample sentences; At least two nodes are generated according to at least two entity nodes and A sentence nodes, and node initial vectors corresponding to the at least two nodes are generated according to the at least two word segmentation encoding vectors.

15. The method according to claim 14, wherein: The at least two label entity words include the label entity word C d ; d is a positive integer, and d is less than or equal to the total number of the at least two tag entity words; The method further comprises: If the label entity word C exists in the sample text d The corresponding label mention word E d , then construct the label mention word E d The corresponding mention node; Then, generating at least two nodes according to at least two entity nodes and A sentence nodes includes: At least two entity nodes, A sentence nodes and the label mention word E d The corresponding mentioned nodes are determined to be at least two nodes.

16. A data processing method comprising: Get text; The text is input into a text recognition model; wherein, The text includes K entity words to be recognized; K is a positive integer greater than 1; the text recognition model is obtained by adjusting the parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to every two entity nodes; the graph initial structure includes node initial vectors and edge initial vectors corresponding to at least two nodes; At least two node initial vectors are generated by inputting a training sample set including a sample text, at least two label entity words in the sample text, and the label entity word pairs carrying label relationships into the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences in the sample text, and entity nodes corresponding to the at least two label entity words respectively; A is a positive integer; the edge initial vector is determined according to the universal training parameters of the associated node edge and the node initial vectors corresponding to the two nodes connected by the associated node edge respectively; the associated node edge is generated according to the at least two nodes; the parameters in the text recognition initial model include the universal training parameters; The entity word pairs having the label relationship among the K entity words to be identified are determined through the text recognition model.

17. The method according to claim 16, wherein: The text recognition model includes a text encoding layer, a graph construction layer and a relationship prediction layer; Determining the entity word pairs having the label relationship among the K entity words to be identified by the text recognition model includes: Generate word segmentation encoding vectors corresponding to B word segmentations in the text through the text encoding layer, and input the B word segmentation encoding vectors into the graph construction layer; B is a positive integer greater than 1; Through the graph construction layer, entity nodes corresponding to the K entity words to be identified are constructed respectively, node vectors corresponding to the K entity nodes are generated respectively according to the B word segmentation encoding vectors, and the K node vectors are input into the relationship prediction layer; the K entity words to be identified include a first entity word to be identified and a second entity word to be identified; the K node vectors include a first node vector corresponding to the first entity word to be identified and a second node vector corresponding to the second entity word to be identified; Through the relationship prediction layer, the first node vector and the second node vector are concatenated to obtain a target concatenated vector; Performing weighted processing on the target concatenated vector to obtain a target vector to be activated, and performing activation processing on the target vector to be activated to obtain a target prediction relationship between the first entity word to be identified and the second entity word to be identified; According to the target prediction relationship corresponding to every two entity words to be identified, an entity word pair with the label relationship is generated.

18. A data processing device, comprising: A sample acquisition module, configured to acquire a training sample set; The training sample set includes a sample text, at least two label entity words in the sample text, and a label entity word pair carrying a label relationship; The first generation module is configured to input the training sample set into the text recognition initial model, and generate node initial vectors corresponding to at least two nodes respectively through the text recognition initial model; the at least two nodes include sentence nodes corresponding to A sample sentences belonging to the sample text, and entity nodes corresponding to at least two label entity words respectively; A is a positive integer; A second generating module is configured to generate an associated node edge according to the at least two nodes, and determine an edge initialization vector corresponding to the associated node edge according to a common training parameter of the associated node edge and node initialization vectors corresponding to two nodes connected by the associated node edge; The third generation module is configured to generate an initial graph structure including the at least two node initial vectors and the edge initial vectors, and adjust the parameters in the text recognition initial model according to the node initial vectors corresponding to each two entity nodes, the label entity word pairs and the graph initial structure, so as to obtain a text recognition model for determining entity word pairs with label relationships in the text; the parameters in the text recognition initial model include general training parameters.

19. A data processing device, comprising: A text input module is configured to obtain text and input the text into a text recognition model; the text includes K entity words to be recognized; K is a positive integer greater than 1; the text recognition model is obtained by adjusting parameters in the text recognition initial model according to the node initial vectors, label entity word pairs and graph initial structure corresponding to every two entity nodes; the graph initial structure includes node initial vectors and edge initial vectors corresponding to at least two nodes; At least two node initial vectors are obtained by inputting a training sample set including a sample text, at least two label entity words in the sample text, and label entity word pairs carrying label relationships into the text recognition initial model. generated; The at least two nodes include sentence nodes corresponding to A sample sentences in the sample text, and entity nodes corresponding to at least two label entity words respectively; A is a positive integer; The edge initialization vector is determined according to the universal training parameters of the associated node edge and the node initialization vectors corresponding to the two nodes connected by the associated node edge; the associated node edge is generated according to at least two nodes; the parameters in the text recognition initial model include the universal training parameters; The relationship determination module is configured to determine entity word pairs having label relationships among K entity words to be identified through a text recognition model.

20. A computer device comprising: Processor, memory, and network interface; The processor is connected to the memory and the network interface, wherein the network interface is used to provide a data communication function, the memory is used to store a computer program, and the processor is used to call the computer program so that the computer device executes the method described in any one of claims 1 to 17.

21. A computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, wherein the computer program is suitable for being loaded and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 17.

22. A computer program product, comprising a computer program, wherein the computer program is stored in a computer-readable storage medium, and the computer program is suitable for being read and executed by a processor, so that a computer device having the processor executes the method according to any one of claims 1 to 17.

Citation Information

Patent Citations

  • Data processing method, equipment and computer readable storage medium

    CN112182253A

  • Document-level entity relationship extraction method based on document structure and external knowledge

    CN113032585A

  • Systems and methods for entity resolution using attributes from structured and unstructured data

    US9535902B1