A semantic recognition method, device, computer equipment and storage medium

Through the semantic recognition model, feature extraction and label generation of user input information is performed, and pseudo-labels and weak labels are used for model training, which solves the problem of manual annotation dependence in the intelligent dialogue system and improves the accuracy and efficiency of semantic recognition.

CN112052318BActive Publication Date: 2024-11-08TENCENT TECHNOLOGY (SHENZHEN) CO LTD +1
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202010840252.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-08-18
Publication Date
2024-11-08
Estimated Expiration
2040-08-18

AI Technical Summary

Technical Problem

The existing intelligent dialogue system relies on a large amount of artificial fine annotation data in semantic recognition, which makes data annotation difficult, time-consuming and unfavorable to system expansion.

Method used

The semantic recognition model extracts text feature information from the user input information, adjusts model parameters based on predicted semantic information and labels, and uses pseudo-labels and weak labels for model training, reducing dependence on manual annotations, and improving the semantic recognition accuracy of the model.

Benefits of technology

It reduces the dependence of semantic recognition model training on manual annotation, shortens training time, improves the semantic recognition accuracy of the model, and is suitable for a variety of application scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112052318B_ABST
    Figure CN112052318B_ABST
Patent Text Reader

Abstract

The present application discloses a semantic recognition method, apparatus, computer equipment and storage medium, which can realize semantic recognition based on artificial intelligence technology. The text feature information of a first user input information sample can be extracted through a semantic recognition model, so as to identify the predicted semantic information of the sample, and the parameters of the semantic recognition model are adjusted based on the label and predicted semantic information of the sample; the text feature information of a second user input information sample is extracted through the adjusted semantic recognition model, so as to identify the predicted semantic information of the sample; the parameters of the semantic recognition model are adjusted again based on the label and predicted semantic information of the sample to obtain a trained semantic recognition model; semantic recognition is performed on the target user input information based on the semantic recognition model to obtain semantic information, wherein the first user input information sample does not need to be manually labeled, which can reduce the dependence on manual labeling, and the second user input information sample is used to train the model, which can improve the accuracy of semantic recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of natural language processing, and in particular to a semantic recognition method, device and storage medium. Background Art

[0002] Intelligent dialogue systems can perform semantic recognition on user input information and determine the user's dialogue intention. Generally, in order to achieve good recognition results, the model used by the dialogue system requires a large amount of precisely labeled data. For different application scenarios, the precisely labeled data may require different professionals to label, which will take a lot of time. For example, for dialogue systems used in medical scenarios, in order to perform accurate semantic recognition, professional doctors are required to translate the user's colloquial description in the sample into professional medical terms as the semantic information of the sample, and then train a semantic recognition model based on the sample and deploy the model in the dialogue system. This demand for a large number of manually precisely labeled samples is not conducive to the implementation and expansion of the dialogue system. Summary of the invention

[0003] The embodiments of the present invention provide a semantic recognition method, device and storage medium, which can reduce the dependence of the semantic recognition model on manual annotation to a certain extent.

[0004] An embodiment of the present invention provides a semantic recognition method, the method comprising:

[0005] extracting text feature information from the first user input information sample through a semantic recognition model, and identifying predicted semantic information of the first user input information sample based on the text feature information of the first user input information sample, wherein the label of the first user input information sample includes semantic information obtained by semantic recognition of the first user input information sample and / or information obtained from reply information of the first user input information sample;

[0006] Based on the label and predicted semantic information of the first user input information sample, adjusting parameters of the semantic recognition model;

[0007] extracting text feature information from the second user input information sample by using the adjusted semantic recognition model, and identifying predicted semantic information of the second user input information sample based on the text feature information of the second user input information sample, wherein the label of the second user input information sample includes the semantic information of the second user input information sample;

[0008] Based on the label and predicted semantic information of the second user input information sample, adjusting parameters of the semantic recognition model to obtain a trained semantic recognition model;

[0009] Semantic recognition is performed on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information.

[0010] The embodiment of the present invention further provides a semantic recognition device, the device comprising:

[0011] a first semantic prediction unit, configured to extract text feature information from a first user input information sample through a semantic recognition model, and identify predicted semantic information of the first user input information sample based on the text feature information of the first user input information sample, wherein the label of the first user input information sample includes semantic information obtained by semantic recognition of the first user input information sample and / or information obtained from reply information of the first user input information sample;

[0012] A first parameter adjustment unit, configured to adjust parameters of the semantic recognition model based on the label and predicted semantic information of the first user input information sample;

[0013] a second semantic prediction unit, configured to extract text feature information from a second user input information sample by using the adjusted semantic recognition model, and identify predicted semantic information of the second user input information sample based on the text feature information of the second user input information sample, wherein the label of the second user input information sample includes the semantic information of the second user input information sample;

[0014] A second parameter adjustment unit, configured to adjust parameters of the semantic recognition model based on the label and predicted semantic information of the second user input information sample to obtain a trained semantic recognition model;

[0015] The semantic recognition unit is used to perform semantic recognition on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information.

[0016] In an optional example, the semantic recognition unit is used to:

[0017] Extracting text features of the target user input information through the trained semantic recognition model to obtain text feature information of the target user input information;

[0018] Using the semantic recognition model, based on the text feature information of the target user input information, the semantic information of the target user input information is identified

[0019] In an optional example, the semantic recognition unit is used to:

[0020] Mapping the target user input information to the feature space through the trained semantic recognition model to obtain text feature information of the target user input information in the feature space;

[0021] By using the semantic recognition model, comparing the feature distance between the text feature information of the target user input information and the text feature information of at least one preset semantic information in the feature space;

[0022] Based on the feature distance, semantic information of the target user input information is identified.

[0023] In an optional example, when the label of the first user input information sample includes semantic information obtained by performing semantic recognition on the first user input information sample, the apparatus further includes: a sample acquisition unit, configured to:

[0024] Before extracting text features from the first user input information sample using the semantic recognition model to obtain text feature information of the first user input information sample,

[0025] Obtaining an unlabeled first user input information sample;

[0026] Performing semantic recognition on the first user input information sample to obtain first semantic information of the first user input information sample;

[0027] A pseudo label of the first user input information sample is generated based on the first semantic information.

[0028] In an optional example, when the label of the first user input information sample includes information obtained from reply information of the first user input information sample, the sample obtaining unit is further configured to:

[0029] Before extracting text features of the first user input information sample through the semantic recognition model to obtain text feature information of the first user input information sample, obtaining reply information to the first user input information sample in the conversation information where the first user input information sample is located;

[0030] Acquire second semantic information of the first user input information sample from the reply information;

[0031] A weak label for the first user input information sample is generated based on the second semantic information.

[0032] In an optional example, the sample acquisition unit is used to:

[0033] Training the semantic recognition model through the labeled second user input information sample;

[0034] Using the trained semantic recognition model to perform semantic recognition on the first user input information sample to obtain predicted semantic information of the first user input information sample;

[0035] The obtained predicted semantic information is used as the first semantic information of the first user input information sample.

[0036] In an optional example, the sample acquisition unit is further configured to:

[0037] Before extracting text features of the first user input information sample by the semantic recognition model to obtain text feature information of the first user input information sample, obtaining reply information for the first user input information sample in the conversation information where the first user input information sample is located;

[0038] Acquire second semantic information of the first user input information sample from the reply information;

[0039] generating a pseudo label of the first user input information sample based on the second semantic information;

[0040] The pseudo label and the weak label of the first user input information sample are merged to obtain a merged label of the second semantic information.

[0041] In an optional example, the sample acquisition unit is used to:

[0042] Matching the reply information with a preset semantic information set;

[0043] Based on the matched semantic information in the semantic information set, second semantic information of the first user input information sample is determined.

[0044] In an optional example, the first parameter adjustment unit is used to:

[0045] Calculating the loss of the semantic recognition model based on the predicted semantic information of the first user input information sample and the semantic information in the merged label of the first user input information sample;

