Interactive data processing method for accompanying assistant and electronic equipment
By acquiring multi-dimensional user information and continuously fine-tuning the pre-trained large language model, personalized response content is generated, solving the problem of homogenized response content in user interaction and improving user experience and model adaptability.
Patent Information
- Application Number
- CN202510920310.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-03
- Publication Date
- 2025-11-21
AI Technical Summary
In existing technologies, when users interact with AI agents, the responses rely excessively on prompts provided by large model developers, resulting in homogenized dialogues and a poor user experience.
By acquiring multi-dimensional user information, generating multi-dimensional dialogue samples, and continuously fine-tuning the pre-trained large language model, personalized response content is obtained, thereby improving the model's accuracy and personalization.
It improves the accuracy of personalized responses during user interaction, enhances the user experience, reduces reliance on prompt words, and strengthens the model's personalized adaptability.
Smart Images

Figure CN120994768A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and in particular to an interaction data processing method for a companion assistant and an electronic device. BACKGROUND
[0002] In recent years, with the rapid development of artificial intelligence and natural language processing technology, products related to human-computer interaction have brought many conveniences to the work and life of users. Therefore, how to provide users with more intelligent and personalized artificial intelligence agents has become a key research problem in the industry.
[0003] In related technologies, in the interaction process between a user and an artificial intelligence agent, the user's input content is combined to obtain a reply to the user's content using a general interaction large model mainly relying on a prompt word driven mode. However, this mode excessively depends on the dependent words provided by the large model developers, and therefore the reply content may be for a certain type of person, leading to homogenization of the generated dialogue, resulting in a large difference between the final reply content to the user and the expected reply content of the user, and causing poor user experience.
[0004] Therefore, how to improve the accuracy of the user's reply content while meeting the performance of the large model and improve the user experience has become a problem to be solved. SUMMARY
[0005] The embodiments of the present application provide an interaction data processing method for a companion assistant and an electronic device, which improves the accuracy of the user's reply content and further improves the user experience.
[0006] In a first aspect, the embodiments of the present application provide an interaction data processing method for a companion assistant, comprising:
[0007] In response to an interaction operation of a target user, multi-dimensional user information of the target user is obtained;
[0008] A user data layer object is obtained according to the multi-dimensional user information and the companion assistant;
[0009] User sample interaction information is obtained, and a sample generation operation is performed according to the sample interaction information and the user data layer object to obtain a plurality of multi-dimensional dialogue samples;
[0010] In response to an adjustment operation of the target user on the plurality of multi-dimensional dialogue samples, to-be-input dialogue data is obtained;
[0011] A pre-trained large language model is continuously and cyclically fine-tuned according to the to-be-input dialogue data and a preset loss function to obtain a fine-tuned large language model;
[0012] deploy the fine-tuned large language model into the companion assistant to obtain a target companion assistant;
[0013] obtain target user input information, and input the target user input information into the target companion assistant to obtain personalized reply content.
[0014] The method for processing interaction data of a companion assistant provided in the embodiments of the present application obtains a plurality of multi-dimensional dialogue samples based on multi-dimensional user information collected through user-authorized interaction operations, sends the dialogue samples to a user for review, obtains adjusted to-be-input dialogue data of the plurality of multi-dimensional dialogue samples in response to an adjustment operation of the target user, continuously and cyclically fine-tunes a pre-trained large model according to the to-be-input dialogue data and a preset loss function, obtains a fine-tuned large language model, and deploys the fine-tuned large language model into the target companion assistant, so that the final target companion assistant is more in line with the interaction needs of the target user, thereby improving the accuracy of personalized reply content and eliminating the need for the user to input too many prompt words in the later interaction process, ensuring the performance of the target companion assistant and improving the user experience.
[0015] In a possible implementation, the multi-dimensional user information includes user static information, dynamic behavior data, and personalized demand information, and the companion assistant is deployed with a natural language processing model and a machine learning model. Accordingly, obtaining a user data layer object according to the multi-dimensional user information and the companion assistant includes: extracting static features according to the user static information and the natural language processing model; extracting interaction personalized features according to the dynamic behavior data and the natural language processing model; extracting special demand features according to the personalized demand information and the natural language processing model; and deriving a user data layer object according to the static features, the interaction personalized features, the special demand features, and the machine learning model. Thus, the derived user data layer object is more in line with the target user himself, providing a user data layer object that can better meet the needs of the target user for subsequent generation of multi-dimensional dialogue samples, thereby improving the sample quality of the multi-dimensional dialogue samples.
[0016] In a possible implementation, performing a sample generation operation according to the sample interaction information and the user data layer object to obtain a plurality of multi-dimensional dialogue samples includes repeatedly simulating interaction operations from multiple dimensions according to the user sample interaction information and the user data layer object and an agent in the companion assistant to obtain a plurality of multi-dimensional dialogue samples. Thus, the plurality of multi-dimensional dialogue samples obtained can improve the fit of the plurality of multi-dimensional dialogue samples obtained after the repeated simulation interaction operations to the target user according to different features and attributes in the user data layer object.
[0017] In a possible implementation, the response to the target user's adjustment operation on the plurality of multi-dimensional dialogue samples to obtain the to-be-input dialogue data includes: in response to the user reviewing the plurality of multi-dimensional dialogue samples to divide the plurality of multi-dimensional dialogue samples into first multi-dimensional dialogue samples that do not conform to the user's individual characteristics and second multi-dimensional dialogue samples that conform to the user's individual characteristics, and generating user feedback; performing dialogue adjustment on the first multi-dimensional dialogue samples according to the user feedback to obtain third multi-dimensional dialogue samples; and performing expansion processing on the first multi-dimensional dialogue samples and the third multi-dimensional dialogue samples to obtain to-be-input dialogue samples, wherein the number of the to-be-input dialogue samples is greater than the sum of the number of the first multi-dimensional dialogue samples and the number of the third multi-dimensional dialogue samples. Thus, the dialogue content in the obtained to-be-input dialogue samples are all samples that conform to the user's individual characteristics, providing more accurate samples for subsequent model fine-tuning.
[0018] In a possible implementation, the continuously cyclically fine-tuning the pre-trained large language model according to the to-be-input dialogue data and a preset loss function to obtain a fine-tuned large language model includes: dividing the to-be-input dialogue data into a training set and an evaluation set according to a preset proportion; fine-tuning model training the pre-trained large language model according to the training set to obtain an intermediate large language model; performing model evaluation processing on the intermediate large language model according to the evaluation set to obtain a user individuality simulation performance index; when it is detected that the user individuality simulation performance index does not meet a standard, obtaining user adjustment supplement information, supplementing the user adjustment supplement information to multi-dimensional user information of the target user, and then jumping to the step of obtaining the user data layer object according to the multi-dimensional user information and the companion assistant to perform a cycle until the user individuality performance index meets the standard, so as to take the intermediate large language model obtained in the last cycle as the fine-tuned large language model. Thus, the fine-tuned large language model obtained finally is a model that has passed training of the training set and evaluation of the evaluation set, and therefore the performance of the fine-tuned large language model is more reliable.
[0019] In a possible implementation, the fine-tuning model training the pre-trained large language model according to the training set to obtain an intermediate large language model includes: fine-tuning model training the pre-trained large language model by inserting a low-rank matrix into the pre-trained large language model according to the training set to obtain the intermediate large language model. Thus, the parameter amount required for fine-tuning model training is reduced, the efficiency of model fine-tuning is improved, and overfitting of the intermediate large language model is avoided.
[0020] In a possible implementation, the method further includes: obtaining historical interaction data of the target user; generating an active greeting according to the historical interaction data, and performing an interactive operation with the target user according to the active greeting to obtain new interaction information; performing complex question recognition processing according to the new interaction information to obtain complex question interaction data; inputting the complex question interaction data into an expert model to generate to-be-replied information; and inputting the to-be-replied information into the target companion assistant to obtain complex question reply content. The above scheme processes complex questions through an expert model with stronger interaction performance, improves the fault tolerance and complex question processing efficiency of the target companion assistant, and further makes the user feel valued through the active greeting, and is more willing to interact with the target companion assistant, thereby improving the user experience.
[0021] In a possible implementation, the method further includes: in response to a subsequent interactive operation of the target user, obtaining updated user information of the target user in real time; storing the updated user information into a preset memory module to supplement the updated user information into the multi-dimensional user information, and jumping to the step of obtaining the user data layer object according to the multi-dimensional user information and the companion assistant. Therefore, the adjustment of the fine-tuning model is performed again based on the updated user information of the target user, so as to improve the interaction performance of the target companion assistant and improve the interactive experience of the user.
[0022] In a possible implementation, the method further includes: in response to an assistant sharing operation of the target user, uploading the target companion assistant to a model sharing platform to enable other users to use the target companion assistant to interact; and adding a voice interaction function link and a task image function link in the target companion assistant to generate a digital human companion assistant. Therefore, when the user interacts with the digital human companion assistant, the user is provided with a more immersive and real interactive experience, and the target companion assistant can also be uploaded to the model sharing platform to provide a reference model for other users, thereby reducing the model training cost and time of other users similar to the target user.
[0023] In a second aspect, the embodiments of the present application further provide an electronic device, the electronic device comprising a memory and a processor;
[0024] The memory and the processor are coupled;
[0025] The memory is configured to store program instructions;
[0026] The processor is configured to invoke the program instructions to enable the electronic device to perform the method described in the first aspect.
[0027] The device provided by the embodiments of the present application provides more accurate and user demand meeting reply content for the user by performing the method described in the first aspect, and improves the user interactive experience. BRIEF DESCRIPTION OF DRAWINGS
[0028] Figure 1 is a flowchart of a method for processing interaction data of a companion assistant provided by an embodiment of the present application;
[0029] Figure 2 is a structural diagram of an apparatus for processing interaction data of a companion assistant provided by an embodiment of the present application;
[0030] Figure 3 is a structural diagram of an electronic device provided by an embodiment of the present application. DETAILED DESCRIPTION
[0031] Figure 1 is a flowchart of a method for processing interaction data of a companion assistant provided by an embodiment of the present application.
[0032] As shown in Figure 1 , the present application provides a method for processing interaction data of a companion assistant, comprising:
[0033] S101: In response to an interaction operation of a target user, obtaining multi-dimensional user information of the target user.
[0034] In this embodiment, the target user inputs the basic setting information of the role set by himself through the information collection intelligent agent in the companion assistant. At the same time, the target user obtains more detailed description information about himself by selecting his dynamic behavior data independently. The target user can also input the demand information for his own privacy protection and the non-universal value expression information. The above-mentioned basic setting information, dynamic behavior data, demand information for his own privacy protection and non-universal value expression information, etc. constitute the multi-dimensional user information which describes the target user from various dimensions.
[0035] S102: Obtaining a user data layer object according to the multi-dimensional user information and the companion assistant.
[0036] In this embodiment, a corresponding intelligent agent can be selected in the companion assistant. Based on the multi-dimensional user information obtained in step S101, the intelligent agent uses natural language processing technology and machine learning algorithm to deduce a complete user data layer object. The user layer data object can be a weight containing multi-dimensional labels such as static attributes, dynamic characteristics and personalized needs. The user layer data object can also be a virtual object used to simulate the target user. Through the simulation interaction between the user layer data object and the companion assistant, a large number of interaction dialogue samples in the tone of the target user can be generated.
[0037] In an optional embodiment of the present application, the multi-dimensional user information includes user static information, dynamic behavior data, and personalized demand information, and the companion assistant is deployed with a natural language processing model and a machine learning model; accordingly, step S102 specifically includes:
[0038] S102a: extracting static features according to the user static information and the natural language processing model.
[0039] In the present embodiment, the static features are extracted from the user static information such as user interests, hobbies, values, personal experiences, and personality characteristics, which are related to the target user, based on the LLM (Large Language Model) through the natural language processing model.
[0040] In an optional embodiment of the present application, the target user can be interacted with through a combination of structured questionnaires and open questions to obtain more comprehensive user static information.
[0041] S102b: extracting interactive personalized features according to the dynamic behavior data and the natural language processing model.
[0042] In the present embodiment, the dynamic behavior data can be data such as language style, emotional characteristics, thinking logic, and interaction mode of the user collected after authorization by the target user. By combining the detailed description selected by the target user with the chat records uploaded by the target user in interaction with others or other intelligent agents, interactive personalized features that can reflect the unique personality of the target user in daily communication are extracted.
[0043] S102c: extracting special demand features according to the personalized demand information and the natural language processing model.
[0044] In the present embodiment, the personalized demand information can be the requirement content of the target user's special attention to personal privacy protection and the value expression information that is different from other users. The fine-tuned large model needs to have sensitivity, respect, and accurately reflect the personalized demand of the target user that is different from other users.
[0045] S102d: deriving a user data layer object according to the static features, interactive personalized features, special demand features, and machine learning model.
[0046] In the present embodiment, the process of deriving the user data layer object can be to predict the future interaction behavior of the target user by using the machine learning model to extract the static features, interactive personalized features, and special demand features, and then to derive a more three-dimensional user portrait as the user data layer object.
[0047] S103: Obtain user sample interaction information, and perform sample generation operation based on the sample interaction information and user data layer object to obtain multiple multi-dimensional dialogue samples.
[0048] In this embodiment, the user sample interaction information can be interactive prompts provided by the user to generate dialogue samples or preset interactive start statements of various dimensions. Performing sample generation operations based on the sample interaction information and the user data layer object can automatically simulate dialogue with the companion assistant based on the sample interaction information and the user data layer object to obtain dialogue samples in different dimensions, serving as multiple multi-dimensional dialogue samples.
[0049] Based on the above embodiments, in an optional embodiment of this application, step S103 includes: repeatedly simulating interactive operations with the intelligent agent in the companion assistant from multiple dimensions based on user sample interaction information and user data layer objects, to obtain multiple multi-dimensional dialogue samples.
[0050] In this embodiment, multiple dimensions can represent various interaction scenarios set by the target user, such as inquiries about illness, financial management, equipment repair, computer technology, and daily communication. Repeatedly simulating interaction operations refers to simulating interactions between the target user and the intelligent agent, with multiple interactions performed for each dimension, ultimately resulting in multiple multi-dimensional dialogue samples.
[0051] S104: In response to the target user's adjustment operation on multiple multi-dimensional dialogue samples, obtain the dialogue data to be input.
[0052] In this embodiment, if the target user finds that some responses are significantly different from the responses they need after viewing multiple multi-dimensional dialogue samples, they can input adjustment content to adjust the multi-dimensional dialogue samples and obtain the final dialogue data to be input.
[0053] Specifically, in an optional embodiment of this application, step S104 includes:
[0054] S104a: In response to the target user's review of multiple multi-dimensional dialogue samples, the multiple multi-dimensional dialogue samples are divided into first multi-dimensional dialogue samples that do not conform to the user's personality characteristics and second multi-dimensional dialogue samples that conform to the user's personality characteristics, and user feedback is generated.
[0055] In this embodiment, the target user reviews each multi-dimensional dialogue sample one by one to determine whether there are any multi-dimensional dialogue samples that do not meet the user's expectations. Multi-dimensional dialogue samples that do not conform to the user's personality characteristics are stored as the first multi-dimensional dialogue sample, and vice versa. The user then inputs modification suggestions for the first multi-dimensional dialogue sample to generate user feedback.
[0056] S104b: dialogue adjustment is performed on the first multi-dimensional dialogue sample according to the user feedback, and a third multi-dimensional dialogue sample is obtained.
[0057] In this embodiment, the agent adjusts the dialogue of the first multi-dimensional dialogue sample according to the user feedback to modify part of the content in the first multi-dimensional dialogue sample, and obtains a third multi-dimensional dialogue sample.
[0058] S104c: extension processing is performed according to the first multi-dimensional dialogue sample and the third multi-dimensional dialogue sample, and a to-be-input dialogue sample is obtained, wherein the number of the to-be-input dialogue sample is greater than the sum of the number of the first multi-dimensional dialogue sample and the third multi-dimensional dialogue sample.
[0059] In this embodiment, the extension processing can be a process of greatly increasing the number of corresponding samples by expanding similar dialogue content data according to the original dialogue content through a large language model. For example, the sum of the number of the first multi-dimensional dialogue sample and the second multi-dimensional dialogue sample is 100, and after automatic extension processing by the large language model, 1000 to-be-input dialogue samples are output.
[0060] S105: continuously and cyclically fine-tuning the pre-trained large language model according to the to-be-input dialogue data and the preset loss function, to obtain a fine-tuned large language model.
[0061] In this embodiment, the preset loss function can be a loss function for training a large language model, such as an autoregressive cross-entropy loss, a masked language model loss, or a denoising autoencoder loss. Continuous and cyclic fine-tuning refers to the process of training and model evaluation of the pre-trained large language model in the process of continuous iteration and modification of model parameters, until a large language model that meets the evaluation requirements is obtained.
[0062] Specifically, in an optional embodiment of the present application, step S105 includes:
[0063] S105a: dividing the to-be-input dialogue data into a training set and an evaluation set according to a preset ratio.
[0064] In this embodiment, the preset ratio can be any ratio value in which the proportion of the training set is greater than that of the evaluation set, for example, 800 out of 1000 to-be-input dialogue data are used as the training set, and the remaining 200 are used as the evaluation set.
[0065] S105b: fine-tuning model training is performed on the pre-trained large language model according to the training set, and an intermediate large language model is obtained.
[0066] S105c: model evaluation processing is performed on the intermediate large language model according to the evaluation set, and a user individual simulation performance index is obtained.
[0067] S105d: When it is detected that the user personality simulation performance index does not meet the standard, user adjustment supplementary information is obtained, and the user adjustment supplementary information is supplemented into the multi-dimensional user information of the target user, and then the step of obtaining the user data layer object according to the multi-dimensional user information and the accompanying assistant is jumped to cycle until the user personality performance index meets the standard, so as to take the intermediate large language model obtained in the last cycle as the fine-tuned large language model.
[0068] In the embodiment, the process of steps S105a to S105d can be: inputting the pre-training large language model into the training set, and then comparing the content output by the pre-training large language model with the standard reply content in the training set. When the difference between the two is large, the related parameters or weight values of the pre-training large language model are dynamically and slightly adjusted, so that the content output by the subsequent intermediate large language model is closer to or even identical to the standard reply content. Similarly, the model performance index of the intermediate large language model is evaluated according to the evaluation set, and the necessary adjustment and optimization of the intermediate large language model are guided according to the model performance index. The process of steps S105a to S105c is repeated, and finally the fine-tuned large language model is obtained, which is more in line with the interactive needs of the target user.
[0069] Specifically, in an optional embodiment of the present application, step S105a includes: fine-tuning the model training of the pre-training large language model by inserting a low-rank matrix into the pre-training large language model according to the training set, to obtain an intermediate large language model.
[0070] In the embodiment, the low-rank matrix is inserted to reduce the amount of parameters required for fine-tuning. Compared with full-parameter fine-tuning, the process of fine-tuning model training provided in the embodiment can ensure that the model is always in a better state through LoRA (Low-Rank Adaptation, low-rank matrix adjustment) fine-tuning, which is an efficient fine-tuning method for large pre-training models, and can improve training efficiency while avoiding overfitting.
[0071] S106: Deploying the fine-tuned large language model into the accompanying assistant to obtain a target accompanying assistant.
[0072] In the embodiment, deploying the fine-tuned large language model into the accompanying assistant can be a process of adding the related code of the fine-tuned large language model to the accompanying assistant, and the final obtained accompanying assistant is the target accompanying assistant.
[0073] S107: Obtaining target user input information and inputting the target user input information into the target accompanying assistant to obtain personalized reply content.
[0074] In this embodiment, after the target user opens the target companion assistant, the target user inputs information in the input bar as the input of the target companion assistant. After the target companion assistant analyzes the input information of the target user, the target companion assistant outputs the personalized reply content required by the target user.
[0075] To sum up, the method provided in the embodiments of the present application obtains a plurality of multi-dimensional dialogue samples based on multi-dimensional user information collected through user-authorized interactive operations, sends the dialogue samples to the user for review, obtains adjusted to-be-input dialogue data of the plurality of multi-dimensional dialogue samples in response to an adjustment operation of the target user, continuously and cyclically fine-tunes the pre-trained large model according to the to-be-input dialogue data and a preset loss function, obtains the fine-tuned large language model, and deploys the fine-tuned large language model into the target companion assistant, so that the final target companion assistant is more in line with the interactive requirements of the target user, thereby improving the accuracy of the personalized reply content and ensuring the performance of the target companion assistant while improving the user experience without the need for the user to input too many prompt words in the later interactive process.
[0076] Based on the above embodiments, the interactive data processing method for a companion assistant provided in an optional embodiment of the present application further includes:
[0077] Step A: Obtain the historical interactive data of the target user.
[0078] In this embodiment, the historical interactive data of the target user can be the previous interactive data of the target user and the companion assistant stored in the memory module. Here, the previous refers to the interactive data at any time before step S101.
[0079] In an optional embodiment of the present application, the memory module includes a short-term memory module and a long-term memory module. The short-term memory module is used to store daily sent things, conversations, moods, health conditions, and activity contents related to the target user generated during the interaction between the target user and the target companion assistant as the information source for the proactive greeting. The long-term memory module is used to store the newly added hobbies, experiences, and role attributes of the target user, as well as more satisfactory and fitting dialogue jingles. These information can be temporarily added to the dialogue in the form of prompt words for timely application. As time goes by, when there is enough new data, a new round of fine-tuning iteration will be triggered, i.e., the process of steps S101 to S105 will be re-executed to optimize the target companion assistant.
[0080] Step B: Generate a proactive greeting according to the historical interactive data, and perform an interactive operation with the target user according to the proactive greeting to obtain new interactive information.
[0081] In this embodiment, generating the proactive greeting refers to making a proactive caring interaction content based on a statement expressing negative emotions or physical discomfort of the target user in the historical interaction data, which needs the care of others. For example, when it is detected that the target user mentioned being sick or injured the previous day, the target companion assistant will ask the target user about the recovery the next day.
[0082] Step C: complex question recognition processing is performed according to the new interaction information, and complex question interaction data is obtained.
[0083] In this embodiment, the complex question refers to a question that the target companion assistant has never answered before, which requires a large amount of data training to output a reply content that can satisfy the target user.
[0084] Step D: input the complex question interaction data into the expert model to generate the to-be-replied information.
[0085] In this embodiment, the expert model refers to an artificial intelligence model with stronger computing power and performance than the target companion model. After inputting the complex question interaction data into the expert model, the expert model can output to-be-replied information that can satisfy the target user, such as a document composed of professional vocabulary.
[0086] Step E: input the to-be-replied information into the target companion assistant to obtain the complex question reply content.
[0087] In this embodiment, the target companion assistant performs model fine-tuning and polishing on the to-be-replied content to output an interaction content that conforms to the language habits and personal style of the target user as the final complex question reply content.
[0088] The target companion assistant provided in this embodiment can enhance the emotional color of the dialogue through detailed and meticulous caring interaction, so that the user feels valued and supported, and can interact deeply with daily life, not just window companionship, but also can play the role of a tree hole, providing a safe and private space for users to share their daily feelings.
[0089] On the basis of the above-mentioned embodiments, the interaction data processing method for the companion assistant provided in an optional embodiment of the present application further comprises:
[0090] Step F: in response to a subsequent interaction operation of the target user, real-time acquisition of updated user information of the target user.
[0091] Step G: store the updated user information in a preset memory module to supplement the updated user information into the multi-dimensional user information, and jump to the step of obtaining the user data layer object according to the multi-dimensional user information and the companion assistant.
[0092] In this embodiment, as the target user interacts with the target companion assistant, new information related to the target user will be continuously collected and stored in the long-term memory module in the preset memory module. When a certain amount of new data is accumulated, the model fine-tuning operation is automatically restarted at step S102 to ensure that the target companion assistant always keeps up with the latest changes of the user and provides a better interactive experience for the target user. In this example, the preset memory module is similar to the memory module in the above embodiments, so this embodiment will not be described here.
[0093] Based on the above embodiments, the interactive data processing method for a companion assistant provided in an optional embodiment of the present application further includes:
[0094] Step H: In response to the assistant sharing operation of the target user, uploading the target companion assistant to a model sharing platform to enable other users to interact with the target companion assistant.
[0095] In this embodiment, the model sharing platform is a resource sharing cloud platform that can upload the fine-tuned large language model or target companion assistant after being authorized by the user. This cloud platform allows users to share fine-tuned large language models or target companion assistants that meet their individual design under the premise of protecting privacy for other users with the same or similar personality. The uploaded user can also reduce costs by charging the downloaded user. It can also motivate other users to continue to fine-tune the large language model with multi-dimensional user information related to themselves, making the final large language model more humanized and further improving the accuracy of the reply content, thereby improving the user experience.
[0096] Step I: Adding a voice interaction function link and a simulated character image function link in the target companion assistant to generate a digital human companion assistant.
[0097] In this embodiment, by introducing a personified language assistant and a simulated character image, a complete digital human is created, which replaces the original target companion assistant and interacts with the target user, further providing a more realistic and immersive interactive experience for the user.
[0098] Figure 2 FIG. 1 is a structural schematic diagram of an interactive data processing device for a companion assistant provided by an embodiment of the present application.
[0099] As Figure 2 The interactive data processing device for a companion assistant provided by an embodiment of the present application includes an information collection module 21, a dialogue sample generation module 22, a model fine-tuning module 23, and a communication module 24.
[0100] The information collection module 21 is configured to acquire multi-dimensional user information of a target user in response to an interactive operation of the target user.
[0101] The information collection module 21 is further configured to obtain a user data layer object according to the multi-dimensional user information and the companion assistant.
[0102] The dialogue sample generation module 22 is configured to obtain user sample interaction information, and perform sample generation according to the sample interaction information and the user data layer object to obtain a plurality of multi-dimensional dialogue samples.
[0103] The dialogue sample generation module 22 is further configured to obtain to-be-input dialogue data in response to an adjustment operation of the target user on the plurality of multi-dimensional dialogue samples.
[0104] The model fine-tuning module 23 is configured to perform continuous cycle fine-tuning on the pre-trained large language model according to the to-be-input dialogue data and a preset loss function to obtain a fine-tuned large language model.
[0105] The model fine-tuning module 23 is configured to deploy the fine-tuned large language model into the companion assistant to obtain a target companion assistant.
[0106] The communication module 24 is configured to obtain target user input information, and input the target user input information into the target companion assistant to obtain personalized reply content.
[0107] In an optional embodiment of the present application, the multi-dimensional user information includes user static information, dynamic behavior data and personalized demand information, and the companion assistant is deployed with a natural language processing model and a machine learning model; accordingly, the information collection module 21 is specifically configured to: extract static features according to the user static information and the natural language processing model; extract interactive personalized features according to the dynamic behavior data and the natural language processing model; extract special demand features according to the personalized demand information and the natural language processing model; and deduce the user data layer object according to the static features, the interactive personalized features, the special demand features and the machine learning model.
[0108] In an optional embodiment of the present application, the dialogue sample generation module 22 is specifically configured to: repeatedly simulate interaction operations from multiple dimensions according to the user sample interaction information and the user data layer object and an agent in the companion assistant to obtain the plurality of multi-dimensional dialogue samples.
[0109] In an optional embodiment of the present application, the dialogue sample generation module 22 is specifically configured to: in response to the target user reviewing the plurality of multi-dimensional dialogue samples, divide the plurality of multi-dimensional dialogue samples into first multi-dimensional dialogue samples that do not conform to the user personality characteristics and second multi-dimensional dialogue samples that conform to the user personality characteristics, and generate user feedback opinions; perform dialogue adjustment on the first multi-dimensional dialogue samples according to the user feedback opinions to obtain third multi-dimensional dialogue samples; and perform expansion processing on the first multi-dimensional dialogue samples and the third multi-dimensional dialogue samples to obtain the to-be-input dialogue samples, wherein the number of the to-be-input dialogue samples is greater than the sum of the number of the first multi-dimensional dialogue samples and the number of the third multi-dimensional dialogue samples.
[0110] In an optional embodiment of the present application, the model fine-tuning module 23 is specifically configured to: divide the to-be-input dialogue data into a training set and an evaluation set according to a preset proportion; perform fine-tuning model training on the pre-trained large language model according to the training set to obtain an intermediate large language model; perform model evaluation processing on the intermediate large language model according to the evaluation set to obtain a user personality simulation performance index; when it is detected that the user personality simulation performance index does not meet a standard, obtain user adjustment supplement information, supplement the user adjustment supplement information into the multi-dimensional user information of the target user, and then jump to the step of obtaining the user data layer object according to the multi-dimensional user information and the companion assistant, and perform a cycle until the user personality performance index meets the standard, so as to take the intermediate large language model obtained in the last cycle as the fine-tuned large language model.
[0111] In an optional embodiment of the present application, the model fine-tuning module 23 is specifically configured to: perform fine-tuning model training on the pre-trained large language model by inserting a low-rank matrix into the pre-trained large language model according to the training set to obtain an intermediate large language model.
[0112] In an optional embodiment of the present application, the communication module 23 is further configured to: obtain historical interaction data of the target user; generate an active greeting according to the historical interaction data, and perform an interactive operation with the target user according to the active greeting to obtain new interaction information; perform complex question recognition processing according to the new interaction information to obtain complex question interaction data; input the complex question interaction data into an expert model to generate to-be-replied information; and input the to-be-replied information into the target companion assistant to obtain complex question reply content.
[0113] In an optional embodiment of the present application, the communication module 23 is further configured to: in response to a subsequent interactive operation of the target user, obtain updated user information of the target user in real time; store the updated user information in a preset memory module to supplement the updated user information into the multi-dimensional user information in a timely manner, and jump to the step of obtaining the user data layer object according to the multi-dimensional user information and the companion assistant.
[0114] In an optional embodiment of this application, the model fine-tuning module 23 is further configured to: in response to the assistant sharing operation of the target user, upload the target companion assistant to the model sharing platform so that other users can interact with the target companion assistant; add a voice interaction function link and a simulated human image function link to the target companion assistant to generate a digital human companion assistant.
[0115] Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0116] like Figure 3 As shown, the electronic device 30 may include a processor 31 and a memory 32, wherein the processor 31 and the memory 32 are coupled and can communicate with each other; for example, the processor 31 and the memory 32 communicate through a communication bus 33, the memory 32 is used to store computer execution instructions, and the processor 31 is used to call the computer execution instructions in the memory to execute the interactive data processing method for companion assistant shown in the above method embodiment.
[0117] Optionally, the electronic device 30 may also include a communication interface, which may include a transmitter and / or a receiver.
[0118] Optionally, the electronic device 30 may also include a communication interface, which may include a transmitter and / or a receiver.
[0119] Optionally, the aforementioned processor can be a central processing unit (CPU), a graphics processing unit (GPU), other general-purpose processors, a digital signal processor (DSP), or an application-specific integrated circuit (ASIC), etc. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of this application can be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules within the processor.
[0120] This application provides a computer-readable storage medium storing computer program instructions; when the program instructions are executed by an electronic device or a computing device, the electronic device or computing device performs the above-described interactive data processing method for a companion assistant.
[0121] The embodiment of the application provides a computer program product, which comprises computer program instructions, when the computer program instructions are executed, causing a computer device or a computing device to execute an interaction data processing method for a companion assistant.
[0122] All or part of the steps of the method embodiments described above can be completed by program instruction related hardware. The foregoing program can be stored in a readable memory. When the program is executed, the steps of the method embodiments described above are executed; and the foregoing memory (storage medium) includes: a read-only memory (English: read-only memory, abbreviation: ROM), a RAM, a flash memory, a hard disk, a solid state disk, a magnetic tape, a floppy disk (English: floppy disk), an optical disc (English: optical disc), and any combination thereof.
[0123] The embodiments of the application are described with reference to flowcharts and / or block diagrams according to the methods, devices (systems), and computer program products of the embodiments of the application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable terminal equipment processing unit to produce a machine, so that the instructions executed by the computer or other programmable terminal equipment processing unit produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one block or multiple blocks.
[0124] These computer program instructions can also be stored in a computer readable memory that can guide the computer or other programmable terminal equipment to work in a specific way, so that the instructions stored in the computer readable memory produce a product including instruction devices that implement the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one block or multiple blocks.
[0125] These computer program instructions can also be loaded into a computer or other programmable terminal equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce a computer-implemented process, so that the instructions executed on the computer or other programmable equipment provide a process for implementing the functions specified in the flowcharts and / or block diagrams. Figure 1 The functions specified in one flow or multiple flows and / or blocks Figure 1 The functions specified in one block or multiple blocks.
[0126] It will be apparent to those skilled in the art that various modifications and variations can be made to the embodiments of this application without departing from the spirit or scope of the application. Thus, it is intended that the embodiments of this application cover the modifications and variations of this application provided they come within the scope of the appended claims and their equivalents.
[0127] In the embodiments of the present application, the terms "comprising", "containing" or any other similar term are intended to encompass non-exclusive inclusion such that processes, methods, articles, or apparatuses that comprise a list of elements are not limited to those elements, but can also include other elements not expressly listed or inherent to such processes, methods, articles, or apparatuses. Without more limitations, the element defined by the phrase "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element. The term "or" and its variants can mean "and / or". In the embodiments of the present application, the terms "first", "second", etc. are used to distinguish similar objects, not necessarily to describe a specific order or sequence. In the embodiments of the present application, "a plurality of" means two or more. "And / or", which describes the relationship between the associated objects, means that there can be three relationships, for example, A and / or B can mean that A exists alone, A and B exist together, and B exists alone. The character " / " generally represents an "or" relationship between the associated objects.
[0128] Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the application disclosed herein. It is intended that the embodiments of the present application cover any and all modifications, variations, or adaptations of the application that fall within the scope of the general inventive concept and that include equivalents of the disclosed application.
Claims
1. A method for processing interactive data for a companion assistant, characterized in that, include: In response to the interactive operations of the target user, obtain multi-dimensional user information of the target user; Based on the multi-dimensional user information and the companion assistant, a user data layer object is obtained; Obtain user sample interaction information, and perform sample generation operation based on the sample interaction information and the user data layer object to obtain multiple multi-dimensional dialogue samples; In response to the target user's adjustment operation on the multiple multi-dimensional dialogue samples, the dialogue data to be input is obtained; The pre-trained large language model is continuously and iteratively fine-tuned based on the input dialogue data and the preset loss function to obtain the fine-tuned large language model. The finely tuned large language model is deployed into the companion assistant to obtain the target companion assistant. Obtain the target user's input information and input the target user's input information into the target companion assistant to obtain personalized reply content.
2. The method according to claim 1, characterized in that, The multi-dimensional user information includes static user information, dynamic behavioral data, and personalized needs information. The companion assistant is equipped with a natural language processing model and a machine learning model. Accordingly, obtaining the user data layer object based on the multi-dimensional user information and the companion assistant includes: Based on the user's static information and the natural language processing model, extract static features; Based on the dynamic behavior data and the natural language processing model, extract personalized interaction features; Based on the personalized demand information and the natural language processing model, extract special demand features; Based on the static features, the interactive personalization features, the special needs features, and the machine learning model, the user data layer object is deduced.
3. The method according to claim 2, characterized in that, The step of performing a sample generation operation based on the sample interaction information and the user data layer object yields multiple multi-dimensional dialogue samples, including: Based on the user sample interaction information and the user data layer object, the intelligent agent in the companion assistant repeatedly simulates interaction operations from multiple dimensions to obtain multiple multi-dimensional dialogue samples.
4. The method according to claim 2, characterized in that, The process of responding to the target user's adjustment operation on the multiple multi-dimensional dialogue samples to obtain the input dialogue data includes: In response to the target user reviewing the multiple multi-dimensional dialogue samples, the multiple multi-dimensional dialogue samples are divided into a first multi-dimensional dialogue sample that does not conform to the user's personality characteristics and a second multi-dimensional dialogue sample that conforms to the user's personality characteristics, and user feedback is generated. Based on the user feedback, the first multi-dimensional dialogue sample is adjusted to obtain the third multi-dimensional dialogue sample. The first multi-dimensional dialogue sample and the third multi-dimensional dialogue sample are expanded to obtain the input dialogue sample, wherein the number of the input dialogue sample is greater than the sum of the number of the first multi-dimensional dialogue sample and the third multi-dimensional dialogue sample.
5. The method according to claim 1, characterized in that, The step of continuously and iteratively fine-tuning the pre-trained large language model based on the input dialogue data and a preset loss function to obtain the fine-tuned large language model includes: The dialogue data to be input is divided into a training set and an evaluation set according to a preset ratio; The pre-trained large language model is fine-tuned and trained based on the training set to obtain an intermediate large language model. The intermediate large language model is evaluated based on the evaluation set to obtain user personality simulation performance indicators. When it is detected that the user's personality simulation performance index does not meet the standard, the user adjustment and supplementary information is obtained and added to the multi-dimensional user information of the target user. Then, the process jumps to the step of obtaining the user data layer object based on the multi-dimensional user information and the companion assistant and repeats until the user's personality performance index meets the standard. The intermediate large language model obtained in the last iteration is used as the fine-tuned large language model.
6. The method according to claim 5, characterized in that, The step of fine-tuning the pre-trained large language model based on the training set to obtain an intermediate large language model includes: Based on the training set, the pre-trained large language model is fine-tuned by inserting a low-rank matrix into the pre-trained large language model to obtain an intermediate large language model.
7. The method according to claim 1, characterized in that, Also includes: Obtain historical interaction data of the target user; Generate a proactive greeting based on the historical interaction data, and interact with the target user based on the proactive greeting to obtain new interaction information; Based on the new interaction information, complex problem identification and processing are performed to obtain complex problem interaction data; The complex problem interaction data is input into the expert model to generate the information to be answered; Input the information to be answered into the target companion assistant to obtain the response to the complex question.
8. The method according to any one of claims 1 to 7, characterized in that, Also includes: In response to subsequent interactive operations by the target user, the updated user information of the target user is obtained in real time; The updated user information is stored in a preset memory module to periodically supplement the updated user information into the multi-dimensional user information, and then the process jumps to the step of obtaining the user data layer object based on the multi-dimensional user information and the companion assistant.
9. The method according to claim 1, characterized in that, Also includes: In response to the assistant sharing operation of the target user, the target companion assistant is uploaded to the model sharing platform so that other users can interact with the target companion assistant; Add voice interaction and simulated human image links to the target companion assistant to generate a digital human companion assistant.
10. An electronic device, characterized in that, The electronic device includes a memory and a processor; The memory and the processor are coupled; The memory is used to store program instructions; The processor is used to invoke the program instructions to cause the electronic device to perform the method as described in any one of claims 1 to 9.