Methods, apparatus, equipment and storage media for online model training
By receiving conversation messages during human-computer interaction, performing annotation and intent recognition based on contextual information, and adjusting model parameters, the problems of inaccurate annotation of conversation content and insufficient feedback are solved, and real-time optimization and accuracy of the model are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2019-07-05
- Publication Date
- 2026-03-06
AI Technical Summary
In existing technologies, human-computer dialogue models struggle to accurately label dialogue content after the dialogue ends and cannot provide real-time feedback or optimization.
By receiving messages from the current session, labeling and identifying intent based on contextual information, adjusting the parameters of the intent identification model, generating and scoring response messages, and optimizing the model until a predetermined threshold is reached.
It improved the accuracy of session content annotation and enabled real-time model optimization and feedback.
Smart Images

Figure CN116738233B_ABST
Abstract
Description
[0001] This application is a divisional application of Chinese patent application filed on July 5, 2019, with application number 201910603432.4 and entitled "Method, Apparatus, Device and Storage Medium for Online Training Model". Technical Field
[0002] This application relates to the field of artificial intelligence technology, and in particular to a method for online training of a model, an apparatus for online training of a model, a device for online training of a model, and a computer-readable storage medium. Background Technology
[0003] With the development of NLU (Natural Language Understanding) technology, the application of human-computer interaction technology is becoming more and more widespread.
[0004] Human-computer dialogue models are intelligent dialogue models based on NLU technology, capable of communicating with others in place of humans. In one approach, after a human-computer dialogue session ends, conversation messages from multiple rounds are acquired, each round's messages are independently labeled, and the model is trained based on these labeled messages. However, this approach has two drawbacks: firstly, it doesn't consider contextual information, making accurate labeling of the dialogue content difficult; secondly, it lacks real-time feedback on the model's results, hindering real-time model optimization based on feedback. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, device, and computer-readable storage medium for online model training, in order to solve the problems of difficulty in accurately labeling session content and the inability to provide real-time feedback and optimization of the model.
[0006] To solve the above-mentioned technical problems, the embodiments of this application are implemented as follows:
[0007] According to a first aspect of the embodiments of this application, a method for training an online model is provided, comprising: receiving a session message sent by the initiator of a current session; annotating the session message based on context information of the current session to obtain an annotated intent of the session message; performing intent recognition on the session message through an intent recognition model to obtain an identified intent of the session message; and adjusting the parameters of the intent recognition model based on the difference between the annotated intent and the identified intent, so that the difference is less than a first predetermined threshold.
[0008] In some embodiments of this application, based on the above scheme, the method further includes: generating an original response message corresponding to the session message based on the identified intent through a response generation model, wherein the identified intent includes an intent attribute; scoring the original response message based on the context information of the current session to obtain a scoring result of the original response message; if the scoring result is less than a second predetermined threshold, adjusting the original response message based on the context information of the current session to generate a valid response message.
[0009] In some embodiments of this application, based on the above scheme, adjusting the original response message based on the context information of the current session to generate a valid response message includes: adjusting the original response message based on the context information of the current session to generate an intermediate response message; scoring the intermediate response message based on the context information of the current session to obtain a scoring result of the intermediate response message; and if the scoring result of the intermediate response message is greater than the second predetermined threshold, then the intermediate response message is taken as the valid response message.
[0010] In some embodiments of this application, based on the above scheme, the method further includes: determining the difference between the original response message and the valid response message; and adjusting the parameters of the response generation model based on the difference between the original response message and the valid response message.
[0011] In some embodiments of this application, based on the above scheme, determining the difference between the original response message and the valid response message includes: performing word segmentation on the original response message and the valid response message; generating word vectors for the original response message and the valid response message based on the result of the word segmentation; determining the distance between the word vectors of the original response message and the valid response message, and using the distance as the difference between the original response message and the valid response message.
[0012] In some embodiments of this application, based on the above scheme, the step of annotating the session message based on the context information of the current session includes: performing word segmentation on the session message of the current session to obtain multiple words; performing lexical, syntactic and grammatical analysis on the multiple words based on the context information of the current session; and annotating the session message based on the analysis results.
[0013] In some embodiments of this application, based on the above scheme, the step of performing intent recognition on the session message through an intent recognition model to obtain the identified intent of the session message includes: performing topic analysis on the session message based on the context of the session message to determine the topic of the session message; and performing intent analysis on the session message based on the topic and the intent recognition model to determine the identified intent of the session message.
[0014] In some embodiments of this application, based on the above scheme, adjusting the parameters of the intent recognition model based on the difference between the labeled intent and the recognized intent includes: performing word segmentation on the labeled intent and the recognized intent; determining the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent based on the result of the word segmentation; determining the distance between the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent; and adjusting the parameters of the intent recognition model based on the distance.
[0015] In some embodiments of this application, based on the above scheme, generating the original response message corresponding to the conversation message based on the identified intent through the response generation model includes: determining the conversation type of the conversation message based on the identified intent, wherein the conversation type includes: question-and-answer, task-based, or voice chat; determining the corresponding response generation model based on the conversation type; and generating the original response message corresponding to the conversation message based on the determined response generation model.
[0016] According to a second aspect of this application, an apparatus for online training a model is provided, comprising: a receiving module for receiving a session message sent by the initiator of the current session; an annotation module for annotating the session message based on context information of the current session to obtain an annotation intent of the session message; an intent recognition module for performing intent recognition on the session message through an intent recognition model to obtain an recognized intent of the session message; and a first adjustment module for adjusting the parameters of the intent recognition model based on the difference between the annotation intent and the recognized intent, so that the difference is less than a first predetermined threshold.
[0017] In some embodiments of this application, based on the above scheme, the apparatus further includes: a response generation module, configured to generate an original response message corresponding to the session message based on the identified intent through a response generation model, wherein the identified intent includes an intent attribute; a scoring module, configured to score the original response message based on the context information of the current session to obtain a scoring result of the original response message; and a response adjustment module, configured to adjust the original response message based on the context information of the current session to generate a valid response message if the scoring result is less than a second predetermined threshold.
[0018] In some embodiments of this application, based on the above scheme, the response adjustment module includes: an intermediate response generation unit, used to adjust the original response message based on the context information of the current session to generate an intermediate response message; an intermediate result generation unit, used to score the intermediate response message based on the context information of the current session to obtain a score result of the intermediate response message; and a valid response generation unit, used to take the intermediate response message as the valid response message if the score result of the intermediate response message is greater than the second predetermined threshold.
[0019] In some embodiments of this application, based on the above scheme, the apparatus further includes: a first difference determination module, used to determine the difference between the original response message and the valid response message; and a second adjustment module, used to adjust the parameters of the response generation model based on the difference between the original response message and the valid response message.
[0020] In some embodiments of this application, based on the above scheme, the first difference determination module includes: a first word segmentation processing unit, used to perform word segmentation processing on the original response message and the valid response message; a first word vector generation unit, used to generate word vectors of the original response message and the valid response message based on the result of the word segmentation processing; and a distance determination unit, used to determine the distance between the word vectors of the original response message and the word vectors of the valid response message, and to use the distance as the difference between the original response message and the valid response message.
[0021] In some embodiments of this application, based on the above scheme, the annotation module includes: a second word segmentation processing unit, used to perform word segmentation processing on the conversation message of the current session to obtain multiple words; a syntax analysis unit, used to perform lexical, syntactic and grammatical analysis on the multiple words based on the context information of the current session; and an annotation unit, used to annotate the conversation message based on the analysis results.
[0022] In some embodiments of this application, based on the above scheme, the intent recognition module includes: a topic determination unit, used to perform topic analysis on the conversation message based on the context of the conversation message to determine the topic of the conversation message; and an intent analysis unit, used to perform intent analysis on the conversation message based on the topic and the intent recognition model to determine the recognition intent of the conversation message.
[0023] In some embodiments of this application, based on the above scheme, the first adjustment module includes: a third word segmentation processing unit, used to perform word segmentation processing on the labeled intent and the recognized intent; a second word vector generation unit, used to determine the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent based on the result of the word segmentation processing; a second distance determination unit, used to determine the distance between the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent; and an adjustment unit, used to adjust the parameters of the intent recognition model based on the distance.
[0024] In some embodiments of this application, based on the above scheme, the response generation module includes: a session type determination unit, used to determine the session type of the session message based on the identification intent, the session type including: question-and-answer, task-based, or voice chat; a module determination unit, used to determine the corresponding response generation model based on the session type; and an original response generation unit, used to generate an original response message corresponding to the session message based on the determined response generation model.
[0025] According to a third aspect of the present application, an apparatus for online training of a model is provided, comprising: a processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to implement the steps of the method for online training of a model as described in any of the first aspects.
[0026] According to a fourth aspect of the present application, a storage medium is provided for storing computer-executable instructions, which, when executed, implement the steps of the method for training an online model as described in any one of the first aspects.
[0027] Through the technical solutions in this application embodiment, on the one hand, the session messages are labeled based on the context information of the current session, which can combine the context to label the session content and improve the accuracy of the labeling; on the other hand, the intent recognition model is used to identify the intent of the session messages of the current session, and the parameters of the intent recognition model are adjusted based on the difference between the labeled intent and the identified intent, which can provide feedback on the prediction results of the model online in real time, thereby enabling the model to be optimized in real time. Attached Figure Description
[0028] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0029] Figure 1 A flowchart illustrating a method for online model training according to some embodiments of this application is shown;
[0030] Figure 2 A flowchart illustrating the generation of a valid response message is shown according to some embodiments of this application;
[0031] Figure 3 A schematic diagram is shown illustrating a decision tree model as the response generation model provided according to some embodiments of this application;
[0032] Figure 4 A flowchart illustrating a method for online model training according to other embodiments of this application is shown;
[0033] Figure 5 A schematic block diagram of an apparatus for online training of models according to some embodiments of this application is shown;
[0034] Figure 6 A schematic block diagram of an apparatus for online training of models according to some embodiments of this application is shown;
[0035] Figure 7 A schematic block diagram of an apparatus for online training models according to other embodiments of this application is shown; and
[0036] Figure 8 A schematic block diagram of an apparatus for online training models according to some embodiments of this application is shown. Detailed Implementation
[0037] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this application.
[0038] Figure 1 A flowchart illustrating a method for online model training according to some embodiments of this application is shown. This method can be applied to terminal devices, including but not limited to mobile phones, tablets, smart speakers, smartwatches, desktop computers, etc., and can also be applied to other suitable devices; this application does not specifically limit its application in this regard. The method includes steps S110 to S140, which are described below in conjunction with… Figure 1 The method for training the online model in the example embodiment is described in detail.
[0039] Reference Figure 1 As shown, in step S110, a session message sent by the initiator of the current session is received.
[0040] In an example embodiment, during a two-person conversation, each person saying one sentence is defined as a round of dialogue. In the current nth round of dialogue, the initiator of the current conversation sends the nth round dialogue message. For example, in a shopping scenario, the initiator of the current conversation enters the dialogue message "buy Nike shoes".
[0041] In step S120, the session message is annotated based on the context information of the current session to obtain the annotation intent of the session message.
[0042] In the example embodiment, the conversation message of the current session is segmented into multiple words. Lexical, syntactic, and grammatical analyses are then performed on these words based on the context information of the current session. The conversation message is then labeled based on the analysis results to obtain the labeled intent. For example, the conversation message "buy Nike shoes" is segmented into the words "buy," "Nike," and "shoes." The context information of the current session, such as a shopping scenario, is obtained, where "buy" is a verb and "Nike" and "shoes" are nouns. Therefore, the intent of the conversation message "buy Nike shoes" is "shopping," and the intent attributes include "shoes" and "Nike." Thus, the labeled intent of the conversation message "buy Nike shoes" is "shopping," and the labeled intent attributes are "shoes" and "Nike."
[0043] Furthermore, in the example embodiment, an intent template can be pre-set, which contains a mapping relationship between predetermined words and corresponding intents. The intents in the conversation message are labeled based on the mapping relationship, such as mapping "buy" to "shopping", "play" to "listen to music", "train ticket" to "travel", and "hotel" to "accommodation".
[0044] In the example embodiments, the conversation messages can be segmented and tagged with parts of speech using Word2Vector, or other methods such as GloVe or ELMo can also be used. This application does not impose any specific limitations on these methods. Furthermore, in other embodiments, the conversation messages can be manually annotated with lexical, syntactic, grammatical, and intent attributes to obtain the annotated intent and intent attributes of the conversation messages. Further, the annotated conversation messages containing the annotated intents are stored in a corpus.
[0045] In step S130, the intent of the current session message is identified by the intent recognition model to obtain the identified intent of the session message.
[0046] In the example embodiment, the intent recognition model is a classification model in machine learning, such as SVM (Support Vector Machine), CNN (Convolutional Neural Networks), LSTM (Long Short-Term Memory), etc., or other suitable classification models. This application does not impose any special limitations on this.
[0047] Furthermore, in the example embodiment, a corresponding feature vector is generated based on the word tagging results of the current session's conversational messages. The generated feature vector is input into the intent recognition model, and the intent of the current session's conversational messages is recognized based on the intent recognition model to obtain the recognition intent of the conversational messages. For example, based on the word tagging results "buy", "shoes", and "Nike" of the conversational message "buy Nike shoes", corresponding word vectors are generated as feature vectors. The generated feature vectors are input into the intent recognition model, and the recognition intent of the conversational message, namely "shopping", is obtained based on the intent recognition model, with the parameters of "shoes" and "Nike".
[0048] In step S140, the parameters of the intent recognition model are adjusted based on the difference between the labeled intent and the recognized intent, so that the difference is less than a predetermined threshold.
[0049] In the example embodiment, the session message of the current session is the training sample, the labeled intent is the labeling result of the training sample, and the recognized intent is the recognition result of the intent recognition model on the training sample. The parameters of the intent recognition model are adjusted based on the difference between the recognition result and the labeled result of the training sample. The difference between the recognition result and the labeled result of the training sample represents the difference between the predicted value and the true value, i.e., the loss function. The smaller the value of the loss function, the smaller the difference between the predicted value and the true value, and the more accurate the prediction result of the model. When the value of the loss function is less than a predetermined threshold, the trained intent recognition model is obtained. The predetermined threshold can be determined according to the size of the sample data and the size of the computing resources.
[0050] Specifically, the intention of the current session message is segmented into words; based on the result of the word segmentation, the word vectors corresponding to the intention of the annotation and the word vectors corresponding to the intention of the recognition are determined; the distance between the word vectors corresponding to the intention of the annotation and the word vectors corresponding to the intention of the recognition is determined; the parameters of the intention recognition model are adjusted based on the distance, and when the distance is less than a predetermined threshold, it indicates that the recognition result of the intention recognition model is relatively accurate and the model training has achieved the expected goal.
[0051] It should be noted that the distance between each word vector can be Hamming distance, Euclidean distance, or cosine distance, but the distance in the exemplary embodiments of this application is not limited to these. For example, the distance can also be Mahalanobis distance, Manhattan distance, etc.
[0052] according to Figure 1 The online training model method in the example embodiment, on the one hand, annotates the session messages based on the context information of the current session, which can combine the context to annotate the session content and improve the accuracy of the annotation; on the other hand, it uses an intent recognition model to identify the intent of the session messages of the current session, and adjusts the parameters of the intent recognition model based on the difference between the annotated intent and the identified intent, which can provide feedback on the prediction results of the model online in real time, thereby optimizing the model in real time.
[0053] Furthermore, to accurately identify the intent of conversation messages, in the example embodiment, topic analysis is performed on the conversation message based on its context to determine the topic of the conversation message; then, intent analysis is performed on the conversation message based on the topic and the intent identification model to determine the identified intent of the conversation message. For example, if the content of the conversation message is "buy train tickets," and the context dialogue includes information about tourist attractions, then the topic of the conversation message is "travel," and intent analysis is performed on the conversation message based on this topic and the intent identification model to determine the identified intent of the conversation message.
[0054] Figure 2 A schematic diagram of the process for generating a valid response message is shown according to some embodiments of this application.
[0055] Reference Figure 2 As shown, in step S210, the original response message corresponding to the current session message is generated by the response generation model based on the identified intent of the session message.
[0056] In an example embodiment, the identified intent and intent attributes of the current session's message are obtained, and an original response message corresponding to the session message is generated based on the identified intent and intent attributes. For example, suppose the current session message is "buy Nike shoes," the identified intent of the session message is "shopping," and the intent attributes are "shoes" and "Nike." Based on the identified intent and intent attributes of the session message, a response message corresponding to the session message is generated through a response generation model. The response generation model can be a decision tree model. The response message corresponding to the session message is generated based on the decision tree model, referring to... Figure 3As shown, the system first determines that the user's intent is to shop, and the product type under this intent is shoes. Then, it checks if the product's brand, size, and other parameters are complete. If the parameters are complete, the system outputs the corresponding product information for the user to choose from; if the information is incomplete, it outputs a response message corresponding to the missing information. For example, after the user enters "buy Nike shoes," the product's shoe parameters must include at least two items: brand and size. If the shoe size information is missing, the corresponding response message is generated: "What size shoes do you want?"
[0057] In step S220, the original response message is scored based on the context information of the current session to obtain the score result of the original response message.
[0058] In the example embodiment, the actual response message corresponding to the original response message is retrieved from the session database based on the context information of the current session. The original response message is then scored based on the context information and the actual response message. The session database pre-stores session messages from a large number of sessions. For example, the difference between the original response message and the actual response message can be determined based on the context information, and the score of the original response message can be determined based on this difference.
[0059] In other example embodiments, the original response message is scored manually based on the context information of the current session to obtain the score result of the original response message. For example, the original response message is judged based on the context information to determine whether the understanding of the preceding text is accurate, whether the response can be connected with the preceding text, whether it can guide the direction of the dialogue, and whether it has human-like language, etc.
[0060] In step S230, if the score of the original response message is less than a predetermined threshold, the original response message is adjusted based on the context information of the current session to generate a valid response message.
[0061] In an example embodiment, if the score of the original response message is less than a predetermined threshold, the original response message is adjusted based on the context information of the current session to generate an intermediate response message; the intermediate response message is then scored based on the context information of the current session to obtain a score result; if the score result of the intermediate response message is greater than a second predetermined threshold, the intermediate response message is considered a valid response message. For example, multiple corresponding intermediate response messages are retrieved from the session database based on the context information of the current session, and these multiple intermediate response messages are scored sequentially. If the score result of any intermediate response message is greater than the second predetermined threshold, the intermediate response message is considered a valid response message.
[0062] In other embodiments, the original response message can be manually adjusted based on the context information of the current session to generate an intermediate response message; the intermediate response message can be scored based on the context information of the current session to obtain a score result; if the score result of the intermediate response message is greater than a second predetermined threshold, the intermediate response message is regarded as a valid response message.
[0063] Furthermore, in the example embodiment, the conversation type of the conversation message can be determined based on the user's identification intent. Conversation types include question-and-answer, task-based, or voice chat. A corresponding response generation model is determined based on the determined conversation type, and a response message corresponding to the conversation message is generated based on the determined response generation model. For example, if the user's current conversation message is "buy train tickets," and the identification intent of the conversation message is "purchase tickets," then the conversation type of the conversation message is determined to be task-based, and the response generation model corresponding to task-based conversations is a decision tree model. If the user's current conversation message is "How's the weather tomorrow?", and the identification intent of the conversation message is "ask a question," then the conversation type of the conversation message is determined to be question-and-answer, and the response generation model corresponding to question-and-answer conversations is a retrieval model. If the user's current conversation message is "I'm in a bad mood," and the identification intent of the conversation message is "chat," then the conversation type of the conversation message is determined to be voice chat, and the response generation model corresponding to voice chat conversations is a deep learning model.
[0064] Furthermore, in the example embodiment, after obtaining a valid response message, the difference between the original response message and the valid response message is determined, and the parameters of the response generation model are adjusted based on this difference. For example, word segmentation is performed on the original response message and the valid response message; word vectors for the original response message and the valid response message are generated based on the results of the word segmentation; the distance between the word vectors of the original response message and the valid response message is determined, and this distance is used as the difference between the original response message and the valid response message. The parameters of the response generation model are adjusted based on this difference so that the difference is less than a predetermined threshold.
[0065] Figure 4 A flowchart illustrating a method for training an online model according to other embodiments of this application is shown.
[0066] Reference Figure 4 As shown, in step S410, the initiator of the session sends a session message. In a two-person session, each person saying one sentence is defined as a round of dialogue. In the current nth round of dialogue, the initiator of the current session sends the nth round of dialogue message.
[0067] In step S420, the conversation message of the current session is segmented to obtain multiple words. Based on the context information of the current session, lexical, syntactic and grammatical analysis is performed on the multiple words. Based on the analysis results, the conversation message is labeled to obtain the labeling intent and intent attributes of the conversation message. The labeling results are then transmitted to the corpus.
[0068] In step S430, intent recognition is performed on the session messages of the current session based on the intent recognition model to obtain the recognized intent of the session messages. For example, a corresponding feature vector is generated based on the word tagging results of the session messages of the current session, and the generated feature vector is input into the intent recognition model. The intent recognition model is then used to perform intent recognition on the session messages of the current session to obtain the recognized intent of the session messages.
[0069] In step S440, the identification intent and intent attributes of the current session message are obtained, and an original response message corresponding to the session message is generated based on the identification intent and intent attributes of the session message.
[0070] In step S450, the original response message is scored based on the context information of the current session to obtain the score result of the original response message. For example, based on the context information, it is judged whether the original response message accurately understands the preceding text, whether the response can connect with the preceding text, whether it can guide the direction of the dialogue, and whether it has anthropomorphic language, etc.
[0071] In step S460, the original response message is adjusted, for example, modified or rewritten, based on the context information of the current session to generate an intermediate response message; the intermediate response message is scored based on the context information of the current session to obtain the score result of the intermediate response message; if the score result of the intermediate response message is greater than a second predetermined threshold, the intermediate response message is regarded as a valid response message.
[0072] In step S470, a valid response message is returned to the other party.
[0073] Figure 5 A schematic block diagram of an apparatus for online training of models according to some embodiments of this application is shown.
[0074] Reference Figure 5As shown, the device for training the online model includes an online annotation module 510, an online training module 520, a feedback module 530, and an annotated corpus 540. The online annotation module 510 is used to annotate conversation messages and response messages; the online training module 520 is used to identify the intent of conversation messages, generate corresponding responses based on the identification results, and train the model based on the annotated conversation messages and response messages; the feedback module 530 is used to provide feedback and adjustment to the intent identification module based on the difference between the annotated intent and the identified intent, and to provide feedback and adjustment to the response generation module based on the difference between the original response message and the real response message.
[0075] The online annotation module 510 includes a semantic annotation unit 512, an intent annotation unit 514, and a response annotation unit 516. The semantic annotation unit 512 performs syntactic, lexical, and syntactic annotation on conversational messages. For example, it segments the current conversational message "buy Nike shoes" into three words: "buy," "Nike," and "shoes," where "buy" is a verb, and "Nike" and "shoes" are nouns. The intent annotation unit 514 annotates the intent of conversational messages based on the context of the current conversation. For example, if the context of the current conversational message "buy Nike shoes" is a shopping scenario, the user's intent is determined to be shopping based on the verb "buy" and the shopping scenario. The response annotation unit 514 annotates response messages. For example, it judges whether the response accurately understands the preceding text, whether the response connects with the preceding text, whether it guides the direction of the conversation, and whether it uses anthropomorphic language, etc., based on contextual information, and annotates the response message accordingly.
[0076] The online training module 520 includes an intent recognition unit 522 and a response generation unit 524. The intent recognition unit 522 is used to recognize the intent of the conversation message in the current session using an intent recognition model and generate the corresponding recognized intent. The intent recognition model can be a classification model in machine learning, such as an SVM (Support Vector Machine) model, a CNN (Convolutional Neural Networks) model, an LSTM (Long Short-Term Memory) model, etc., or other suitable classification models. This application does not impose any special limitations on this. The response generation unit 524 is used to generate the corresponding response message based on the recognized intent generated by the intent recognition unit 522 and the context information.
[0077] The feedback module 530 includes a model recognition performance determination unit 532 and a model response performance determination unit 534. The model recognition performance determination unit 532 determines the difference between the recognized intent generated by the intent recognition unit 522 and the labeled intent generated by the intent labeling unit 514, and feeds this difference back to the intent recognition unit 522 to adjust the intent recognition model. The model response performance determination unit 534 determines the difference between the response message generated by the response generation unit 524 and the labeled message generated by the response labeling unit 516, and feeds this difference back to the response generation unit 524 to adjust the response generation model.
[0078] In an example embodiment of this application, an apparatus for online model training is also provided. (See also...) Figure 6 As shown, the device 600 includes: a receiving module 610, an annotation module 620, an intent recognition module 630, and a first adjustment module 640. The receiving module 610 receives session messages sent by the initiator of the current session; the annotation module 620 annotates the session messages based on the context information of the current session to obtain the annotated intent of the session messages; the intent recognition module 630 performs intent recognition on the session messages using an intent recognition model to obtain the recognized intent of the session messages; and the first adjustment module 640 adjusts the parameters of the intent recognition model based on the difference between the annotated intent and the recognized intent, so that the difference is less than a first predetermined threshold.
[0079] In some embodiments of this application, based on the above scheme, the device 600 further includes: a response generation module, configured to generate an original response message corresponding to the session message based on the identified intent through a response generation model, wherein the identified intent includes an intent attribute; a scoring module, configured to score the original response message based on the context information of the current session to obtain a scoring result of the original response message; and a response adjustment module, configured to adjust the original response message based on the context information of the current session to generate a valid response message if the scoring result is less than a second predetermined threshold.
[0080] In some embodiments of this application, based on the above scheme, the response adjustment module includes: an intermediate response generation unit, used to adjust the original response message based on the context information of the current session to generate an intermediate response message; an intermediate result generation unit, used to score the intermediate response message based on the context information of the current session to obtain a score result of the intermediate response message; and a valid response generation unit, used to take the intermediate response message as the valid response message if the score result of the intermediate response message is greater than the second predetermined threshold.
[0081] In some embodiments of this application, based on the above scheme, the apparatus further includes: a first difference determination module, used to determine the difference between the original response message and the valid response message; and a second adjustment module, used to adjust the parameters of the response generation model based on the difference between the original response message and the valid response message.
[0082] In some embodiments of this application, based on the above scheme, the first difference determination module includes: a first word segmentation processing unit, used to perform word segmentation processing on the original response message and the valid response message; a first word vector generation unit, used to generate word vectors of the original response message and the valid response message based on the result of the word segmentation processing; and a distance determination unit, used to determine the distance between the word vectors of the original response message and the word vectors of the valid response message, and to use the distance as the difference between the original response message and the valid response message.
[0083] In some embodiments of this application, based on the above scheme, the annotation module includes: a second word segmentation processing unit, used to perform word segmentation processing on the conversation message of the current session to obtain multiple words; a syntax analysis unit, used to perform lexical, syntactic and grammatical analysis on the multiple words based on the context information of the current session; and an annotation unit, used to annotate the conversation message based on the analysis results.
[0084] In some embodiments of this application, based on the above scheme, the intent recognition module 630 includes: a topic determination unit 710, used to perform topic analysis on the conversation message based on the context of the conversation message to determine the topic of the conversation message; and an intent analysis unit 720, used to perform intent analysis on the conversation message based on the topic and the intent recognition model to determine the recognition intent of the conversation message.
[0085] In some embodiments of this application, based on the above scheme, the first adjustment module includes: a third word segmentation processing unit, used to perform word segmentation processing on the labeled intent and the recognized intent; a second word vector generation unit, used to determine the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent based on the result of the word segmentation processing; a second distance determination unit, used to determine the distance between the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent; and an adjustment unit, used to adjust the parameters of the intent recognition model based on the distance.
[0086] In some embodiments of this application, based on the above scheme, the response generation module includes: a session type determination unit, used to determine the session type of the session message based on the identification intent, the session type including: question-and-answer, task-based, or voice chat; a module determination unit, used to determine the corresponding response generation model based on the session type; and an original response generation unit, used to generate an original response message corresponding to the session message based on the determined response generation model.
[0087] according to Figure 6 The apparatus for training an online model in the example embodiment, on the one hand, annotates the session messages based on the context information of the current session, which can combine the context to annotate the session content and improve the accuracy of the annotation; on the other hand, it performs intent recognition on the session messages of the current session through an intent recognition model, and adjusts the parameters of the intent recognition model based on the difference between the annotated intent and the recognized intent, which can provide feedback on the prediction results of the model online in real time, thereby enabling real-time optimization of the model.
[0088] The online training model apparatus provided in this application embodiment can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.
[0089] Furthermore, embodiments of this application also provide an online model training device, such as... Figure 8 As shown.
[0090] Devices for online training models can vary significantly in configuration and performance, and may include one or more processors 801 and memory 802. Memory 802 may store one or more application programs or data. Memory 802 can be temporary or persistent storage. The application programs stored in memory 802 may include one or more modules (not shown), each module including a series of computer-executable instructions for the online training model device. Furthermore, processor 801 may be configured to communicate with memory 802 to execute the series of computer-executable instructions in memory 802 on the online training model device. The online training model device may also include one or more power supplies 803, one or more wired or wireless network interfaces 804, one or more input / output interfaces 805, one or more keyboards 806, etc.
[0091] In one specific embodiment, the device for online training of models includes a memory and one or more programs, wherein one or more programs are stored in the memory, and one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the device for online training of models, and is configured to be executed by one or more processors. The one or more programs include computer-executable instructions for performing the following: receiving a session message sent by the initiator of the current session; annotating the session message based on the context information of the current session to obtain the annotated intent of the session message; performing intent recognition on the session message through an intent recognition model to obtain the recognized intent of the session message; and adjusting the parameters of the intent recognition model based on the difference between the annotated intent and the recognized intent, so that the difference is less than a first predetermined threshold.
[0092] Optionally, when the computer-executable instructions are executed, the method further includes: generating an original response message corresponding to the session message based on the identified intent through a response generation model, wherein the identified intent includes an intent attribute; scoring the original response message based on the context information of the current session to obtain a scoring result of the original response message; and if the scoring result is less than a second predetermined threshold, adjusting the original response message based on the context information of the current session to generate a valid response message.
[0093] Optionally, when the computer-executable instructions are executed, adjusting the original response message based on the context information of the current session to generate a valid response message includes: adjusting the original response message based on the context information of the current session to generate an intermediate response message; scoring the intermediate response message based on the context information of the current session to obtain a scoring result of the intermediate response message; and if the scoring result of the intermediate response message is greater than the second predetermined threshold, then the intermediate response message is taken as the valid response message.
[0094] Optionally, when the computer-executable instructions are executed, the method further includes: determining the difference between the original response message and the valid response message; and adjusting the parameters of the response generation model based on the difference between the original response message and the valid response message.
[0095] Optionally, when the computer-executable instructions are executed, determining the difference between the original response message and the valid response message includes: performing word segmentation on the original response message and the valid response message; generating word vectors for the original response message and the valid response message based on the result of the word segmentation; determining the distance between the word vectors of the original response message and the valid response message, and using the distance as the difference between the original response message and the valid response message.
[0096] Optionally, when the computer-executable instructions are executed, the step of annotating the session message based on the context information of the current session includes: performing word segmentation on the session message of the current session to obtain multiple words; performing lexical, syntactic, and grammatical analysis on the multiple words based on the context information of the current session; and annotating the session message based on the analysis results.
[0097] Optionally, when the computer-executable instructions are executed, the step of performing intent recognition on the session message through an intent recognition model to obtain the identified intent of the session message includes: performing topic analysis on the session message based on the context of the session message to determine the topic of the session message; and performing intent analysis on the session message based on the topic and the intent recognition model to determine the identified intent of the session message.
[0098] Optionally, when the computer-executable instructions are executed, adjusting the parameters of the intent recognition model based on the difference between the labeled intent and the recognized intent includes: performing word segmentation on the labeled intent and the recognized intent; determining the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent based on the result of the word segmentation; determining the distance between the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent; and adjusting the parameters of the intent recognition model based on the distance.
[0099] Optionally, when the computer-executable instructions are executed, the step of generating an original response message corresponding to the conversation message based on the identified intent through a response generation model includes: determining the conversation type of the conversation message based on the identified intent, wherein the conversation type includes: question-and-answer, task-based, or voice chat; determining the corresponding response generation model based on the conversation type; and generating an original response message corresponding to the conversation message based on the determined response generation model.
[0100] The device for training online models provided in this application embodiment can implement the various processes in the aforementioned method embodiments and achieve the same functions and effects, which will not be repeated here.
[0101] Furthermore, this application embodiment also provides a storage medium for storing computer-executable instructions. In a specific embodiment, the storage medium can be a USB flash drive, optical disc, hard disk, etc. When the computer-executable instructions stored in the storage medium are executed by a processor, they can achieve the following process: receiving a session message sent by the initiator of the current session; annotating the session message based on the context information of the current session to obtain the annotation intent of the session message; performing intent recognition on the session message through an intent recognition model to obtain the recognized intent of the session message; and adjusting the parameters of the intent recognition model based on the difference between the annotation intent and the recognized intent so that the difference is less than a first predetermined threshold.
[0102] Optionally, when the computer-executable instructions stored in the storage medium are executed by a processor, the method further includes: generating an original response message corresponding to the session message based on the identified intent through a response generation model, wherein the identified intent includes an intent attribute; scoring the original response message based on the context information of the current session to obtain a scoring result of the original response message; and if the scoring result is less than a second predetermined threshold, adjusting the original response message based on the context information of the current session to generate a valid response message.
[0103] Optionally, when the computer-executable instructions stored in the storage medium are executed by a processor, adjusting the original response message based on the context information of the current session to generate a valid response message includes: adjusting the original response message based on the context information of the current session to generate an intermediate response message; scoring the intermediate response message based on the context information of the current session to obtain a scoring result of the intermediate response message; and if the scoring result of the intermediate response message is greater than the second predetermined threshold, then the intermediate response message is taken as the valid response message.
[0104] Optionally, when the computer-executable instructions stored in the storage medium are executed by a processor, the method further includes: determining the difference between the original response message and the valid response message; and adjusting the parameters of the response generation model based on the difference between the original response message and the valid response message.
[0105] Optionally, when the computer-executable instructions stored in the storage medium are executed by a processor, determining the difference between the original response message and the valid response message includes: performing word segmentation on the original response message and the valid response message; generating word vectors for the original response message and the valid response message based on the result of the word segmentation; determining the distance between the word vectors of the original response message and the valid response message, and using the distance as the difference between the original response message and the valid response message.
[0106] Optionally, when the computer-executable instructions stored in the storage medium are executed by the processor, the step of annotating the session message based on the context information of the current session includes: performing word segmentation on the session message of the current session to obtain multiple words; performing lexical, syntactic, and grammatical analysis on the multiple words based on the context information of the current session; and annotating the session message based on the analysis results.
[0107] Optionally, when the computer-executable instructions stored in the storage medium are executed by the processor, the step of performing intent recognition on the session message through an intent recognition model to obtain the identified intent of the session message includes: performing topic analysis on the session message based on the context of the session message to determine the topic of the session message; and performing intent analysis on the session message based on the topic and the intent recognition model to determine the identified intent of the session message.
[0108] Optionally, when the computer-executable instructions stored in the storage medium are executed by a processor, the adjustment of the parameters of the intent recognition model based on the difference between the labeled intent and the recognized intent includes: performing word segmentation on the labeled intent and the recognized intent; determining the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent based on the result of the word segmentation; determining the distance between the word vector corresponding to the labeled intent and the word vector corresponding to the recognized intent; and adjusting the parameters of the intent recognition model based on the distance.
[0109] Optionally, when the computer-executable instructions stored in the storage medium are executed by a processor, the step of generating an original response message corresponding to the conversation message based on the identified intent through a response generation model includes: determining the conversation type of the conversation message based on the identified intent, wherein the conversation type includes: question-and-answer, task-based, or voice chat; determining the corresponding response generation model based on the conversation type; and generating an original response message corresponding to the conversation message based on the determined response generation model.
[0110] The computer-readable storage medium provided in this application embodiment can implement the various processes in the foregoing method embodiments and achieve the same functions and effects, which will not be repeated here.
[0111] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using a hardware physical module. For example, a Programmable Logic Device (PLD) (e.g., a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program a digital system themselves to "integrate" it onto a PLD, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.
[0112] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0113] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or entities, or by products with certain functions. A typical implementation device is a computer. Specifically, a computer can be, for example, a personal computer, laptop computer, cellular phone, camera phone, smartphone, personal digital assistant, media player, navigation device, email device, game console, tablet computer, wearable device, or any combination of these devices.
[0114] For ease of description, the above devices are described separately by function as various units. Of course, in implementing this application, the functions of each unit can be implemented in one or more software and / or hardware.
[0115] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0116] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0117] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0118] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0119] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0120] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0121] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0122] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0123] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0124] This application can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a specific task or implement a specific abstract data type. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0125] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.
[0126] The above description is merely an embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of this application should be included within the scope of the claims of this application.
Claims
1. A method of training a model online, the method comprising: The method comprises: performing intent recognition on a session message of a current session by an intent recognition model to obtain a recognized intent of the session message; adjusting parameters of the intent recognition model based on a difference between the recognized intent and a label graph of the session message, so that the difference is less than a first predetermined threshold; generating an original response message corresponding to the session message based on the recognized intent by a response generation model; generating an effective response message based on the original response message and context information of the current session; adjusting parameters of the response generation model based on a difference between the original response message and the effective response message, so that the difference is less than a third predetermined threshold.
2. The method of claim 1, wherein, The method further comprises: receiving a session message sent by an initiator of a current session.
3. The method of claim 1, wherein, The method further comprises: labeling a session message of a current session based on context information of the current session to obtain a label graph of the session message; or labeling a session message of a current session based on a preset intent template to obtain a label graph of the session message.
4. The method of claim 1, wherein, The method of generating an effective response message based on the original response message and the context information comprises: scoring the original response message based on the context information of the current session to obtain a scoring result of the original response message; if the scoring result is less than a second predetermined threshold, adjusting the original response message based on the context information of the current session to generate an effective response message.
5. The method of claim 4, wherein, The method of adjusting the original response message based on the context information of the current session to generate an effective response message comprises: adjusting the original response message based on the context information of the current session to generate an intermediate response message; scoring the intermediate response message based on the context information of the current session to obtain a scoring result of the intermediate response message; if the scoring result of the intermediate response message is greater than the second predetermined threshold, taking the intermediate response message as the effective response message.
6. The method of claim 4, wherein, Before adjusting the parameters of the response generation model based on the difference between the original response message and the effective response message, the method further comprises: determining the difference between the original response message and the effective response message.
7. The method of claim 6, wherein, The method of determining the difference between the original response message and the effective response message comprises: performing word segmentation processing on the original response message and the effective response message; generating a word vector of the original response message and a word vector of the effective response message based on the result of the word segmentation processing; determining a distance between the word vector of the original response message and the word vector of the effective response message, and taking the distance as the difference between the original response message and the effective response message.
8. The method of claim 3, wherein, The method of labeling a session message of a current session based on context information of the current session comprises: performing word segmentation processing on a session message of a current session to obtain a plurality of words; performing morphological, syntactic and grammatical analysis on the plurality of words based on the context information of the current session; labeling the session message based on the result of the analysis.
9. The method of claim 1, wherein, The intent recognition model is used for intent recognition on the session message of the current session, and an identified intent of the session message is obtained. The session message is subjected to topic analysis based on a context of the session message of the current session, and a topic in which the session message is located is determined. The session message is subjected to intent analysis based on the topic and the intent recognition model, and the identified intent of the session message is determined.
10. The method of claim 1, wherein, The parameters of the intent recognition model are adjusted based on a difference between the identified intent and a label attention graph of the session message, and the difference is less than a first predetermined threshold. The label attention graph and the identified intent of the session message are subjected to word segmentation processing. Word vectors corresponding to the label attention graph and the identified intent are determined based on a result of the word segmentation processing. A distance between the word vectors corresponding to the label attention graph and the identified intent is determined. The parameters of the intent recognition model are adjusted based on the distance.
11. The method of claim 4, wherein, The response generation model is used for generating an original response message corresponding to the session message based on the identified intent, and the original response message is generated. The session type of the session message is determined based on the identified intent, and the session type includes a question and answer type, a task type or a chat type. A corresponding response generation model is determined based on the session type. The original response message corresponding to the session message is generated based on the determined response generation model.
12. An apparatus for training a model online, the apparatus comprising: The intent recognition model is used for intent recognition on the session message of the current session, and an identified intent of the session message is obtained. The parameters of the intent recognition model are adjusted based on a difference between the identified intent and a label attention graph of the session message, and the difference is less than a first predetermined threshold. The response generation model is used for generating an original response message corresponding to the session message based on the identified intent, and the original response message is generated. An effective response message is generated based on the original response message and context information of the current session. The parameters of the response generation model are adjusted based on a difference between the original response message and the effective response message, and the difference is less than a third predetermined threshold. The session message of the current session is received.
13. The apparatus of claim 12, wherein, The session message of the current session is labeled based on the context information of the current session, and a label attention graph of the session message is obtained. Alternatively, 14. The apparatus of claim 12, wherein, The session message of the current session is labeled based on a preset intent template, and the label attention graph of the session message is obtained. The effective response generation module includes: The original response message is scored based on the context information of the current session, and a scoring result of the original response message is obtained. The original response message is adjusted based on the context information of the current session to generate an effective response message if the scoring result is less than a second predetermined threshold.
15. The apparatus of claim 12, wherein, The response adjustment module includes: 16. The apparatus of claim 15, wherein, An intermediate response generation unit is configured to adjust the original response message based on the context information of the current session to generate an intermediate response message; An intermediate result generation unit is configured to score the intermediate response message based on the context information of the current session to obtain a scoring result of the intermediate response message; An effective response generation unit is configured to, if the scoring result of the intermediate response message is greater than the second predetermined threshold, take the intermediate response message as the effective response message.
17. The apparatus of claim 15, wherein, The device further includes: A first difference determination module is configured to determine a difference between the original response message and the effective response message.
18. The apparatus of claim 17, wherein, The first difference determination module includes: A first word segmentation processing unit is configured to perform word segmentation processing on the original response message and the effective response message; A first word vector generation unit is configured to generate a word vector of the original response message and a word vector of the effective response message based on a result of the word segmentation processing; A distance determination unit is configured to determine a distance between the word vector of the original response message and the word vector of the effective response message, and take the distance as the difference between the original response message and the effective response message.
19. The apparatus of claim 14, wherein, The labeling module includes: A second word segmentation processing unit is configured to perform word segmentation processing on the session message of the current session to obtain a plurality of words; A syntax analysis unit is configured to perform morphological, syntactic, and grammatical analysis on the plurality of words based on the context information of the current session; A labeling unit is configured to label the session message based on a result of the analysis.
20. The apparatus of claim 12, wherein, The intent recognition module includes: A topic determination unit is configured to perform topic analysis on the session message of the current session based on a context of the session message to determine a topic in which the session message is located; An intent analysis unit is configured to perform intent analysis on the session message based on the topic and an intent recognition model to determine a recognized intent of the session message.
21. The apparatus of claim 12, wherein, The first adjustment module includes: A third word segmentation processing unit is configured to perform word segmentation processing on a label graph of the session message and the recognized intent; A second word vector generation unit is configured to determine a word vector corresponding to the label graph and a word vector corresponding to the recognized intent based on a result of the word segmentation processing; A second distance determination unit is configured to determine a distance between the word vector corresponding to the label graph and the word vector corresponding to the recognized intent; An adjustment unit is configured to adjust a parameter of the intent recognition model based on the distance.
22. The apparatus of claim 15, wherein, The response generation module includes: A session type determination unit is configured to determine a session type of the session message based on the recognized intent, the session type including a question and answer type, a task type, or a chat type; A model determination unit is configured to determine a corresponding response generation model based on the session type; An original response generation unit is configured to generate an original response message corresponding to the session message based on the determined response generation model.
23. An apparatus for training a model online, the apparatus comprising: The device includes: A processor; and a memory configured to store computer-executable instructions that, when executed, cause the processor to implement the method of training an online model according to any one of claims 1-11.
24. A storage medium storing computer-executable instructions, wherein the computer-executable instructions comprise instructions for: The computer executable instructions, when executed, implement the method of training an online model of any of claims 1-11.
Citation Information
Patent Citations
Online model training method, device and apparatus and storage medium
CN110457449A