Dialogue text processing methods, apparatus, devices and storage media
By combining dialogue text processing methods with dialogue grouping semantic features and label semantic features, and utilizing attention processing and feature fusion, the problem of low accuracy in named entity recognition is solved, and higher accuracy in named entity recognition is achieved.
Patent Information
- Application Number
- CN202111034035.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-03
- Publication Date
- 2025-10-31
- Estimated Expiration
- 2041-09-03
AI Technical Summary
Existing named entity recognition methods in dialogue text focus on limited information from the current turn, resulting in low accuracy in named entity recognition.
By acquiring the semantic features of dialogue groups and the semantic features of reference tags in the dialogue text, and combining attention processing and feature fusion, the named entities in the current dialogue group are identified, taking into account the impact of subsequent dialogue content on the state of potential named entities in the current group.
It improves the accuracy of named entity recognition by making full use of the influence of subsequent dialogue content on the state of named entities in the current group, thereby enhancing the recognition effect.
Smart Images

Figure CN115757704B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of machine learning, and in particular to a method, apparatus, device, and storage medium for dialogue text processing. Background Technology
[0002] Named Entity Recognition (NER), also known as proper name recognition, refers to the identification of entities with specific meanings in text, mainly including personal names, place names, organization names, proper nouns, etc.
[0003] Currently, in related technologies, named entity extraction methods in dialogue text can be performed using neural network models. For example, each round of dialogue (usually containing a question and an answer) is input into a neural network model, which then outputs the named entities from that round of dialogue.
[0004] In related technologies, when identifying named entities, the focus is on the information in the current round of the dialogue. This results in a limited amount of information being considered during the named entity extraction process, leading to low accuracy in named entity recognition. Summary of the Invention
[0005] This application provides a method, apparatus, device, and storage medium for processing dialog text, which can improve the accuracy of identifying named entities from dialog text. The technical solution is as follows:
[0006] According to one aspect of this application, a dialogue text processing method is provided, the method comprising:
[0007] Obtain the grouping semantic features of at least two dialogue groups in the dialogue text; the at least two dialogue groups are arranged in the order in which the dialogue occurs, and each dialogue group contains at least one sentence of dialogue;
[0008] Obtain the semantic features of the reference tags; the reference tags contain the state attributes of reference named entities within the target domain;
[0009] Based on the label semantic features, attention processing is performed on the group semantic features of at least two dialogue groups to obtain the first group features of at least two dialogue groups.
[0010] The first group features of each of the at least two dialogue groups are respectively fused with the first group features of the subsequent dialogue group to obtain the second group features of each of the at least two dialogue groups.
[0011] Based on the grouping semantic features of at least two of the dialogue groups, the tag semantic features, and the second grouping features of at least two of the dialogue groups, the named entity prediction results of at least two of the dialogue groups are obtained; the named entity prediction results are used to indicate the named entities in the dialogue groups.
[0012] According to another aspect of this application, a dialogue text processing method is provided, the method comprising:
[0013] The encoder in the named entity extraction model encodes at least two sample dialogue groups in the sample dialogue text to obtain the sample group semantic features of each of the at least two sample dialogue groups; the at least two sample dialogue groups are arranged in the order in which the dialogue occurs, and each sample dialogue group contains at least one sentence of dialogue.
[0014] The reference label is encoded by the encoder to obtain the label semantic features of the reference label; the reference label contains the state attributes of the reference named entity in the target domain;
[0015] By using the label text attention network in the named entity extraction model, attention processing is performed on the sample group semantic features of at least two sample dialogue groups based on the label semantic features to obtain the first sample group features of at least two sample dialogue groups.
[0016] The first feature fusion network in the named entity extraction model is used to fuse the first sample group features of at least two sample dialogue groups with the first sample group features of the subsequent sample dialogue group to obtain the second sample group features of at least two sample dialogue groups.
[0017] The prediction network in the named entity extraction model obtains named entity prediction results for at least two sample dialogue groups based on their respective sample group semantic features, the label semantic features, and their respective second sample group features; the named entity prediction results are used to indicate the predicted named entities in the sample dialogue groups.
[0018] Based on the named entity prediction results of at least two of the sample dialogue groups and the named entity annotation results of at least two of the sample dialogue groups, the parameters of the named entity extraction model are updated; the named entity annotation results are used to indicate the named entities annotated in the sample dialogue groups.
[0019] According to another aspect of this application, a dialogue text processing apparatus is provided, the apparatus comprising:
[0020] The first acquisition module is used to acquire the group semantic features of at least two dialogue groups in the dialogue text; the at least two dialogue groups are arranged in the order in which the dialogue occurs, and each dialogue group contains at least one sentence of dialogue;
[0021] The second acquisition module is used to acquire the semantic features of the reference tags; the reference tags contain the state attributes of reference named entities in the target domain;
[0022] The first processing module is used to perform attention processing on the grouping semantic features of at least two dialogue groups based on the label semantic features, so as to obtain the first grouping features of at least two dialogue groups.
[0023] The second processing module is used to perform feature fusion on the first group features of each of the at least two dialogue groups and the first group features of the subsequent dialogue group to obtain the second group features of each of the at least two dialogue groups.
[0024] The prediction module is used to obtain the named entity prediction results of at least two dialogue groups based on the grouping semantic features of each of the at least two dialogue groups, the tag semantic features, and the second grouping features of each of the at least two dialogue groups; the named entity prediction results are used to indicate the named entities in the dialogue groups.
[0025] According to another aspect of this application, a dialogue text processing apparatus is provided, the apparatus comprising:
[0026] The first encoding module is used to encode at least two sample dialogue groups in the sample dialogue text by the encoder in the named entity extraction model, so as to obtain the sample group semantic features of each of the at least two sample dialogue groups.
[0027] The second encoding module is used to encode the reference label through an encoder to obtain the label semantic features of the reference label;
[0028] The tag processing module is used to extract the tag text attention network in the named entity extraction model, and perform attention processing on the sample group semantic features of at least two sample dialogue groups based on the tag semantic features to obtain the first sample group features of at least two sample dialogue groups.
[0029] The word feature fusion module is used to fuse the first feature fusion network in the named entity extraction model with the first sample group features of each of the at least two sample dialogue groups and the first sample group features of the subsequent sample dialogue group to obtain the second sample group features of each of the at least two sample dialogue groups.
[0030] The prediction module is used to extract the prediction network in the named entity extraction model, and obtain the named entity prediction results for at least two sample dialogue groups based on the sample group semantic features of each of the at least two sample dialogue groups, the label semantic features, and the second sample group features of each of the at least two sample dialogue groups; the named entity prediction results are used to indicate the predicted named entities in the sample dialogue groups.
[0031] An update module is used to update the parameters of the named entity extraction model based on the named entity prediction results of at least two of the sample dialogue groups and the named entity annotation results of at least two of the sample dialogue groups; the named entity annotation results are used to indicate the named entities annotated in the sample dialogue groups.
[0032] According to another aspect of this application, a computer device is provided, comprising: a processor and a memory, wherein the memory stores at least one computer instruction, the at least one computer instruction being loaded and executed by the processor to implement the dialog text processing method as described above.
[0033] According to another aspect of this application, a computer storage medium is provided, wherein at least one computer instruction is stored in the computer-readable storage medium, the at least one computer instruction being loaded and executed by a processor to implement the dialog text processing method as described above.
[0034] According to another aspect of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium; the computer instructions are read from and executed by a processor of a computer device from the computer-readable storage medium, causing the computer device to perform the dialog text processing method as described above.
[0035] The beneficial effects of the technical solution provided in this application include at least the following:
[0036] For a dialogue text containing multiple dialogue groups, named entities in the current dialogue group can be identified by combining the group semantic features of the current dialogue group, the tag semantic features of the reference tag, and the second group features of the current dialogue group. Since the second group features contain information about the current dialogue group as well as information about other subsequent dialogue groups, this scheme can fully consider the impact of subsequent dialogue content on the state of potential named entities in the current group during the named entity recognition process, thereby improving the accuracy of named entity recognition. Attached Figure Description
[0037] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0038] Figure 1 This is a schematic diagram of the system architecture of a dialogue text processing method provided in an exemplary embodiment of this application;
[0039] Figure 2 This is a flowchart of a dialogue text processing method provided in an exemplary embodiment of this application;
[0040] Figure 3 This is a framework diagram of named entity extraction model generation and dialogue text processing provided in an exemplary embodiment of this application;
[0041] Figure 4 This is a flowchart of a dialogue text processing method provided in an exemplary embodiment of this application;
[0042] Figure 5 This is a flowchart of a dialogue text processing method provided in an exemplary embodiment of this application;
[0043] Figure 6 This is a schematic diagram of the structure of a dialogue text processing framework provided in an exemplary embodiment of this application;
[0044] Figure 7 This is a flowchart of a dialogue text processing method provided in an exemplary embodiment of this application;
[0045] Figure 8 This is a structural block diagram of a dialog text processing apparatus provided in an exemplary embodiment of this application;
[0046] Figure 9 This is a structural block diagram of a dialog text processing apparatus provided in an exemplary embodiment of this application;
[0047] Figure 10 This is a structural block diagram of a computer device provided in an exemplary embodiment of this application.
[0048] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this application clearer, the embodiments of this application will be described in further detail below with reference to the accompanying drawings.
[0050] Figure 1 A schematic diagram of the system architecture of a dialogue text processing method provided in an exemplary embodiment of this application is shown, such as... Figure 1 As shown, the system includes: a named entity recognition device 110 and a dialogue text acquisition device 120.
[0051] The aforementioned identification device 110 can be implemented as a terminal or a server. When the identification device 110 is implemented as a server, it can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms. When the identification device 110 is implemented as a terminal, it can be a smartphone, tablet computer, laptop computer, desktop computer, etc.
[0052] The aforementioned dialogue text acquisition device 120 is a device with dialogue text acquisition function. For example, the dialogue text acquisition device can be a recording device, a speech recognition device, or other device with speech-to-text function.
[0053] Optionally, the system described above includes one or more recognition devices 110 and one or more dialogue text acquisition devices 120. This application embodiment does not limit the number of recognition devices 110 and dialogue text acquisition devices 120.
[0054] The text acquisition device 120 and the recognition device 110 are connected via a communication network. Optionally, the communication network can be a wired network or a wireless network.
[0055] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPsec) can be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies. This application does not impose any limitations.
[0056] In this embodiment of the application, the text acquisition device 120 can acquire the dialogue text and provide the dialogue text to the recognition device 110 for recognition, so as to identify the named entities in the dialogue text.
[0057] Named Entity Recognition (NER) refers to the identification of entities with specific meanings in text, mainly including personal names, place names, organization names, proper nouns, as well as text such as time, quantity, currency, and ratio values.
[0058] Named entity recognition can often be achieved using artificial intelligence (AI). AI is the theory, methods, technology, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that attempts to understand the essence of intelligence and produce a new kind of intelligent machine that can react in a way similar to human intelligence. AI studies the design principles and implementation methods of various intelligent machines, enabling them to possess the functions of perception, reasoning, and decision-making.
[0059] Artificial intelligence (AI) is a comprehensive discipline encompassing a wide range of fields, including both hardware and software technologies. Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily include computer vision, speech processing, natural language processing, and machine learning / deep learning.
[0060] Machine learning (ML) is a multidisciplinary field involving probability theory, statistics, approximation theory, convex analysis, and algorithm complexity theory. It specifically studies how computers can simulate or implement human learning behavior to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is the core of artificial intelligence and the fundamental way to endow computers with intelligence; its applications span all areas of artificial intelligence. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and learn-by-doing.
[0061] The solutions shown in the subsequent embodiments of this application can identify named entities from dialogues based on speech processing and machine learning technologies in AI.
[0062] Figure 2 A flowchart illustrating an exemplary embodiment of this application is shown. This method can be executed by a computing device, which can be implemented as follows: Figure 1 The identification device 110 shown is, for example Figure 2 As shown, the dialogue text processing method may include the following steps:
[0063] Step 202: Obtain the group semantic features of at least two dialogue groups in the dialogue text; obtain the label semantic features of the reference label.
[0064] Dialogue text can consist of sentences from a single dialogue (which may include one round or multiple consecutive rounds). A round of dialogue may include one sentence from each of the two parties (such as a question and an answer), and a single dialogue process typically includes one or more rounds.
[0065] In this embodiment, the dialogue text includes at least two dialogue groups (also referred to as a dialogue window) arranged in the order in which the dialogue occurs, and each dialogue group contains at least one sentence of dialogue. Taking the dialogue group as the object, when a dialogue group is obtained, the computer device can concatenate at least one sentence of dialogue in the dialogue group to obtain a concatenated text, and then perform semantic extraction on the concatenated text to obtain the group semantic features of the dialogue group.
[0066] The reference tag in this embodiment includes the state attributes of a reference named entity within the target domain. The reference tag may consist of two parts: the text of the reference named entity and the text of its state attributes. A computer device can perform semantic extraction using the reference tag to obtain its tag semantic features.
[0067] Among them, the state attribute of the referenced named entity can indicate whether the referenced named entity is true.
[0068] For example, in the medical field, a reference named entity can be a named entity within the medical field, such as chest pain. This reference named entity can correspond to three reference labels: "chest pain-positive", "chest pain-negative" and "chest pain-unknown". "Chest pain-positive" indicates that the symptoms of chest pain exist, "chest pain-negative" indicates that the symptoms of chest pain do not exist, and "chest pain-unknown" indicates that it is impossible to determine whether the symptoms of chest pain exist.
[0069] Step 204: Based on the label semantic features, perform attention processing on the group semantic features of at least two dialogue groups to obtain the first group features of at least two dialogue groups.
[0070] Having obtained the semantic features of the reference label, the computer device can perform attention processing on the group semantic features of each of the above dialogue groups through an attention mechanism based on the semantic features of the reference label, thereby updating the group semantic features of each dialogue group and finally obtaining the first group feature of each dialogue group.
[0071] Step 206: Perform feature fusion between the first group features of at least two dialogue groups and the first group features of the subsequent dialogue group to obtain the second group features of at least two dialogue groups.
[0072] Given the first group features corresponding to at least two dialogue groups, the computer device can, based on a dynamic attention mechanism, fuse the first group features corresponding to each dialogue group with the first group features of other dialogue groups following that dialogue group to obtain the second group features of each of the two dialogue groups.
[0073] In one possible implementation, the dynamic attention mechanism can refer to using the first group feature corresponding to the current dialogue group as the query, and performing attention fusion between the first group feature corresponding to the current dialogue group and the first group features corresponding to other dialogue groups after the current dialogue group. As the current dialogue group moves down, the number of other dialogue groups after the current dialogue group will decrease accordingly. When the current dialogue group is the last dialogue group, there are no other dialogue groups to fuse with it.
[0074] In step 204 above, the impact of the state of the reference named entity on the accuracy of named entity recognition in the aforementioned dialogue group was considered. However, the state of a named entity in the current dialogue text is not always constant. For example, in a previous dialogue group, the state attribute of a potential named entity is a first state, while in a subsequent dialogue, the state of that potential named entity may be updated to a second state. For example, taking dialogue text in the medical field as an example, in one dialogue group, a doctor, based on previous dialogue with a patient, initially determines that the patient has coronary heart disease, then the state attribute of the command entity "coronary heart disease" should be "positive." However, in a subsequent dialogue group, the doctor, based on further dialogue with the patient, overturns the previous preliminary judgment of "coronary heart disease," then the state attribute of the command entity "coronary heart disease" should be updated to "negative." In other words, in this embodiment of the application, for a dialogue group, it is not possible to determine whether the semantics of the dialogue group matches the attributes of the current reference named entity based solely on the information of the dialogue group; it is also necessary to combine the subsequent dialogue to assist in the determination. In this regard, the solution shown in the embodiments of this application further integrates the first group feature of each dialogue group with the first group feature of the subsequent dialogue group in the dialogue text (that is, other dialogue groups located after this dialogue group) to obtain the second group feature of the dialogue group. At this time, the second group feature contains not only the information of the current dialogue group, but also the information of other subsequent dialogue groups.
[0075] Step 208: Based on the group semantic features, label semantic features, and second group features of at least two dialogue groups, obtain the named entity prediction results of at least two dialogue groups. The named entity prediction results are used to indicate the named entities in the dialogue groups.
[0076] In this embodiment of the application, based on the grouping semantic features and tag semantic features of the dialogue group, the computer device also combines the second grouping features of the dialogue group to predict the named entities in the current dialogue group.
[0077] In this context, there are usually multiple reference tags in the target domain. For each reference tag, the computer device can identify named entities in the dialogue text according to the scheme provided in the embodiments of this application, thereby realizing the identification of various named entities related to the target domain from the dialogue text.
[0078] In summary, the dialogue text processing method provided in this application can identify named entities in a dialogue text containing multiple dialogue groups by combining the group semantic features of the current dialogue group, the tag semantic features of the reference tag, and the second group features of the current dialogue group. Since the second group features contain information about the current dialogue group and information about other subsequent dialogue groups, this solution can fully consider the impact of subsequent dialogue content on the state of potential named entities in the current group during the named entity recognition process, thereby improving the accuracy of named entity recognition.
[0079] The solution described in this application embodiment can be applied to any application scenario that requires identifying named entities from dialogue text. For example, the above application scenarios may include, but are not limited to, the following:
[0080] 1) Scenario for generating electronic medical records from medical clinical inquiries:
[0081] Electronic medical records (EMRs) are widely used in modern medical information systems to store information about an individual's health history. While EMRs play a crucial role in modern healthcare systems, writing them for patients is a time-consuming and labor-intensive task for doctors. Doctors spend almost twice as much time on administrative tasks as they do on patient consultations, with the most time-consuming part being the manual creation of EMRs. To alleviate the burden on doctors, the dialogue text processing method provided in this application can be used to divide medical dialogue text into multiple dialogue groups. For each dialogue group, combining the semantic features of that dialogue group, the semantic features of reference tags, and a second group feature that integrates information from the current dialogue group and subsequent dialogue groups, named entities in the current dialogue group are identified, obtaining a named entity prediction result. This named entity prediction result can be used to automatically convert doctor-patient dialogue text into EMRs, thus reducing the heavy workload of doctors.
[0082] 2) Scenarios for assisting in the generation of customer service records:
[0083] In daily life, after providing customer service, customer service personnel may need to fill out customer service records. This requires them to review the conversation and manually extract key information, a process that is often time-consuming and labor-intensive, and the accuracy of manual extraction is relatively low. In this scenario, the dialogue text processing method provided in this application can divide the customer service dialogue text into multiple dialogue groups, identify named entities within each group, and obtain named entity prediction results. These prediction results can then be used to automatically convert the customer service dialogue text into customer service records, saving customer service personnel time and labor in filling out these records and improving their accuracy.
[0084] The solution described in the above embodiments of this application can be implemented by calling a pre-trained named entity extraction model. In other words, the solution involved in this application includes a named entity extraction model generation stage and a dialogue text processing stage. Figure 3 This is a framework diagram illustrating a named entity extraction model generation and named entity extraction according to an exemplary embodiment, such as... Figure 3 As shown, in the named entity extraction model generation stage, the named entity extraction model generation device 310 trains the named entity extraction model using a pre-set training sample dataset (including different sample dialogue texts, named entity annotation information corresponding to each sample dialogue text, and reference labels) to obtain a trained named entity extraction model. In the dialogue text processing stage, the dialogue text processing device 320 processes the input dialogue text based on the named entity extraction model to obtain the named entity prediction results for each dialogue group in the dialogue text.
[0085] The named entity extraction model generation device 310 and the dialogue text processing device 320 mentioned above can be computer devices. For example, the computer device can be a fixed computer device such as a personal computer or a server, or it can be a mobile computer device such as a tablet computer or an e-book reader.
[0086] Optionally, the named entity extraction model generation device 310 and the dialogue text processing device 320 can be the same device, or they can be different devices. Furthermore, when the named entity extraction model generation device 310 and the dialogue text processing device 320 are different devices, they can be of the same type, such as both being servers; or they can be of different types, such as the dialogue text processing device 320 being a personal computer or terminal, while the named entity extraction model generation device 310 can be a server. This application does not limit the specific types of the named entity extraction model generation device 310 and the dialogue text processing device 320.
[0087] Figure 4 A flowchart illustrating an exemplary embodiment of this application is shown. This method can be executed by a computing device, which can be implemented as follows: Figure 3 The named entity extraction model generation device 310 shown is as follows: Figure 4 As shown, the dialogue text processing method may include the following steps:
[0088] Step 402: Encode at least two sample dialogue groups in the sample dialogue text using the encoder in the named entity extraction model to obtain the sample group semantic features of each of the at least two sample dialogue groups; the at least two sample dialogue groups are arranged in the order in which the dialogue occurs, and each sample dialogue group contains at least one sentence of dialogue.
[0089] Step 404: Encode the reference label using an encoder to obtain the label semantic features of the reference label; the reference label contains the state attributes of the reference named entity in the target domain.
[0090] Step 406: Using the named entity extraction model, the label text attention network performs attention processing on the semantic features of each of the at least two sample dialogue groups based on the label semantic features, to obtain the first sample group features of each of the at least two sample dialogue groups.
[0091] Step 408: Using the first feature fusion network in the named entity extraction model, the first sample group features of each of the at least two sample dialogue groups are fused with the first sample group features of the subsequent sample dialogue group to obtain the second sample group features of each of the at least two sample dialogue groups.
[0092] Step 410: Using the prediction network in the named entity extraction model, based on the sample group semantic features, label semantic features, and second sample group features of each of the at least two sample dialogue groups, obtain the named entity prediction results of each of the at least two sample dialogue groups; the named entity prediction results are used to indicate the named entities predicted in the sample dialogue groups.
[0093] In this embodiment, the named entity extraction model may include an encoder, a labeled text attention network, a first feature fusion network, and a prediction network; the computer device calls each part of the named entity extraction model according to the above... Figure 2 The scheme in the illustrated embodiment processes the input reference tags and text (dialogue text or sample dialogue text) to predict named entities in the input text.
[0094] Step 412: Update the parameters of the named entity extraction model based on the named entity prediction results of at least two sample dialogue groups and the named entity annotation results of at least two sample dialogue groups; the named entity annotation results are used to indicate the named entities annotated in the sample dialogue groups.
[0095] In the training process of the aforementioned named entity extraction model, after predicting the named entities in the sample dialogue group and obtaining the named entity prediction results, the computer device also updates the parameters of the named entity extraction model by combining the named entity annotation results and the named entity prediction results, so as to train the named entity extraction model.
[0096] In summary, the dialogue text processing method provided in this application trains a named entity extraction model using sample dialogue text, the named entity annotation information corresponding to the sample dialogue text, and reference tags. In subsequent applications, for a dialogue text containing multiple dialogue groups, this named entity extraction model can combine the group semantic features of the current dialogue group, the tag semantic features of the reference tags, and the second group features of the current dialogue group to identify named entities in the current dialogue group. Since the second group features contain information about the current dialogue group and information about other subsequent dialogue groups, this solution can fully consider the impact of subsequent dialogue content on the state of potential named entities in the current group during the named entity recognition process, thereby improving the accuracy of named entity recognition.
[0097] Figure 5 A flowchart illustrating an exemplary embodiment of this application is shown. This method can be executed by a computing device, which can be implemented as... Figure 1 The computer device 110 shown is, for example Figure 5As shown, the dialogue text processing method includes the following steps:
[0098] Step 502: Obtain the group semantic features of at least two dialogue groups in the dialogue text; obtain the label semantic features of the reference label.
[0099] In this embodiment of the application, the computer device can encode each dialogue group and reference tag in the above-mentioned dialogue text through the encoder in the named entity extraction model to obtain the group semantic features of each dialogue group and the tag semantic features of the reference tag.
[0100] In one possible implementation, the encoder described above can be an encoder based on a Long Short-Term Memory (LSTM) network, such as a Bi-directional LSTM (BiLSTM) network.
[0101] For example, taking a clinical inquiry text as an example, the inquiry text contains at least two dialogue groups arranged in the order of the dialogue. Each dialogue group contains at least one sentence expressed by the doctor and at least one sentence expressed by the patient. The entire inquiry text can be divided into multiple dialogue groups, which can be represented as: X = {X1, X2, ..., X...} m Let X be the entire consultation text, X2 be the second dialogue group in the entire consultation text X, and m be the number of dialogue groups in the entire consultation text X. When encoding the above consultation text using a BiLSTM encoder, for each dialogue group, the computer device concatenates the dialogue (i.e., two sentences) in the dialogue group and inputs it into a bidirectional long short-term memory encoder to obtain the group semantic features of the dialogue group. By performing the above processing on each dialogue group in sequence, the group semantic features corresponding to each dialogue group can be obtained.
[0102] Grouping semantic features H corresponding to dialogue grouping i The encoding formula can be expressed as:
[0103] H i =BiLSTM(x i )={v l v2, ..., v n}
[0104] In the formula, X i H represents the concatenated dialogue in the i-th dialogue group within the entire consultation text X. iLet v1 be the semantic feature of the i-th dialogue group, and v1 be the semantic feature of the first word in the semantic features of the i-th dialogue group, where n is the number of words in the dialogue group. That is, in this embodiment, the above-mentioned semantic features include the semantic features of each word in the dialogue group.
[0105] The computer device can input the dialogues in the dialogue group into the bidirectional long short-term memory encoder in both forward and reverse order. The bidirectional long short-term memory encoder extracts features from the dialogues in the dialogue group. For each word in the dialogue group, it outputs the corresponding output vectors in both forward and reverse order (i.e., the extracted feature vectors). By concatenating the two output vectors corresponding to a word, the semantic features of that word can be obtained.
[0106] In one possible implementation, the semantic features of a word in the above-mentioned grouped semantic features can be the hidden state corresponding to that word, output by the BiLSTM encoder when processing that word.
[0107] Similar to the encoding process of dialogue grouping, the semantic features H of the reference labels are used. l The encoding formula can be expressed as:
[0108] H l =BiLSTM(Y l )
[0109] In the formula, Y l H is the l-th reference tag in the reference tag set. l This represents the semantic features of the tag corresponding to the l-th reference tag.
[0110] Step 504: Fuse the semantic features of each word in at least two dialogue groups with the semantic features of the co-occurring words of each word in the dialogue text to obtain the co-occurring word fused group features of at least two dialogue groups.
[0111] After acquiring the semantic features of each word in the dialogue text, based on the semantic features of any target word in the dialogue text, the computer device can calculate the attention score of the target word to the target word in the entire dialogue text by co-occurring words in the entire dialogue text, and then fuse the semantic features of the target word and the semantic features of the co-occurring words in the entire dialogue text to update the semantic features of the target word, thereby obtaining the fine-grained fused semantic features of the target word, and then obtaining the co-occurring word fused grouping features of the dialogue group. In the same way, the computer device updates the semantic features of target words that have co-occurring words in the entire dialogue text. If a target word has no co-occurring words in the entire dialogue text, the semantic features of the target word do not need to be updated.
[0112] In one possible implementation, the computer device can obtain the attention score of the target word's co-occurring words in the dialogue text based on the target word's word embedding vector and the semantic features of the target word's co-occurring words in the dialogue text; the target word can be any word in the dialogue text. Based on the attention score of the target word's co-occurring words in the dialogue text, the computer device fuses the semantic features of the target word with the semantic features of the target word's co-occurring words in the dialogue text to obtain a fine-grained fused semantic feature of the target word, and thus obtains the co-occurring word fused grouping feature of the dialogue group. The fine-grained fused semantic feature of the target word is the feature corresponding to the target word in the co-occurring word fused grouping feature of the dialogue group to which the target word belongs.
[0113] Co-occurring words refer to words that, apart from the target word itself, are identical to or have the same meaning as the target word throughout the dialogue text. Co-occurring words can be in the same dialogue group as the target word or in a different dialogue group; this embodiment does not impose such limitations.
[0114] In one possible implementation, the computer device may invoke the second feature fusion network in the named entity extraction model to perform the above-described steps of fusing the semantic features of each word in at least two dialogue groups with the semantic features of the co-occurring words of each word in the dialogue text.
[0115] For example, the second feature fusion network may contain one or more memory sets, each containing instances of a set of co-occurring words from the aforementioned dialogue text. The co-occurring words in the memory sets can be represented as:
[0116] M=(K1, V1), (K2, V2)…(K j V j )
[0117] In the formula, M is the memory set, and K j For the j-th co-occurring word Z j The word embedding vector, V j The semantic features of the j-th co-occurring word are, for example, the hidden state output by BiLSTM for the j-th co-occurring word.
[0118] In one possible implementation, the word embedding vectors can be fine-tuned during the model's training process. For example, in this embodiment, the named entity extraction model includes a word embedding network to convert each word in the dialogue text into word embedding vectors for processing by the encoder in the named entity extraction model. During the training of the named entity extraction model, the parameters of the word embedding network are also updated accordingly.
[0119] For a target word Z in the dialogue text i For the target word Zi Using word embedding vector K i As the target word Z i If we query the attention key of co-occurring words in the memory set M, then the target word Z... i The semantic feature V of the j-th co-occurring word in the memory set j Attention scores can be expressed as:
[0120]
[0121] In the formula, dw is K i The dimension of the word embedding vector, K i For target word Z i The word embedding vector, V j Let be the semantic features of the j-th co-occurring word.
[0122] Target word Z i The semantic features d of the corresponding co-occurring words i It can be represented as:
[0123]
[0124]
[0125] In the formula, feature d i For target word Z i The semantic features of the corresponding co-occurring words, v i The semantic features of the target word.
[0126] After calculating the attention score of the target word to its co-occurring words in the dialogue text, the semantic features of the target word are fused with the semantic features of its co-occurring words in the dialogue text to obtain the fine-grained fused semantic features of the target word. The formula for calculating the fine-grained fused semantic features of the target word can be expressed as:
[0127] g i =λ·v i +(1-λ)·d i
[0128] In the formula, λ is a hyperparameter used to balance the semantic features v of the target word. i Semantic features of co-occurring words d i .
[0129] Co-occurrence word fusion grouping features of dialogue grouping R i It can be represented as:
[0130] R i ={g1, g2, ..., g n}
[0131] Step 506: Based on the semantic features of the labels, perform attention processing on the co-occurring word fusion group features of at least two dialogue groups to obtain the first group features of at least two dialogue groups.
[0132] For example, in one possible implementation, the computer device can obtain the attention scores of at least two dialogue groups to a reference label based on the label semantic features and the group semantic features of at least two dialogue groups, and process the group semantic features of at least two dialogue groups based on the attention scores of at least two dialogue groups to the reference label to obtain the first group features of at least two dialogue groups.
[0133] In one possible implementation, the computer device can obtain the first group feature of each of the at least two dialogue groups by multiplying the co-occurring word fusion group features of each of the at least two dialogue groups with the attention scores of each of the at least two dialogue groups to the reference label.
[0134] In this embodiment, the attention score of a dialogue group to a reference label is used to represent the relevance between the dialogue group and the reference label; a high attention score indicates a high relevance. The computer device can obtain the co-occurring word fusion grouping features of a dialogue group, and use the label semantic features H of the reference label... l As a tag-embedded query, the attention score is calculated by combining the tag semantic features of the reference tag with the co-occurrence word fusion group features of a certain dialogue group, and the weight α is obtained. i weight α i The calculation formula can be expressed as:
[0135] α i =H l ·R i
[0136] In the formula, H l R represents the semantic features of the reference label. i α represents the co-occurrence word fusion grouping feature of a certain dialogue group (the i-th dialogue group). i Indicates the weight.
[0137] In obtaining the weight α i In the case of weight α i Normalization is performed to obtain the usable weights p. i :
[0138] p i =softmax(α) i )
[0139] After obtaining the weight p i In the case of weight p iThe first group feature c corresponding to each dialogue group is obtained by weighted summation of the co-occurrence word fusion group features of each dialogue group and the target label based on the attention score between the target label and the co-occurrence word fusion group features of that dialogue group. i The first group feature c i The calculation formula can be expressed as:
[0140] c i =∑p i R i
[0141] In the formula, p i R represents the weights. i This represents the co-occurrence word fusion grouping feature of the i-th dialogue group.
[0142] Step 508: Perform feature fusion between the first group features of at least two dialogue groups and the first group features of the subsequent dialogue group to obtain the second group features of at least two dialogue groups.
[0143] In this embodiment of the application, the computer device can use an attention mechanism to fuse the first grouping feature of the current dialogue group with the first grouping features of other dialogue groups after the current dialogue group to obtain the second grouping feature of the current dialogue group.
[0144] In one possible implementation, for a first dialogue group, based on the first group features of the first dialogue group and the first group features of each dialogue group in the subsequent group set, the attention scores of each dialogue group in the subsequent group set to the first dialogue group are obtained; the first dialogue group is any dialogue group other than the last dialogue group among at least two dialogue groups; the subsequent group set includes at least two dialogue groups that are located after the first dialogue group.
[0145] For example, suppose the dialogue text contains 5 dialogue groups, where the first dialogue group can be any one of the 1st to 4th dialogue groups, and the subsequent group set consists of all the dialogue groups after the first dialogue group. For example, suppose the first dialogue group is the 3rd dialogue group among the above 5 dialogue groups, then the subsequent group set includes the 4th and 5th dialogue groups among the above 5 dialogue groups.
[0146] Then, based on the attention scores of each dialogue group in the subsequent grouping set for the first dialogue group, the computer device fuses the first grouping features of the first dialogue group with the first grouping features of each dialogue group in the subsequent grouping set to obtain the second grouping features of the first dialogue group.
[0147] Taking the first dialogue group as the third of the five dialogue groups mentioned above, and the subsequent group set containing the fourth and fifth dialogue groups, the computer device can calculate the attention score (score 1) of the fourth dialogue group on the third dialogue group, and the attention score (score 2) of the fifth dialogue group on the third dialogue group. Based on the calculated attention scores, the first group feature of the third dialogue group is fused with the first group feature of the subsequent dialogue groups to obtain the second group feature of the third dialogue group.
[0148] In one possible implementation, the computer device can concatenate the first grouping feature of the first dialogue group with the first grouping feature of the target dialogue group following the first dialogue group to obtain the second grouping feature of the first dialogue group.
[0149] Among them, the target dialogue group is the dialogue group with the highest attention score to the first dialogue group in the group set after the first dialogue group.
[0150] For example, taking the first dialogue group as the third of the above five dialogue groups as an example, after the computer device obtains the scores 1 and 2, it concatenates the first group feature of the dialogue group corresponding to the highest score with the first group feature of the third dialogue group to obtain the second group feature of the third dialogue group.
[0151] For example, given a first grouping feature of a first dialogue group is c i The subsequent dialogue groups after the first dialogue group can be represented as {c i+1 c L}. Take the first group feature c of the current first dialogue group. i For the query, calculate the first group feature c of the current first dialogue group. i The attention score between the first group representation vector and other dialogue groups in the subsequent group set is used to obtain the weight a. t The calculation formula can be expressed as:
[0152] a t =c i *c t
[0153] In the formula, c t Let t represent the t-th dialogue group, where t∈{i+1,L}.
[0154] In obtaining weight a t In the case of weight a t Normalization is performed to obtain the usable weights p. t :
[0155] p t =softmax(a t )
[0156] Given the attention scores of other dialogue groups in the subsequent grouping set relative to the first dialogue group, the first group feature of the dialogue group with the highest attention score in the subsequent grouping set is selected and concatenated to the first group feature of the current first dialogue group to obtain the second group feature c of the first dialogue group. G For example, the first grouping feature c of the dialogue group with the highest attention score in the subsequent grouping set. g Then the second group feature c G The calculation formula can be expressed as:
[0157] c G =[c i c g ]
[0158] For example, when the current first dialogue group is the last dialogue group, the first grouping feature c of the following dialogue group g It can be set to zero, or it can be set to c. i .
[0159] Step 510: Based on the group semantic features, tag semantic features, and second group features of each of the at least two dialogue groups, obtain the named entity prediction results of each of the at least two dialogue groups; the named entity prediction results are used to indicate the named entities in the dialogue groups.
[0160] In this embodiment of the application, the computer device can call the prediction network in the named entity extraction model to process the group semantic features, tag semantic features and second group features of at least two dialogue groups, and output the named entity prediction results of each dialogue group.
[0161] In one possible implementation, the computer device can obtain domain information prediction results for at least two dialogue groups based on their respective second grouping features; then, it can obtain named entity prediction results for at least two dialogue groups based on their respective domain information prediction results, their respective grouping semantic features, and their respective tag semantic features. The domain information prediction results are used to indicate whether the dialogue groups contain information related to the target domain.
[0162] In one possible implementation, the domain information prediction results described above can be used to indicate whether a dialogue group contains information corresponding to a reference label.
[0163] In one possible implementation, in response to the domain information prediction result of the second dialogue group indicating that the second dialogue group contains target domain-related information, the computer device can perform named entity prediction based on the group semantic features and label semantic features in the second dialogue group to obtain the named entity prediction result corresponding to the second dialogue group; the second dialogue group is any one of at least two dialogue groups.
[0164] For example, in this embodiment of the application, the prediction network may include two networks: a domain information prediction network and a named entity prediction network. When the second grouping feature of the current dialogue group is obtained, the computer device can input it into the domain information prediction network, and output the domain information prediction result after processing by the domain information prediction network.
[0165] Named entities refer to entity words in dialogue text that have specific meanings. The formula for calculating the domain information prediction result can be expressed as:
[0166] c f =forward(c G )
[0167] y l =sigmoid(c f )
[0168] In the formula, c G The second grouping feature of the dialogue grouping, y l The prediction results are based on domain information.
[0169] In one possible implementation, in response to the domain information prediction result of the second dialogue group indicating that the second dialogue group contains target domain-related information, named entity prediction is performed based on the group semantic features and tag semantic features in the second dialogue group to obtain the named entity prediction result corresponding to the second dialogue group.
[0170] In one possible implementation, the domain information prediction result output by the domain information prediction network can be a probability value, representing the probability that the current dialogue group contains target domain-related information. If the probability value output by the domain information prediction network is greater than a threshold, the current dialogue group can be considered to contain target domain-related information (e.g., information corresponding to a reference label). In this case, named entity prediction can be performed within the current dialogue group using its group semantic features and label semantic features. If the probability value output by the domain information prediction network is not greater than the threshold, in response to the domain information prediction result of the third dialogue group indicating that the third dialogue group does not contain target domain-related information, the step of performing named entity prediction based on the group semantic features and label semantic features of the third dialogue group is skipped. That is, the current dialogue group is considered not to contain target domain-related information, and the process of performing named entity prediction within the current dialogue group using its group semantic features and label semantic features is skipped.
[0171] The thresholds mentioned above can be preset by the developers or set by the users themselves; this embodiment does not limit this.
[0172] In one possible implementation, the named entity prediction result is used to indicate the start and end positions of named entities in a dialog group.
[0173] In one possible implementation, when a computer device performs named entity prediction within a current dialogue group using the group semantic features and label semantic features of the current dialogue group, it can perform prediction processing by concatenating the group semantic features of the current group and the label semantic features of the reference label through a named entity prediction network, so as to determine the start and end positions of the named entity in the current dialogue group.
[0174] The starting position y of the named entity start It can be derived from the following formula:
[0175] y start = sigmoid(forward([H i H l ]))
[0176] The starting position y of the named entity end It can be derived from the following formula:
[0177] y end = sigmoid(forward([H i H l ]))
[0178] Based on the domain information prediction results output by the domain information prediction network, the name entity prediction network determines the start and end positions of the named entities in the current dialogue group. Alternatively, after skipping the determination of the start and end positions of the named entities in the current dialogue group, the computer device can obtain the next reference label and perform the above-mentioned named entity prediction process again for each dialogue group in the above dialogue text.
[0179] In summary, the dialogue text processing method provided in this application can identify named entities in a dialogue text containing multiple dialogue groups by combining the group semantic features of the current dialogue group, the tag semantic features of the reference tag, and the second group features of the current dialogue group. Since the second group features contain information about the current dialogue group and information about other subsequent dialogue groups, this solution can fully consider the impact of subsequent dialogue content on the state of potential named entities in the current group during the named entity recognition process, thereby improving the accuracy of named entity recognition.
[0180] Figure 6 A schematic diagram of the structure of a dialogue text processing framework provided in an exemplary embodiment of this application is shown. The dialogue text processing model includes a bidirectional long short-term memory encoder 601, a second feature fusion network 602, a label-text attention network 603, a first feature fusion network 604, a domain information prediction network 605, and a named entity prediction network 606.
[0181] This application embodiment relates to a reference tag set and dialogue text. The reference tag set includes at least one reference tag; the dialogue text includes at least two dialogue groups. A computer device inputs one reference tag from the reference tag set and at least two dialogue groups from the dialogue text into a bidirectional long short-term memory encoder 601 for processing. This processing step can refer to step 502 described above. After processing by the bidirectional long short-term memory encoder 601, the reference tag outputs tag semantic features, and the at least two dialogue groups output their respective group semantic features.
[0182] The computer device inputs the semantic features of at least two dialogue groups into the second feature fusion network 602 for processing. The processing steps can refer to step 504 above. The second feature fusion network 602 outputs the co-occurrence word fusion group features of at least two dialogue groups.
[0183] The computer device inputs the label semantic features output by the bidirectional long short-term memory encoder 601 and the co-occurrence word fusion group features of at least two dialogue groups output by the second feature fusion network 602 into the label-text attention network 603 for processing. This processing step can refer to step 506 above. Through calculation, the label-text attention network 603 outputs the first group features of at least two dialogue groups.
[0184] The computer device inputs the first group features of each of at least two dialogue groups into the first feature fusion network 604 for processing. The processing steps can refer to step 508 above. Based on the dynamic attention mechanism, the first feature fusion network 604 outputs the first group features of the subsequent dialogue group. By fusing the first group features of each of at least two dialogue groups and the first group features of the subsequent dialogue group, the second group features of each of at least two dialogue groups are obtained.
[0185] The computer device inputs the second grouping features of at least two dialogue groups into the domain information prediction network 605 for processing. This processing step can refer to step 510 described above. If the domain information prediction result output by the domain information prediction network 605 for the current dialogue group is greater than a threshold, i.e., if the domain information prediction result indicates that the dialogue group contains information corresponding to the reference label, the named entity prediction network 606 outputs the start and end positions of the named entities in the dialogue group based on the grouping semantic features and label semantic features of the dialogue group. Then, it selects the next label and continues the above steps.
[0186] If the domain information prediction result indicates that the current dialogue group does not contain information corresponding to the reference label, the named entity prediction network 606 skips the step of outputting the start and end positions of the named entities in the dialogue group based on the group semantic features and label semantic features of the dialogue group.
[0187] After performing named entity recognition on at least two dialogue groups based on the reference label, select the next label and repeat the above steps.
[0188] Figure 7 A flowchart illustrating an exemplary embodiment of this application is shown. This method can be executed by a computing device, which can be implemented as follows: Figure 1 The server or terminal shown, such as Figure 7 As shown, the dialogue text processing method may include the following steps:
[0189] Step 702: Encode at least two sample dialogue groups in the sample dialogue text using the encoder in the named entity extraction model to obtain the sample group semantic features of each of the at least two sample dialogue groups; Encode the reference label using the encoder to obtain the label semantic features of the reference label.
[0190] The sample dialogue text contains at least two sample dialogue groups arranged in the order of their occurrence, and each sample dialogue group contains at least one sentence of dialogue. Given the sample dialogue groups, the encoder in the named entity extraction model encodes at least two sample dialogue groups in the sample dialogue text to obtain the semantic features of each sample dialogue group; the encoder also encodes reference labels to obtain the label semantic features of the reference labels. The reference labels contain the state attributes of reference named entities within the target domain.
[0191] Step 704: By using the second feature fusion network in the named entity extraction model, the semantic features of each sample word in at least two sample dialogue groups are fused with the semantic features of the co-occurring words of each sample word in the sample dialogue text to obtain the sample co-occurring word fusion group features of at least two sample dialogue groups.
[0192] After obtaining the semantic features corresponding to each sample word in the sample dialogue text, the second feature fusion network in the named entity extraction model is used to update the semantic features of the sample target word based on the semantic features of a certain sample target word in the sample dialogue text. This is achieved by calculating the attention score of the co-occurring words of the sample target word in the entire sample dialogue text, fusing the semantic features of the sample target word and the semantic features of the co-occurring words in the entire sample dialogue text, thereby obtaining the fine-grained fused semantic features of the sample target word, and then obtaining the co-occurring word fused grouping features of the sample dialogue group. The same method is used to update the semantic features of the sample target words that have co-occurring words in the entire sample dialogue text. If a certain sample target word has no co-occurring words in the entire sample dialogue text, the semantic features of the sample target word are not updated.
[0193] Step 706: Using a label text attention network, based on the label semantic features, perform attention processing on the sample co-occurrence word fusion group features of at least two sample dialogue groups to obtain the first sample group features of at least two sample dialogue groups.
[0194] The reference label contains the state attributes of the reference named entity within the target domain. Having obtained the label semantic features corresponding to the reference label, a label text attention network is used to determine the attention score of each sample dialogue group to the label semantic features based on these features. The co-occurrence word fusion group features of each dialogue group are then updated by multiplying them by the attention score of that dialogue group to the reference label. Finally, the first group features for each sample dialogue group are obtained.
[0195] Step 708: Using the first feature fusion network in the named entity extraction model, the first sample group features of each of at least two sample dialogue groups are fused with the first sample group features of the subsequent sample dialogue group to obtain the second sample group features of each of at least two sample dialogue groups.
[0196] Having obtained the first group features corresponding to at least two sample dialogue groups, the first feature fusion network in the named entity extraction model, based on a dynamic attention mechanism, obtains the attention scores of each sample dialogue group in the subsequent group set to the first sample dialogue group, according to the first sample group features of the first sample dialogue group and the first sample group features of each sample dialogue group in the subsequent group set. The first sample group features of the first sample dialogue group are then concatenated with the first sample group features of the target sample dialogue group following that sample dialogue group to obtain the second sample group features of the first sample dialogue group.
[0197] Step 710: Using the domain information prediction network, perform domain information prediction based on the second sample group features of at least two sample dialogue groups to obtain the domain information prediction results of at least two sample dialogue groups; perform named entity prediction based on the domain information prediction results of at least two sample dialogue groups, the sample group semantic features of at least two sample dialogue groups, and the tag semantic features to obtain the named entity prediction results of at least two sample dialogue groups.
[0198] Having obtained the second sample group features of each of the sample dialogue groups, a domain information prediction network is used to predict domain information based on the second sample group features of at least two sample dialogue groups, obtaining domain information prediction results for at least two sample dialogue groups. These domain information prediction results indicate whether the sample dialogue group contains target domain-related information. Target domain-related information is used to indicate named entities and their corresponding state attributes within the dialogue group.
[0199] Given the domain information prediction results of the sample dialogue groups, and combining the group semantic features and label semantic features of each of the at least two sample dialogue groups, the domain information prediction network is used to obtain the named entity prediction results of each of the at least two sample dialogue groups. The named entity prediction results are used to indicate the start and end positions of the named entities in the sample dialogue groups.
[0200] Step 712: Update the parameters of the named entity extraction model based on the named entity prediction results of at least two sample dialogue groups and the named entity annotation results of at least two sample dialogue groups; the named entity annotation results are used to indicate the named entities annotated in the sample dialogue groups.
[0201] In this embodiment, a computer device can calculate a loss function value, such as a cross-entropy loss function, based on the difference between the named entities labeled in the sample dialogue group and the named entities predicted in the sample dialogue group. Then, the parameters of each network in the named entity extraction model are updated based on the calculated loss function value.
[0202] In this embodiment of the application, the prediction network includes a domain information prediction network and a named entity prediction network, and the domain information prediction network and the named entity prediction network share network parameters.
[0203] The steps described above, which involve using the prediction network in the named entity extraction model to obtain the named entity prediction results for at least two sample dialogue groups based on their respective sample group semantic features, label semantic features, and second sample group features, include:
[0204] Domain information prediction network is used to predict domain information based on the second sample group features of at least two sample dialogue groups, and the domain information prediction results of at least two sample dialogue groups are obtained. The domain information prediction results are used to indicate whether the sample dialogue group contains information related to the target domain.
[0205] Named entity prediction is performed using a named entity prediction network based on the domain information prediction results of at least two sample dialogue groups, the sample group semantic features of at least two sample dialogue groups, and the label semantic features, to obtain the named entity prediction results of at least two sample dialogue groups.
[0206] In this embodiment, the domain information prediction network and the named entity prediction network each include a feature extraction part and an output part; wherein the feature extraction parts of the domain information prediction network and the named entity prediction network have the same network structure and share parameters. Alternatively, as described above, the domain information prediction network and the named entity prediction network share a single feature extraction part.
[0207] In this embodiment of the application, before the aforementioned label text attention network in the named entity extraction model performs attention processing on the semantic features of each of at least two sample dialogue groups based on label semantic features to obtain the first sample group features of each of the at least two sample dialogue groups, the method further includes:
[0208] By using the second feature fusion network in the named entity extraction model, the semantic features of each sample word in at least two sample dialogue groups are fused with the semantic features of the co-occurring words of each sample word in the sample dialogue text to obtain the sample co-occurring word fusion group features of at least two sample dialogue groups.
[0209] The steps described above, which involve using a named entity extraction model with a label text attention network to perform attention processing on the semantic features of at least two sample dialogue groups based on label semantic features, to obtain the first sample group features of each of the at least two sample dialogue groups, include:
[0210] By using a label text attention network, attention processing is performed on the sample co-occurrence word fusion group features of at least two sample dialogue groups based on the label semantic features, to obtain the first sample group features of at least two sample dialogue groups.
[0211] In summary, the dialogue text processing method provided in this application trains a named entity extraction model using sample dialogue text, the named entity annotation information corresponding to the sample dialogue text, and reference tags. In subsequent applications, for a dialogue text containing multiple dialogue groups, this named entity extraction model can combine the group semantic features of the current dialogue group, the tag semantic features of the reference tags, and the second group features of the current dialogue group to identify named entities in the current dialogue group. Since the second group features contain information about the current dialogue group and information about other subsequent dialogue groups, this solution can fully consider the impact of subsequent dialogue content on the state of potential named entities in the current group during the named entity recognition process, thereby improving the accuracy of named entity recognition.
[0212] Figure 8 A block diagram of a dialog text processing apparatus illustrated in an exemplary embodiment of this application is shown. This dialog text processing apparatus can be used to implement, for example... Figure 2 or Figure 5 All or part of the steps in the method shown. For example... Figure 8 As shown, the dialogue text processing device includes:
[0213] The first acquisition module 801 is used to acquire the group semantic features of at least two dialogue groups in the dialogue text; the at least two dialogue groups are arranged in the order in which the dialogue occurs, and each dialogue group contains at least one sentence of dialogue;
[0214] The second acquisition module 802 is used to acquire the semantic features of the reference label; the reference label contains the state attributes of the reference named entity in the target domain;
[0215] The first processing module 803 is used to perform attention processing on the group semantic features of at least two dialogue groups based on the label semantic features, so as to obtain the first group features of at least two dialogue groups.
[0216] The second processing module 804 is used to perform feature fusion on the first group features of each of the at least two dialogue groups and the first group features of the subsequent dialogue group to obtain the second group features of each of the at least two dialogue groups.
[0217] The prediction module 805 is used to obtain the named entity prediction results of at least two dialogue groups based on the grouping semantic features of each of the at least two dialogue groups, the tag semantic features, and the second grouping features of each of the at least two dialogue groups; the named entity prediction results are used to indicate the named entities in the dialogue groups.
[0218] In one possible implementation, the second processing module 804 includes:
[0219] A first attention score unit is used to obtain, for a first dialogue group, the attention score of each dialogue group in the subsequent group set for the first dialogue group, based on the first group feature of the first dialogue group and the first group feature of each dialogue group in the subsequent group set; the first dialogue group is any one of the at least two dialogue groups except the last dialogue group; the subsequent group set includes the dialogue group located after the first dialogue group among the at least two dialogue groups.
[0220] The first fusion unit is configured to fuse the first grouping feature of the first dialogue group with the first grouping feature of each of the dialogue groups in the subsequent grouping set based on the attention scores of each of the dialogue groups in the subsequent grouping set for the first dialogue group, to obtain the second grouping feature of the first dialogue group.
[0221] In one possible implementation, the first splicing unit is used to splice the first grouping feature of the first dialogue group with the first grouping feature of the target dialogue group to obtain the second grouping feature of the first dialogue group.
[0222] The target dialogue group is the dialogue group that has the highest attention score to the first dialogue group in the subsequent group set.
[0223] In one possible implementation, the prediction module 805 includes:
[0224] A domain information prediction unit is used to predict domain information based on the second grouping features of at least two dialogue groups, and to obtain domain information prediction results for at least two dialogue groups; the domain information prediction results are used to indicate whether the dialogue group contains information related to the target domain.
[0225] The named entity prediction unit is used to perform named entity prediction based on the domain information prediction results of at least two dialogue groups, the group semantic features of at least two dialogue groups, and the tag semantic features, so as to obtain the named entity prediction results of at least two dialogue groups.
[0226] In one possible implementation, the named entity prediction unit is configured to, in response to the domain information prediction result of the second dialogue group indicating that the second dialogue group contains target domain-related information, perform named entity prediction based on the group semantic features and tag semantic features in the second dialogue group to obtain a named entity prediction result corresponding to the second dialogue group; the second dialogue group is any one of at least two of the dialogue groups.
[0227] In one possible implementation, the named entity prediction unit is used to skip the step of performing named entity prediction based on the group semantic features and label semantic features in the third dialogue group in response to the domain information prediction result of the third dialogue group indicating that the third dialogue group does not contain target domain-related information.
[0228] In one possible implementation, the named entity prediction result is used to indicate the start and end positions of named entities in the dialog group within the dialog group.
[0229] In one possible implementation, the first processing module 803 includes:
[0230] The second attention score unit is used to obtain the attention scores of at least two dialogue groups to the reference label based on the label semantic features and the group semantic features of at least two dialogue groups respectively.
[0231] The second fusion unit is used to process the group semantic features of at least two dialogue groups based on their respective attention scores to the reference labels, so as to obtain the first group features of at least two dialogue groups.
[0232] In one possible implementation, the fusion unit is configured to multiply the group semantic features of each of the at least two dialogue groups by the attention scores of each of the at least two dialogue groups to the reference labels, and obtain the first group features of each of the at least two dialogue groups.
[0233] In one possible implementation, the grouping semantic features include the semantic features of each word in the dialogue group; the apparatus preceding the first processing module 803 further includes:
[0234] The fusion module is used to fuse the semantic features of each word in at least two dialogue groups with the semantic features of the co-occurring words of each word in the dialogue text to obtain the co-occurring word fusion group features of at least two dialogue groups.
[0235] The first processing module 803 is used to perform attention processing on the co-occurrence word fusion group features of at least two dialogue groups based on the semantic features of the labels, so as to obtain the first group features of at least two dialogue groups.
[0236] In one possible implementation, the fusion module is used for:
[0237] Based on the word embedding vector of the target word and the semantic features of the co-occurring words of the target word in the dialogue text, the attention score of the co-occurring words of the target word in the dialogue text is obtained; the target word is any word in the dialogue text.
[0238] Based on the attention score of the target word to the co-occurring words in the dialogue text, the semantic features of the target word are fused with the semantic features of the co-occurring words of the target word in the dialogue text to obtain the fine-grained fused semantic features of the target word.
[0239] The fine-grained fusion semantic features of the target word are the features corresponding to the target word in the co-occurrence word fusion group features of the dialogue group to which the target word belongs.
[0240] In summary, the dialogue text processing method provided in this application can identify named entities in a dialogue text containing multiple dialogue groups by combining the group semantic features of the current dialogue group, the tag semantic features of the reference tag, and the second group features of the current dialogue group. Since the second group features contain information about the current dialogue group and information about other subsequent dialogue groups, this solution can fully consider the impact of subsequent dialogue content on the state of potential named entities in the current group during the named entity recognition process, thereby improving the accuracy of named entity recognition.
[0241] Figure 9 A block diagram of a dialog text processing apparatus illustrated in an exemplary embodiment of this application is shown. This dialog text processing apparatus can be used to implement, for example... Figure 4 or Figure 7 All or part of the steps in the method shown. For example... Figure 9 As shown, the dialogue text processing device includes:
[0242] The first encoding module 901 is used to encode at least two sample dialogue groups in the sample dialogue text through the encoder in the named entity extraction model, so as to obtain the sample group semantic features of each of the at least two sample dialogue groups.
[0243] The second encoding module 902 is used to encode the reference tag through an encoder to obtain the tag semantic features of the reference tag.
[0244] The tag processing module 903 is used to perform attention processing on the sample group semantic features of at least two sample dialogue groups based on the tag semantic features of the name entity extraction model and the tag text attention network in the model to obtain the first sample group features of at least two sample dialogue groups.
[0245] The word feature fusion module 904 is used to fuse the first sample group features of at least two sample dialogue groups with the first sample group features of the subsequent sample dialogue group through the first feature fusion network in the named entity extraction model to obtain the second sample group features of at least two sample dialogue groups.
[0246] Prediction module 905 is used to obtain the named entity prediction results of at least two sample dialogue groups based on the sample group semantic features of each of the at least two sample dialogue groups, the label semantic features, and the second sample group features of each of the at least two sample dialogue groups; the named entity prediction results are used to indicate the predicted named entities in the sample dialogue groups.
[0247] The update module 906 is used to update the parameters of the named entity extraction model based on the named entity prediction results of at least two of the sample dialogue groups and the named entity annotation results of at least two of the sample dialogue groups; the named entity annotation results are used to indicate the named entities annotated in the sample dialogue groups.
[0248] In one possible implementation, the prediction network includes a domain information prediction network and a named entity prediction network, and the domain information prediction network and the named entity prediction network share network parameters.
[0249] The prediction module 905 includes:
[0250] The first prediction unit is configured to perform domain information prediction based on the second sample group features of each of the at least two sample dialogue groups through the domain information prediction network, and obtain the domain information prediction results of each of the at least two sample dialogue groups; the domain information prediction results are used to indicate whether the sample dialogue group contains information related to the target domain.
[0251] The second prediction unit is used to perform named entity prediction based on the domain information prediction results of at least two sample dialogue groups, the sample group semantic features of at least two sample dialogue groups, and the tag semantic features through the named entity prediction network, so as to obtain the named entity prediction results of at least two sample dialogue groups.
[0252] In one possible implementation, prior to the tag processing module 903, the apparatus further includes:
[0253] The word feature fusion module is used to fuse the semantic features of each sample word in at least two sample dialogue groups with the semantic features of the co-occurring words of each sample word in the sample dialogue text through the second feature fusion network in the named entity extraction model, so as to obtain sample co-occurring word fusion group features for at least two sample dialogue groups.
[0254] In one possible implementation, the tag processing module 903 is used to perform attention processing on the sample co-occurrence word fusion group features of at least two sample dialogue groups based on the tag semantic features through the tag text attention network, so as to obtain the first sample group features of at least two sample dialogue groups.
[0255] In summary, the dialogue text processing method provided in this application trains a named entity extraction model using sample dialogue text, the named entity annotation information corresponding to the sample dialogue text, and reference tags. In subsequent applications, for a dialogue text containing multiple dialogue groups, this named entity extraction model can combine the group semantic features of the current dialogue group, the tag semantic features of the reference tags, and the second group features of the current dialogue group to identify named entities in the current dialogue group. Since the second group features contain information about the current dialogue group and information about other subsequent dialogue groups, this solution can fully consider the impact of subsequent dialogue content on the state of potential named entities in the current group during the named entity recognition process, thereby improving the accuracy of named entity recognition.
[0256] Figure 10 A structural block diagram of a computer device 1000 illustrated in an exemplary embodiment of this application is shown. This computer device can be implemented as a server as described above in this application. The computer device 1000 includes a Central Processing Unit (CPU) 1001, a system memory 1004 including Random Access Memory (RAM) 1002 and Read-Only Memory (ROM) 1003, and a system bus 1005 connecting the system memory 1004 and the CPU 1001. The computer device 1000 also includes a mass storage device 1006 for storing an operating system 1009, application programs 1010, and other program modules 1011.
[0257] The mass storage device 1006 is connected to the central processing unit 1001 via a mass storage controller (not shown) connected to the system bus 1005. The mass storage device 1006 and its associated computer-readable media provide non-volatile storage for the computer device 1000. That is, the mass storage device 1006 may include computer-readable media (not shown), such as a hard disk or a compact disc read-only memory (CD-ROM) drive.
[0258] 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 using 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), electrically erasable programmable read-only memory (EEPROM), flash memory or other solid-state storage technologies, CD-ROM, digital versatile disc (DVD) or other optical storage, magnetic tape cassettes, magnetic tape, disk storage, or other magnetic storage devices. Of course, those skilled in the art will recognize that the computer storage media are not limited to the above-mentioned types. The system memory 1004 and mass storage device 1006 described above can be collectively referred to as memory.
[0259] According to various embodiments of this disclosure, the computer device 1000 can also be connected to a remote computer on a network, such as the Internet. That is, the computer device 1000 can be connected to the network 1008 via a network interface unit 1007 connected to the system bus 1005, or the network interface unit 1007 can be used to connect to other types of networks or remote computer systems (not shown).
[0260] The memory also includes at least one computer instruction stored in the memory. The central processing unit 1001 executes the at least one instruction, at least one program, code set, or instruction set to implement all or part of the steps in the dialogue text processing method shown in the above embodiments.
[0261] In one exemplary embodiment, a computer-readable storage medium is also provided for storing at least one computer instruction, which is loaded and executed by a processor to implement all or part of the steps in the above-described dialog text processing method. For example, the computer-readable storage medium may be a read-only memory (ROM), a random access memory (RAM), a compact disc read-only memory (CD-ROM), magnetic tape, floppy disk, or optical data storage device, etc.
[0262] In one exemplary embodiment, a computer program product or computer program is also provided, which includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform all or part of the steps of the dialog text processing method described above.
[0263] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.
[0264] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for processing dialogue text, characterized in that, The method includes: Obtain the grouping semantic features of at least two dialogue groups in the dialogue text; the at least two dialogue groups are arranged in the order in which the dialogue occurs, and each dialogue group contains at least one sentence of dialogue; Obtain the semantic features of the reference tags; the reference tags contain the state attributes of reference named entities within the target domain; Based on the label semantic features, attention processing is performed on the group semantic features of at least two dialogue groups to obtain the first group features of at least two dialogue groups. The first group features of each of the at least two dialogue groups are respectively fused with the first group features of the subsequent dialogue group to obtain the second group features of each of the at least two dialogue groups. Based on the grouping semantic features of at least two of the dialogue groups, the tag semantic features, and the second grouping features of at least two of the dialogue groups, the named entity prediction results of at least two of the dialogue groups are obtained; the named entity prediction results are used to indicate the named entities in the dialogue groups.
2. The method according to claim 1, characterized in that, The step of fusing the first group features of each of at least two of the dialogue groups with the first group features of a subsequent dialogue group to obtain the second group features of each of the at least two dialogue groups includes: For the first dialogue group, based on the first grouping feature of the first dialogue group and the first grouping feature of each of the dialogue groups in the subsequent grouping set, the attention score of each of the dialogue groups in the subsequent grouping set to the first dialogue group is obtained; the first dialogue group is any one of the at least two dialogue groups except the last one; the subsequent grouping set includes the dialogue group that is located after the first dialogue group among the at least two dialogue groups. Based on the attention scores of each dialogue group in the subsequent grouping set for the first dialogue group, the first grouping feature of the first dialogue group is fused with the first grouping feature of each dialogue group in the subsequent grouping set to obtain the second grouping feature of the first dialogue group.
3. The method according to claim 2, characterized in that, The step of fusing the first grouping feature of the first dialogue group with the first grouping features of each of the dialogue groups in the subsequent grouping set, based on the attention scores of each of the dialogue groups in the subsequent grouping set, to obtain the second grouping feature of the first dialogue group, includes: The first grouping feature of the first dialogue group is concatenated with the first grouping feature of the target dialogue group to obtain the second grouping feature of the first dialogue group; The target dialogue group is the dialogue group that has the highest attention score to the first dialogue group in the subsequent group set.
4. The method according to claim 1, characterized in that, The step of obtaining named entity prediction results for at least two dialogue groups based on their respective grouping semantic features, the tag semantic features, and the respective second grouping features of at least two dialogue groups includes: Domain information prediction is performed based on the second grouping features of at least two of the dialogue groups to obtain domain information prediction results for each of the at least two dialogue groups; the domain information prediction results are used to indicate whether the dialogue group contains information related to the target domain. Named entity prediction is performed based on the domain information prediction results of at least two of the dialogue groups, the group semantic features of at least two of the dialogue groups, and the tag semantic features, to obtain the named entity prediction results of at least two of the dialogue groups.
5. The method according to claim 4, characterized in that, The process of performing named entity prediction based on the domain information prediction results of at least two of the dialogue groups, the group semantic features of at least two of the dialogue groups, and the tag semantic features to obtain the named entity prediction results of at least two of the dialogue groups includes: In response to the domain information prediction result of the second dialogue group indicating that the second dialogue group contains information related to the target domain, named entity prediction is performed based on the group semantic features and the tag semantic features in the second dialogue group to obtain the named entity prediction result corresponding to the second dialogue group; the second dialogue group is any one of at least two dialogue groups.
6. The method according to claim 4, characterized in that, The process of performing named entity prediction based on the domain information prediction results of at least two of the dialogue groups, the group semantic features of at least two of the dialogue groups, and the tag semantic features to obtain the named entity prediction results of at least two of the dialogue groups includes: If the domain information prediction result of the third dialogue group indicates that the third dialogue group does not contain information related to the target domain, the step of performing named entity prediction based on the group semantic features and the tag semantic features in the third dialogue group is skipped.
7. The method according to claim 1, characterized in that, The named entity prediction result is used to indicate the start and end positions of the named entities in the dialog group.
8. The method according to claim 1, characterized in that, The step of performing attention processing on the grouping semantic features of at least two dialogue groups based on the label semantic features to obtain the first grouping features of at least two dialogue groups includes: Based on the semantic features of the label and the grouping semantic features of each of the at least two dialogue groups, obtain the attention scores of each of the at least two dialogue groups to the reference label; Based on the attention scores of each of the at least two dialogue groups to the reference label, the group semantic features of each of the at least two dialogue groups are processed to obtain the first group features of each of the at least two dialogue groups.
9. The method according to claim 8, characterized in that, The step of processing the group semantic features of at least two dialogue groups based on their respective attention scores to the reference label to obtain the first group features of each of the at least two dialogue groups includes: The first grouping feature of each of the at least two dialogue groups is obtained by multiplying the grouping semantic features of each of the at least two dialogue groups with their respective attention scores to the reference label.
10. The method according to claim 1, characterized in that, The grouping semantic features include the semantic features of each word in the dialogue group; Before performing attention processing on the grouping semantic features of at least two dialogue groups based on the label semantic features to obtain the first grouping features of each of the at least two dialogue groups, the method further includes: The semantic features of each word in at least two of the dialogue groups are fused with the semantic features of the co-occurring words of each word in the dialogue text to obtain the co-occurring word fused group features of at least two of the dialogue groups. The step of performing attention processing on the grouping semantic features of at least two dialogue groups based on the label semantic features to obtain the first grouping features of at least two dialogue groups includes: Based on the semantic features of the tags, attention processing is performed on the co-occurrence word fusion group features of at least two dialogue groups to obtain the first group features of each of the at least two dialogue groups.
11. The method according to claim 10, characterized in that, The step of fusing the semantic features of each word in at least two of the dialogue groups with the semantic features of the co-occurring words of each word in the dialogue text to obtain the co-occurring word fused group features of at least two of the dialogue groups includes: Based on the word embedding vector of the target word and the semantic features of the co-occurring words of the target word in the dialogue text, the attention score of the co-occurring words of the target word in the dialogue text is obtained; the target word is any word in the dialogue text. Based on the attention score of the target word to the co-occurring words in the dialogue text, the semantic features of the target word are fused with the semantic features of the co-occurring words in the dialogue text to obtain the fine-grained fused semantic features of the target word. The fine-grained fusion semantic features of the target word are the features corresponding to the target word in the co-occurrence word fusion group features of the dialogue group to which the target word belongs.
12. A method for processing dialogue text, characterized in that, The method includes: The encoder in the named entity extraction model encodes at least two sample dialogue groups in the sample dialogue text to obtain the sample group semantic features of each of the at least two sample dialogue groups; the at least two sample dialogue groups are arranged in the order in which the dialogue occurs, and each sample dialogue group contains at least one sentence of dialogue. The reference label is encoded by the encoder to obtain the label semantic features of the reference label; the reference label contains the state attributes of the reference named entity in the target domain; By using the label text attention network in the named entity extraction model, attention processing is performed on the sample group semantic features of at least two sample dialogue groups based on the label semantic features to obtain the first sample group features of at least two sample dialogue groups. The first feature fusion network in the named entity extraction model is used to fuse the first sample group features of at least two sample dialogue groups with the first sample group features of the subsequent sample dialogue group to obtain the second sample group features of at least two sample dialogue groups. The prediction network in the named entity extraction model obtains named entity prediction results for at least two sample dialogue groups based on their respective sample group semantic features, the label semantic features, and their respective second sample group features; the named entity prediction results are used to indicate the predicted named entities in the sample dialogue groups. Based on the named entity prediction results of at least two of the sample dialogue groups and the named entity annotation results of at least two of the sample dialogue groups, the parameters of the named entity extraction model are updated; the named entity annotation results are used to indicate the named entities annotated in the sample dialogue groups.
13. The method according to claim 12, characterized in that, The prediction network includes a domain information prediction network and a named entity prediction network, and the domain information prediction network and the named entity prediction network share network parameters. The step of obtaining named entity prediction results for at least two sample dialogue groups through the prediction network in the named entity extraction model, based on the sample group semantic features of each of the at least two sample dialogue groups, the tag semantic features, and the second sample group features of each of the at least two sample dialogue groups, includes: The domain information prediction network is used to predict domain information based on the second sample group features of each of the at least two sample dialogue groups, thereby obtaining domain information prediction results for each of the at least two sample dialogue groups; the domain information prediction results are used to indicate whether the sample dialogue group contains information related to the target domain. Named entity prediction is performed using the named entity prediction network based on the domain information prediction results of at least two sample dialogue groups, the sample group semantic features of at least two sample dialogue groups, and the tag semantic features, to obtain the named entity prediction results of at least two sample dialogue groups.
14. The method according to claim 12, characterized in that, Before the step of using the label text attention network in the named entity extraction model to perform attention processing on the sample group semantic features of at least two sample dialogue groups based on the label semantic features, and obtaining the first sample group features of each of the at least two sample dialogue groups, the method further includes: The semantic features of each sample word in at least two sample dialogue groups are fused with the semantic features of the co-occurring words of each sample word in the sample dialogue text through the second feature fusion network in the named entity extraction model to obtain sample co-occurring word fusion group features of at least two sample dialogue groups. The step of using the label text attention network in the named entity extraction model to perform attention processing on the sample group semantic features of at least two sample dialogue groups based on the label semantic features, and obtaining the first sample group features of at least two sample dialogue groups, includes: Through the tag text attention network, based on the tag semantic features, attention processing is performed on the sample co-occurrence word fusion group features of at least two sample dialogue groups to obtain the first sample group features of each of the at least two sample dialogue groups.
15. A dialog text processing device, characterized in that, The device includes: The first acquisition module is used to acquire the group semantic features of at least two dialogue groups in the dialogue text; the at least two dialogue groups are arranged in the order in which the dialogue occurs, and each dialogue group contains at least one sentence of dialogue; The second acquisition module is used to acquire the semantic features of the reference tags; the reference tags contain the state attributes of reference named entities in the target domain; The first processing module is used to perform attention processing on the grouping semantic features of at least two dialogue groups based on the label semantic features, so as to obtain the first grouping features of at least two dialogue groups. The second processing module is used to perform feature fusion on the first group features of each of the at least two dialogue groups and the first group features of the subsequent dialogue group to obtain the second group features of each of the at least two dialogue groups. The prediction module is used to obtain the named entity prediction results of at least two dialogue groups based on the group semantic features of each of the at least two dialogue groups, the tag semantic features, and the second group features of each of the at least two dialogue groups; the named entity prediction results are used to indicate the named entities in the dialogue groups.
16. A dialog text processing device, characterized in that, The device includes: The encoding module is used to encode at least two sample dialogue groups in the sample dialogue text through the encoder in the named entity extraction model to obtain the sample group semantic features of each of the at least two sample dialogue groups; the at least two sample dialogue groups are arranged in the order in which the dialogue occurs, and each sample dialogue group contains at least one sentence of dialogue. The encoding module is further configured to encode the reference label using the encoder to obtain the label semantic features of the reference label; the reference label contains the state attributes of the reference named entity within the target domain; The tag processing module is used to extract the tag text attention network in the named entity extraction model, and perform attention processing on the sample group semantic features of at least two sample dialogue groups based on the tag semantic features to obtain the first sample group features of at least two sample dialogue groups. The group feature fusion module is used to fuse the first sample group features of at least two sample dialogue groups with the first sample group features of the subsequent sample dialogue group through the first feature fusion network in the named entity extraction model to obtain the second sample group features of at least two sample dialogue groups. The named entity prediction module is used to obtain the named entity prediction results of at least two sample dialogue groups based on the sample group semantic features of each of the at least two sample dialogue groups, the label semantic features, and the second sample group features of each of the at least two sample dialogue groups; the named entity prediction results are used to indicate the predicted named entities in the sample dialogue groups. An update module is used to update the parameters of the named entity extraction model based on the named entity prediction results of at least two of the sample dialogue groups and the named entity annotation results of at least two of the sample dialogue groups; the named entity annotation results are used to indicate the named entities annotated in the sample dialogue groups.
17. A computer device, characterized in that, The computer device includes a processor and a memory, the memory storing at least one computer instruction, the at least one computer instruction being loaded and executed by the processor to implement the dialog text processing method as described in any one of claims 1 to 14.
18. A computer-readable storage medium, characterized in that, The readable storage medium stores at least one computer instruction, which is loaded and executed by a processor to implement the dialog text processing method as described in any one of claims 1 to 14.
19. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium; the computer instructions are read from and executed by a processor of a computer device, causing the computer device to perform the dialog text processing method as described in any one of claims 1 to 14.
Citation Information
Patent Citations
Dialogue method and device based on mixed knowledge management and electronic equipment
CN113158691A
Methods and systems for automatic analysis of conversations between customer care agents and customers
US20160162474A1