[0046] Parameters of the semantic recognition model are adjusted based on the loss.

[0047] In an optional example, the semantic recognition device of this embodiment further includes a reply unit, which is used to:

[0048] After performing semantic recognition on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information, intelligent reply information of the target user input information is generated based on the semantic information and the current dialogue scenario;

[0049] The smart reply information is output.

[0050] In some embodiments of the present invention, a computer device may be provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the computer program.

[0051] In some embodiments of the present invention, a storage medium may be provided, on which a computer program is stored. When the computer program is executed on a computer, the computer is caused to execute the steps of the method as described above.

[0052] According to the embodiment of the present application, the text feature information of the first user input information sample can be extracted through the semantic recognition model, and the predicted semantic information of the first user input information sample can be identified based on the text feature information. Based on the label and predicted semantic information of the first user input information sample, the parameters of the semantic recognition model are adjusted; the text feature information of the second user input information sample is extracted through the adjusted semantic recognition model, and the predicted semantic information of the second user input information sample can be identified based on the text feature information; based on the label and predicted semantic information of the second user input information sample, the parameters of the semantic recognition model are adjusted to obtain a trained semantic recognition model; based on the trained semantic recognition model, the semantic recognition model is trained to obtain a trained semantic recognition model. The semantic recognition model performs semantic recognition on the target user input information to obtain the semantic information of the target user input information. The label of the first user input information sample in this embodiment includes the semantic information obtained by semantic recognition and / or the information obtained from the reply information of the first user input information sample. Therefore, the label of the first user input information sample does not need to be manually labeled, which can reduce the dependence of the semantic recognition model training on manual labeling and shorten the time required for model training. After the semantic recognition model is trained based on the first user input information sample, the model is further fine-tuned using the precisely labeled second user input information sample, which can effectively improve the semantic recognition accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0054] Figure 1a is a schematic diagram of the structure of a semantic recognition system provided by an embodiment of the present invention;

[0055] Figure 1b is a flow chart of a semantic recognition method provided by an embodiment of the present invention;

[0056] Figure 2 is a schematic diagram of a two-step training method for a semantic recognition model provided by an embodiment of the present invention;

[0057] Figure 3 is a flow chart of a semantic recognition method in a medical scenario provided by an embodiment of the present invention;

[0058] Figure 4 is a schematic diagram of the structure of a semantic recognition device provided by an embodiment of the present invention;

[0059] Figure 5 It is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0060] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.

[0061] Embodiments of the present invention provide a semantic recognition method, apparatus, computer equipment and storage medium.

[0062] The embodiment of the present invention provides a semantic recognition system, which includes a semantic recognition device suitable for a computer device, wherein the computer device may be a terminal or a server.

[0063] The terminal may be a mobile phone, tablet computer, laptop computer or other terminal device, or a wearable device, smart TV or other smart terminal with a display module.

[0064] Among them, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, as well as big data and artificial intelligence platforms, but is not limited to these.

[0065] The semantic recognition device of this embodiment may be integrated into a terminal or a server. Optionally, it may be integrated into the terminal or the server in the form of an application program or the like.

[0066] refer to Figure 1a , the semantic recognition system provided in this embodiment includes a terminal 10 and a server 20, etc.

[0067] The terminal 10 may be used to obtain target user input information, and send the target user input information to the server 20 .

[0068] The server 20 can be used to extract text feature information from a first user input information sample through a semantic recognition model, and identify predicted semantic information of the first user input information sample based on the text feature information of the first user input information sample, wherein the label of the first user input information sample includes semantic information obtained by semantic recognition of the first user input information sample, and / or information obtained from reply information of the first user input information sample; adjust parameters of the semantic recognition model based on the label and predicted semantic information of the first user input information sample; extract text feature information from a second user input information sample through the adjusted semantic recognition model, and identify predicted semantic information of the second user input information sample based on the text feature information of the second user input information sample, wherein the label of the second user input information sample includes semantic information of the second user input information sample; adjust parameters of the semantic recognition model based on the label and predicted semantic information of the second user input information sample to obtain a trained semantic recognition model; perform semantic recognition on target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information.

[0069] It should be noted that the description order of the following embodiments is not intended to limit the preferred order of the embodiments.

[0070] The embodiments of the present invention will be described from the perspective of a semantic recognition device, which may be specifically integrated into a terminal and / or a server, for example, may be integrated into the terminal or the server in the form of an application.

[0071] A semantic recognition method provided by an embodiment of the present invention can be executed by a processor of a terminal or a server. In this embodiment, semantic recognition is realized based on a semantic recognition model, which is an application based on natural language processing (NLP) technology. Natural language processing technology is an important direction in the fields of computer science and artificial intelligence. It studies various theories and methods that can realize effective communication between people and computers using natural language. Natural language processing is a science that integrates linguistics, computer science, and mathematics. Therefore, research in this field will involve natural language, that is, the language used by people in daily life, so it is closely related to the study of linguistics. Natural language processing technology generally includes text processing, semantic understanding, machine translation, robot question answering, knowledge graph and other technologies.

[0072] like Figure 1bAs shown, the process of the semantic recognition method can be as follows:

[0073] 101. Extract text feature information from a first user input information sample through a semantic recognition model, and identify predicted semantic information of the first user input information sample based on the text feature information of the first user input information sample, wherein the label of the first user input information sample includes semantic information obtained by semantic recognition of the first user input information sample and / or information obtained from reply information of the first user input information sample;

[0074] In the semantic recognition of this embodiment, the semantic recognition model uses semantic understanding technology, especially semantic analysis technology, and robot question answering (similar to Siri / Microsoft Xiaobing) technology, especially query understanding technology. The training of the semantic recognition model is based on AI (Artificial Intelligence) technology, especially machine learning (ML) technology in artificial intelligence technology, and more specifically, it can be achieved through deep learning in machine learning.

[0075] The semantic recognition model in this embodiment can be based on the structure of any artificial neural network that can be used for semantic recognition. For example, the semantic recognition model can be implemented based on BERT (Bidirectional Encoder Representation from Transformers, bidirectional Transformer encoder), which is a pre-trained language model. Its embedding of words or sentences can help downstream natural language processing tasks improve performance. The semantic recognition model can be implemented based on RNN (Recurrent Neural Network, cyclic neural network), which is a recursive neural network that takes sequence data as input, recurses in the direction of sequence evolution, and all nodes (circular units) are connected in a chain to form a closed loop. The semantic recognition model can be implemented based on CNN (Convolutional Neural Networks, convolutional neural network), which is a feedforward neural network that includes convolution or related calculations and has a deep structure. The semantic recognition model can be implemented based on RCNN (Rich featurehierarchies Convolutional Neural Network, a convolutional neural network with rich hierarchical features), etc., and this embodiment has no limitation on this.

[0076] In this embodiment, the field recognized by the semantic recognition model is not limited and can be any arbitrarily divided field. For example, the semantic recognition model of this embodiment can be a model in the field of medical dialogue recognition, or the semantic recognition model of this embodiment can be a model in the field of music, or it can also be a model in the field of chemistry, a model in the field of physics, a model in the field of games, a model in the field of intelligent robots, etc. The division of the field can be based on user needs. After the field is divided, the first user input information sample and the second user input information sample that can be used to train the model in the field can be obtained, and then the model can be trained by these two samples to obtain the semantic recognition model in this embodiment.

[0077] In this embodiment, the first user input information sample and the second user input information sample contain user input information, and both samples are annotated, and the annotated information is the semantic information of the user input information in the samples.

[0078] The user input information in the first user input information sample and the second user input information sample in this embodiment can be the user input information from the dialogue information. The label of the second user input information sample is manually annotated. During manual annotation, the semantic information of the user input information is manually determined. The semantic information can be understood as the purpose of the user's dialogue, the intention the user wants to express, etc. For example, in the medical field, in this field, the dialogue information is medical dialogue information, and the user input information is generally the inquiry information input by the patient. The inquiry information may be a description of the condition to a large extent. The description information generally has the characteristics of colloquialism. For example, the user input information is "Doctor, my stomach hurts", then during manual annotation, according to the intention the user input information wants to express, the label of the user input information will be annotated as "abdominal pain". However, it can be imagined that if all the samples of the model need to be manually annotated, the data annotation is difficult and time-consuming.

