Data structuring method, device, equipment, storage medium and program product

By identifying core action entities and target entities in question-and-answer data and generating semantic expressions, the problem of single structured results in existing technologies is solved, achieving more accurate representation of entity dependencies and improving the feedback accuracy of intelligent conversation systems.

CN116450766BActive Publication Date: 2024-11-22TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210006123.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-05
Publication Date
2024-11-22
Estimated Expiration
2042-01-05

AI Technical Summary

Technical Problem

Existing semantic understanding methods based on domain, intent, and slot yield relatively simple structured results, making it difficult to effectively represent entity dependencies in complex question-and-answer content.

Method used

By acquiring candidate entities from question-and-answer data, identifying core action entities and target entities, generating semantic expressions based on verb-object relationships, and constructing an acyclic rooted graph to represent the dependencies between entities.

Benefits of technology

It improves the effectiveness of data structuring, enhances the feedback accuracy of intelligent conversation systems, and can more accurately represent entity dependencies in question-and-answer content.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116450766B_ABST
    Figure CN116450766B_ABST
Patent Text Reader

Abstract

The present application is about a data structuring method, device, equipment, storage medium and program product, and relates to the field of data processing technology. The method includes: obtaining question and answer data used to describe the question and answer content of the target user; recalling candidate entities based on the question and answer data to obtain at least two candidate entities; obtaining a core action entity from at least two candidate entities; the core action entity is used to indicate the core verb in the question and answer data; based on the core action entity, obtaining a target entity from at least two candidate entities; the target entity is used to indicate an entity that has a subject-object relationship with the core action entity; based on the core action entity and the target entity, generating a semantic expression of the question and answer data; the semantic expression is used to indicate the structured question and answer data. Through the above method, discrete question and answer content can be converted into a structured semantic expression that can characterize the dependency relationship between entities, thereby improving the effect of data structuring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data processing technology, and in particular to data structuring methods, devices, equipment, storage media and program products. Background Art

[0002] With the development of artificial intelligence, intelligent customer service has become an important alternative way to solve user problems. Among them, intelligent customer service can be achieved through an intelligent dialogue system. The semantic understanding module in the intelligent dialogue system can convert the user's question and answer content into a structured data form that is conducive to data analysis and mining.

[0003] In related technologies, in order to achieve the structuring of question and answer content, relevant personnel usually set up a semantic understanding module, and classify the various entities that make up the question and answer content based on the semantic understanding method of domain, intent, and slot to achieve the structuring of the question and answer content.

[0004] However, the structured results obtained based on the above data structuring method are flat results. For question-and-answer content containing many entities, the structured results corresponding to the question-and-answer content can only reflect the categories to which each entity belongs, such as domain, intent, slot, etc., which makes the content that the structured results can represent relatively single and the structuring effect is poor. Summary of the invention

[0005] The embodiments of the present application provide a data structuring method, apparatus, device, storage medium and program product, which can improve the effect of data structuring. The technical solution is as follows.

[0006] In one aspect, a data structuring method is provided, the method comprising:

[0007] Acquire question and answer data, where the question and answer data is used to describe the question and answer content of the target user;

[0008] Recall candidate entities based on the question-answer data to obtain at least two candidate entities; the candidate entities are named entities of events of a specified type occurring in the target domain;

[0009] Acquire a core action entity from at least two of the candidate entities; the core action entity is used to indicate a core verb in the question and answer data;

[0010] Based on the core action entity, a target entity is obtained from at least two candidate entities; the target entity includes an entity that has a subject-object relationship with the core action entity;

[0011] Based on the core action entity and the target entity, a semantic expression of the question and answer data is generated; the semantic expression is used to indicate the structured question and answer data.

[0012] In another aspect, a data structuring device is provided, the device comprising:

[0013] A data acquisition module is used to acquire question and answer data, wherein the question and answer data is used to describe the question and answer content of the target user;

[0014] A candidate entity acquisition module, used to recall candidate entities based on the question and answer data to obtain at least two candidate entities; the candidate entities are named entities of events of a specified type occurring in the target domain;

[0015] A core action entity acquisition module, used to acquire a core action entity from at least two of the candidate entities; the core action entity is used to indicate a core verb in the question and answer data;

[0016] A target entity acquisition module, used to acquire a target entity from at least two candidate entities based on the core action entity; the target entity includes an entity that has a subject-object relationship with the core action entity;

[0017] A generation module is used to generate a semantic expression of the question and answer data based on the core action entity and the target entity; the semantic expression is used to indicate the structured question and answer data.

[0018] In a possible implementation, the question-answer data includes an entity word sequence consisting of at least two entity words; and the candidate entity acquisition module includes:

[0019] A position tag acquisition submodule, used to acquire a position tag of each of the at least two entity words, wherein the position tag is used to indicate whether the entity word is at the start position of an entity and whether the entity word is at the end position of an entity;

[0020] The candidate entity determination submodule is used to determine at least two candidate entities based on the position tag of each entity word.

[0021] In a possible implementation, the position label acquisition submodule is used to input the entity word sequence into a label prediction model to obtain the position label of each entity word output by the label prediction model;

[0022] Among them, the label prediction model is obtained by training based on the first sample entity word sequence and the sample position labels corresponding to the sample entity words in the first sample entity word sequence; the sample position labels include a sample start label and a sample end label; the sample start label is used to indicate whether the sample entity word is at the start position of an entity; the sample end label is used to indicate whether the sample entity word is at the end position of an entity.

[0023] In a possible implementation, the core action entity acquisition module includes:

[0024] An information acquisition submodule, used to acquire entity representation information of at least two of the candidate entities;

[0025] The core action entity acquisition submodule is used to acquire the core action entity from at least two candidate entities based on the entity representation information of each of the at least two candidate entities.

[0026] In a possible implementation, the core action entity acquisition submodule includes:

[0027] A vector acquisition unit, used to acquire a semantic vector of a start entity word and a semantic vector of an end entity word in a target candidate entity; the start entity word includes the entity word at the start position of the target candidate entity, and the end entity word includes the entity word at the end position of the target candidate entity; the target candidate entity is any one of at least two candidate entities;

[0028] A matrix acquisition unit, configured to query an embedding matrix of the entity length based on the entity length of the target candidate entity; the entity length is used to indicate the number of entity words between the start entity word and the end entity word in the target candidate entity;

[0029] A core action entity acquisition unit is used to construct the entity representation information of the target candidate entity based on the semantic vector of the start entity word, the semantic vector of the end entity word, and the embedding matrix of the entity length.

[0030] In a possible implementation, the core action entity acquisition unit is used to input entity representation information into an entity classification model to obtain a classification result of the candidate entity output by the entity classification model; the classification result of the candidate entity is used to indicate whether the candidate entity is the core action entity;

[0031] Among them, the entity classification model is obtained by training based on the sample entity representation information of each entity in the second sample entity word sequence, and the first entity classification label of each entity in the second sample entity word sequence; the first entity classification label includes a core action entity label and a non-core action entity label.

[0032] In a possible implementation, the target entity acquisition module includes:

[0033] A marker insertion submodule, configured to insert entity recognition markers into the question-answer data based on at least two of the candidate entities and the core action entity; the entity recognition markers are used to indicate the boundaries of each of the candidate entities in the question-answer data; the entity recognition markers include a start marker and an end marker;

[0034] An encoding submodule, used for encoding the question and answer data after inserting the entity identification mark to obtain an encoding result;

[0035] A vector acquisition submodule, used to acquire, from the encoding result, an encoding vector of the start mark of the core action entity and an encoding vector of the start mark of a candidate target entity; the candidate target entity is an entity other than the core action entity among at least two candidate entities;

[0036] A vector concatenation submodule, used to concatenate the encoding vector of the start flag of the core action entity with the output encoding of the start flag of each candidate target entity, to obtain a concatenation vector corresponding to each candidate target entity;

[0037] The target entity determination submodule is used to determine the target entity from the candidate target entities based on the splicing vector corresponding to each of the candidate target entities.

[0038] In a possible implementation, the target entity determination submodule is used to input the concatenation vector corresponding to each of the candidate target entities into a relationship recognition model to obtain a recognition result of the candidate target entity output by the relationship recognition model; the recognition result of the candidate target entity is used to indicate whether the candidate target entity is the target entity;

[0039] The relationship recognition model is obtained by training based on a sample splicing vector and a second entity classification label of a sample candidate target entity corresponding to the sample splicing vector, and the second entity classification label is used to indicate whether the sample candidate target entity is the target entity.

[0040] In a possible implementation, the device module further includes:

[0041] A phrase acquisition module, used to acquire selectable phrases in the question and answer data; the selectable phrases include other phrases in the question and answer data except the core action entity and the target entity;

[0042] The generation module is used to generate the semantic expression of the question and answer data based on the core action entity, the target entity and the optional phrase.

[0043] In one possible implementation, the generation module is used to construct an acyclic rooted graph based on the core action entity, the target entity and the optional phrases; each graph node in the acyclic rooted graph is used to represent the core action entity, the target entity and the optional phrases; and the edges in the acyclic rooted graph are used to represent the association relationship between entities.

[0044] In a possible implementation, the selectable phrases include: at least one of an intention phrase, a state phrase, an attribute phrase, and other conditional phrases;

[0045] Among them, the intention phrase is used to indicate the question type of the question and answer content; the status phrase is used to indicate the development status of the event described in the question and answer content; and the attribute phrase is used to modify the entity in the question and answer content.

