Session interaction method and device, electronic equipment and storage medium
By optimizing the input optimization model based on a bidirectional autoregressive model, the challenge of personalized and professional responses in conversational interactions using natural language models is solved, achieving low-cost and efficient personalized and professional responses.
Patent Information
- Application Number
- CN202511144428.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-15
- Publication Date
- 2025-11-21
AI Technical Summary
Existing natural language models struggle to provide personalized and professional responses in conversational interactions, and they also suffer from high training costs and long response delays.
An input optimization model based on a bidirectional autoregressive model is used to optimize the text to be replied to. The target text output by the input optimization model is used as the prompt text to guide the natural language model to generate a more appropriate reply, thereby reducing the training cost of the natural language model.
While reducing training and system operation costs, it improves the professionalism and personalization of conversation responses, thereby increasing response speed and user satisfaction.
Smart Images

Figure CN120994791A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent model technology, and in particular to a conversational interaction method, device, electronic device, and storage medium. Background Technology
[0002] In terms of conversational interaction, the addition of natural language models has significantly improved the naturalness of conversational interaction and the richness of knowledge reserves. However, with the development of natural language model technology, people have put forward higher requirements for the personalization and specialization of natural language models.
[0003] Current technologies typically employ a combination of natural language models and retrieval-enhanced generation techniques. This involves semantically retrieving the user-input text from a database, then inputting the search results along with the original text into the natural language model to generate a precise response. However, this approach struggles to learn user preferences and thus fails to provide truly personalized and professional answers. On the other hand, combining a local natural language model with knowledge base retrieval requires fine-tuning with specific data, resulting in high training costs. Furthermore, limitations in hardware performance and computing resources lead to significant response latency and slow response times. Summary of the Invention
[0004] This invention provides a conversational interaction method, apparatus, electronic device, and storage medium to improve the professionalism and personalization of conversational responses while ensuring low training and inference costs.
[0005] In a first aspect, embodiments of the present invention provide a session interaction method, the method comprising:
[0006] The text to be replied to is determined and input into the input optimization model to obtain the target text output by the input optimization model;
[0007] The input optimization model is obtained by training a bidirectional autoregressive model.
[0008] The target text is used as the prompt text and input into the natural language model to obtain the target response output by the natural language model.
[0009] Secondly, embodiments of the present invention also provide a conversational interaction device, the device comprising:
[0010] An input optimization module is used to determine the text to be replied to and input the text to be replied to into the input optimization model to obtain the target text output by the input optimization model;
[0011] The input optimization model is obtained by training a bidirectional autoregressive model.
[0012] The conversational interaction module is used to input the target text as prompt text into the natural language model and obtain the target response output by the natural language model.
[0013] Thirdly, embodiments of the present invention also provide an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the session interaction method as described in any of the embodiments of the present invention.
[0014] Fourthly, embodiments of the present invention also provide a storage medium for storing computer-executable instructions, which, when executed by a computer processor, are used to perform a session interaction method as described in any of the embodiments of the present invention.
[0015] The technical solution of this invention involves training an input optimization model based on a bidirectional autoregressive model. The text to be replied to is input into the input optimization model, which optimizes the text to obtain the target text. This target text is then input as a prompt text into a natural language model, resulting in the target reply output by the natural language model. This embodiment uses a bidirectional autoregressive model for training the input optimization model. Since the bidirectional autoregressive model has relatively few parameters, it eliminates the need to train the natural language model itself, reducing training costs and system operating costs. Furthermore, the input optimization model optimizes the text to be replied to, guiding the natural language model to output a more suitable reply, thus improving the professionalism and personalization of the response.
[0016] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of a conversational interaction method provided in Embodiment 1 of the present invention;
[0019] Figure 2 This is a flowchart of a conversational interaction method provided in Embodiment 2 of the present invention;
[0020] Figure 3This is a schematic diagram of a conversational interaction system provided in Embodiment 2 of the present invention;
[0021] Figure 4 This is a schematic diagram of the structure of a conversational interaction device provided in Embodiment 3 of the present invention;
[0022] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 4 of the present invention. Detailed Implementation
[0023] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or device that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or devices. In the embodiments of this application, certain software, components, models, and other existing industry solutions may be mentioned. These should be considered exemplary, intended only to illustrate the feasibility of implementing the technical solutions of this application, and do not imply that the applicant has already used or necessarily used such solutions.
[0025] The acquisition, transmission, storage, use, and processing of data in this application all comply with the relevant provisions of national laws and regulations.
[0026] Example 1
[0027] Figure 1 The flowchart below provides a conversational interaction method according to Embodiment 1 of the present invention. This embodiment is applicable to situations involving conversational interaction, typically in scenarios such as intelligent customer service, emotional companionship, and professional consultation (psychological counseling, medical consultation, etc.). This method can be executed by a conversational interaction device, which can be implemented in hardware and / or software and can be configured in a server.
[0028] like Figure 1 As shown, the method includes:
[0029] S110. Determine the text to be replied to, and input the text to be replied to into the input optimization model to obtain the target text output by the input optimization model.
[0030] In this embodiment, the text to be replied to is the user-input text. Compared with the prior art, which directly uses the user-input text as the prompt text for the natural language model, this embodiment optimizes the input of the text to be replied to, guiding the natural language model to output a more appropriate reply.
[0031] The input optimization model is trained based on a bidirectional autoregressive (BART) model, also known as the Bidirectional Auto-Regressive Transformer. BART is a Transformer-based sequence-to-sequence (seq2seq) model that includes a bidirectional encoder and an autoregressive decoder. During training, BART first perturbs the input text, then trains the model to reconstruct the input text, enabling it to learn a deep semantic representation of the text. Furthermore, this embodiment can employ the BART-tiny model, a type of BART model with fewer parameters.
[0032] The target text is the text obtained by the input optimization model after performing semantic understanding and translation on the input text to be replied to.
[0033] In this embodiment, instead of training a natural language model, an input optimization model with fewer parameters is trained, reducing model training costs and system operating costs. Simultaneously, by understanding, translating, and reconstructing the text to be replied to through the input optimization model, the natural language model is guided to generate more appropriate responses, indirectly adjusting the inference results of the natural language model. This achieves improved conversational interaction at a lower cost.
[0034] In an optional embodiment, inputting the text to be replied to into the input optimization model to obtain the target text output by the input optimization model may include:
[0035] Determine the personalized matrix parameters corresponding to the response object that matches the text to be replied to;
[0036] The input optimization model is updated based on the personalized matrix parameters;
[0037] The text to be replied to is input into the updated input optimization model to obtain the target text output by the input optimization model.
[0038] The respondent can be a person or a system other than a conversational interaction system. The personalization matrix parameters represent the respondent's preference characteristics during conversational interaction; different respondents may have different personalization matrix parameters.
[0039] Furthermore, personalized matrix parameters can be set for each response to enhance the personalization capability of the input optimization model, enabling personalized optimization for different response recipients and improving their experience and satisfaction. Alternatively, different response recipient types can be pre-defined, with different personalized matrix parameters set for each type, while a single set of personalized matrix parameters can be reused for response recipients of the same type. This approach further reduces the number of parameters that need to be trained and improves response speed.
[0040] Furthermore, if it is determined that there is no personalized matrix parameter corresponding to a reply object that matches the text to be replied to, then a personalized matrix is created for the reply object that matches the text to be replied to, and the personalized matrix is initialized to a blank matrix.
[0041] Understandably, if the respondent is interacting with the client for the first time, and the personalized matrix parameters for that respondent are not yet stored in the optimization model, a personalized matrix will be created for that respondent and initialized as a blank matrix. As subsequent target responses are generated, the personalized matrix parameters for that respondent will be updated based on the respondent's evaluation of the target response. When the respondent interacts with the client again, its personalized matrix parameters can be directly retrieved.
[0042] In this embodiment, personalized matrix parameters for each reply object or reply object type can be stored in a hot-swappable matrix group. On one hand, the hot-swappable matrix group allows for the direct insertion or removal of matrix parameters without restarting, facilitating updates or additions to matrix parameters as the session interaction system continues to run, thus improving the flexibility and maintenance efficiency of the system. On the other hand, the hot-swappable matrix group offers fast and low-cost parameter loading, enhancing the response speed of session interactions.
[0043] In this embodiment, the personalized matrix parameters of the response object are updated into the input optimization model by addition. The original matrix parameters of the input optimization model are frozen, and the personalized matrix parameters are added to the original matrix parameters of the input optimization model to ensure the loading speed of parameters. The text to be replied to is input into the updated input optimization model, which performs semantic understanding and translation on the text to be replied to, and outputs the target text.
[0044] In this embodiment, by designing an input optimization model, personalized matrix parameters are added to the BART-tiny model to achieve personalized optimization for different response objects. As the input optimization model is continuously updated and the personalized matrix parameters are continuously adjusted, the adaptability of the input optimization model to different response objects can be continuously improved, thereby increasing the satisfaction of the response objects.
[0045] Furthermore, the personalized matrix parameters include a first matrix parameter and a second matrix parameter, wherein the first matrix and the second matrix are obtained by matrix decomposition based on the personalized matrix.
[0046] In this embodiment, to further reduce the number of parameters, improve the model training speed, and reduce the model training cost and the operating cost of the conversation interaction system, the principle of matrix factorization is adopted to perform matrix factorization on the personalized matrix.
[0047] Specifically, the dimension of the personalization matrix should be consistent with that of the parameter matrix of the BART-tiny model. For example, if the parameter matrix W of the BART-tiny model has a dimension of r×n, the dimension of the personalization matrix should also be r×n. Matrix decomposition of the personalization matrix yields the first matrix U. m Second matrix U m ' The personalized matrix satisfies the following relationship with the first and second matrices: ΔW P =U m ·(U m ' ) T , where ΔW P This represents the personalized matrix. At this point, the first matrix U... m The dimension is r×k, and the second matrix U m ' The dimension is k×n, where k is a hyperparameter, which is less than the maximum value of r and n.
[0048] In this embodiment, matrix decomposition is used to replace high-dimensional matrices with low-dimensional matrix multiplication, which can effectively reduce the number of parameters.
[0049] In another optional embodiment, inputting the text to be replied to into the input optimization model to obtain the target text output by the input optimization model may further include:
[0050] Determine the professional matrix parameters that match the text to be replied to;
[0051] The input optimization model is updated based on the professional matrix parameters;
[0052] The text to be replied to is input into the updated input optimization model to obtain the target text output by the input optimization model.
[0053] This embodiment not only provides personalized responses to the respondent based on personalized matrix parameters, but also provides a way to achieve personalized optimization for different scenarios based on professional matrix parameters.
[0054] The professional matrix parameters represent the industry, scenario, or domain characteristics of the text to be replied to, such as finance or healthcare. A single set of professional matrix parameters can be used within the same industry or scenario.
[0055] In this embodiment, determining the professional matrix parameters that match the text to be replied to can be done by extracting and matching keywords from the text to be replied to, determining the industry or scenario to which the text to be replied to belongs, and then determining the professional matrix parameters that match that industry or scenario. Alternatively, the professional matrix parameters can be determined in response to the industry or scenario selected by the recipient.
[0056] Furthermore, if it is determined that there is no professional matrix parameter that matches the text to be replied to, then the conversation scenario that matches the text to be replied to is determined.
[0057] Create a professional matrix for the aforementioned session scenario and initialize the professional matrix as a blank matrix.
[0058] Understandably, when a conversation is first initiated in a given scenario, the input optimization model may not contain the corresponding professional matrix parameters. In this case, a new professional matrix is created for that scenario and initialized as a blank matrix. As the target response is subsequently generated and the professional matrix is updated, the latest professional matrix can be directly obtained when the conversation is initiated again in that scenario.
[0059] Similarly, professional matrix parameters can be stored in hot-swappable matrix groups. By using hot-swappable matrix groups to store both personalized and professional matrix parameters, high loading speed is maintained while keeping the number of parameters low. The combination of personalized and professional matrix parameters enables personalized optimization of session interaction and enhancement of professional capabilities.
[0060] Similarly, the professional matrix parameters are updated by addition to the input optimization model. The original matrix parameters of the input optimization model are frozen, and the professional matrix parameters are added to them, ensuring fast parameter loading. The text to be replied to is then input into the updated input optimization model, which performs semantic understanding and translation on the text to be replied to, and outputs the target text.
[0061] In this embodiment, professional optimization for different scenarios and industries is achieved through professional matrix parameters. Professional matrix parameters for the same scenario and industry can be reused to ensure the professionalism and style consistency of responses in the same scenario or industry.
[0062] Furthermore, this embodiment can select one of the personalized matrix parameters and the professional matrix parameters, or a combination thereof, according to actual needs, and update the input optimization model by adding them together to achieve personalized optimization of conversation interaction and improvement of professional capabilities.
[0063] Furthermore, the professional matrix parameters include a third matrix parameter and a fourth matrix parameter, wherein the third matrix and the fourth matrix are obtained by matrix decomposition based on the professional matrix.
[0064] Similarly, in order to further reduce the number of parameters, improve the model training speed, and reduce the model training cost and the operating cost of the conversation interaction system, the principle of matrix factorization was adopted to perform matrix factorization on the professional matrix.
[0065] Specifically, the dimensions of the specialty matrix should be consistent with those of the parameter matrix of the BART-tiny model. For example, if the parameter matrix W of the BART-tiny model has dimensions r×n, the dimensions of the specialty matrix should also be r×n. Matrix decomposition of the specialty matrix yields a third matrix M and a fourth matrix M. ' The professional matrix satisfies the following relationship with the third and fourth matrices: ΔW S =M·(M ' ) T , where ΔW S This represents the professional matrix. At this point, the dimension of the third matrix M is r×k, and the fourth matrix M... ' The dimension is k×n, where k is a hyperparameter, which is less than the maximum value of r and n.
[0066] The professional matrix parameters and personalized matrix parameters are added together to update the input optimization model. The matrix parameters of the input optimization model are: W t =W+ΔW S +ΔW P W t Here, W represents the matrix parameters of the updated input optimization model, and W represents the original matrix parameters of the BART-tiny model. The original matrix parameters of the BART-tiny model are frozen and only participate in the calculation during model inference, but are not updated when the input optimization model is updated.
[0067] S120. The target text is used as prompt text and input into the natural language model to obtain the target response output by the natural language model.
[0068] After the target text is output from the optimization model, it is used as a prompt and input into the natural language model. The natural language model can combine search enhancement generation or knowledge base to generate the target response.
[0069] After each target response is received, the professional matrix parameters and / or personalized matrix parameters involved in this round of conversation interaction can be updated based on the respondent's evaluation of the target response. This allows for adjustments to the response output with a relatively small number of parameters. Simultaneously, as the professional matrix parameters are continuously optimized and updated, the target text output by the input optimization model becomes more professional, leading to a more professional response from the natural language model. Furthermore, as the personalized matrix parameters are continuously updated and optimized, the target text output by the input optimization model receives more personalized hints as the respondent uses the model, resulting in a more personalized response from the natural language model.
[0070] The technical solution of this invention involves training an input optimization model based on a bidirectional autoregressive model. The text to be replied to is input into the input optimization model, which optimizes the text to obtain the target text. This target text is then input as a prompt text into a natural language model, resulting in the target reply output by the natural language model. This embodiment uses a bidirectional autoregressive model for training the input optimization model. Since the bidirectional autoregressive model has relatively few parameters, it eliminates the need to train the natural language model itself, reducing training costs and system operating costs. Furthermore, the input optimization model optimizes the text to be replied to, guiding the natural language model to output a more suitable reply, thus improving the professionalism and personalization of the response.
[0071] Example 2
[0072] Figure 2 This is a flowchart of a conversational interaction method provided in Embodiment 2 of the present invention. Based on the above embodiments, the present invention further specifies the input optimization process and adds a step of updating the matrix parameters of the input optimization model based on the evaluation results of the target response.
[0073] like Figure 2 As shown, the method includes:
[0074] S210. Confirm the text to be replied to.
[0075] S220. Determine the personalized matrix parameters corresponding to the reply object that matches the text to be replied to.
[0076] S230. Update the input optimization model based on the personalized matrix parameters.
[0077] S240. Determine the professional matrix parameters that match the text to be replied to.
[0078] S250. Update the input optimization model based on the professional matrix parameters.
[0079] S260. Input the text to be replied to into the updated input optimization model to obtain the target text output by the input optimization model.
[0080] S270. The target text is used as prompt text and input into the natural language model to obtain the target response output by the natural language model.
[0081] The process of updating the input optimization model based on personalized matrix parameters and professional matrix parameters, then processing the text to be replied to through the input optimization model to obtain the target text, and inputting the target text into the natural language model to obtain the target reply has been described in the above embodiments, and will not be repeated here.
[0082] S280. Determine the evaluation results of the target response output by the natural language model.
[0083] The evaluation result can be obtained by the respondent evaluating the target response. Specifically, after outputting the target response, an evaluation interface is provided to the respondent, allowing them to evaluate the target response. For example, a rating system, such as 0-5 or 0-10, can be used for evaluation.
[0084] Alternatively, the target response can be evaluated using a natural language model that outputs the target response, or other natural language models. For example, you could input "Please rate your response across the dimensions of professionalism, personalization, and user comprehension, with a maximum score of 5 points. Output only the numerical result" into the natural language model that outputs the target response, and obtain the numerical evaluation result from the natural language model.
[0085] Alternatively, the target response may not be evaluated in this round of conversation, and the matrix parameters may not be updated. This embodiment does not impose any restrictions on this.
[0086] Furthermore, when the respondent does not evaluate the target response, a random number generator can be used to generate a random number to determine whether to evaluate using a natural language model or not. Specifically, a threshold (e.g., 5) is preset. A random number generator generates a random number; if the generated random number is greater than or equal to the threshold, then the natural language model evaluates the response; otherwise, no evaluation is performed.
[0087] S290. Based on the evaluation results of the target response, update the personalized matrix parameters and / or professional matrix parameters of the input optimization model.
[0088] In this embodiment, since personalized matrix parameters and / or professional matrix parameters are saved in the hot-swappable matrix group, the matrix parameters can be updated quickly.
[0089] Furthermore, personalized and / or professional matrix parameters can be updated in real time to maintain the optimal personalized and professional performance of the input optimization model. Update periods can also be set, such as periods with low session interaction frequency (0:00-5:00 AM, etc.), saving evaluation results from each session interaction and updating matrix parameters uniformly during these periods. Resource usage can also be monitored; matrix parameter updates can be performed uniformly when resources are redundant, such as when CPU utilization is less than 60% or memory utilization is less than 50%.
[0090] Figure 3 A schematic diagram of a conversational interaction system is provided, such as... Figure 3 As shown, the conversational interaction system includes a hot-pluggable matrix group, an input optimization model, a natural language model, and an evaluation module. In the conversational interaction system, user m (the respondent) inputs the text to be replied to, `inputtokens`, into the input optimization model. The input optimization model determines whether user m is a new user. If so, it creates a new personalized matrix for m and initializes it as a blank matrix; otherwise, it directly obtains user m's personalized matrix from the hot-pluggable matrix group. Simultaneously, it determines whether the current conversation scenario is a new conversation scenario. If so, it creates a new professional matrix for m and initializes it as a blank matrix; otherwise, it directly obtains the professional matrix for the current conversation scenario from the hot-pluggable matrix group. The professional matrix parameters and personalized matrix parameters are updated into the input optimization model by addition. The BART model parameters of the input optimization model itself are frozen and only participate in the calculation process during model inference; only the professional matrix parameters and personalized matrix parameters are updated. The input optimization model obtains the target text, `outputtokens`, based on the text to be replied to, calls the natural language model interface, inputs the `outputtokens` into the natural language model, and obtains the target reply. The evaluation module provides an evaluation interface. If user m evaluates the target response, the personalized matrix parameters and professional matrix parameters are trained in reverse using the evaluation result. If user m does not evaluate, the natural language model can evaluate, and the matrix parameters are trained in reverse in the same way. Alternatively, if no evaluation is performed, no reverse training is performed in this round.
[0091] The technical solution in this embodiment, through the design of the input optimization model, adds professional matrix parameters and personalized matrix parameters to the BART-tiny model, achieving professional enhancement for different conversation scenarios and personalized optimization for different response objects. Professional matrix parameters for the same conversation scenario can be reused, and personalized matrix parameters are updated for each or each type of response object, reducing the number of training parameters and improving the applicability of the input optimization model. Simultaneously, professional and personalized matrix parameters are stored in a hot-swappable matrix group, enabling rapid parameter loading. Building upon the small size and low parameter count of the BART-tiny model itself, matrix decomposition is employed to further reduce the number of parameters and improve parameter loading speed, achieving hot-swappable loading of matrix parameters and improving the operating speed of the conversation interaction system. Furthermore, the conversation interaction system does not require training the natural language model; only the matrix parameters with a small parameter count need to be trained, resulting in low system operating costs and achieving black-box tuning without changing the natural language model parameters.
[0092] Example 3
[0093] Figure 4 This is a schematic diagram of the structure of a conversational interaction device provided in Embodiment 3 of the present invention. Figure 4 As shown, the device includes:
[0094] The input optimization module 310 is used to determine the text to be replied to and input the text to be replied to into the input optimization model to obtain the target text output by the input optimization model.
[0095] The input optimization model is obtained by training a bidirectional autoregressive model.
[0096] The conversational interaction module 320 is used to input the target text as prompt text into the natural language model and obtain the target response output by the natural language model.
[0097] The technical solution of this invention involves training an input optimization model based on a bidirectional autoregressive model. The text to be replied to is input into the input optimization model, which optimizes the text to obtain the target text. This target text is then input as a prompt text into a natural language model, resulting in the target reply output by the natural language model. This embodiment uses a bidirectional autoregressive model for training the input optimization model. Since the bidirectional autoregressive model has relatively few parameters, it eliminates the need to train the natural language model itself, reducing training costs and system operating costs. Furthermore, the input optimization model optimizes the text to be replied to, guiding the natural language model to output a more suitable reply, thus improving the professionalism and personalization of the response.
[0098] Based on the above embodiments, optionally, the input optimization module 310 includes:
[0099] A personalized matrix parameter determination unit is used to determine the personalized matrix parameters corresponding to the reply object that matches the text to be replied to;
[0100] The first input optimization model update unit is used to update the input optimization model according to the personalized matrix parameters;
[0101] The first text input unit is used to input the text to be replied to into the updated input optimization model to obtain the target text output by the input optimization model.
[0102] Based on the above embodiments, optionally, the personalized matrix parameter determination unit is specifically used for:
[0103] If it is determined that there is no personalized matrix parameter corresponding to a reply object that matches the text to be replied to, then a personalized matrix is created for the reply object that matches the text to be replied to, and the personalized matrix is initialized to a blank matrix.
[0104] Based on the above embodiments, optionally, the input optimization module 310 includes:
[0105] A professional matrix parameter determination unit is used to determine the professional matrix parameters that match the text to be replied to;
[0106] The second input optimization model update unit is used to update the input optimization model according to the professional matrix parameters;
[0107] The second text input unit is used to input the text to be replied to into the updated input optimization model to obtain the target text output by the input optimization model.
[0108] Based on the above embodiments, optionally, the professional matrix parameter determination unit is specifically used for:
[0109] If it is determined that there is no professional matrix parameter that matches the text to be replied to, then the conversation scenario that matches the text to be replied to is determined.
[0110] Create a professional matrix for the aforementioned session scenario and initialize the professional matrix as a blank matrix.
[0111] Based on the above embodiments, optionally, the personalized matrix parameters include a first matrix parameter and a second matrix parameter, wherein the first matrix and the second matrix are obtained by matrix decomposition based on the personalized matrix;
[0112] The professional matrix parameters include a third matrix parameter and a fourth matrix parameter, wherein the third matrix and the fourth matrix are obtained by matrix decomposition based on the professional matrix.
[0113] Optionally, based on the above embodiments, the device may further include:
[0114] The target response evaluation module is used to determine the evaluation result of the target response output by the natural language model;
[0115] The matrix parameter update module is used to update the personalized matrix parameters and / or professional matrix parameters of the input optimization model based on the evaluation results of the target response.
[0116] The conversational interaction device provided in the embodiments of the present invention can execute the conversational interaction method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0117] Example 4
[0118] Figure 5 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, 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 (e.g., helmets, glasses, watches, etc.), 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 invention described and / or claimed herein.
[0119] like Figure 5 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0120] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0121] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as session interaction methods.
[0122] In some embodiments, the session interaction method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the session interaction method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the session interaction method by any other suitable means (e.g., by means of firmware).
[0123] 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.
[0124] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to the processor of a general-purpose computer, a special-purpose computer, or other programmable session interaction device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0125] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. 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 fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0126] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. 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).
[0127] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users 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., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0128] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0129] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and no limitation is imposed herein.
[0130] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A conversational interaction method, characterized in that, include: The text to be replied to is determined and input into the input optimization model to obtain the target text output by the input optimization model; The input optimization model is obtained by training a bidirectional autoregressive model. The target text is used as the prompt text and input into the natural language model to obtain the target response output by the natural language model.
2. The method according to claim 1, characterized in that, The text to be replied to is input into the input optimization model to obtain the target text output by the input optimization model, including: Determine the personalized matrix parameters corresponding to the response object that matches the text to be replied to; The input optimization model is updated based on the personalized matrix parameters; The text to be replied to is input into the updated input optimization model to obtain the target text output by the input optimization model.
3. The method according to claim 2, characterized in that, Determine the personalized matrix parameters corresponding to the response object that matches the text to be replied to, including: If it is determined that there is no personalized matrix parameter corresponding to a reply object that matches the text to be replied to, then a personalized matrix is created for the reply object that matches the text to be replied to, and the personalized matrix is initialized to a blank matrix.
4. The method according to claim 2, characterized in that, The process of inputting the text to be replied to into the input optimization model to obtain the target text output by the input optimization model also includes: Determine the professional matrix parameters that match the text to be replied to; The input optimization model is updated based on the professional matrix parameters; The text to be replied to is input into the updated input optimization model to obtain the target text output by the input optimization model.
5. The method according to claim 4, characterized in that, Determine the professional matrix parameters that match the text to be replied to, including: If it is determined that there is no professional matrix parameter that matches the text to be replied to, then the conversation scenario that matches the text to be replied to is determined. Create a professional matrix for the aforementioned session scenario and initialize the professional matrix as a blank matrix.
6. The method according to claim 4, characterized in that, The personalized matrix parameters include a first matrix parameter and a second matrix parameter, wherein the first matrix and the second matrix are obtained by matrix decomposition based on the personalized matrix; The professional matrix parameters include a third matrix parameter and a fourth matrix parameter, wherein the third matrix and the fourth matrix are obtained by matrix decomposition based on the professional matrix.
7. The method according to claim 4 or 6, characterized in that, After obtaining the target response output by the natural language model, the process also includes: Determine the evaluation results of the target response output by the natural language model; Based on the evaluation results of the target response, the personalized matrix parameters and / or professional matrix parameters of the input optimization model are updated.
8. A conversational interaction device, characterized in that, include: An input optimization module is used to determine the text to be replied to and input the text to be replied to into the input optimization model to obtain the target text output by the input optimization model; The input optimization model is obtained by training a bidirectional autoregressive model. The conversational interaction module is used to input the target text as prompt text into the natural language model and obtain the target response output by the natural language model.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the session interaction method as described in any one of claims 1-7.
10. A storage medium for storing computer-executable instructions, characterized in that, The computer-executable instructions, when executed by a computer processor, are used to perform the session interaction method as described in any one of claims 1-7.