[0079] In view of reducing the cost of annotation, the data source of the sample is improved in this embodiment, so that the annotation of the first user input information sample is no longer completed manually, but is obtained based on semantic recognition and from the reply information of the user input information.

[0080] The semantic recognition model in this embodiment is essentially a classification model. The semantic recognition model may include a feature extraction layer and a classification layer. The classification layer defines n semantic categories. The semantic recognition result of the semantic recognition model is the classification probability of the user input information in each semantic category.

[0081] 102. Adjust parameters of the semantic recognition model based on the label and predicted semantic information of the first user input information sample;

[0082] 103. Extracting text feature information from the second user input information sample by using the adjusted semantic recognition model, and identifying predicted semantic information of the second user input information sample based on the text feature information of the second user input information sample, wherein the label of the second user input information sample includes the semantic information of the second user input information sample;

[0083] 104. Based on the label and predicted semantic information of the second user input information sample, adjust the parameters of the semantic recognition model to obtain a trained semantic recognition model;

[0084] In this embodiment, the above steps 101-102 can be regarded as a pre-training process for the semantic recognition model, during which the parameters of the model will be roughly adjusted, and steps 103-104 can be regarded as a fine-tuning process for the semantic recognition model, during which the parameters of the semantic recognition model will be fine-tuned.

[0085] Optionally, this embodiment also combines Figure 2The training process of the semantic recognition model is described in detail with examples. The two major steps of the semantic recognition model in this embodiment are pre-training and model fine-tuning. Figure 2 , which correspond to step 201 and step 202 respectively.

[0086] In the "pre-training" step of the model, i.e., step 101, the specific process of obtaining the predicted semantic information of the first user input information sample through the semantic recognition model may include: mapping the first user input information sample to the feature space through the semantic recognition model (the feature extraction layer), and obtaining the text feature information of the first user input information sample in the feature space; comparing the feature distance between the text feature information of the first user input information sample and the text feature information of at least one preset semantic information in the feature space through the semantic recognition model (the classification layer); and identifying the predicted semantic information of the first user input information sample based on the feature distance.

[0087] Among them, the feature distance can be calculated using methods such as Euclidean distance, and this embodiment has no limitation on this. In this embodiment, the output of the model includes not only the predicted semantic information, but also the predicted probability of each predicted semantic information. Before outputting the predicted semantic information, the model can first determine the predicted probability of each preset semantic information set by the classification layer of the model based on the feature distance, discard the semantic information with a predicted probability lower than the minimum predicted probability threshold, and only output the classification results of other preset semantic information with a predicted probability higher than the minimum predicted probability threshold.

[0088] The model can determine the prediction probability of each preset semantic information based on the feature distance.

[0089] In the "fine tuning" step of the model, i.e., step 103, similarly, the specific process of obtaining the predicted semantic information of the second user input information sample through the semantic recognition model may include: mapping the second user input information sample to the feature space through the semantic recognition model (the feature extraction layer), and obtaining the text feature information of the second user input information sample in the feature space; comparing the feature distance between the text feature information of the second user input information sample and the text feature information of at least one preset semantic information in the feature space through the semantic recognition model (the classification layer); and identifying the predicted semantic information of the second user input information sample based on the feature distance.

[0090] It is understandable that, in this embodiment, the detailed steps for obtaining the semantic recognition result of the user input information are different if the structure of the semantic recognition model is different, and are not limited to the above-mentioned detailed steps.

[0091] Optionally, in this embodiment, the label information of the first user input information sample includes three situations:

[0092] The first type, label information of the first user input information sample includes: first semantic information obtained by performing semantic recognition on the first user input information sample.

[0093] The second type, the label information of the first user input information sample includes: second semantic information obtained from reply information of the first user input information sample.

[0094] Third, the label information of the first user input information sample includes: first semantic information obtained by semantically identifying the first user input information sample, and second semantic information obtained from reply information of the first user input information sample.

[0095] For the label in the first case, it is obtained based on semantic recognition and can be considered as a pseudo label of the first user input information sample. Before extracting text feature information from the first user input information sample through the semantic recognition model, the pseudo label acquisition step may include: obtaining an unlabeled first user input information sample; performing semantic recognition on the first user input information sample to obtain first semantic information of the first user input information sample; and generating a pseudo label of the first user input information sample based on the first semantic information.

[0096] In the case where the label of the first user input information sample only includes a pseudo label, the step of “adjusting parameters of the semantic recognition model based on the label of the first user input information sample and the predicted semantic information” may include:

[0097] Based on the predicted semantic information of the first user input information sample and the semantic information in the pseudo label of the first user input information sample, the loss (in the pre-training stage) of the semantic recognition model is calculated, and the parameters of the semantic recognition model are adjusted based on the loss.

[0098] The loss can be calculated using any existing available classification loss function, and this embodiment has no limitation on this.

[0099] For the label in the second case, it is obtained from the reply information of the first user input information sample and can be considered as a weak label of the first user input information sample. Before extracting text feature information from the first user input information sample through the semantic recognition model, the specific process of obtaining the weak label may include: obtaining the reply information for the first user input information sample in the conversation information where the first user input information sample is located; obtaining the second semantic information of the first user input information sample from the reply information; and generating a weak label for the first user input information sample based on the second semantic information.

[0100] In the case where the label of the first user input information sample includes only a weak label, the step of “adjusting parameters of the semantic recognition model based on the label of the first user input information sample and the predicted semantic information” may include:

[0101] Based on the predicted semantic information of the first user input information sample and the semantic information in the weak label of the first user input information sample, the loss of the semantic recognition model (in the pre-training stage) is calculated, and the parameters of the semantic recognition model are adjusted based on the loss. The loss can also be calculated using any existing available classification loss function, and this embodiment has no limitation on this.

[0102] The label in the third case can be understood as being composed of a pseudo label and a weak label, and its acquisition process includes the acquisition process of the pseudo label and the weak label, wherein the acquisition order of the pseudo label and the weak label is not limited.

[0103] It is understandable that in the third case, the loss of the semantic recognition model needs to be calculated based on weak labels and pseudo labels.

[0104] refer to Figure 2 In this embodiment, during the model training phase, a weak supervision reinforcement module is set for the model. The module can be connected to the semantic recognition model or can be set relatively independently from the semantic recognition model. The specific function of the module is to provide the semantic recognition model with the above-mentioned first user input information sample. During the actual use phase of the semantic recognition model, the module stops working.

[0105] refer to Figure 2 ,A teacher model is provided in the weak supervision reinforcement module, which has the function of semantic recognition, and can identify the user’s conversation intention from the user’s input information and obtain the semantic information.,Wherein, the classification categories set in the teacher model include all the classification categories set in the semantic recognition model.

[0106] From the above description, it can be seen that in one example, the first user input information sample may only have a weak label, which can play a weak supervision role for the semantic recognition model, so it has a weak label (refer to Figure 2 The first user input information sample in the figure 5) is a weakly supervised data (reference Figure 2 ), the weakly supervised data can be represented by D, and the precisely labeled second user input information sample can be represented by D*.