[0046] On the other hand, a computer device is provided, comprising a processor and a memory, wherein the memory stores at least one instruction, at least one program, a code set or an instruction set, and the at least one instruction, the at least one program, the code set or the instruction set are loaded and executed by the processor to implement the above-mentioned data structuring method.

[0047] On the other hand, a computer-readable storage medium is provided, wherein at least one computer program is stored in the computer-readable storage medium, and the computer program is loaded and executed by a processor to implement the above-mentioned data structuring method.

[0048] On the other hand, a computer program product or a computer program is provided, the computer program product or the computer program includes computer instructions, the computer instructions are stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device executes the data structuring method provided in the above various optional implementations.

[0049] The technical solution provided by this application may have the following beneficial effects:

[0050] The data processing device extracts at least two candidate entities from the question and answer data, first obtains the core action entity from the at least two candidate entities, and then obtains the target entity from the at least two candidate entities based on the subject-object relationship between the core action entity; and generates a semantic expression indicating the structured question and answer data based on the obtained core action entity and the target entity. Through the above method, the data processing device can convert discrete question and answer content into a structured semantic expression that can characterize the dependency relationship between entities, thereby improving the effect of data structuring. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0052] Figure 1 A schematic diagram showing the structure of an intelligent conversation system shown in an exemplary embodiment of the present application;

[0053] Figure 2 A schematic diagram showing a system architecture of a semantic understanding component 110 provided by an exemplary embodiment of the present application;

[0054] Figure 3 A flowchart of a data structuring method shown in an exemplary embodiment of the present application is shown;

[0055] Figure 4 A schematic diagram of a semantic expression provided by an exemplary embodiment of the present application is shown;

[0056] Figure 5 A schematic diagram showing another semantic expression provided by an exemplary embodiment of the present application is shown;

[0057] Figure 6 A flowchart of a data structuring method shown in an exemplary embodiment of the present application is shown;

[0058] Figure 7 A schematic diagram of the structure of a label prediction model shown in an exemplary embodiment of the present application is shown;

[0059] Figure 8 A schematic diagram of the structure of an entity classification model shown in an exemplary embodiment of the present application is shown;

[0060] Fig. 9 A schematic diagram of the structure of a relationship identification model shown in an exemplary embodiment of the present application is shown;

[0061] Fig.10 A framework diagram of a data structuring system shown in an exemplary embodiment of the present application is shown;

[0062] Fig.11A schematic diagram of a data structuring device shown in an exemplary embodiment of the present application is shown;

[0063] Fig.12 A structural block diagram of a computer device shown in an exemplary embodiment of the present application is shown;

[0064] Fig.13 A structural block diagram of a computer device shown in an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION

[0065] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0066] It should be understood that the "plurality" mentioned in this article refers to two or more. "And / or" describes the association relationship of the associated objects, indicating that there can be three relationships. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0067] The embodiment of the present application provides a data structuring method, which can improve the accuracy and interpretability of data structuring. For ease of understanding, several terms involved in the present application are explained below.

[0068] 1) Artificial Intelligence (AI)

[0069] Artificial intelligence is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.

[0070] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. Basic artificial intelligence technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operating / interactive systems, and mechatronics. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning. The display device including an image acquisition component shown in this application mainly involves computer vision technology and machine learning / deep learning.

[0071] 2) Natural Language Processing (NLP)

[0072] Natural language processing is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can achieve effective communication between people 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 usually includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

[0073] The data structuring method provided in this application can be applied to an intelligent conversation system. Figure 1 FIG. 1 is a schematic diagram showing the structure of an intelligent conversation system according to an exemplary embodiment of the present application. Figure 1As shown, the intelligent conversation system 100 includes a semantic understanding component 110, a conversation management component 120 and a dialogue generation component 130; wherein the semantic understanding component 110 is used to semantically understand the received question and answer content of the target user, convert the question and answer content into a structured representation, obtain a structured result, and send the structured result to the conversation management component 120; after receiving the structured result, the conversation management component 120 determines the operation content to be taken in the next step based on the structured result, for example, the operation content includes asking questions, confirming or directly returning answers, etc.; the dialogue generation component 130 generates a dialogue content corresponding to the operation content based on the operation content determined by the conversation management component 120; the dialogue content is returned to the target user, and a system reply is given to the target user to guide the target user to perform the corresponding operation, or to enable the target user to obtain the required information. In the above process, the effect of the semantic understanding component 110 on the data structuring of the question and answer content directly affects the feedback accuracy of the intelligent conversation system. Based on this, an embodiment of the present application provides a data structuring method that can be applied to the semantic understanding component 110 of the intelligent conversation system. This method enables the semantic understanding component 110 to accurately classify entities when the question and answer data (used to describe the question and answer content of the target user) contains multiple entities by establishing dependencies between the entities, thereby improving the effect of data structuring. After the structured results are sent to the downstream components of the intelligent conversation system, the downstream components can obtain accurate introduction content based on the structured results, thereby improving the feedback accuracy of the intelligent conversation system.

[0074] Figure 2 A schematic diagram showing the system architecture of the semantic understanding component 110 provided by an exemplary embodiment of the present application is shown in FIG. Figure 2 As shown, the semantic understanding component 110 includes: a data processing device 210 and a data receiving device 220 .

[0075] The above-mentioned data processing device 210 can be implemented as a terminal or a server. When the data processing device 210 is implemented as a server, the data processing device 210 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 services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), blockchain networks, and big data and artificial intelligence platforms. When the data processing device 210 is implemented as a terminal, the data processing device 210 can be a smart phone, a tablet computer, a laptop, a desktop computer, and the like.

[0076] The above-mentioned data receiving device 220 is a device with data collection and storage functions, which is used to obtain question and answer data and send the question and answer data to the data processing device 210 so that the data processing device 210 performs data structuring processing on the question and answer data; wherein, the data receiving device 220 can be implemented as a terminal or a server.

[0077] Optionally, the semantic understanding component 110 may include one or more data processing devices 210, or one or more data receiving devices 220. The embodiment of the present application does not limit the number of data processing devices 210 and data receiving devices 220.

[0078] The data receiving device 220 and the data processing device 210 may be connected via a communication network. Optionally, the communication network is a wired network or a wireless network.

[0079] Optionally, the above-mentioned wireless network or wired network uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to any combination of local area network (LAN), metropolitan area network (MAN), wide area network (WAN), mobile, wired or wireless network, private network or virtual private network. In some embodiments, the data exchanged through the network is represented by technology and / or format including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPsec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technology can also be used to replace or supplement the above-mentioned data communication technology. This application is not limited here.

[0080] Figure 3 A flowchart of a data structuring method according to an exemplary embodiment of the present application is shown. The method can be executed by a computer device, and the computer device can be implemented as follows: Figure 2 The data processing device 210 shown in FIG. Figure 3 As shown, the data structuring method may include the following steps.

[0081] Step 310, obtaining question and answer data, where the question and answer data is used to describe the question and answer content of the target user.

[0082] Optionally, the question-answer data can be Figure 2 The data receiving device shown sends the data to the data processing device; accordingly, the data processing device obtains the question and answer data.

[0083] In one possible implementation, the data receiving device has an interface display function for displaying an intelligent conversation page; the data receiving device obtains the question and answer content input by the target user based on the intelligent conversation page as question and answer data, and sends the question and answer data to a data processing device; or, optionally, the data receiving device has an audio acquisition function for collecting voice information of the target user; the data receiving device obtains the question and answer content carried in the voice information of the target user collected by the audio acquisition function as question and answer data, and sends the question and answer data to a data processing device. This application does not limit the way in which the data receiving device obtains question and answer data.

[0084] The target user may be a user who inputs the question and answer content corresponding to the question and answer data being processed by the data processing device.

[0085] Step 320, recall candidate entities based on the question and answer data to obtain at least two candidate entities.

[0086] The structuring method of question and answer data provided in the present application can be applied to scenarios with complex question and answer content with multiple entities; therefore, after acquiring the question and answer data, the data processing device can recall at least two candidate entities from the question and answer data.

[0087] The candidate entities in the embodiments of the present application may be named entities of events of a specified type occurring in the target domain; different target domains correspond to different types of candidate entities; illustratively, when the target domain is the medical insurance domain, the candidate entities include named entities of events of a specified type occurring in the medical insurance domain, such as query, payment, details, etc.; when the target domain is the medical record statistics domain, the candidate entities may be implemented as diagnosis, surgery, drug name, surgery name, etc.; the contents of the candidate entities under different target domains may be set by relevant personnel, and the present application does not impose any restrictions on this.

[0088] In an embodiment of the present application, the candidate entity may include one or more action entities and one or more content entities.

[0089] Step 330, obtaining a core action entity from at least two candidate entities; the core action entity is used to indicate a core verb in the question and answer data.

[0090] The core action entity belongs to one or more action entities included in the candidate entity.

[0091] Illustratively, in a Chinese intelligent conversation scenario, the core action entity may be the predicate in the question and answer content; for example, the question and answer content is "Please help me check the electronic medical insurance payment details", which contains multiple entities; among them, "query", "electronic medical insurance", "payment", "payment details", "details", etc. may be used as different candidate entities. Based on the data structuring method provided in this application, the data processing device may first obtain the core action entity "query" from the above-mentioned multiple entity devices in order to perform subsequent operations.

