Intelligent response method and device, electronic device and medium
Patent Information
- Application Number
- CN202211049264.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-30
- Publication Date
- 2026-11-03
- Estimated Expiration
- 2042-08-30
AI Technical Summary
Existing intelligent response systems may respond to the same query in different scenarios, times, or locations, expressing different user intentions, leading to inaccurate responses and affecting user experience.
By receiving a query question and determining the associated contextual information, the query question and first reference information are fused to extract the vector to be matched. The similarity between the vector to be matched and the standard vector is calculated using a feature extraction model, thereby determining the target vector and response information.
It improves the accuracy and precision of responses, enabling a better understanding of the user's true intent and enhancing the accuracy of matching standard questions.
Smart Images

Figure CN115309883B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence technology, and more particularly to the field of human-computer interaction technology, specifically to an intelligent response method and apparatus, a training method and apparatus for a feature extraction model, an electronic device, a computer-readable storage medium, and a computer program product. Background Technology
[0002] In recent years, with the continuous development of artificial intelligence technology, intelligent response systems such as assistant robots and customer service robots have been applied to more and more industries. These intelligent response systems can use a question-and-answer format to provide corresponding response information to the user's input query. In this process, it is necessary to match the corresponding response information based on the semantics of the user's input query, and improving the matching accuracy is necessary to improve the accuracy of the response.
[0003] The methods described in this section are not necessarily methods that had been previously conceived or adopted. Unless otherwise specified, no method described in this section should be assumed to be prior art simply because it is included in this section. Similarly, unless otherwise specified, the issues mentioned in this section should not be considered to be accepted in any prior art. Summary of the Invention
[0004] This disclosure provides an intelligent response method and apparatus, a training method and apparatus for a feature extraction model, an electronic device, a computer-readable storage medium, and a computer program product.
[0005] According to one aspect of this disclosure, an intelligent response method is provided, comprising: in response to receiving a query question, determining first reference information corresponding to the query question, the first reference information being used to represent contextual information associated with the query question; determining a matching vector corresponding to the query question based on the query question and the first reference information; determining a target vector matching the matching vector from the multiple standard vectors based on the similarity between the matching vector and multiple standard vectors, wherein the multiple standard vectors have corresponding candidate response information; and determining response information for the query question based on the candidate response information corresponding to the target vector.
[0006] According to one aspect of this disclosure, an intelligent response device is provided, comprising: a first determining unit configured to, in response to receiving a query question, determine first reference information corresponding to the query question, the first reference information representing contextual information associated with the query question; a second determining unit configured to, based on the query question and the first reference information, determine a target vector corresponding to the query question; a third determining unit configured to, based on the similarity between the target vector and multiple standard vectors, determine a target vector matching the target vector from multiple standard vectors, wherein the multiple standard vectors have corresponding candidate response information; and a fourth determining unit configured to, based on the candidate response information corresponding to the target vector, determine response information for the query question.
[0007] According to one aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform any of the methods described above.
[0008] According to one aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform any of the methods described above.
[0009] According to one aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements any of the methods described above.
[0010] According to one or more embodiments of this disclosure, it is possible to more accurately understand the user's query intent and improve the accuracy of the response.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0013] Figure 1 A schematic diagram of an example system in which the various methods described herein can be implemented according to embodiments of the present disclosure is shown; Figure 2 A flowchart of an intelligent response method according to an embodiment of the present disclosure is shown; Figure 3 A flowchart of a feature extraction model training method according to an embodiment of the present disclosure is shown; Figure 4 A schematic diagram of a feature extraction model training method according to an embodiment of the present disclosure is shown; Figure 5 A structural block diagram of an intelligent response device according to an embodiment of the present disclosure is shown; Figure 6 A structural block diagram of a training apparatus for a feature extraction model according to an embodiment of the present disclosure is shown; and Figure 7 A structural block diagram of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0014] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0015] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0016] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0017] Currently, when a user interacts with an intelligent response system, the system can determine the user's intent and / or desired response message based on the query entered by the user, and then send the corresponding response message to the user's device.
[0018] In related technologies, intelligent response systems can select the closest standard question from a database based on the user's input query and provide the candidate response information corresponding to that standard question as the actual response to the user. However, the applicant noted that the same query may express different user intentions in different scenarios, times, or locations. For example, in a shopping scenario, a user inputs the query "Where to pay?" into the intelligent response system. If the user is currently in a physical store, their intention is likely to be to know the location of the checkout counter; if the user is currently in a virtual store, their intention is likely to be to know how to access the payment page. In this case, relying solely on the query question, the intelligent response system cannot understand the user's true intention and provide accurate response messages, thus affecting the user experience.
[0019] Based on this, this disclosure provides an intelligent response method that extracts a matching vector corresponding to the query question based on the query question and the first reference information corresponding to the query question. Since the matching vector integrates information from both the query question and the first reference information, it can more accurately represent the user's true intent when inputting the query question. Therefore, it can improve the accuracy of matching the standard question and enhance the precision of the response.
[0020] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0021] Figure 1 This is a schematic diagram illustrating an example system 100 in which various methods described herein may be implemented according to exemplary embodiments.
[0022] refer to Figure 1 The system 100 includes a client device 110, a server 120, and a network 130 that communicatively couples the client device 110 and the server 120.
[0023] Client device 110 includes a display 114 and a client application (APP) 112 that can be displayed on the display 114. Client application 112 can be an application that needs to be downloaded and installed before running, or a lightweight application (liteapp). If client application 112 is an application that needs to be downloaded and installed before running, client application 112 can be pre-installed on client device 110 and activated. If client application 112 is a mini-app, user 102 can run client application 112 directly on client device 110 without installing it, by searching for client application 112 in the host application (e.g., by the name of client application 112) or by scanning the graphic code of client application 112 (e.g., barcode, QR code, etc.). In some embodiments, client device 110 can be any type of mobile computing device, including mobile computers, mobile phones, wearable computing devices (e.g., smartwatches, smart glasses, and other head-mounted devices), or other types of mobile devices. In some embodiments, the client device 110 may alternatively be a fixed computer device, such as a desktop computer, server computer, or other type of fixed computer device.
[0024] Server 120 is typically a server deployed by an Internet Service Provider (ISP) or Internet Content Provider (ICP). Server 120 can represent a single server, a cluster of multiple servers, a distributed system, or a cloud server providing basic cloud services such as cloud databases, cloud computing, cloud storage, and cloud communications. It will be understood that, although... Figure 1 The diagram shows that server 120 communicates with only one client device 110, but server 120 can provide background services to multiple client devices simultaneously.
[0025] Examples of network 130 include combinations of local area networks (LANs), wide area networks (WANs), personal area networks (PANs), and / or communication networks such as the Internet. Network 130 can be wired or wireless. In some embodiments, technologies and / or formats including Hypertext Markup Language (HTML), Extensible Markup Language (XML), etc., are used to process data exchanged through network 130. Furthermore, encryption technologies such as Secure Sockets Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), and Internet Protocol Security (IPsec) can be used to encrypt all or some of the links. In some embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0026] For the purposes of this disclosure's embodiments, Figure 1In the example, client application 112 can be a smart answering application that can provide various functions based on smart answering, such as obtaining the user's query question, providing answer information, etc. Correspondingly, server 120 can be a server used with the smart answering application. Server 120 can provide online smart answering services to client application 112 running in client device 110 based on road network data. Alternatively, server 120 can also provide road network data to client device 110, whereby client application 112 running in client device 110 provides local answering services.
[0027] Figure 2 A flowchart of a smart response method 200 according to an embodiment of the present disclosure is shown. Figure 2 As shown, method 200 includes: step S201, in response to receiving a query question, determining first reference information corresponding to the query question, the first reference information being used to represent contextual information associated with the query question; step S202, based on the query question and the first reference information, determining a target vector corresponding to the query question; step S203, based on the similarity between the target vector and multiple standard vectors, determining a target vector matching the target vector from multiple standard vectors, wherein the multiple standard vectors have corresponding candidate response information; and step S204, based on the candidate response information corresponding to the target vector, determining the response information for the query question.
[0028] Since the vector to be matched integrates information from both the query question and the first reference information, it can more accurately represent the user's true intent when entering the query question. This can improve the accuracy of standard question matching and thus improve the accuracy of the response.
[0029] The steps of method 200 are described in detail below.
[0030] In step S201, a query question input by the user through the terminal device can be received. The query question can be text data, voice data, or video data, and is not limited thereto.
[0031] According to some embodiments, the first reference information may include at least one of the following information types: location information; time information; dialogue status information; and scene information.
[0032] Using one or more of the location, time, dialogue status, and context information corresponding to the user's query as the primary reference information can help to more accurately understand the user's true intent, thereby improving the accuracy of the response.
[0033] Location information can be the geographical location of the user's terminal device when the user enters a query, such as the user's city. Location information can also be a virtual location, such as the webpage the user is currently browsing.
[0034] The time information can be the time when the query entered by the user was received.
[0035] Dialogue state information can represent the stage a user is in during a conversation. For example, in a shopping scenario, the system can pre-set a three-stage conversation process: the first stage determines the user's purchase intention, the second stage determines the user's contact number and address, and the third stage determines the user's payment method. The dialogue state information indicates which stage the conversation is currently in. It can also be understood that dialogue state information can be the current conversation state identified through semantic understanding.
[0036] The scenario information can include shopping scenarios, recruitment scenarios, banking scenarios, etc.
[0037] In step S202, by integrating the first reference information and the query question, the missing information in the query question can be supplemented, and the exact meaning expressed by the query question can be understood more accurately, so that the extracted matching vector can accurately represent the user's true intent.
[0038] According to some embodiments, determining the matching vector corresponding to the query question based on the query question and the first reference information may include: performing feature extraction on the query question and the first reference information to obtain the matching vector corresponding to the query question.
[0039] According to some embodiments, feature extraction of the query question and first reference information to obtain the matching vector corresponding to the query question may include: inputting the query question and first reference information into a feature extraction model to obtain the matching vector corresponding to the query question. Thus, based on the trained feature extraction model, the matching vector corresponding to the query question can be obtained efficiently.
[0040] According to some embodiments, the feature extraction model can be constructed based on a self-attention mechanism. Therefore, the extracted matching vector can effectively integrate relevant information from the query question and the first reference information, further improving the accuracy of the matching vector.
[0041] In one implementation, the feature extraction model can be built based on models such as BERT, simBERT, and transformer.
[0042] According to some embodiments, feature extraction of a query question and first reference information to obtain a matching vector corresponding to the query question may include: performing feature extraction on the query question to obtain a first sub-vector corresponding to the query question; performing feature extraction on the first reference information to obtain a second sub-vector corresponding to the first reference information; and determining the matching vector corresponding to the query question based on the first sub-vector and the second sub-vector.
[0043] According to some embodiments, the feature extraction model may include a first sub-model and a second sub-model. Extracting features from the query question to obtain a first sub-vector corresponding to the query question may include: inputting the query question into the first sub-model to obtain the first sub-vector corresponding to the query question output by the first sub-model. Extracting features from the first reference information to obtain a second sub-vector corresponding to the first reference information may include: inputting the first reference information into the second sub-model to obtain the second sub-vector corresponding to the first reference information output by the second sub-model.
[0044] In practical applications, the first reference information is often structured, such as location information represented by binary information of a predetermined number of bits. Conversely, the query question is usually unstructured. Therefore, using two independent first and second sub-models to handle the query question and the first reference information respectively allows each sub-model to be configured according to the specific information type, thereby improving the effectiveness of processing both structured and unstructured information.
[0045] In step S203, the response information for the query question is determined based on the candidate response information corresponding to the target vector.
[0046] According to some embodiments, the target vector can be the standard vector with the highest similarity to the vector to be matched among multiple standard vectors, and the response information of the query question is the candidate response information corresponding to the target vector. Therefore, the response information of the query question can be determined efficiently and accurately based on the candidate response information of the most similar standard vector.
[0047] For example, the similarity between the vector to be matched and the multiple standard vectors can be determined by calculating the cosine of the angle between each vector and the standard vectors.
[0048] According to some embodiments, the plurality of standard vectors are determined based on a plurality of preset standard problems and second reference information corresponding to the plurality of standard problems respectively. The method may further include determining the plurality of standard problems and the second reference information corresponding to the plurality of standard problems respectively, wherein the second reference information and the first reference information have the same information type; and for each of the plurality of standard problems, determining the standard vector corresponding to the standard problem based on the standard problem and the second reference information corresponding to the standard problem.
[0049] In the process of extracting the standard vector, by integrating the second reference information with the standard problem, the extracted standard vector can more accurately represent the true meaning of the standard problem.
[0050] Furthermore, since the extraction of standard vectors is independent of the query question, after determining multiple standard questions and the corresponding second reference information for each standard question, the standard vector for each standard question can be calculated and pre-stored in the system. Thus, upon receiving a user's query question, only the vector to be matched needs to be extracted for the query question, without needing to extract standard vectors for the standard questions. This significantly reduces the amount of data processing during the intelligent response process and effectively shortens the processing time required to provide feedback.
[0051] The second reference information includes at least one of the following information types: location information; time information; dialogue status information; and scene information.
[0052] According to some embodiments, the second reference information corresponding to each standard question may include multiple second reference sub-information, and each second reference sub-information can be used to generate a standard vector corresponding to the standard question. In other words, for each standard question, different standard vectors can be generated based on different second reference sub-information. Thus, the pre-stored standard vectors can be further refined based on the standard question and different second reference sub-information, improving the matching accuracy of the vector to be matched, and thereby effectively improving the accuracy of the response.
[0053] The following section uses a recruitment scenario to illustrate the intelligent response method disclosed herein.
[0054] In recruitment scenarios, intelligent response systems can act as recruiters to communicate with job applicants. These systems pre-program the recruitment dialogue process, which can be divided into three stages. In the first stage, the system confirms the applicant's information, including name, applied position, and whether their educational background meets the requirements. In the second stage, it confirms whether the applicant accepts the preferred working hours and location. In the third stage, the applicant can freely ask questions.
[0055] After receiving a job applicant's query, the system uses the current stage of the conversation as the conversation status information and the city where the applied position is located as the location information. The conversation status information and location information together constitute the primary reference information corresponding to the query.
[0056] The query question is integrated with the first reference information to extract the matching vector corresponding to the query question. The similarity between the matching vector and each of the multiple pre-stored standard vectors is further calculated. The candidate response information of the standard vector with the highest similarity to the matching vector is determined as the response information to the applicant, thereby realizing intelligent response in the recruitment scenario.
[0057] Figure 3 A flowchart of a feature extraction model training method according to an embodiment of this disclosure is shown. Figure 3 As shown, method 300 includes: step S301, determining sample data and labels for the sample data, wherein the sample data includes similar questions, third reference information corresponding to the similar questions, standard questions, and fourth reference information corresponding to the standard questions, the third reference information and the fourth reference information having the same information type, and the labels including the true similarity between the similar questions and the standard questions; step S302, performing feature extraction processing for the similar questions and the standard questions, wherein the feature extraction processing includes: step S302-1, inputting at least the similar questions and the third reference information into an initial feature extraction model to obtain a first matching vector corresponding to the similar questions; and step S302-2, inputting at least the standard questions and the fourth reference information into an auxiliary model to obtain a second matching vector corresponding to the standard questions, wherein the model structure of the auxiliary model is the same as the model structure of the initial feature extraction model; step S303, calculating the predicted similarity between the first matching vector and the second matching vector; and step S304, adjusting the parameters of the feature extraction model based on the labels and the predicted similarity.
[0058] The similar and standard questions in the sample data can be any of the following: textual information, audio information, or video information.
[0059] During the training process, the initial feature extraction model learns how to combine similar problems with third reference information to extract more accurate feature vectors, thus obtaining the feature extraction model after training.
[0060] The feature extraction model trained in this way can be used in the process of intelligent response. By fusing the user's input query question with the first reference information, it can extract a more accurate matching vector, thereby improving the accuracy of matching the query question with the standard question and improving the precision of the response.
[0061] The following describes in detail each step of method 300.
[0062] In step S301, according to some embodiments, the third reference information may include at least one of the following information types: location information; time information; dialogue status information; and scene information.
[0063] Similarly, the fourth reference information has the same information type as the third reference information, and may also include at least one of location information, time information, dialogue state information, and scene information.
[0064] Among them, true similarity is used to evaluate the degree of similarity between similar questions and standard questions. The higher the true similarity, the more accurately the candidate information corresponding to the standard question can answer the similar question. Conversely, the lower the true similarity, the more accurately the candidate information corresponding to the standard question can answer the similar question.
[0065] In step S302, an initial feature extraction model and an auxiliary model are used to extract the first matching vector corresponding to the similar problem and the second matching vector corresponding to the standard problem, respectively. The model structure of the auxiliary model is the same as that of the initial feature extraction model.
[0066] It is understood that in the training method of the model disclosed herein, the parameters of both the initial feature extraction model and the auxiliary model can be adjusted during training. That is, in step S303, the parameters of the auxiliary model are adjusted based on the label and the predicted similarity. It is also understood that the auxiliary model and the initial feature extraction model can be the same model.
[0067] Both the trained feature extraction model and the auxiliary model can be used in the aforementioned intelligent response method. The feature extraction model fuses the query question and the first reference information to obtain the matching vector corresponding to the query question. The auxiliary model can be used to extract the standard vector, that is, to fuse the standard question and the second reference information to determine the standard vector corresponding to the standard question.
[0068] According to some embodiments, the initial feature extraction model includes a first initial sub-model and a second initial sub-model, wherein inputting at least the similarity problem and third reference information into the feature extraction model to obtain the first matching vector corresponding to the similarity problem may include: inputting the similarity problem into the first initial sub-model to obtain a first predicted sub-vector output by the first initial sub-model; inputting the third reference information into the second initial sub-model to obtain a second predicted sub-vector output by the second initial sub-model; and determining the first matching vector corresponding to the similarity problem based on the first predicted sub-vector and the second predicted sub-vector.
[0069] The third reference information can be structured, such as binary information with a preset number of bits. Conversely, similarity problems are usually unstructured. Therefore, using two independent first and second initial sub-models to handle similarity problems and the third reference information respectively allows the trained first and second sub-models to be applicable to unstructured and structured data processing, respectively, improving the model's adaptability to different types of data.
[0070] According to some embodiments, the sample data also includes first response information corresponding to similar questions and second response information corresponding to standard questions, and the feature extraction process may include: inputting similar questions, third reference information and first response information into an initial feature extraction model to obtain a first matching vector corresponding to similar questions; and inputting standard questions, fourth reference information and second response information into an auxiliary model to obtain a second matching vector corresponding to standard questions.
[0071] In cases where similar questions are historical query questions collected in advance, the first response information can be the historical response information corresponding to that historical query question. Similarly, the second response information can be the historical response information corresponding to the standard question.
[0072] Using historically validated response information as part of the sample data for model training can provide richer auxiliary information during the training process. This allows the feature extraction model and auxiliary model to further enhance their understanding of similar and standard problems during training, thereby improving the accuracy of feature vector extraction.
[0073] It is understandable that, although the response information is not used as input data for the feature extraction model in practical applications, the trained feature extraction model has already gained a better understanding of the query question with the help of the response information during the training process. Even without the response information as input in practical applications, it can still ensure accurate feature extraction results.
[0074] In some embodiments, to avoid the trained feature extraction model and auxiliary model from relying excessively on the first response information and the second response information, during the training process, both samples including the first response information and the second response information and samples excluding the first response information and the second response information can be used simultaneously to perform model training.
[0075] According to some embodiments, the feature extraction model includes a first initial sub-model and a second initial sub-model, wherein inputting similar questions, third reference information, and first response information into the initial feature extraction model to obtain a first matching vector corresponding to the similar questions includes: inputting similar questions and first response information into the first initial sub-model to obtain a third predicted sub-vector output by the first initial sub-model; inputting the third reference information into the second initial sub-model to obtain a fourth predicted sub-vector output by the second initial sub-model; and determining the first matching vector corresponding to the similar questions based on the third predicted sub-vector and the fourth predicted sub-vector.
[0076] In practical applications, third-party reference information is often structured, while similar questions and first-response information are unstructured. Therefore, using independent first and second initial sub-models to process these two types of information separately allows each sub-model to be configured according to the type of information it processes, improving the effectiveness of information processing.
[0077] In step S303, the predicted similarity between the first vector to be matched and the second vector to be matched is calculated. For example, the predicted similarity between the first vector to be matched and the second vector to be matched can be determined by calculating the cosine of the angle between them.
[0078] In step S304, the parameters of the initial feature extraction model are adjusted based on the label and predicted similarity.
[0079] According to some embodiments, the parameters of the initial feature extraction model can be adjusted based on the difference between the true similarity and the predicted similarity in the labels.
[0080] In one implementation, a loss value is calculated based on the true similarity and the predicted similarity, and the parameters of the initial feature extraction model are adjusted based on the loss value.
[0081] Figure 4 A schematic diagram of a training method for a feature extraction model is shown. For example... Figure 4 As shown, encoder 410, encoder 420, and feature processor 450 constitute the feature extraction model. Encoder 430, encoder 440, and feature processor 460 constitute the auxiliary model. For example, feature processors 450 and 460 can be pooling layers, or single-layer or multi-layer feedforward neural networks, as long as they can process the vectors output by the encoders according to the needs of the actual application scenario to optimize model performance; the structural type of the feature processor is not limited.
[0082] During training, the first position information 401 and the first dialogue state information 402 are input into the encoder 410 (i.e., the second sub-model mentioned above) to obtain vector a for structured data. The similar question 403 and the first response information 404 are input into the encoder 420 (i.e., the first sub-model mentioned above) to obtain vector b for unstructured data. The feature processor 450 is used to process vector a and vector b. For example, when the feature processor 450 is a pooling layer, the vector a and vector b can be pooled to obtain the first matching vector output by the feature extraction model.
[0083] Inputting the second position information 405 and the second dialogue state information 406 into the encoder 430 yields a vector c for structured data. Inputting the standard question 407 and the second response information 408 into the encoder 440 yields a vector d for unstructured data. The feature processor 460 processes vectors c and d. For example, when the feature processor 460 is a pooling layer, it can perform pooling processing on vectors c and d, thereby obtaining the second matching vector output by the auxiliary model.
[0084] Finally, the similarity calculation module 470 is used to calculate the predicted similarity between the first and second vectors to be matched, and the parameters of the feature extraction model and the auxiliary model can be further adjusted based on the label and the predicted similarity.
[0085] By fusing reference information (i.e., first position information 401 and first dialogue state information 402, as well as second position information 405 and second dialogue state information 406) and response information (i.e. first response information 404 and second response information 408) during the model training process, the feature extraction model and the auxiliary model can learn how to combine reference information and response information to extract feature vectors during the training process, thereby improving the model's feature extraction capability.
[0086] According to another aspect of this disclosure, a smart response device is also provided. Figure 5A smart response device 500 according to an embodiment of the present disclosure is shown, comprising: a first determining unit 510 configured to, in response to receiving a query question, determine first reference information corresponding to the query question, the first reference information representing contextual information associated with the query question; a second determining unit 520 configured to, based on the query question and the first reference information, determine a target vector corresponding to the query question; a third determining unit 530 configured to, based on the similarity between the target vector and multiple standard vectors, determine a target vector matching the target vector from multiple standard vectors, wherein the multiple standard vectors have corresponding candidate response information; and a fourth determining unit 540 configured to, based on the candidate response information corresponding to the target vector, determine response information for the query question.
[0087] According to some embodiments, the apparatus further includes: a fifth determining unit configured to determine a plurality of standard problems and second reference information corresponding to the plurality of standard problems respectively, wherein the second reference information and the first reference information have the same information type; and a sixth determining unit configured to determine a standard vector corresponding to each of the plurality of standard problems based on the standard problem and the second reference information corresponding to the standard problem.
[0088] According to some embodiments, the first reference information includes at least one of the following information types: location information; time information; dialogue status information; and scene information.
[0089] According to some embodiments, the second determining unit includes a subunit for inputting the query question and the first reference information into a feature extraction model to obtain the matching vector corresponding to the query question.
[0090] It should be understood that Figure 5 Each unit of the device 500 shown can be connected to a reference. Figure 2 The steps in method 200 described correspond to each other. Therefore, the operations, features, and advantages described above for method 200 also apply to apparatus 500 and its constituent units. For the sake of brevity, some operations, features, and advantages will not be repeated here.
[0091] According to some embodiments, the apparatus 500 also includes a training device for the feature extraction model. Figure 6A training apparatus 600 for a feature extraction model according to an embodiment of the present disclosure is shown, comprising: a seventh determining unit 610 configured to determine sample data and labels for the sample data, wherein the sample data includes similar questions, third reference information corresponding to the similar questions, a standard question, and fourth reference information corresponding to the standard question, the third reference information and the fourth reference information having the same information type, and the labels including the true similarity between the similar questions and the standard questions; and an execution unit 620 configured to perform feature extraction processing for the similar questions and the standard questions, wherein the execution unit 620 includes: a first acquiring subunit 621 configured to... The system comprises: a first feature extraction model, configured to input at least the similar question and the third reference information into an initial feature extraction model to obtain a first matching vector corresponding to the similar question; a second acquisition subunit 622, configured to input at least the standard question and the fourth reference information into an auxiliary model to obtain a second matching vector corresponding to the standard question, wherein the model structure of the auxiliary model is the same as that of the initial feature extraction model; a calculation unit 630, configured to calculate the predicted similarity between the first matching vector and the second matching vector; and an adjustment unit 640, configured to adjust the parameters of the initial feature extraction model based on the label and the predicted similarity.
[0092] According to some embodiments, the third reference information includes at least one of the following information types: location information; time information; dialogue status information; and scene information.
[0093] According to some embodiments, the initial feature extraction model includes a first initial sub-model and a second initial sub-model, wherein the first acquisition sub-unit includes: a sub-unit for inputting the similarity problem into the first initial sub-model to obtain a first predicted sub-vector output by the first initial sub-model; a sub-unit for inputting the third reference information into the second initial sub-model to obtain a second predicted sub-vector output by the second initial sub-model; and a sub-unit for determining a first matching vector corresponding to the similarity problem based on the first predicted sub-vector and the second predicted sub-vector.
[0094] According to some embodiments, the sample data further includes first response information corresponding to the similar question and second response information corresponding to the standard question, wherein the first acquisition subunit is further configured to input the similar question, the third reference information and the first response information into the feature extraction model to obtain a first matching vector corresponding to the similar question; and the second acquisition subunit is further configured to input the standard question, the fourth reference information and the second response information into the auxiliary model to obtain a second matching vector corresponding to the standard question.
[0095] It should be understood that Figure 6 Each unit of the device 600 shown can be connected to a reference. Figure 3 The steps in method 300 described correspond to each other. Therefore, the operations, features, and advantages described above for method 300 also apply to apparatus 300 and its constituent units. For the sake of brevity, some operations, features, and advantages will not be repeated here.
[0096] It should also be understood that this article can describe various technologies in the general context of software and hardware components or program modules. The above regarding... Figure 5 and Figure 6 The described units can be implemented in hardware or in hardware in combination with software and / or firmware. For example, these units can be implemented as computer program code / instructions configured to execute in one or more processors and stored in a computer-readable storage medium. Alternatively, these units can be implemented as hardware logic / circuit. For example, in some embodiments, one or more of units 510-540 and 610-640 can be implemented together in a System on Chip (SoC). The SoC may include an integrated circuit chip (which includes a processor (e.g., a Central Processing Unit (CPU), microcontroller, microprocessor, digital signal processor (DSP), etc.), memory, one or more communication interfaces, and / or one or more other components of circuitry), and may optionally execute received program code and / or include embedded firmware to perform functions.
[0097] According to another aspect of this disclosure, an electronic device is also provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, the instructions being executed by the at least one processor to enable the at least one processor to perform the task scheduling method described above.
[0098] According to another aspect of this disclosure, a non-transitory computer-readable storage medium storing computer instructions is also provided, wherein the computer instructions are used to cause the computer to perform the task scheduling method described above.
[0099] According to another aspect of this disclosure, a computer program product is also provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the task scheduling method described above.
[0100] See Figure 7 The following description serves as a structural block diagram of the electronic device 700 disclosed herein, which is an example of a hardware device applicable to various aspects of this disclosure. The electronic device can be different types of computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the disclosure described and / or claimed herein.
[0101] Figure 7 A block diagram of an electronic device according to an embodiment of the present disclosure is shown. (As follows) Figure 7 As shown, the electronic device 700 may include at least one processor 701, working memory 702, I / O device 704, display device 705, storage device 706 and communication interface 707 that are capable of communicating with each other via system bus 703.
[0102] Processor 701 may be a single processing unit or multiple processing units, and all processing units may include single or multiple computing units or multiple cores. Processor 701 may be implemented as one or more microprocessors, microcomputers, microcontrollers, digital signal processors, central processing units, state machines, logic circuits, and / or any device that manipulates signals based on operating instructions. Processor 701 may be configured to acquire and execute computer-readable instructions stored in working memory 702, storage device 706, or other computer-readable media, such as program code of operating system 702a, program code of application program 702b, etc.
[0103] Working memory 702 and storage device 706 are examples of computer-readable storage media for storing instructions executed by processor 701 to perform the various functions described above. Working memory 702 may include both volatile and non-volatile memory (e.g., RAM, ROM, etc.). Furthermore, storage device 706 may include hard disk drives, solid-state drives, removable media including external and removable drives, memory cards, flash memory, floppy disks, optical disks (e.g., CDs, DVDs), storage arrays, network-attached storage, storage area networks, etc. Working memory 702 and storage device 706 may both be collectively referred to herein as memory or computer-readable storage media, and may be non-transitory media capable of storing computer-readable, processor-executable program instructions as computer program code, which may be executed by processor 701 as a specific machine configured to perform the operations and functions described in the examples herein.
[0104] I / O device 704 may include input devices and / or output devices. Input devices may be any type of device capable of inputting information to electronic device 700, and may include, but are not limited to, a mouse, keyboard, touch screen, trackpad, trackball, joystick, microphone, and / or remote control. Output devices may be any type of device capable of presenting information, and may include, but are not limited to, video / audio output terminals, vibrators, and / or printers.
[0105] Communication interface 707 allows electronic device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunication networks, and may include, but is not limited to, modems, network interface cards, infrared communication devices, wireless communication transceivers and / or chipsets, such as Bluetooth. TM Equipment, 802.11 equipment, Wi-Fi equipment, WiMAX equipment, cellular communication equipment and / or the like.
[0106] The application program 702b in the working memory 702 can be loaded to execute the various methods and processes described above, for example... Figure 2 Steps S201 to S204 in the above process. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 700 via the storage device 706 and / or the communication interface 707. When the computer program is loaded and executed by the processor 701, one or more steps of the task scheduling method described above may be performed.
[0107] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0108] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable task scheduler, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0109] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0110] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0111] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0112] A computing system may include clients and servers. Clients and servers are generally located far apart and typically interact through a communication network. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other.
[0113] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0114] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. An intelligent response method, comprising: In response to receiving a query question, first reference information corresponding to the query question is determined. The first reference information is used to represent context information associated with the query question. The first reference information includes at least one of the following information types: location information, time information, dialogue status information, or scenario information. The location information includes the geographical location information of the terminal device when the user inputs the query question through the terminal device. The time information includes the time when the query question is received. The dialogue status information represents the stage of the user's dialogue process. Based on the query question and the first reference information, determine the matching vector corresponding to the query question; Based on the similarity between the vector to be matched and a plurality of pre-stored standard vectors, a target vector matching the vector to be matched is determined from the plurality of standard vectors, wherein the plurality of standard vectors have corresponding candidate response information; and Based on the candidate response information corresponding to the target vector, the response information for the query question is determined. The plurality of standard vectors are determined based on a plurality of preset standard problems and second reference information corresponding to each of the plurality of standard problems. The process of determining the plurality of standard vectors includes: Multiple standard questions and corresponding second reference information for each standard question are determined. The second reference information for each standard question includes multiple second reference sub-information, and the information types of these sub-information include location information, time information, dialogue state information, or scene information. For each of the plurality of standard problems, based on the standard problem and each of the plurality of second reference sub-information corresponding to the standard problem, a standard vector corresponding to the standard problem and the second reference sub-information is determined to obtain a plurality of standard vectors corresponding to the standard problem. The step of determining the matching vector corresponding to the query question based on the query question and the first reference information includes: The unstructured query question is input into the first sub-model of the feature extraction model to obtain the first sub-vector corresponding to the query question output by the first sub-model. The structured first reference information is input into a second sub-model, independent of the first sub-model, included in the feature extraction model, to obtain a second sub-vector corresponding to the first reference information output by the second sub-model; and The vector to be matched is determined based on the first sub-vector and the second sub-vector.
2. The method according to claim 1, wherein, The feature extraction model was trained using the following method: Determine sample data and labels for the sample data, wherein the sample data includes similar questions, third reference information corresponding to the similar questions, standard questions, and fourth reference information corresponding to the standard questions, the third reference information and the fourth reference information have the same information type, and the labels include the true similarity between the similar questions and the standard questions; Perform feature extraction processing on the similar problem and the standard problem, wherein the feature extraction processing includes: At least the similarity problem and the third reference information are input into the initial feature extraction model to obtain the first matching vector corresponding to the similarity problem; and The standard problem and the fourth reference information are input into the auxiliary model to obtain the second matching vector corresponding to the standard problem, wherein the model structure of the auxiliary model is the same as the model structure of the initial feature extraction model; Calculate the predicted similarity between the first vector to be matched and the second vector to be matched; and Based on the label and the predicted similarity, the parameters of the initial feature extraction model are adjusted.
3. The method according to claim 2, wherein the initial feature extraction model includes a first initial sub-model and a second initial sub-model, and the step of inputting at least the similarity problem and the third reference information into the initial feature extraction model to obtain the first matching vector corresponding to the similarity problem includes: The similar problem is input into the first initial sub-model to obtain the first predicted sub-vector output by the first initial sub-model; The third reference information is input into the second initial sub-model to obtain the second prediction sub-vector output by the second initial sub-model; as well as Based on the first predicted sub-vector and the second predicted sub-vector, the first matching vector corresponding to the similarity problem is determined. Furthermore, adjusting the parameters of the initial feature extraction model based on the label and the predicted similarity includes: Based on the label and the predicted similarity, the parameters of the first initial sub-model and the second initial sub-model are adjusted.
4. The method according to claim 2, wherein, The sample data also includes first response information corresponding to the similar questions and second response information corresponding to the standard questions, wherein the feature extraction process includes: The similar question, the third reference information, and the first response information are input into the initial feature extraction model to obtain the first matching vector corresponding to the similar question; and The standard question, the fourth reference information, and the second response information are input into the auxiliary model to obtain the second matching vector corresponding to the standard question.
5. The method according to claim 4, wherein, The initial feature extraction model includes a first initial sub-model and a second initial sub-model. The step of inputting the similar question, the third reference information, and the first response information into the initial feature extraction model to obtain the first matching vector corresponding to the similar question includes: The similar questions and the first response information are input into the first initial sub-model to obtain the third prediction sub-vector output by the first initial sub-model; The third reference information is input into the second initial sub-model to obtain the fourth prediction sub-vector output by the second initial sub-model; and Based on the third and fourth predictive sub-vectors, the first matching vector corresponding to the similarity problem is determined.
6. The method according to claim 1, wherein, The target vector includes the standard vector among the plurality of standard vectors that has the highest similarity to the vector to be matched. The response information for the query question includes the candidate response information corresponding to the target vector.
7. A smart response device, comprising: A first determining unit is configured to, in response to receiving a query question, determine first reference information corresponding to the query question. The first reference information is used to represent context information associated with the query question. The first reference information includes at least one of the following information types: location information, time information, dialogue status information, or scenario information. The location information includes the geographical location information of the terminal device when the user inputs the query question through the terminal device. The time information includes the time when the query question is received. The dialogue status information represents the stage of the user's dialogue process. The second determining unit is configured to determine the matching vector corresponding to the query question based on the query question and the first reference information; The third determining unit is configured to determine a target vector matching the vector to be matched from a plurality of pre-stored standard vectors based on the similarity between the vector to be matched and the pre-stored standard vectors, wherein the plurality of standard vectors have corresponding candidate response information; and The fourth determining unit is configured to determine the response information for the query question based on the candidate response information corresponding to the target vector. The plurality of standard vectors are determined based on a plurality of preset standard problems and second reference information corresponding to each of the plurality of standard problems. The plurality of standard vectors are obtained using the following unit: The fifth determining unit is configured to determine multiple standard questions and second reference information corresponding to each of the multiple standard questions, wherein the second reference information corresponding to each standard question includes multiple second reference sub-information, and the information types of the multiple second reference sub-information include location information, time information, dialogue state information, or scene information; and The sixth determining unit is configured to, for each of the plurality of standard problems, determine a standard vector corresponding to the standard problem and the second reference sub-information based on the standard problem and each of the plurality of second reference sub-information corresponding to the standard problem, so as to obtain a plurality of standard vectors corresponding to the standard problem. The second determining unit is configured as follows: The unstructured query question is input into the first sub-model of the feature extraction model to obtain the first sub-vector corresponding to the query question output by the first sub-model. The structured first reference information is input into a second sub-model, independent of the first sub-model, included in the feature extraction model, to obtain a second sub-vector corresponding to the first reference information output by the second sub-model; and The vector to be matched is determined based on the first sub-vector and the second sub-vector.
8. The apparatus according to claim 7, wherein, The apparatus further includes a training device for the feature extraction model, the training device comprising: The seventh determining unit is configured to determine sample data and labels for the sample data, wherein the sample data includes similar questions, third reference information corresponding to the similar questions, standard questions, and fourth reference information corresponding to the standard questions, the third reference information and the fourth reference information having the same information type, and the labels include the true similarity between the similar questions and the standard questions; An execution unit is configured to perform feature extraction processing for the similar problem and the standard problem, wherein the execution unit includes: A first acquisition subunit is configured to input at least the similarity question and the third reference information into an initial feature extraction model to obtain a first matching vector corresponding to the similarity question; and The second acquisition subunit is configured to input at least the standard problem and the fourth reference information into the auxiliary model to obtain the second matching vector corresponding to the standard problem, wherein the model structure of the auxiliary model is the same as the model structure of the initial feature extraction model; A computing unit is configured to calculate the predicted similarity between the first vector to be matched and the second vector to be matched; and An adjustment unit is configured to adjust the parameters of the initial feature extraction model based on the label and the predicted similarity.
9. The apparatus according to claim 8, wherein, The initial feature extraction model includes a first initial sub-model and a second initial sub-model, wherein the first acquisition sub-unit includes: A sub-unit used to input the similar problem into the first initial sub-model to obtain the first predicted sub-vector output by the first initial sub-model; Sub-units for inputting the third reference information into the second initial sub-model to obtain the second predicted sub-vector output by the second initial sub-model; and A sub-unit used to determine the first matching vector corresponding to the similarity problem based on the first predicted sub-vector and the second predicted sub-vector. Furthermore, the adjustment unit is configured to adjust the parameters of the first initial sub-model and the second initial sub-model based on the label and the predicted similarity.
10. The apparatus according to claim 9, wherein, The sample data also includes first response information corresponding to the similar questions, and second response information corresponding to the standard questions. Furthermore, the first acquisition subunit is further configured to input the similar question, the third reference information, and the first response information into the initial feature extraction model to obtain a first matching vector corresponding to the similar question; and The second acquisition subunit is further configured to input the standard question, the fourth reference information and the second response information into the auxiliary model to obtain the second matching vector corresponding to the standard question.
11. An electronic device, characterized in that, include: At least one processor; as well as A memory that is communicatively connected to the at least one processor; in The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1-6.
12. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-6.
13. A computer program product, comprising a computer program, characterized in that, The computer program, when executed by a processor, implements the method according to any one of claims 1-6.
Citation Information
Patent Citations
Intelligent question answering method and device based on natural language processing, equipment and medium
CN113312461A
Dialogue response and response strategy matching model training method and device
CN113326359A
Emotion-fused dialogue response method and device, terminal and storage device
CN114595314A