[0107] Intuitively speaking, in the case of finely labeled data ( Figure 2 The icon 2 in the figure shows that the semantic recognition model trained on the second user input information sample has a higher F1 score than the semantic recognition model trained on the weakly supervised data. Therefore, the finely labeled data can provide more accurate label information for weakly supervised learning. According to the above analysis, the parameters learned from the finely labeled data can be regarded as a priori estimates of the parameters of the weakly supervised data. This priori estimation scheme is formalized as follows:

[0108]

[0109] Among them, w represents the parameters of the semantic recognition model, D represents weakly supervised data, D* represents finely labeled data, w* represents the best parameters from the pre-training stage, P(D|w) represents the semantic recognition accuracy of the weakly supervised data D when the parameters of the semantic recognition model are w, and P(D*|w) represents the semantic recognition accuracy of the finely labeled data D* when the parameters of the semantic recognition model are w.

[0110] However, the amount of weakly supervised data D is much larger than the amount of well-annotated fine-label data D*. Therefore, D will over-dominate the entire training process of the semantic recognition model, resulting in the model only being able to learn a small amount of knowledge from D*. In addition, D may be different from D* in terms of label distribution and expression, which may also be harmful to the training of the model.

[0111] In order to alleviate the above problems, this embodiment addresses the problem of insufficient label accuracy in weakly supervised data and proposes a solution for adding pseudo labels to make the label information of weakly supervised data more accurate (i.e., the source of label information includes weak labels and pseudo labels).

[0112] In this solution, the pseudo label may be added before the weak label or after the weak label, and this embodiment has no limitation on this.

[0113] Taking the pseudo label being added after the weak label as an example, after the step of "generating a weak label of the first user input information sample based on the second semantic information", the following may also be included:

[0114] Performing semantic recognition on the first user input information sample to obtain first semantic information of the first user input information sample;

[0115] Generate a pseudo label of the first user input information sample based on the first semantic information;

[0116] The pseudo label and the weak label of the first user input information sample are merged to obtain a merged label of the second semantic information.

[0117] Among them, the merging of the pseudo-label and the weak label of the first user input information sample is specifically the merging of the first semantic information and the second semantic information. When merging, if there is the same semantic information in the two semantic information, the merged semantic information is deduplicated so that there is no repeated semantic information in the merged label.

[0118] In this embodiment, the pseudo label of the first user input information sample can be obtained by performing semantic recognition on the first user input information sample by the teacher model in the weak supervision enhancement module.

[0119] Optionally, in one example, the teacher model may be trained based on the precisely annotated data, that is, trained based on the second user input information sample of this embodiment. In one example, the step of “performing semantic recognition on the first user input information sample to obtain first semantic information of the first user input information sample” may include:

[0120] Through the labeled second user input information sample ( Figure 2 The label number is 2) for the teacher model ( Figure 2 The number 3) is used for semantic recognition training;

[0121] Using the trained teacher model to perform semantic recognition on the first user input information sample to obtain predicted semantic information of the first user input information sample;

[0122] The obtained predicted semantic information is used as the first semantic information of the first user input information sample.

[0123] refer to Figure 2 It can be seen that the learned first semantic information can be used to generate a pseudo label of the first user input information sample ( Figure 2 In the figure, numbered 4), in one example, the teacher model can be a model that is exactly the same as the semantic recognition model in the present embodiment, or it can be the semantic recognition model of the present embodiment itself, that is, the present embodiment first uses the precisely labeled data to train the semantic recognition model, and then uses the trained semantic recognition model to perform semantic recognition on a first user input information sample with a weak label (that is, weak supervision data) to obtain the first semantic information, and generates a pseudo label based on the first semantic information.

[0124] In the example where the pseudo-label is added before the weak label, the pseudo-label is generated in a similar manner. After obtaining the first semantic information to generate the pseudo-label, the reply information for the first user input information sample in the conversation information where the first user input information sample is located can be obtained; the second semantic information of the first user input information sample is obtained from the reply information; the pseudo-label of the first user input information sample is generated based on the second semantic information; the pseudo-label and the weak label of the first user input information sample are merged to obtain a merged label of the second semantic information.

[0125] In this embodiment, in order to extract more accurate second semantic information from the reply information, a corresponding semantic information set can be set for the field of model application. The semantic information set can include the more commonly used semantic information in the field. Taking the medical field as an example, a semantic information set including medical professional vocabulary in the medical field can be set. The set can include medical professional vocabulary such as abdominal pain, abdominal distension, diarrhea, etc.

[0126] Optionally, the step of "obtaining second semantic information of the first user input information sample from the reply information" may include: matching the reply information with a preset semantic information set; and determining the second semantic information of the first user input information sample based on the matched semantic information in the semantic information set.

[0127] In one example, the preset semantic information set can be set according to the category setting of the classification layer of the semantic recognition model. Assuming that the classification layer of the semantic recognition model is set with n categories k1-kn, the name of category ki can be semantically expanded to obtain the semantic associated words corresponding to the category. Each category name and its corresponding semantic associated words (unlimited number) are taken as semantic information and stored accordingly in the semantic information set.

[0128] For example, for abdominal pain, you can set its semantic associated words as "abdominal pain" and so on.

[0129] When matching the reply information with the preset semantic information set, the reply information can be segmented. For the words obtained by the segmentation, each word is matched with each semantic information in the semantic set. If the match is successful, it is determined whether the successfully matched word is a category name or a semantic associated word. If it is a category name, the successfully matched semantic information is directly used as the second semantic information. If it is a semantic associated word, the category name corresponding to the semantic associated word is obtained as the second semantic information, and a weak label is generated based on the second semantic information.

[0130] It is understandable that in order to improve the recognition accuracy of the semantic recognition model, a large field can be divided into multiple small sub-fields, and a corresponding semantic recognition model can be trained for each sub-field. Taking the medical field as an example, it can be divided into more detailed sub-fields such as surgery, internal medicine, gastroenterology, and ENT. Each sub-field has a targeted semantic information set, which is conducive to improving the accuracy of the model.

[0131] The pseudo-label generation scheme in this embodiment is actually a reconstruction of the labels of weakly supervised data, that is, the model learned on the finely labeled data D* ( Figure 2 The icon 3 in the figure is used to annotate D, and the “reconstructed” annotated data can be obtained, which is called pseudo data D’( Figure 2 Icon 4 in D'). The pseudo-label in D' contains certain accurate label information in D*. The learning objective in the above formula can be modified as follows:

[0132]

[0133] Wherein, P(D'|w) represents the semantic recognition accuracy of the pseudo-annotated data D' when the parameter of the semantic recognition model is w.

[0134] Accordingly, for the same sentence s in D and D', the classification layer in the semantic recognition model needs to learn from two types of labels: weak labels from weak supervision data D and pseudo labels from pseudo data D' containing accurate label information.

[0135] In the embodiment of the present application, the pseudo label and the weak label are fused to obtain an enhanced weak label ( Figure 2 The enhanced weak label contains accurate label information and weak label information, which is more informative for the training of semantic recognition model.

[0136] This application designs a label joint algorithm to pre-train the model on D and D', whose goal is called enhanced weak supervision data ( Figure 2 The specific approach of this algorithm is that, for the same sentence, its weak label and pseudo label will be merged as the label of the enhanced weak supervision data.

[0137] refer to Figure 2 It can be seen that the semantic recognition model of this embodiment is implemented using a two-step training method, which aims to use data without manual annotation, so that the deep model reduces its dependence on manual annotation data. The input data of the semantic recognition model is the finely labeled data ( Figure 2 Icon 2 in ) and enhanced weakly supervised data ( Figure 2 The semantic recognition model training is mainly divided into two steps: model pre-training and model fine-tuning.

[0138] The pre-training process and the fine-tuning process have been introduced in detail in the previous examples. Here we explain the parameter adjustment of the model during the pre-training and fine-tuning process.

[0139] In the third case where the label of the first user input information sample is the above, the pre-training process of the model uses the first user input information sample with a pseudo label and a weak label for training, wherein the step of “adjusting parameters of the semantic recognition model based on the label and predicted semantic information of the first user input information sample” may include:

[0140] Calculating the loss of the semantic recognition model based on the predicted semantic information of the first user input information sample and the semantic information in the merged label of the first user input information sample;

[0141] Adjust the parameters of the semantic recognition model based on the loss.

[0142] In the pre-training stage, the loss of the semantic recognition model is the classification loss, and the loss function for calculating the loss can be any existing available loss function, which is not limited in this embodiment.

[0143] In an example, the loss function BCE With Logits Loss (Binary Cross Entropy With Logits Loss) is taken as an example to illustrate the adjustment of model parameters in the pre-training stage.

[0144] Let the parameters of the semantic recognition model be θ and the loss function be BCE With Logits Loss.

[0145] In the pre-training stage, the loss function of the semantic recognition model (for distinction, recorded as the first loss function) is expressed as:

[0146] L = Loss(P(y i |x i ,θ),y′ i )

[0147] Among them, x i Represents the given first user input information sample, y i Represents the semantic recognition model for sample x i In the prediction classification results, the probability distribution of predicted semantic information, y i ′ represents the first user input information sample x i The true probability distribution of semantic information in the merged tags.

[0148] It is understandable that in y i Including x i The predicted classification probability based on each preset semantic information.

[0149] In the pre-training stage, the training goal of the semantic recognition model is to reduce the above-mentioned first loss function. Optionally, the training termination conditions of the pre-training stage include but are not limited to, the number of model training times reaches a preset number threshold, or the model loss converges to a preset range, or the difference between the losses corresponding to two consecutive model trainings is less than a preset loss difference threshold.

[0150] In this embodiment, the model fine-tuning process uses the second user input information sample with artificially precisely annotated labels for training, wherein the step of "adjusting parameters of the semantic recognition model based on the label and predicted semantic information of the second user input information sample to obtain a trained semantic recognition model" may include:

[0151] Calculating the loss of the semantic recognition model based on the predicted semantic information of the second user input information sample and the semantic information in the label of the second user input information sample;

[0152] The parameters of the semantic recognition model are adjusted based on the loss to obtain a trained semantic recognition model.

[0153] In the fine-tuning stage, the loss of the model is also classification loss, and its loss calculation can use any available classification loss function, which is not limited in this embodiment.

[0154] Let’s take BCE With Logits Loss as an example, and let the parameter of the classifier model be θ. In the fine-tuning stage, the loss function of the semantic recognition model (referred to as the second loss function for distinction) is expressed as:

[0155] L = Loss(P(y i |Z i ,θ),y″ i )

[0156] Among them, z i Represents a given second user input information sample, y i Represents the semantic recognition model for sample z i In the predicted classification results, the probability distribution of predicted semantic information, y″ i Indicates that in the second user input information sample z i The true probability distribution of semantic information in the fine-marked labels of y. It can be understood that i Including z i The predicted classification probability based on each preset semantic information.

[0157] It can be understood that in this formula, the initial value of the model parameter θ is the optimal parameter obtained during the pre-training process.

[0158] In this embodiment, for the semantic recognition model, multiple rounds of the above training can be performed, that is, after fine-tuning, the merged label of the first user input information sample can be updated based on the semantic recognition model. Specifically, the first semantic information in the merged label can be updated based on the semantic recognition model. The method of updating the first semantic information is not repeated here. Then, the semantic recognition model is trained based on the first user input information sample after the updated label, and then the semantic recognition model is fine-tuned based on the second user input information sample. After multiple rounds of training, the recognition ability of the semantic recognition model can be further improved.

[0159] In order to compare the two-step training framework of the semantic recognition model proposed in this embodiment, comparative experiments were conducted on four typical classifiers.

[0160] Among them, 1152 labeled data were selected as the fine-label training data, i.e., the second user input information samples, 500 labeled data were selected as the development set data, 1000 labeled data were selected as the test data, and 10000 unlabeled data were selected as the source of weak supervision data (the first user input information samples).

[0161] In this experiment, the feature extraction layer in RNN, CNN, and RCNN can be implemented based on the trained BERT model, that is, the pre-trained BERT is used as a fixed text feature representation, and the parameters of BERT do not need to be updated during the training process. When BERT is used as a separate classifier, its own parameters can be updated during training.

[0162] In this experiment, the comparison scheme is as follows:

[0163] RNN, CNN, RCNN and BERT are classifiers: the model is trained only on the well-labeled data;

[0164] RNN, CNN, RCNN or BERT+weak supervision: first use weakly supervised data (with weak labels) to pre-train the model, and then fine-tune it on the precisely labeled data.

[0165] RNN, CNN, RCNN or BERT + weak supervision enhancement: first use the enhanced weak supervision data (labels are merged labels) to pre-train the model, and then fine-tune it on the precisely labeled data.

[0166] The experimental results of the above three solutions under four-class classifier are as follows:

[0167] plan F1 value Round accuracy RNN 68.73 45.30 RNN + weak supervision 75.29 53.70 RNN+weak supervision enhancement 76.72 54.40 CNN 70.69 45.50 CNN+weak supervision 74.18 51.90 CNN+weak supervision enhancement 77.89 54.50 RCNN 72.36 49.70 RCNN + weak supervision 74.89 51.00 RCNN+weak supervision enhancement 76.81 52.50 BERT 80.13 60.60 BERT+Weak Supervision 81.82 66.00 BERT+ weak supervision enhancement 88.59 70.00

[0168] When compared with the results of the classifier trained only on the well-annotated data, the recall and F1 score of the model obtained by adding the two-step training with weakly supervised data increased, indicating that weakly supervised data is expected to improve the performance of the classifier.

[0169] In addition, we can see that the classifier trained on the enhanced weakly supervised data has an average improvement of 3.46% in F1 score, which is better than the classifier without data augmentation. It turns out that the label joint method can benefit the proposed framework and the effect is better, which means that adding pseudo labels is effective.

[0170] 105. Perform semantic recognition on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information.

[0171] Optionally, in this embodiment, the step of “performing semantic recognition on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information” may include:

[0172] Extracting text features of the target user input information through the trained semantic recognition model to obtain text feature information of the target user input information;

[0173] The semantic information of the target user input information is identified through the semantic recognition model based on the text feature information of the target user input information.

[0174] The step of “extracting text features from the target user input information through the trained semantic recognition model to obtain text feature information of the target user input information” may include:

[0175] The target user input information is mapped into the feature space through the trained semantic recognition model to obtain the text feature information of the target user input information in the feature space.

[0176] Specifically, the target user input information may be mapped into the feature space through the feature extraction layer of the semantic recognition model to obtain the text feature information of the target user input information in the feature space.

[0177] The text feature information in this embodiment may be composed of vectors, such as word vectors, sentence vectors, and the like.

[0178] The step of “identifying the semantic information of the target user input information based on the text feature information of the target user input information through a semantic recognition model” may include:

[0179] Comparing the feature distance between the text feature information of the target user input information and the text feature information of at least one preset semantic information in the feature space through the semantic recognition model;

[0180] Based on the feature distance, the semantic information of the target user input information is identified.

[0181] Specifically, the above text feature information may be compared through the classification layer of the semantic recognition model, and then the semantic information of the target user input information may be identified based on the feature distance.

[0182] Among them, each classification in the classification layer corresponds to a preset semantic information, and each output in the semantic recognition model includes the semantic information of the target user's input information, which is the predicted probability of the preset semantic information corresponding to the output.

[0183] In this embodiment, the feature extraction layer can be implemented using a trained model that can be used for text feature extraction. Specifically, it can be implemented using a trained word2vec or BERT model. When using this trained model structure to extract text feature information, during the training of the semantic recognition model, when adjusting the parameters of the semantic recognition model based on the loss, the parameters of the feature extraction layer can be kept fixed.

[0184] After obtaining the semantic information of the target user input information through the semantic recognition model, the semantic information can be input into the module of the downstream task for execution of the downstream task. In one example, the downstream task can be set by the developer, and this embodiment has no limitation on this.

[0185] Optionally, the downstream service may be a user tag generation service, which may further include, after the step of identifying the semantic information of the target user input information based on the text feature information:

[0186] Generate query tags for the current user based on semantic information;

[0187] Get the user information of the current user;

[0188] The user information of the current user, the target user input information and the query tag are sent to the query object of the current user.

[0189] Among them, in different inquiry scenarios, the inquiry object may be different. In the medical dialogue, the inquiry object may be a doctor, a triage nurse, and so on.

[0190] Based on the current conversation scenario, generate intelligent reply information for the target user's input information;

[0191] Output smart reply information.

[0192] In an example, the downstream business may be an intelligent question-answering business. After identifying the semantic information of the target user's input information based on text feature information through a semantic recognition model, the following may also be included:

[0193] Generate intelligent reply information for target user input information based on semantic information and current conversation scenario;

[0194] Output smart reply information.

[0195] Among them, the dialogue scene can be associated with the recognition field of the semantic recognition model. For example, if the recognition field of the semantic recognition model is the medical field, the dialogue scene can be a condition inquiry scene, a medication recommendation scene, and the like.

[0196] In another example, if there is no semantic information whose prediction probability of semantic information is greater than the preset prediction probability in the semantic information of the target user input information identified by the model, the user can be further guided to input target user input information with more accurate semantics through guidance, so that the model can identify more accurate semantic information. Optionally, after the semantic information of the target user input information is identified based on the text feature information through the semantic recognition model, the following may also be included:

[0197] If there is no semantic information whose prediction probability exceeds a preset probability threshold among the semantic information recognized by the semantic recognition model from the target user input information, then the guiding semantic information is obtained from the recognized semantic information;

[0198] Based on the guidance semantic information and the current dialogue scenario, generating user guidance information associated with the guidance semantic information;

[0199] Output user guidance information;

[0200] Obtain user input information for user guidance information;

[0201] The user input information is used as new target user input information, and semantic information of the new target user input information is identified based on a semantic recognition model.

[0202] The guiding semantic information may be guiding information of a preset number of predicted probabilities (such as the top 3 predicted probabilities), or guiding information of a predicted probability exceeding a minimum preset probability threshold (such as 30%).

[0203] The user guidance information in this embodiment may be a detailed and accurate description of the guidance semantic information. The user guidance information may include first guidance information for determining the guidance voice information and second guidance information for excluding non-guidance semantic information.

[0204] For example, assuming that the guidance semantic information is "abdominal pain", the first guidance information in the user guidance information may include: which specific part of the body is painful, please refer to this description input: the abdominal tissue below the ribs feels pain. The second guidance information may include: please make sure that the pain part does not include the parts listed below, such as the parts above the ribs such as the chest cavity.

[0205] Using the embodiment of the present application, in view of the fact that the present embodiment improves the annotation source of the model training samples, information can be extracted from the dialogue information as a weak annotation of the user input information in the dialogue information, which greatly reduces the need for manually annotated data. And because of the weak annotation, the present application can introduce sample data containing more colloquial expressions, thereby greatly improving the recall rate of the model of this solution and having better performance in actual application scenarios. The embodiment of the present application addresses the problem of lack of precise label information in weakly supervised data, and proposes to use the model trained on the precise annotated data to annotate the unlabeled data to obtain pseudo labels. Thus, only the weakly supervised data with weak labels is improved, which enhances the recognition accuracy of the semantic recognition model, and the present embodiment has no limitation on the structure of the semantic recognition model, as long as semantic recognition can be achieved, and the model training using the present embodiment will not increase the number of model parameters, and will not affect the running speed in real scenarios (especially online services).

[0206] This embodiment also takes a medical dialogue scenario as an example to provide a detailed example description of the semantic recognition method.

[0207] refer to Figure 3 , the semantic recognition method includes:

[0208] 301. Obtain user input information from the medical dialogue;

[0209] The medical conversation in this embodiment can be obtained from any existing medical-related platform, for example, it can be obtained from the customer service module of a shopping platform, from an intelligent robot in a hospital, or from a medical service client provided by a terminal. This embodiment has no restrictions on this.

[0210] The medical dialogue in this embodiment includes user input information and reply information. The reply information is the reply of professionals in the medical field, such as doctors, nurses, pharmacists, etc. to the user input information. In one medical dialogue, multiple interactive dialogues can be carried out between the user and the doctor.

[0211] For example, a medical conversation might include the following:

[0212] User: Doctor, my stomach hurts, what’s the problem?

[0213] Doctor: Is it upper or lower abdominal pain? Do you have diarrhea?

[0214] User: Lower abdominal pain and diarrhea.

[0215] Doctor: It may be acute gastroenteritis.

[0216] The user input information in this embodiment can be the information input by the user once in a medical conversation, such as "Doctor, my stomach hurts, what's the problem?", or it can be all the information input by the user in a medical conversation, such as "Doctor, my stomach hurts, what's the problem?" and "Lower abdominal pain and diarrhea".

[0217] 302. Send a portion of the user input information to the manual annotation platform, receive the annotated user input information returned by the manual annotation platform, and determine the annotated user input information as a second user input information sample;

[0218] 303. Performing semantic recognition training on the semantic recognition model based on the second user input information sample;

[0219] The semantic recognition model in this embodiment can be set according to the hospital's division of patient outpatient departments. A semantic recognition model can be set up for each department. Alternatively, each department can be divided into several smaller departments, and a semantic recognition model can be set up for each smaller department.

[0220] Among them, the n categories set in the classification layer of each semantic recognition model can include medical terms that may be used in the department corresponding to the semantic recognition model. The medical terms can be terms used to describe conditions and symptoms. For example, in gastroenterology, the categories of the semantic recognition model can be set to include: diarrhea, gastroenteritis, abdominal pain, abdominal distension, and other terms.

[0221] 304. Use a portion of the user input information as a pseudo-labeled first user input information sample, perform semantic recognition on the first user input information sample through the trained semantic recognition model to obtain first semantic information of the first user input information sample, and generate a pseudo label of the first user input information sample based on the first semantic information;

[0222] 305. Obtaining reply information corresponding to the user input information in the first user input information sample from the medical dialogue;

[0223] 306. Match the reply information corresponding to the first user input information sample with a preset semantic information set, determine second semantic information of the first user input information sample based on the matched semantic information in the semantic information set, and generate a weak label for the first user input information sample based on the second semantic information;

[0224] The semantic information set in this embodiment can be set for the semantic recognition model under each department. One semantic recognition model is set with a corresponding semantic information set. The semantic information in the semantic information set includes n classification names of the classification layer of the semantic recognition model, and semantic associated words semantically associated with the n classification names, wherein the semantic associated words can also be professional medical terms.

[0225] This embodiment is based on the semantic information set and can quickly extract medical keywords from the reply information as weak labels for the first user input information sample.

[0226] 307. Merge the weak label and the pseudo label of the first user input information sample to obtain a merged label of the first user input information sample;

[0227] 308. Extract text feature information from the first user input information sample through a semantic recognition model, and identify predicted semantic information of the first user input information sample based on the text feature information of the first user input information sample;

[0228] 309. Calculate a first loss in a pre-training phase of a semantic recognition model based on a label and predicted semantic information of the first user input information sample;

[0229] 310. Adjusting parameters of the semantic recognition model based on the first loss;

[0230] 311. Extract text feature information from the second user input information sample by using the adjusted semantic recognition model, and identify predicted semantic information of the second user input information sample based on the text feature information of the second user input information sample;

[0231] 312. Calculate a second loss of the semantic recognition model in the fine-tuning phase based on the label and predicted semantic information of the second user input information sample;

[0232] 313. Adjust parameters of the semantic recognition model based on the second loss to obtain a trained semantic recognition model;

[0233] 314. Perform semantic recognition on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information.

[0234] By adopting the solution of this embodiment, there is no need for medical professionals to manually label the first user input information sample, which can reduce the dependence of semantic recognition model training on manual labeling and shorten the time required for model training. After training the semantic recognition model based on the first user input information sample, the semantic recognition model can be further fine-tuned using the precisely labeled second user input information sample, which can effectively improve the semantic recognition accuracy of the model.

[0235] In order to better implement the above method, accordingly, an embodiment of the present invention further provides a semantic recognition device, which is specifically integrated in a terminal or a server.

[0236] refer to Figure 4 , the device comprises:

[0237] A first semantic prediction unit 401 is configured to extract text feature information from a first user input information sample through a semantic recognition model, and identify predicted semantic information of the first user input information sample based on the text feature information of the first user input information sample, wherein the label of the first user input information sample includes semantic information obtained by semantic recognition of the first user input information sample and / or information obtained from reply information of the first user input information sample;

[0238] A first parameter adjustment unit 402, configured to adjust parameters of a semantic recognition model based on a label and predicted semantic information of a first user input information sample;

[0239] The second semantic prediction unit 403 is used to extract text feature information from the second user input information sample through the adjusted semantic recognition model, and identify the predicted semantic information of the second user input information sample based on the text feature information of the second user input information sample, wherein the label of the second user input information sample includes the semantic information of the second user input information sample;

[0240] A second parameter adjustment unit 404 is used to adjust the parameters of the semantic recognition model based on the label and predicted semantic information of the second user input information sample to obtain a trained semantic recognition model;

[0241] The semantic recognition unit 405 is used to perform semantic recognition on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information.

[0242] In an optional example, the semantic recognition unit is used to:

[0243] The trained semantic recognition model is used to extract text features of the target user input information to obtain text feature information of the target user input information;

[0244] Through the semantic recognition model, the semantic information of the target user's input information is identified based on the text feature information of the target user's input information

[0245] In an optional example, the semantic recognition unit is used to:

[0246] The target user input information is mapped to the feature space through the trained semantic recognition model to obtain the text feature information of the target user input information in the feature space;

[0247] Comparing the feature distance between the text feature information of the target user input information and the text feature information of at least one preset semantic information in the feature space through the semantic recognition model;

[0248] Based on the feature distance, the semantic information of the target user input information is identified.

[0249] In an optional example, when the label of the first user input information sample includes semantic information obtained by performing semantic recognition on the first user input information sample, the apparatus further includes: a sample acquisition unit, configured to:

[0250] Before extracting text features from the first user input information sample using the semantic recognition model to obtain text feature information of the first user input information sample,

[0251] Obtaining an unlabeled first user input information sample;

[0252] Performing semantic recognition on the first user input information sample to obtain first semantic information of the first user input information sample;

[0253] A pseudo label of the first user input information sample is generated based on the first semantic information.

[0254] In an optional example, when the label of the first user input information sample includes information obtained from reply information of the first user input information sample, the sample obtaining unit is further configured to:

[0255] Before extracting text features of the first user input information sample through the semantic recognition model to obtain text feature information of the first user input information sample, obtaining reply information for the first user input information sample in the conversation information where the first user input information sample is located;

[0256] Acquire second semantic information of the first user input information sample from the reply information;

[0257] A weak label of the first user input information sample is generated based on the second semantic information.

[0258] In an optional example, the sample acquisition unit is used to:

[0259] Training the semantic recognition model through the labeled second user input information sample;

[0260] Using the trained semantic recognition model to perform semantic recognition on the first user input information sample to obtain predicted semantic information of the first user input information sample;

[0261] The obtained predicted semantic information is used as the first semantic information of the first user input information sample.

[0262] In an optional example, the sample acquisition unit is further configured to:

[0263] Before extracting text features of the first user input information sample through the semantic recognition model to obtain text feature information of the first user input information sample, obtaining reply information for the first user input information sample in the conversation information where the first user input information sample is located;

[0264] Acquire second semantic information of the first user input information sample from the reply information;

[0265] Generate a pseudo label of the first user input information sample based on the second semantic information;

[0266] The pseudo label and the weak label of the first user input information sample are merged to obtain a merged label of the second semantic information.

[0267] In an optional example, the sample acquisition unit is used to:

[0268] Match the reply information with the preset semantic information set;

[0269] Based on the matched semantic information in the semantic information set, second semantic information of the first user input information sample is determined.

[0270] In an optional example, the first parameter adjustment unit is used to:

[0271] Calculating the loss of the semantic recognition model based on the predicted semantic information of the first user input information sample and the semantic information in the merged label of the first user input information sample;

[0272] Adjust the parameters of the semantic recognition model based on the loss.

[0273] In an optional example, the semantic recognition device of this embodiment further includes a reply unit, which is used to:

[0274] After semantic recognition is performed on the target user's input information based on the trained semantic recognition model and the semantic information of the target user's input information is obtained, intelligent reply information of the target user's input information is generated based on the semantic information and the current conversation scenario;

[0275] Output smart reply information.

[0276] By adopting the embodiment of the present application, the label of the first user input information sample of the semantic recognition model does not need to be manually labeled, which can reduce the dependence of the training of the semantic recognition model on manual labeling and improve the training speed of the semantic recognition model. In addition, the semantic recognition training of the semantic recognition model by the first user input information sample and the second user input information sample can effectively improve the accuracy of semantic recognition.

[0277] In addition, an embodiment of the present invention further provides a computer device, which may be a terminal or a server. Figure 5 As shown, it shows a schematic diagram of the structure of a computer device involved in an embodiment of the present invention, specifically:

[0278] The computer device may include one or more processing core processors 501, one or more computer-readable storage media memories 502, a power supply 503, an input unit 504 and other components. Those skilled in the art will appreciate that Figure 5 The computer device structure shown in the figure does not constitute a limitation on the computer device, and may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently. Among them:

[0279] The processor 501 is the control center of the computer device. It uses various interfaces and lines to connect various parts of the entire computer device. By running or executing software programs and / or modules stored in the memory 502 and calling data stored in the memory 502, it executes various functions of the computer device and processes data, thereby performing overall detection of the computer device. Optionally, the processor 501 may include one or more processing cores; preferably, the processor 501 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 501.

[0280] The memory 502 can be used to store software programs and modules. The processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 502. The memory 502 may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 502 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices. Accordingly, the memory 502 may also include a memory controller to provide the processor 501 with access to the memory 502.

[0281] The computer device also includes a power supply 503 for supplying power to various components. Preferably, the power supply 503 can be logically connected to the processor 501 through a power management system, so as to manage charging, discharging, power consumption and other functions through the power management system. The power supply 503 can also include one or more DC or AC power supplies, recharging systems, power failure detection circuits, power converters or inverters, power status indicators and other arbitrary components.

[0282] The computer device may further include an input unit 504, which may be used to receive input digital or character information and generate keyboard, mouse, joystick, optical or trackball signal input related to user settings and function control.

[0283] Although not shown, the computer device may further include a display unit, etc., which will not be described in detail herein. Specifically in this embodiment, the processor 501 in the computer device will load the executable files corresponding to the processes of one or more application programs into the memory 502 according to the following instructions, and the processor 501 will run the application programs stored in the memory 502, thereby realizing various functions, as follows:

[0284] extracting text feature information from the first user input information sample through a semantic recognition model, and identifying predicted semantic information of the first user input information sample based on the text feature information of the first user input information sample, wherein the label of the first user input information sample includes semantic information obtained by semantic recognition of the first user input information sample and / or information obtained from reply information of the first user input information sample;

[0285] Based on the label and predicted semantic information of the first user input information sample, adjusting parameters of the semantic recognition model;

[0286] extracting text feature information from the second user input information sample by using the adjusted semantic recognition model, and identifying predicted semantic information of the second user input information sample based on the text feature information of the second user input information sample, wherein the label of the second user input information sample includes the semantic information of the second user input information sample;

[0287] Based on the label and predicted semantic information of the second user input information sample, adjusting parameters of the semantic recognition model to obtain a trained semantic recognition model;

[0288] Semantic recognition is performed on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information.

[0289] Therefore, the label of the first user input information sample of the semantic recognition model in this embodiment does not need to be manually labeled, which can reduce the dependence of the semantic recognition model training on manual labeling and improve the training speed of the semantic recognition model. In addition, the use of two types of samples can effectively improve the accuracy of semantic recognition.

[0290] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0291] A person of ordinary skill in the art will appreciate that all or part of the steps in the various methods of the above embodiments may be completed by instructions, or by controlling related hardware through instructions. The instructions may be stored in a computer-readable storage medium and loaded and executed by a processor.

[0292] To this end, an embodiment of the present invention further provides a storage medium, in which a plurality of instructions are stored. The instructions can be loaded by a processor to execute the semantic recognition method provided by the embodiment of the present invention.

[0293] According to one aspect of the present application, a computer program product or a computer program is also provided, the computer program product or the computer program includes a computer instruction, and the computer instruction is stored in a computer-readable storage medium. The processor of the computer device reads the computer instruction from the computer-readable storage medium, and the processor executes the computer instruction, so that the computer device executes the method provided in various optional implementations in the above embodiments.

[0294] The specific implementation of the above operations can be found in the previous embodiments, which will not be described in detail here.

[0295] The storage medium may include: a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.

[0296] Since the instructions stored in the storage medium can execute the steps in the semantic recognition method provided in the embodiment of the present invention, the beneficial effects that can be achieved by the semantic recognition method provided in the embodiment of the present invention can be achieved. Please refer to the previous embodiments for details and will not be repeated here.

[0297] The above is a detailed introduction to a semantic recognition method, device, computer equipment and storage medium provided in an embodiment of the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of ​​the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.

Claims

1. A semantic recognition method, characterized in that: include: extracting text feature information from a first user input information sample through a semantic recognition model, and identifying predicted semantic information of the first user input information sample based on the text feature information of the first user input information sample, wherein the label of the first user input information sample includes first semantic information obtained by semantically recognizing the first user input information sample, and / or second semantic information obtained from reply information of the first user input information sample; When the label of the first user input information sample includes second semantic information obtained from reply information of the first user input information sample, before extracting text feature information from the first user input information sample by using the semantic recognition model, the method further includes: Matching the reply information of the first user input information sample with a preset semantic information set, wherein the preset semantic information set includes each category name set by the classification layer of the semantic recognition model and the semantic associated words corresponding to each category name; Determining second semantic information of the first user input information sample based on the matched semantic information in the semantic information set; Based on the label and predicted semantic information of the first user input information sample, adjusting parameters of the semantic recognition model; extracting text feature information from the second user input information sample by using the adjusted semantic recognition model, and identifying predicted semantic information of the second user input information sample based on the text feature information of the second user input information sample, wherein the label of the second user input information sample includes the semantic information of the second user input information sample; Based on the label and predicted semantic information of the second user input information sample, adjusting parameters of the semantic recognition model to obtain a trained semantic recognition model; Semantic recognition is performed on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information.

2. The semantic recognition method according to claim 1, characterized in that: The semantic recognition of the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information includes: Extracting text features of the target user input information through the trained semantic recognition model to obtain text feature information of the target user input information; The semantic recognition model is used to recognize semantic information of the target user input information based on text feature information of the target user input information.

3. The semantic recognition method according to claim 2, characterized in that: The trained semantic recognition model extracts text features from the target user input information to obtain text feature information of the target user input information, including: Mapping the target user input information to the feature space through the trained semantic recognition model to obtain text feature information of the target user input information in the feature space; The identifying, by the semantic recognition model, the semantic information of the target user input information based on the text feature information of the target user input information includes: By using the semantic recognition model, comparing the feature distance between the text feature information of the target user input information and the text feature information of at least one preset semantic information in the feature space; Based on the feature distance, semantic information of the target user input information is identified.

4. The semantic recognition method according to claim 1, characterized in that: When the label of the first user input information sample includes first semantic information obtained by semantically recognizing the first user input information sample, before extracting text feature information from the first user input information sample by the semantic recognition model, the method further includes: Obtaining an unlabeled first user input information sample; Performing semantic recognition on the first user input information sample to obtain first semantic information of the first user input information sample; A pseudo label of the first user input information sample is generated based on the first semantic information.

5. The semantic recognition method according to claim 1, characterized in that: When the label of the first user input information sample includes second semantic information obtained from reply information of the first user input information sample, before extracting text feature information from the first user input information sample by using the semantic recognition model, the method further includes: Obtaining reply information to the first user input information sample in the dialog information where the first user input information sample is located; Acquire second semantic information of the first user input information sample from the reply information; A weak label for the first user input information sample is generated based on the second semantic information.

6. The semantic recognition method according to claim 4, characterized in that: The performing semantic recognition on the first user input information sample to obtain first semantic information of the first user input information sample includes: Training the semantic recognition model using the labeled second user input information sample; Using the trained semantic recognition model to perform semantic recognition on the first user input information sample to obtain predicted semantic information of the first user input information sample; The obtained predicted semantic information is used as the first semantic information of the first user input information sample.

7. The semantic recognition method according to claim 4, characterized in that: Before extracting text feature information from the first user input information sample by using the semantic recognition model, the method further includes: Obtaining reply information to the first user input information sample in the dialog information where the first user input information sample is located; Acquire second semantic information of the first user input information sample from the reply information; generating a pseudo label of the first user input information sample based on the second semantic information; The pseudo label and the weak label of the first user input information sample are merged to obtain a merged label of the second semantic information.

8. The semantic recognition method according to claim 7, characterized in that: The step of adjusting parameters of the semantic recognition model based on the label and predicted semantic information of the first user input information sample includes: Calculating the loss of the semantic recognition model based on the predicted semantic information of the first user input information sample and the semantic information in the merged label of the first user input information sample; Parameters of the semantic recognition model are adjusted based on the loss.

9. The semantic recognition method according to any one of claims 1 to 8, characterized in that: After performing semantic recognition on the target user input information based on the trained semantic recognition model to obtain the semantic information of the target user input information, the method further includes: Based on the semantic information and the current conversation scenario, generate intelligent reply information of the target user input information; The smart reply information is output.

10. A semantic recognition device, characterized in that: include: a first semantic prediction unit, configured to extract text feature information from a first user input information sample through a semantic recognition model, and identify predicted semantic information of the first user input information sample based on the text feature information of the first user input information sample, wherein the label of the first user input information sample includes first semantic information obtained by semantically recognizing the first user input information sample, and / or second semantic information obtained from reply information of the first user input information sample; When the label of the first user input information sample includes information obtained from the reply information of the first user input information sample, before extracting text feature information from the first user input information sample by using the semantic recognition model, the method further includes: A sample acquisition unit, used to match the reply information of the first user input information sample with a preset semantic information set, wherein the preset semantic information set includes each category name set by the classification layer of the semantic recognition model, and the semantic associated words corresponding to each category name; Determining second semantic information of the first user input information sample based on the matched semantic information in the semantic information set; A first parameter adjustment unit, configured to adjust parameters of the semantic recognition model based on the label and predicted semantic information of the first user input information sample; a second semantic prediction unit, configured to extract text feature information from a second user input information sample by using the adjusted semantic recognition model, and identify predicted semantic information of the second user input information sample based on the text feature information of the second user input information sample, wherein the label of the second user input information sample includes the semantic information of the second user input information sample; A second parameter adjustment unit, configured to adjust parameters of the semantic recognition model based on the label and predicted semantic information of the second user input information sample to obtain a trained semantic recognition model; The semantic recognition unit is used to perform semantic recognition on the target user input information based on the trained semantic recognition model to obtain semantic information of the target user input information.

11. A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

12. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed on a computer, the computer is caused to execute the steps of the method according to any one of claims 1 to 9.

13. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 9 are implemented.

Citation Information

Patent Citations

  • Method and device for realizing document format conversion

    CN106294493A

  • Dialogue reply method and device, computer equipment and computer readable storage medium

    CN110287297A

  • Corpus processing method

    CN110717017A

  • Semantic search in document review on a tangible user interface

    US20180203921A1

  • Text categorization using natural language processing

    US20190340235A1