[0092] Step 340, based on the core action entity, obtain a target entity from at least two candidate entities; the target entity includes an entity that has a subject-object relationship with the core action entity.

[0093] The target entity belongs to one of the one or more content entities included in the candidate entity.

[0094] That is to say, the target entity is the object of the verb corresponding to the core action entity; schematically, taking the question and answer content in step 330 as an example, the object of the "query" action is "payment details" or "details", then "payment details" or "details" can be obtained as the target entity corresponding to "query".

[0095] Optionally, a core action entity may have one or more target entities having a subject-object relationship with it, and this application does not limit the number of target entities.

[0096] Step 350: Generate a semantic expression of the question and answer data based on the core action entity and the target entity; the semantic expression is used to indicate the structured question and answer data.

[0097] Optionally, the data processing device may generate a semantic expression of the question and answer data based on the core action entity, the target entity, and the subject-object relationship between the core action entity and the target action entity.

[0098] In summary, the data structure processing method provided by the embodiment of the present application is that the data processing device extracts at least two candidate entities in the question and answer data, first obtains the core action entity from the at least two candidate entities, and then obtains the target entity from the at least two candidate entities based on the subject-object relationship between the core action entity; based on the obtained core action entity and the target entity, a semantic expression is generated to indicate the structured question and answer data. Through the above method, the data processing device can convert discrete question and answer content into a structured semantic expression that can characterize the dependency relationship between entities, thereby improving the effect of data structuring.

[0099] At the same time, when the data processing device provides the semantic expression to the downstream components of the intelligent conversation system, the downstream components can obtain accurate introduction content based on the structured results, thereby improving the feedback accuracy of the intelligent conversation system.

[0100] The data structuring method provided in the embodiment of the present application defines a structured semantic expression, which is an acyclic rooted graph, and the acyclic rooted graph is composed of graph nodes and edges; optionally, the graph nodes can represent core action entities and target entities, and the edges can represent the relationship between the core action entities and the target entities.

[0101] Furthermore, the graph node may also represent at least one of an attribute phrase, an intention phrase, a state phrase, and other conditional phrases; wherein the core action entity refers to the core predicate in the question and answer content, that is, the core action; the target entity refers to the object of the core action, which is the object or recipient of the core action; the attribute phrase is a phrase that modifies the entire sentence (the sentence corresponding to the question content), and schematically, the attribute phrase may include task type, time, location, organization, etc.; the intention phrase is used to indicate the user's question type, which may include asking how long (how long), when (when), how much (how much), how (how), where (where), what result (what result), what is (what is), what is (what), what is the use (what use), what is needed (what thing), what is required (what condition), what group of people (what people), what organization (what org), whether, why, difference, which, command, etc.; state entity is used to indicate the development state of the time described by the question and answer content, including failure (error), success, start (start), end (end), negation (cannot), etc.; other conditional phrases are used to indicate the premise of the question and answer content, and to describe the question and answer content conditionally; schematically, taking the application of data structuring method to intelligent conversation system in the field of intelligent medical insurance as an example, Figure 4 A schematic diagram of a semantic expression provided by an exemplary embodiment of the present application is shown. Figure 4 As shown, the question and answer content (medical insurance question) sent by the target user is "How can non-local employees make up for the resident medical insurance after the payment is interrupted?" After the data structuring method provided by this application structures the question and answer content, the following is obtained: Figure 4The semantic expression (acyclic rooted graph) shown in FIG. 1 is a graph in which the core action entity is “supplementary payment”, the target entity having a subject-object relationship with the core action entity is “resident medical insurance”, the attribute phrase representing the person of the target entity is “resident”, the attribute phrase representing the place is “other place”, the attribute phrase representing the person is “employee”, the intention phrase is “how”, which is used to ask about the method (how), and the other conditional phrases are “after the interruption of payment”, which are used to indicate the prerequisites of the question and answer content.

[0102] Figure 5 A schematic diagram of another semantic expression provided by an exemplary embodiment of the present application is shown. Figure 5 As shown in FIG. 1 , the question and answer content (medical insurance question) sent by the target user is “What should I do if the medical insurance payment fails?” After structuring the question and answer content based on the data structuring method provided in this application, the following is obtained: Figure 5 The semantic expression (acyclic rooted graph) shown in FIG. 1 is a graph in which the core action entity is “payment”, the target entity having a subject-object relationship with the core action entity is “medical insurance”, the state phrase is “failure”, and the intention phrase is “what to do”, which is used to ask the method (how).

[0103] Depend on Figure 4 , Figure 5 From the two examples of semantic expressions shown, we can see that due to the contextual differences in the target user's question and answer content, or the colloquial expressions in the question and answer content, other phrases besides the core action entity and the target entity may exist in the question and answer content, such as Figure 4 In the semantic expression shown, in addition to the core action entity and the target entity, there are also attribute phrases, intention phrases and other conditional phrases; Figure 5 In the semantic expression shown, in addition to the core action entity and the target entity, there are also intention phrases and state phrases; in the embodiment of the present application, these phrases contained in some contexts, except for the core action entity and the target entity, can be collectively referred to as optional phrases. When generating the semantic expression of the question and answer data, the semantic expression of the question and answer data can be generated based on the core action entity, the target entity and the optional phrases. Based on this, Figure 6 A flowchart of a data structuring method according to an exemplary embodiment of the present application is shown. The method can be executed by a computer device, and the computer device can be implemented as follows: Figure 2 The data processing device 210 shown in FIG. Figure 6 As shown, the data structuring method may include the following steps.

[0104] Step 610, obtaining question and answer data, where the question and answer data is used to describe the question and answer content of the target user.

[0105] The question-answering data includes an entity word sequence consisting of at least two entity words. The entity word may be the smallest unit constituting the entity word sequence; illustratively, in the Chinese context, the entity word may be a text constituting a sentence (entity sequence); in the English context, the entity word may be a word constituting a sentence (entity sequence).

[0106] Step 620, recall candidate entities based on the question and answer data to obtain at least two candidate entities; the candidate entities are named entities of specified types of events occurring in the target domain.

[0107] Optionally, the process of entity recall from question-answering data can be implemented as:

[0108] Obtain a position tag of each entity word of at least two entity words, where the position tag is used to indicate whether the entity word is at the start position of an entity and whether the entity word is at the end position of an entity;

[0109] Based on the position tag of each entity word, at least two candidate entities are determined.

[0110] After determining the position tag of each entity word, the data processing device can extract a fragment between the start entity word and the end entity word, and obtain the fragment as an entity; the start entity word includes the entity word at the start position of the candidate entity, and the end entity word includes the entity word at the end position of the candidate entity.

[0111] Optionally, the data processing device can determine the position of the entity word based on the position tag of the entity word; the start entity word includes an entity word whose position tag indicates that it is at the start position of the candidate entity, and the end entity word includes an entity word whose position tag indicates that it is at the end position of the candidate entity.

[0112] In a possible implementation, position tags of each entity word can be obtained based on a tag prediction model; the start entity word and the end entity word obtained based on the tag prediction model are independent of each other. Therefore, the segment between each start entity word and each end entity word will be obtained as an entity, which may cause some non-entity segments to be obtained as entities. Schematically, for the entity word sequence "query the payment details of user A", by obtaining the position tags of each entity, it can be known that the start entity words include "cha", "jiao", and "ming", and the end entity words include "xun", "fei", and "xi". When determining candidate entities, "query", "query the payment of user A", "query the payment details of user A", "payment", "payment details", and "details" can all be obtained as candidate segments; however, "query the payment of user A" and "query the payment details of user A" are not entities; thus, some non-entities are included in the candidate segments. Therefore, based on the obtained candidate segments, further entity screening is required to obtain candidate entities.

[0113] Or, in another possible implementation, while the position tag of an entity word indicates that the entity word is at the start position of an entity or at the end position of an entity, the position tag also indicates the entity type of the entity corresponding to the entity word; for example, the entity type can include an action entity type and a content entity type. That is to say, when the position tag of the entity word indicates that the entity word is at the start position of an entity, the position tag of the entity word can also indicate that the entity word is at the start position of an action entity or at the start position of a content entity; correspondingly, when the position tag of the entity word indicates that the entity word is at the end position of an entity, the position tag can also indicate that the entity word is at the end position of an action entity or at the end position of a content entity.

[0114] In a possible implementation, the candidate segments determined based on the start entity word and the end entity word can be preliminarily screened by restricting the entity length to remove non-entity content with a relatively large number of entity words; that is to say, a candidate entity length threshold can be set in the data processing device. When obtaining candidate entities, candidate segments with a segment length greater than the candidate entity length threshold among the candidate segments can be excluded, and candidate segments with a candidate segment length less than the candidate entity length threshold can be obtained as candidate entities. Schematically, assuming that the candidate entity length threshold is 5, then based on the candidate segments "query", "query the payment of user A", "query the payment details of user A", "payment", "payment details", and "details" obtained in the above example, "query the payment of user A" and "query the payment details of user A" can be excluded, so as to obtain candidate entities "query", "payment", "payment details", and "details".

[0115] In this case, when obtaining candidate entities, since the position tags of entity words can indicate that the entity word is at the start position of an action entity, or at the start position of a content entity, or at the end position of an action entity, or at the end position of a content entity; therefore, after obtaining the position tags of each entity word, the data processing device can extract the segment between the entity word whose position tag indicates the start position of the action entity and the entity word whose position tag indicates the end position of the action entity to obtain the action entity; and extract the segment between the entity word whose position tag indicates the start position of the content entity and the entity word whose position tag indicates the end position of the content entity to obtain the content entity; thereby reducing the segment extraction between the action entity and the content entity when obtaining candidate entities, thus reducing the number of candidate entities recalled and avoiding meaningless entity recall. Schematically, for the entity word sequence "query the payment details of user A", the entity words whose position tags indicate the start position of the action entity are "query" and "payment", the entity indicating the end position of the action entity is "inquire" and "fee", the entity words whose position tags indicate the start position of the content entity are "payment" and "detail", and the entity word whose position tag indicates the end position of the content entity is "detail", so that the action entities can be obtained as "query", "query the payment of user A" and "payment", and the content entities are "payment details" and "details" to form candidate entities; thereby reducing the proportion of non-entity content in the candidate entities and reducing the data processing volume of the data processing device in the subsequent processing process.

[0116] Optionally, when obtaining candidate entities based on entity types, the candidate entities obtained can be further filtered by restricting the entity length to further reduce the proportion of non-entity content in the candidate entities. Schematically, after obtaining candidate entities based on entity types, when the action entities obtained are "query", "query the payment of user A" and "payment", and the content entities are "payment details" and "details", assuming the candidate entity length threshold is 5, "query the payment of user A" can be further excluded, so as to obtain the candidate entities as "query", "payment", "payment details" and "details".

[0117] Optionally, when the data processing device obtains position tags, the process of obtaining the respective position tags of each entity word based on a tag prediction model can be implemented as:

[0118] Input the entity word sequence into the tag prediction model to obtain the respective position tags of each entity word output by the tag prediction model;

[0119] The label prediction model is obtained by training based on the first sample entity word sequence and the sample position labels corresponding to the sample entity words in the first sample entity word sequence; the sample position labels include a sample start label and a sample end label.

[0120] The label prediction model may be a model built based on a span prediction network, and the label prediction model may include a span prediction network and a classifier; Figure 7 A schematic diagram of the structure of a label prediction model shown in an exemplary embodiment of the present application is shown in FIG. Figure 7 As shown, the input layer of the label prediction model 700 is the entity word sequence of the target user's question and answer question; wherein, the [CLS] mark is used to indicate the first position of the sentence, and the [SEP] mark is used to separate two input sentences, that is, to indicate the last position of the sentence; after passing through the Span prediction network (BERT layer) 710, each entity word in the entity word sequence can be implied as a 768-dimensional semantic vector; after inputting the semantic vector of each entity word into the classifier 720, the position label of each entity word output by the classifier can be obtained.

[0121] During the model training process, the first sample entity word sequence is input into the label prediction model to obtain the predicted position label corresponding to each sample entity word in the first sample entity word sequence output by the label prediction model; the label prediction model is trained based on the predicted position label corresponding to each sample entity word and the sample position label corresponding to each sample entity word; then, based on different first sample entity word sequences, the above process is repeated to iteratively train the label prediction model so that the predicted position label of each sample entity word is as close as possible to the sample position label of the sample entity word until the training completion condition is met, and a trained label prediction model is obtained, so that the data processing device can predict the position label of each entity word in the entity word sequence corresponding to the question and answer content of the target user through the trained label prediction model.

[0122] In the above process, the function value of the first loss function can be calculated based on the position labels corresponding to each sample entity word and the sample position labels corresponding to each sample entity word, and the label prediction model can be trained based on the function value of the first loss function; wherein the function value of the first loss function is used to indicate the overall prediction accuracy of the label prediction model for the first sample entity word sequence. Schematically, the first loss function can be expressed as:

[0123]

[0124] Where n represents the length of the first sample entity word sequence; Represents the sample start label of the i-th entity word in the entity word sequence; represents the probability distribution of the predicted start label of the i-th entity word in the entity word sequence, and the probability that the predicted start label matches the sample start label; Indicates the end tag of the i-th entity word in the entity word sequence; Represents the probability distribution of the predicted end tag of the i-th entity word in the entity word sequence, and the probability that the predicted end tag matches the sample end tag.

[0125] Corresponding to the content indicated by the above position tag, the sample start tag is used to indicate whether the sample entity word is at the start position of an entity; the sample end tag is used to indicate whether the sample entity word is at the end position of an entity.

[0126] Further, corresponding to the content indicated by the above-mentioned position tag, when the sample start tag indicates that the sample entity word is at the start position of an entity, the sample start tag can further indicate the entity type of the entity corresponding to the sample entity word, and the entity type includes an action entity type and a content entity type. That is, when the sample start tag indicates that the entity word is at the start position of an entity, the sample start tag can also indicate that the entity word is at the start position of an action entity, or, indicates that the entity word is at the start position of a content entity. When the sample end tag indicates that the sample entity word is at the end position of an entity, the sample end tag can further indicate the entity type of the entity corresponding to the sample entity word, and the entity type includes an action entity and a content entity. That is, when the sample end tag indicates that the entity word is at the end position of an entity, the sample start tag can also indicate that the entity word is at the end position of an action entity, or, indicates that the entity word is at the end position of a content entity.

[0127] In an embodiment of the present application, the probability distribution of the predicted start tag is used to indicate the predicted result of the i-th entity word in the entity word sequence, which conforms to the probability of each of the multiple situations indicated by the sample start tag; schematically, taking the example that the sample start tag can indicate that the sample entity word is not at the start position of any entity, at the start position of an action entity, and at the start position of a content entity, assuming that the probability distribution of the predicted start tag of the i-th entity word in the entity word sequence is shown in Table 1, and the sample start tag of the i-th entity word in the entity word sequence indicates that the entity word is at the start position of a sample action entity, then The value of is 50%, which means that the probability that the predicted start label matches the sample start label is 50%.

[0128] Table 1

[0129]

[0130] The probability distribution of the predicted end tag is used to indicate the prediction result of the i-th entity word in the entity word sequence, and the probability of each case among the multiple cases indicated by the sample end tag.

[0131] Optionally, the training completion condition may include that the label prediction accuracy of the trained label prediction model reaches an accuracy threshold, the trained label prediction model converges, or the number of iterations reaches a number threshold.

[0132] Step 630, obtaining a core action entity from at least two candidate entities; the core action entity is used to indicate a core verb in the question and answer data.

[0133] Based on the acquired candidate entities, the data processing device identifies the phrase representing the most core action in the current entity word sequence, namely, the core action entity.

[0134] Optionally, the process of obtaining a core action entity from at least two candidate entities includes:

[0135] Obtaining entity representation information of at least two candidate entities;

[0136] Based on the entity representation information of each of the at least two candidate entities, a core action entity is obtained from the at least two candidate entities.

[0137] Taking one of the at least two candidate entities as an example, when acquiring the entity representation information of each of the at least two candidate entities, the data processing device performs the following operations on each of the at least two candidate entities:

[0138] S6301, obtaining a semantic vector of a start entity word and a semantic vector of an end entity word in a target candidate entity;

[0139] S6302, based on the entity length of the target candidate entity, query the embedding matrix (Widthembeddings) of the entity length; the entity length is used to indicate the number of entity words between the start entity word and the end entity word in the target candidate entity;

[0140] S6303, constructing entity representation information of the target candidate entity based on the semantic vector of the start entity word, the semantic vector of the end entity word, and the embedding matrix.

[0141] Schematically, for the target candidate entity of "query", the start entity word is "cha" and the end entity word is "xun"; the data processing device can obtain the semantic vector of the start entity word of the target candidate entity, the semantic vector of the end entity word, and the entity length of the target candidate entity; and query the embedding matrix of this entity length based on the entity length of the target candidate entity; then, based on the semantic vector of the start entity word of the target candidate entity, the semantic vector of the end entity word, and the embedding matrix of the target candidate entity, construct the entity representation information of the target candidate entity.

[0142] The entity representation information can be a set / fusion representation that includes the semantic vector of the start entity word of the target candidate entity, the semantic vector of the end entity word, and the embedding matrix of the target candidate entity.

[0143] Since the core action entity belongs to the action entity, therefore, when recalling candidate entities, if the candidate entities are recalled by separately obtaining the action entity and the content entity, when obtaining the core action entity, the steps of S6301 to S6303 can be executed for each action entity belonging to the action entity type in the candidate entities to obtain the core action entity from the action entities, without having to execute the above steps on the target entity, thereby reducing the data processing volume of the data processing device and improving the data processing efficiency.

[0144] The computer device can look up the embedding matrix of the entity length from the given embedding matrix library; wherein, the relationship between the embedding matrix in the embedding matrix library and the entity length can be learned through backpropagation; the entity length is an integer variable, and the embedding matrix in the embedding matrix library is the result of mapping the entity length to a semantic vector.

[0145] Optionally, after obtaining the entity representation information constructed from the semantic vector of the start entity word, the semantic vector of the end entity word, and the embedding matrix of the entity length, the core action entity can be obtained through a machine learning model, and this process can be implemented as:

[0146] Input the entity representation information into the entity classification model to obtain the classification result of the candidate entity output by the entity classification model; the classification result of the candidate entity is used to indicate whether the candidate entity is a core action entity;

[0147] Among them, the entity classification model is determined based on the sample entity representation information of each entity in the second sample entity word sequence and the first entity classification label of each entity in the second sample entity word sequence, and the first entity classification label includes the core action entity label and the non-core action entity label.

[0148] The entity classification model can be a binary classification model built based on a joint entity and relationship extraction model with the Transformer network BERT as the core. Figure 8 A schematic diagram of the structure of an entity classification model shown in an exemplary embodiment of the present application is shown in FIG. Figure 8 As shown, in an embodiment of the present application, the entity classification model 810 is connected to the label prediction model 820; by inputting the overall semantic representation of the candidate entity into the entity classification model 810, the classification result output by the entity classification model 810 is obtained; the classification result is used to indicate the predicted probability that the candidate entity belongs to the core action entity, and the predicted probability that the candidate entity belongs to the non-core action entity, so that the data processing device performs 0 / 1 binary classification based on the classification result, and obtains the candidate entity with the highest predicted probability of belonging to the core action entity and exceeding the first probability threshold as the core action entity. Among them, the overall semantic representation of the candidate entity includes the entity representation information of the candidate entity obtained based on the label prediction model 820, and the embedding matrix obtained by the entity classification model 810 based on the entity length of the candidate entity.

[0149] During the model training process, the sample entity representation information of each sample entity in the second sample entity word sequence is input into the entity classification model to obtain the predicted classification label corresponding to each sample entity in the second sample entity word sequence output by the entity classification model; the entity classification model is trained based on the predicted classification label corresponding to each sample entity and the first entity classification label corresponding to each sample entity; optionally, each sample entity in the second sample entity word sequence is obtained by manual annotation; thereafter, based on different second sample entity word sequences, the above process is repeated to train the entity classification model so that the predicted classification label of each sample entity is as close as possible to the first entity classification label of the sample entity until the post-training condition is met, and a trained entity classification model is obtained, so that the data processing device can classify the candidate entities obtained through the label prediction model through the trained entity classification model, thereby determining the core action entity from at least two candidate entities.

[0150] In the above process, the function value of the second loss function can be calculated based on the predicted classification labels corresponding to each sample entity and the first entity classification labels corresponding to each sample entity, and the entity classification model can be trained based on the function value of the second loss function. Schematically, the second loss function can be implemented as a binary cross entropy loss function, and the second loss function can be expressed as:

[0151] L=-[y·log(p)+(1-y)·log(1-p)]

[0152] Wherein, y represents the first entity classification label. Schematically, in the first entity classification label, when the sample entity is a core action entity, y=1; when the sample entity is a non-core action entity, y=0.

[0153] Optionally, during the model training process, non-core action entities in the second entity word sequence can be obtained as negative samples by random sampling; the first entity classification label corresponding to the negative sample indicates that the entity is a non-core action entity.

[0154] Step 640, based on the core action entity, obtain a target entity from at least two candidate entities; the target entity includes an entity that has a subject-object relationship with the core action entity.

[0155] After determining the core action entity, the data processing device can identify the object of action or the object receiving the core action based on the core action entity, that is, determine the target entity.

[0156] In an embodiment of the present application, the problem of identifying target entities based on core action entities can be modeled as a relationship classification problem to determine from the candidate entities whether there is a subject-object relationship between the core action and each candidate target entity; wherein the candidate target entity refers to other entities among the candidate entities except the core action entity.

[0157] Optionally, based on the core action entity, the process of obtaining the target entity can be implemented as follows:

[0158] Based on at least two candidate entities and a core action entity, an entity identification mark is inserted into the question and answer data; the entity identification mark is used to indicate the boundary of each candidate entity in the question and answer data; the entity identification mark includes a start mark and an end mark;

[0159] Encoding the question and answer data after the entity recognition mark is inserted to obtain an encoding result;

[0160] From the encoding result, obtain the encoding vector of the start flag of the core action entity and the encoding vector of the start flag of the candidate target entity;

[0161] The encoding vector of the start flag of the core action entity is concatenated with the output encoding of the start flag of each candidate target entity to obtain a concatenated vector corresponding to each candidate target entity;

[0162] Based on the concatenation vector corresponding to each candidate target entity, a target entity is determined from the candidate target entities.

[0163] In a possible implementation, the data processing device can encode the question-and-answer data after inserting the entity recognition mark by means of BERT encoding to obtain the encoding results of each entity word in the question-and-answer data; wherein each entity word can be encoded as a 768-dimensional vector; the entity recognition mark is used to indicate the entity boundary of each entity and highlight the entity pairs of the relationship to be classified. Among them, the entity recognition marks corresponding to different entities can be different; schematically, the entity word sequence "query payment details" contains four entities "query", "payment", "details" and "payment details", wherein "query" is the core action entity in the entity word sequence, and the start mark of the core action entity can be implemented as: <s:trigger>, the end mark can be implemented as: <e:trigger>, and for candidate target entities other than core action entities, the start flag can be implemented as: <s:target>, the end mark can be implemented as: <e:target>; In order to distinguish candidate target entities, the start and end flags of different candidate target entities can be set differently to distinguish them; for example, the start flag of "payment" is <s:target1>, the end mark is <e:target1>; The start mark of "Details" is <s:target2>, the end mark is <e:target2>; The start mark of "Payment Details" is <s:target3>, the end mark is <e:target3>; The start tag and the end tag of the same candidate target entity correspond to each other, so that the candidate target entity can be composed of the entity words between the start tag and the end tag.

[0164] In a possible implementation, after the splicing vector is obtained, the splicing vector corresponding to each candidate target entity can be input into the relationship recognition model to obtain the recognition result of the candidate target entity output by the relationship recognition model; the recognition result of the candidate target entity is used to indicate whether the candidate target entity is the target entity;

[0165] Among them, the relationship recognition model is determined based on the sample splicing vector corresponding to the sample candidate target entity and the second entity classification label of the sample candidate target entity corresponding to the sample splicing vector, and the second entity classification label is used to indicate whether the sample candidate target entity is a target entity.

[0166] The recognition result of the candidate target entity output by the relationship recognition model is used to indicate the probability that the candidate target entity has a subject-object relationship with the core action entity; in an embodiment of the present application, the data processing device can obtain as the target entity the candidate target entity whose recognition result indicates that the probability of having a subject-object relationship with the core action entity exceeds a second probability threshold.

[0167] The relationship identification model may be a model constructed based on the sota scheme; Fig. 9 FIG. 4 shows a schematic diagram of a relationship identification model according to an exemplary embodiment of the present application. Fig. 9 As shown, after the data processing device performs BERT encoding on the entity word sequence, the encoding vector 910 of the start mark of the core action entity word and the encoding vector 920 of the start mark of the candidate target entity are obtained from the encoding vector set corresponding to the encoded entity word sequence, and the encoding vector 910 of the start mark and the encoding vector 920 of the candidate target entity are spliced ​​to obtain the splicing vector 930 corresponding to the candidate target entity; then, the splicing vector 930 of the candidate target entity is used as the input of the relationship recognition model 940; the relationship recognition model 940 obtains the recognition results of each candidate target entity by performing 0 / 1 binary classification on the splicing vector; the data processing device obtains the candidate target entity among the candidate target entities, whose recognition results indicate that the probability of having a subject-object relationship with the core action entity exceeds the second probability threshold as the target entity.

[0168] Optionally, a core action entity may have multiple target entities. Schematically, in "query paying users and payment records", the target entities of the core action entity "query" are "paying users" and "payment records".

[0169] During the model training process, the sample concatenation vector corresponding to the sample candidate target entity is input into the relationship recognition model to obtain the recognition result of the sample candidate target entity output by the relationship recognition model; the relationship recognition model is trained based on the recognition result of the sample candidate target entity and the second entity classification label of the sample candidate target entity; thereafter, based on different sample candidate target entities, the above process is repeated to iteratively train the relationship recognition model so that the recognition result of each sample candidate target entity is as close as possible to the second entity classification label of the sample candidate target entity until the training completion condition is met, and a trained relationship recognition model is obtained, so that the data processing device can identify the concatenation vectors of each candidate target entity through the trained relationship recognition model, so as to determine the target entity that has a subject-object relationship with the core action entity from each candidate target entity.

[0170] Since the number of core action entities is 1, when concatenating the vectors of each candidate target entity, the encoding vector of the start mark of each candidate target entity is concatenated with the encoding vector of the start mark of the core action entity to obtain the concatenated vector of each candidate target entity.

[0171] Step 650, obtaining selectable phrases in the question and answer data; the selectable phrases include other phrases in the question and answer data except the core action entity and the target entity.

[0172] Optionally, the process of obtaining optional phrases in the question and answer data can be performed simultaneously with the process of obtaining candidate entities, core action entities, and target entities in the question and answer data.

[0173] The selectable phrases include: at least one of intention phrases, state phrases, attribute phrases and other conditional phrases;

[0174] Among them, the intention phrase is used to indicate the question type of the question and answer content; the status phrase is used to indicate the development status of the event described in the question and answer content; and the attribute phrase is used to modify the entity in the question and answer content.

[0175] Optionally, the data processing device may obtain at least one of the intent phrases and status phrases in the question and answer data by a multi-label classification method.

[0176] The data processing device can model the problem of obtaining intent phrases and status phrases as a multi-label classification problem; and build a phrase classification model based on a pre-trained language model (such as a BERT model), so that when an entity word sequence is input into the phrase classification model, the intent phrases and status phrases in the entity word sequence can be obtained; the phrase classification model can be obtained by training the intent labels and status labels of each sample phrase in the third sample word sequence and the third sample entity word sequence.

[0177] The phrase classification model is essentially a binary classification model. Its training process can be referred to as follows: Figure 8 The training process of the entity classification model shown in FIG. 1 is not repeated here.

[0178] Optionally, the data processing device may obtain attribute phrases in the question and answer data by using a sequence labeling method.

[0179] In an embodiment of the present application, the attribute phrases in the structured expression include phrases such as person, time, place, and organization, and therefore, the attribute phrase identification can be performed based on sequence labeling; wherein, sequence labeling refers to mapping an entity word sequence to a tag sequence, and the tag sequence can be labeled with the attributes of each phrase, so that the attributes of the entity word or entity word fragment at the corresponding position in the entity word sequence to be searched can be obtained through the tag sequence, thereby obtaining the attribute phrase in the entity word sequence.

[0180] Optionally, an attribute recognition model can be constructed based on a pre-trained language model (such as a BERT model) so that when an entity word sequence is input into the attribute recognition model, each attribute phrase in the entity word sequence can be obtained; the attribute recognition model can be obtained by training the attribute labels of each sample phrase in the fourth sample word sequence and the fourth sample entity word sequence.

[0181] In an embodiment of the present application, the first sample word sequence, the second sample word sequence, the third sample word sequence and the fourth sample word sequence may be the same, or may overlap, or may be different; the present application does not impose any restrictions on this.

[0182] Step 660, generating a semantic expression of the question and answer data based on the core action entity, the target entity and the optional phrases.

[0183] In the embodiment of the present application, the semantic expression refers to mapping the question content of the target user into a schema field representation defined in the embodiment of the present application. The schema field representation can be implemented as follows: Figure 4 or Figure 5 The rooted acyclic graph shown in Figure 2; the process of generating semantic expressions for question-answer data can be implemented as follows:

[0184] Based on the core action entity, the target entity and the optional phrase, an acyclic rooted graph is constructed; each graph node in the acyclic rooted graph is used to represent the core action entity, the target entity and the optional phrase; and the edges in the acyclic rooted graph are used to represent the association relationship between entities.

[0185] Optionally, when constructing an acyclic rooted graph based on the core action entity, the target entity and the optional phrases, in response to the optional phrases containing an attribute phrase, and the position of the target attribute phrase in the entity word sequence coincides with the position of the target entity word in the entity word sequence, an edge between the target attribute phrase and the target entity word can be constructed to identify the target attribute phrase to modify the target entity word; schematically, Figure 4 In the semantic expression shown, the target entity is "resident medical insurance". The position of the target entity in the entity word sequence is from left to right between 15 and 18, and the position of the attribute phrase "resident" indicating the person in the entity word sequence is from left to right between 15 and 16. The data processing device can determine that "resident" is related to "resident medical insurance" and establish an edge between "resident" and "resident medical insurance".

[0186] In summary, the data structure processing method provided by the embodiment of the present application is that the data processing device extracts at least two candidate entities in the question and answer data, first obtains the core action entity from the at least two candidate entities, and then obtains the target entity from the at least two candidate entities based on the subject-object relationship between the core action entity; based on the obtained core action entity and the target entity, a semantic expression is generated to indicate the structured question and answer data. Through the above method, the data processing device can convert discrete question and answer content into a structured semantic expression that can characterize the dependency relationship between entities, thereby improving the effect of data structuring.

[0187] At the same time, when the data processing device provides the semantic expression to the downstream components of the intelligent conversation system, the downstream components can obtain accurate introduction content based on the structured results, thereby improving the feedback accuracy of the intelligent conversation system.

[0188] The data structuring method provided by this solution can be implemented through the pipeline structure. Fig.10 A framework diagram of a data structuring system shown in an exemplary embodiment of the present application is shown, and the data structuring system can be applied to a data processing device; the data structuring system 1000 includes a label prediction model 1010, an entity classification model 1020, a relationship recognition model 1030, a phrase classification model 1040 and an attribute recognition model 1050; after the question and answer data (entity word sequence) is input into the data structuring system 1000, the data processing device can input the entity word sequence into the label prediction model 1010, the phrase classification model 1040 and the attribute recognition model 1050 respectively, obtain the intention phrase and the state phrase in the entity word sequence through the phrase classification model 1040, and obtain the attribute phrase in the entity word sequence through the attribute recognition model 1050; obtain the position label of each entity word in the entity word sequence through the label prediction model 1010, so that the data processing device can obtain the candidate entities contained in the entity word sequence based on the position label of each entity word. The data processing device obtains the semantic vector of the start entity word and the semantic vector of the end entity word of each candidate entity; and based on the entity length of each candidate entity, obtains the embedding matrix corresponding to each candidate entity, so that for each candidate entity, the semantic vector of the start entity word, the semantic vector of the end entity word and the embedding matrix of the same candidate entity are input into the entity classification model 1020 to obtain the classification results of each candidate entity output by the entity classification model 1020; the data processing device obtains the core action entity from the candidate entity based on the classification results of each candidate entity, and inserts the entity identification mark in the entity word sequence based on the obtained core action entity and the candidate entity to highlight the entity pair of the relationship to be classified; The data processing device inputs the entity word sequence after the entity recognition mark is inserted into the BERT encoding layer, obtains the encoding result of the entity word sequence after the entity recognition mark is inserted, and obtains the encoding vector of the start mark of the core action entity and the encoding vector of the start mark of each candidate target entity, splices the encoding vector of the start mark of the core action entity with the encoding vector of the start mark of each candidate target entity, obtains the splicing vector of each candidate target entity, and inputs the splicing vector of each candidate target entity into the relationship recognition model 1030 to obtain the recognition result of each candidate target entity output by the relationship recognition model 1030; the data processing device determines the target entity from the candidate target entities based on the recognition result.

[0189] After the data processing device obtains the attribute phrases, state phrases, intention phrases, core action entities, target entities, and other conditional phrases other than the above, a rooted acyclic graph can be constructed based on the subject-object relationship between the core action entity and the target entity, and the relationship between the target attribute phrases that may exist in the attribute phrases and the target entity, so as to generate a semantic expression corresponding to the entity word sequence.

[0190] The training process of each model involved above can be referred to Figure 6 The relevant contents in the illustrated embodiment will not be repeated here.

[0191] In another possible implementation, the data structuring method provided by the present solution can be implemented by an End2End (end-to-end) data structuring system. In this process, the data structuring system may include various network structures with the functions of a label prediction model, an entity classification model, a relationship recognition model, a phrase classification model and an attribute recognition model to form a data structuring model. The input of the data structuring model is an entity word sequence, and the output is an attribute phrase, a state phrase, an intention phrase, a core action entity, a target entity and other conditional phrases. When training the data structuring model, the data structuring model can be trained as a whole based on a sample entity word sequence, and a phrase label and an entity label corresponding to the entity word sequence. The phrase label is used to indicate the sample attribute phrase, sample state phrase, sample intention phrase and other conditional phrases contained in the sample entity word sequence, and the entity label is used to indicate the sample core action entity and the sample target entity contained in the sample entity word sequence.

[0192] After the data processing device obtains the attribute phrases, state phrases, intention phrases, core action entities, target entities, and other conditional phrases other than the above, a rooted acyclic graph can be constructed based on the subject-object relationship between the core action entity and the target entity, and the relationship between the target attribute phrases that may exist in the attribute phrases and the target entity, so as to generate a semantic expression corresponding to the entity word sequence.

[0193] In one possible implementation, the data structuring method provided in the present application can be applied in combination with a blockchain system; illustratively, a computer device can obtain question and answer data from the blockchain system; after generating structured text based on the question and answer data, the obtained structured text can be stored in the blockchain system; since the question and answer data is relevant data involving a specified type of event corresponding to a target object, by storing the question and answer data and / or the structured text obtained after processing in the blockchain system, security protection of the question and answer data is achieved and user privacy is protected.

[0194] It is understandable that in the specific implementation of this application, user-related data such as question and answer data is involved. When the above implementation of this application is applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.

[0195] The data structuring method provided in this application is applied to intelligent conversation systems in any scenario. In different application scenarios, the types of the above core action entities and target entities can be set differently. When the data structuring method provided in this application is applied to the medical field, the data structuring method can be applied to scenarios including but not limited to intelligent medical insurance question-and-answer scenarios, automatic medical consultation scenarios, disease prediction, etc.

[0196] Illustratively, in the smart medical insurance question and answer scenario, the data receiving device sends the question and answer content of the target user to the data processing device, so that the semantic understanding module in the data processing device can obtain the entity word sequence corresponding to the question and answer content, and structure the entity word sequence through the data structuring method provided in the embodiment of the present application, obtain the semantic expression corresponding to the entity word sequence, and send the semantic expression to the session management module in the data processing device; the session management module can obtain accurate reference content based on the semantic expression to determine the strategy to be taken next, such as asking questions, confirming or directly returning answers, etc., thereby instructing the session generation module to generate reply content corresponding to the decision content based on the decision content determined by the session relationship module; the data processing device returns the reply content to the data receiving device, so as to feed back the reply content to the user through the data receiving device.

[0197] Fig.11 A schematic diagram of a data structuring device shown in an exemplary embodiment of the present application is shown, and the device is used to implement the following Figure 3 or Figure 6 The data structuring method provided by the illustrated embodiment comprises:

[0198] The data acquisition module 1110 is used to acquire question and answer data, where the question and answer data is used to describe the question and answer content of the target user;

[0199] A candidate entity acquisition module 1120 is used to recall candidate entities based on the question and answer data to obtain at least two candidate entities; the candidate entities are named entities of events of a specified type occurring in the target domain;

[0200] A core action entity acquisition module 1130 is used to acquire a core action entity from at least two of the candidate entities; the core action entity is used to indicate a core verb in the question and answer data;

[0201] A target entity acquisition module 1140 is used to acquire a target entity from at least two candidate entities based on the core action entity; the target entity includes an entity that has a subject-object relationship with the core action entity;

[0202] The generation module 1150 is used to generate a semantic expression of the question and answer data based on the core action entity and the target entity; the semantic expression is used to indicate the structured question and answer data.

[0203] In a possible implementation, the question-answer data includes an entity word sequence consisting of at least two entity words; the candidate entity acquisition module 1120 includes:

[0204] A position tag acquisition submodule, used to acquire a position tag of each of the at least two entity words, wherein the position tag is used to indicate whether the entity word is at the start position of an entity and whether the entity word is at the end position of an entity;

[0205] The candidate entity determination submodule is used to determine at least two candidate entities based on the position tag of each entity word.

[0206] In a possible implementation, the position label acquisition submodule is used to input the entity word sequence into a label prediction model to obtain the position label of each entity word output by the label prediction model;

[0207] Among them, the label prediction model is obtained by training based on the first sample entity word sequence and the sample position labels corresponding to the sample entity words in the first sample entity word sequence; the sample position labels include a sample start label and a sample end label; the sample start label is used to indicate whether the sample entity word is at the start position of an entity; the sample end label is used to indicate whether the sample entity word is at the end position of an entity.

[0208] In a possible implementation, the core action entity acquisition module 1130 includes:

[0209] An information acquisition submodule, used to acquire entity representation information of at least two of the candidate entities;

[0210] The core action entity acquisition submodule is used to acquire the core action entity from at least two candidate entities based on the entity representation information of each of the at least two candidate entities.

[0211] In a possible implementation, the core action entity acquisition submodule includes:

[0212] A vector acquisition unit, used to acquire a semantic vector of a start entity word and a semantic vector of an end entity word in a target candidate entity; the start entity word includes the entity word at the start position of the target candidate entity, and the end entity word includes the entity word at the end position of the target candidate entity; the target candidate entity is any one of at least two candidate entities;

[0213] A matrix acquisition unit, configured to query an embedding matrix of the entity length based on the entity length of the target candidate entity; the entity length is used to indicate the number of entity words between the start entity word and the end entity word in the target candidate entity;

[0214] A core action entity acquisition unit is used to construct the entity representation information of the target candidate entity based on the semantic vector of the start entity word, the semantic vector of the end entity word, and the embedding matrix of the entity length.

[0215] In a possible implementation, the core action entity acquisition unit is used to input entity representation information into an entity classification model to obtain a classification result of the candidate entity output by the entity classification model; the classification result of the candidate entity is used to indicate whether the candidate entity is the core action entity;

[0216] Among them, the entity classification model is obtained by training based on the sample entity representation information of each entity in the second sample entity word sequence, and the first entity classification label of each entity in the second sample entity word sequence; the first entity classification label includes a core action entity label and a non-core action entity label.

[0217] In a possible implementation, the target entity acquisition module 1140 includes:

[0218] A marker insertion submodule, configured to insert entity recognition markers into the question-answer data based on at least two of the candidate entities and the core action entity; the entity recognition markers are used to indicate the boundaries of each of the candidate entities in the question-answer data; the entity recognition markers include a start marker and an end marker;

[0219] An encoding submodule, used for encoding the question and answer data after inserting the entity identification mark to obtain an encoding result;

[0220] A vector acquisition submodule, used to acquire, from the encoding result, an encoding vector of the start mark of the core action entity and an encoding vector of the start mark of a candidate target entity; the candidate target entity is an entity other than the core action entity among at least two candidate entities;

[0221] A vector concatenation submodule, used to concatenate the encoding vector of the start flag of the core action entity with the output encoding of the start flag of each candidate target entity, to obtain a concatenation vector corresponding to each candidate target entity;

[0222] The target entity determination submodule is used to determine the target entity from the candidate target entities based on the splicing vector corresponding to each of the candidate target entities.

[0223] In a possible implementation, the target entity determination submodule is used to input the concatenation vector corresponding to each of the candidate target entities into a relationship recognition model to obtain a recognition result of the candidate target entity output by the relationship recognition model; the recognition result of the candidate target entity is used to indicate whether the candidate target entity is the target entity;

[0224] The relationship recognition model is obtained by training based on a sample splicing vector and a second entity classification label of a sample candidate target entity corresponding to the sample splicing vector, and the second entity classification label is used to indicate whether the sample candidate target entity is the target entity.

[0225] In a possible implementation, the device module further includes:

[0226] A phrase acquisition module, used to acquire selectable phrases in the question and answer data; the selectable phrases include other phrases in the question and answer data except the core action entity and the target entity;

[0227] The generating module 1150 is used to generate the semantic expression of the question and answer data based on the core action entity, the target entity and the optional phrase.

[0228] In one possible implementation, the generation module 1150 is used to construct an acyclic rooted graph based on the core action entity, the target entity and the optional phrases; each graph node in the acyclic rooted graph is used to represent the core action entity, the target entity and the optional phrases; and the edges in the acyclic rooted graph are used to represent the association relationship between entities.

[0229] In a possible implementation, the selectable phrases include: at least one of an intention phrase, a state phrase, an attribute phrase, and other conditional phrases;

[0230] Among them, the intention phrase is used to indicate the question type of the question and answer content; the status phrase is used to indicate the development status of the event described in the question and answer content; and the attribute phrase is used to modify the entity in the question and answer content.

[0231] In summary, the data structure processing device provided by the embodiment of the present application, the data processing device extracts at least two candidate entities in the question and answer data, first obtains the core action entity from the at least two candidate entities, and then obtains the target entity from the at least two candidate entities based on the subject-object relationship between the core action entity; based on the obtained core action entity and the target entity, a semantic expression is generated to indicate the structured question and answer data. Through the above method, the data processing device can convert discrete question and answer content into a structured semantic expression that can characterize the dependency relationship between entities, thereby improving the effect of data structuring.

[0232] At the same time, when the data processing device provides the semantic expression to the downstream components of the intelligent conversation system, the downstream components can obtain accurate introduction content based on the structured results, thereby improving the feedback accuracy of the intelligent conversation system.

[0233] Fig.12 The structural block diagram of a computer device 1200 shown in an exemplary embodiment of the present application is shown. The computer device can be implemented as a server in the above-mentioned solution of the present application. The computer device 1200 includes a central processing unit (CPU) 1201, a system memory 1204 including a random access memory (RAM) 1202 and a read-only memory (ROM) 1203, and a system bus 1205 connecting the system memory 1204 and the central processing unit 1201. The computer device 1200 also includes a large-capacity storage device 1206 for storing an operating system 1209, an application program 1210 and other program modules 1211.

[0234] The mass storage device 1206 is connected to the central processing unit 1201 via a mass storage controller (not shown) connected to the system bus 1205. The mass storage device 1206 and its associated computer readable medium provide non-volatile storage for the computer device 1200. That is, the mass storage device 1206 may include a computer readable medium (not shown) such as a hard disk or a compact disc read-only memory (CD-ROM) drive.

[0235] Without loss of generality, the computer-readable medium may include computer storage media and communication media. Computer storage media include volatile and non-volatile, removable and non-removable media implemented by any method or technology for storing information such as computer-readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, Erasable Programmable Read Only Memory (EPROM), Electronically-Erasable Programmable Read-Only Memory (EEPROM) flash memory or other solid-state storage technology, CD-ROM, Digital Versatile Disc (DVD) or other optical storage, cassettes, tapes, disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that the computer storage medium is not limited to the above. The above-mentioned system memory 1204 and mass storage device 1206 can be collectively referred to as memory.

[0236] According to various embodiments of the present disclosure, the computer device 1200 can also be connected to a remote computer on the network through a network such as the Internet. That is, the computer device 1200 can be connected to the network 1208 through the network interface unit 1207 connected to the system bus 1205, or the network interface unit 1207 can be used to connect to other types of networks or remote computer systems (not shown).

[0237] The memory also includes at least one instruction, at least one program, code set or instruction set, and the at least one instruction, at least one program, code set or instruction set is stored in the memory. The central processing unit 1201 implements all or part of the steps in the data structuring method shown in the above-mentioned embodiments by executing the at least one instruction, at least one program, code set or instruction set.

[0238] Fig.13 The block diagram of the structure of a computer device 1300 provided by an exemplary embodiment of the present application is shown. The computer device 1300 can be implemented as a terminal in the above solution, such as a smart phone, a tablet computer, a notebook computer or a desktop computer. The computer device 1300 may also be called a user device, a portable terminal, a laptop terminal, a desktop terminal or other names.

[0239] Typically, the computer device 1300 includes a processor 1301 and a memory 1302 .

[0240] The processor 1301 may include one or more processing cores, such as a 4-core processor, a 13-core processor, etc. The processor 1301 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), and PLA (Programmable Logic Array). The processor 1301 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a CPU (Central Processing Unit); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 1301 may be integrated with a GPU (Graphics Processing Unit), which is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 1301 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.

[0241] The memory 1302 may include one or more computer-readable storage media, which may be non-transitory. The memory 1302 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 1302 is used to store at least one instruction, which is used to be executed by the processor 1301 to implement all or part of the steps in the data structuring method provided in the method embodiment of the present application.

[0242] In some embodiments, the computer device 1300 may also optionally include: a peripheral device interface 1303 and at least one peripheral device. The processor 1301, the memory 1302 and the peripheral device interface 1303 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 1303 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 1304, a display screen 1305, a camera assembly 1306, an audio circuit 1307 and a power supply 1308.

[0243] In some embodiments, the computer device 1300 further includes one or more sensors 1309 , including but not limited to: an acceleration sensor 1310 , a gyroscope sensor 1311 , a pressure sensor 1312 , an optical sensor 1313 , and a proximity sensor 1314 .

[0244] Those skilled in the art will understand that Fig.13 The structure shown in the figure does not constitute a limitation on the computer device 1300, and the computer device 1300 may include more or less components than shown in the figure, or combine some components, or adopt a different component arrangement.

[0245] In an exemplary embodiment, a computer-readable storage medium is also provided, which is used to store at least one instruction, at least one program, code set or instruction set, and the at least one instruction, the at least one program, the code set or instruction set is loaded and executed by a processor to implement all or part of the steps in the above-mentioned data structuring method. For example, the computer-readable storage medium can be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), a magnetic tape, a floppy disk, an optical data storage device, etc.

[0246] In an exemplary embodiment, a computer program product or a computer program is also provided, the computer program product or the computer program comprising computer instructions, the computer instructions being stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions, so that the computer device performs the above-mentioned Figure 3 or Figure 6 All or part of the steps of the method shown in any embodiment.

[0247] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

[0248] It should be understood that the present application is not limited to the precise structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present application is limited only by the appended claims. < / e:target> < / s:target> < / e:trigger> < / s:trigger>

Claims

1. A data structuring method, characterized in that: The method comprises: Acquire question and answer data, where the question and answer data is used to describe the question and answer content of the target user; Recall candidate entities based on the question-answer data to obtain at least two candidate entities; the candidate entities are named entities of events of a specified type occurring in the target domain; Obtaining a semantic vector of a start entity word and a semantic vector of an end entity word in a target candidate entity; the start entity word includes an entity word at a start position of the target candidate entity, and the end entity word includes an entity word at an end position of the target candidate entity; the target candidate entity is any one of at least two candidate entities; Based on the entity length of the target candidate entity, query the embedding matrix of the target candidate entity; the entity length is used to indicate the number of entity words between the start entity word and the end entity word in the target candidate entity; Based on the semantic vector of the start entity word, the semantic vector of the end entity word, and the embedding matrix, construct entity representation information of the target candidate entity; Based on the entity representation information of each of the at least two candidate entities, a core action entity is obtained from the at least two candidate entities; the core action entity is used to indicate a core verb in the question and answer data; Based on the core action entity, a target entity is obtained from at least two candidate entities; the target entity includes an entity that has a subject-object relationship with the core action entity; Based on the core action entity and the target entity, a semantic expression of the question and answer data is generated; the semantic expression is used to indicate the structured question and answer data.

2. The method according to claim 1, characterized in that The question-and-answer data includes an entity word sequence consisting of at least two entity words; and the recalling of candidate entities based on the question-and-answer data to obtain at least two candidate entities includes: Obtaining a position tag of each of the at least two entity words, wherein the position tag is used to indicate whether the entity word is at the start position of an entity and whether the entity word is at the end position of an entity; Based on the position tag of each of the entity words, at least two candidate entities are determined.

3. The method according to claim 2, characterized in that The obtaining of the location tag of each entity in at least two entity words comprises: Inputting the entity word sequence into a label prediction model to obtain the position label of each entity word output by the label prediction model; Among them, the label prediction model is obtained by training based on the first sample entity word sequence and the sample position labels corresponding to the sample entity words in the first sample entity word sequence; the sample position labels include a sample start label and a sample end label; the sample start label is used to indicate whether the sample entity word is at the start position of an entity; the sample end label is used to indicate whether the sample entity word is at the end position of an entity.

4. The method according to claim 1, characterized in that: The acquiring the core action entity from at least two candidate entities based on the entity representation information of each of the at least two candidate entities comprises: Inputting the entity representation information into an entity classification model to obtain a classification result of the candidate entity output by the entity classification model; the classification result of the candidate entity is used to indicate whether the candidate entity is the core action entity; Among them, the entity classification model is obtained by training based on the sample entity representation information of each entity in the second sample entity word sequence, and the first entity classification label of each entity in the second sample entity word sequence; the first entity classification label includes a core action entity label and a non-core action entity label.

5. The method according to claim 1, characterized in that The acquiring a target entity from at least two candidate entities based on the core action entity includes: Based on at least two of the candidate entities and the core action entity, inserting an entity identification mark into the question and answer data; the entity identification mark is used to indicate the boundary of each of the candidate entities in the question and answer data; the entity identification mark includes a start mark and an end mark; Encoding the question and answer data after inserting the entity identification mark to obtain an encoding result; Obtaining, from the encoding result, an encoding vector of the start flag of the core action entity and an encoding vector of the start flag of a candidate target entity; the candidate target entity is an entity other than the core action entity among at least two candidate entities; Concatenate the encoding vector of the start flag of the core action entity with the output encoding of the start flag of each candidate target entity to obtain a concatenated vector corresponding to each candidate target entity; The target entity is determined from the candidate target entities based on the splicing vector corresponding to each of the candidate target entities.

6. The method according to claim 5, characterized in that The step of determining the target entity from the candidate target entities based on the splicing vector corresponding to each of the candidate target entities includes: Inputting the concatenation vector corresponding to each candidate target entity into a relationship recognition model to obtain a recognition result of the candidate target entity output by the relationship recognition model; the recognition result of the candidate target entity is used to indicate whether the candidate target entity is the target entity; The relationship recognition model is obtained by training based on a sample splicing vector and a second entity classification label of a sample candidate target entity corresponding to the sample splicing vector, and the second entity classification label is used to indicate whether the sample candidate target entity is the target entity.

7. The method according to any one of claims 1 to 6, characterized in that: Before generating a semantic expression of the question-answer data based on the core action entity and the target entity, the method further includes: Acquire selectable phrases in the question and answer data; the selectable phrases include other phrases in the question and answer data except the core action entity and the target entity; The generating a semantic expression of the question-answer data based on the core action entity and the target entity includes: The semantic expression of the question and answer data is generated based on the core action entity, the target entity and the optional phrases.

8. The method according to claim 7, characterized in that The generating the semantic expression of the question-answer data based on the core action entity, the target entity and the optional phrase includes: Based on the core action entity, the target entity and the optional phrases, an acyclic rooted graph is constructed; each graph node in the acyclic rooted graph is used to represent the core action entity, the target entity and the optional phrases; and the edges in the acyclic rooted graph are used to represent the association relationship between entities.

9. The method according to claim 7, characterized in that: The selectable phrases include: at least one of intention phrases, state phrases, attribute phrases and other conditional phrases; Among them, the intention phrase is used to indicate the question type of the question and answer content; the status phrase is used to indicate the development status of the event described in the question and answer content; and the attribute phrase is used to modify the entity in the question and answer content.

10. A data structuring device, characterized in that: The device comprises: A data acquisition module is used to acquire question and answer data, wherein the question and answer data is used to describe the question and answer content of the target user; A candidate entity acquisition module, used to recall candidate entities based on the question and answer data to obtain at least two candidate entities; the candidate entities are named entities of events of a specified type occurring in the target domain; A vector acquisition unit, used to acquire a semantic vector of a start entity word and a semantic vector of an end entity word in a target candidate entity; the start entity word includes an entity word at a start position of the target candidate entity, and the end entity word includes an entity word at an end position of the target candidate entity; the target candidate entity is any one of at least two candidate entities; A matrix acquisition unit, configured to query an embedding matrix of the target candidate entity based on an entity length of the target candidate entity; the entity length is used to indicate the number of entity words between the start entity word and the end entity word in the target candidate entity; A core action entity acquisition unit, configured to construct entity representation information of the target candidate entity based on the semantic vector of the start entity word, the semantic vector of the end entity word, and the embedding matrix; A core action entity acquisition submodule, used to acquire a core action entity from at least two of the candidate entities based on entity representation information of each of the at least two candidate entities; the core action entity is used to indicate a core verb in the question and answer data; A target entity acquisition module, used to acquire a target entity from at least two candidate entities based on the core action entity; the target entity includes an entity that has a subject-object relationship with the core action entity; A generation module is used to generate a semantic expression of the question and answer data based on the core action entity and the target entity; the semantic expression is used to indicate the structured question and answer data.

11. A computer device, characterized in that: The computer device includes a processor and a memory, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the data structuring method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and the computer program is loaded and executed by a processor to implement the data structuring method according to any one of claims 1 to 9.

13. A computer program product, characterized in that The computer program product comprises at least one computer program, and the computer program is loaded and executed by a processor to implement the data structuring method according to any one of claims 1 to 9.