Task template recommendation method and device, medium, electronic equipment and program product
By displaying task templates based on a trained template recommendation model in the interactive interface, and combining object attributes and task template information, a neural matrix factorization model is used to recommend suitable task templates, which solves the problem of poor task processing performance and improves the execution efficiency and consistency of the agent.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING ZITIAO NETWORK TECH CO LTD
- Filing Date
- 2026-01-29
- Publication Date
- 2026-05-12
AI Technical Summary
How to effectively utilize task templates that meet user needs for task processing, ensure the effectiveness of task processing, and improve the execution efficiency and consistency of intelligent agents.
The interactive interface displays the first task template obtained based on the trained template recommendation model. The template recommendation model is trained based on the object's attribute information and candidate task template information. It combines the interaction information between the object and the task template to recommend task templates and uses a neural matrix factorization model to capture linear and nonlinear relationships to recommend suitable task templates.
It improved the quality of task execution and the overall user experience, ensuring that template recommendations met user needs and enhancing the accuracy and consistency of task execution.
Smart Images

Figure CN122020305A_ABST
Abstract
Description
Technical Field
[0001] The technical solution relates to the field of computer technology, specifically to a task template recommendation method, apparatus, medium, electronic device, and program product. Background Technology
[0002] With the continuous development of artificial intelligence, agent technology has received increasing attention and has gradually become an important research topic in the field of artificial intelligence. Among these technologies, agent task templates, as reusable structured descriptions of tasks, can be used to standardize the agent's task intent, tool instructions, and execution steps, thereby significantly improving the agent's execution efficiency and consistency. Therefore, how to effectively utilize task templates that meet user needs for task processing and ensure the effectiveness of task processing has become an urgent problem to be solved. Summary of the Invention
[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] Firstly, a task template recommendation method is provided, including:
[0005] Display an interactive interface, which is used for objects to interact with intelligent agents; The interactive interface displays a first task template, which is obtained based on a trained template recommendation model. The template recommendation model is trained based on the object attribute information of the object and the template information of the candidate second task template. The second task template is used to instruct the agent to perform a task based on the task description information corresponding to the second task template.
[0006] Secondly, a task template recommendation device is provided, comprising: The first display module is configured to display an interactive interface, which is used for objects to interact with intelligent agents; The second display module is configured to display a first task template in the interactive interface. The first task template is obtained based on a trained template recommendation model. The template recommendation model is trained based on the object attribute information of the object and the template information of the candidate second task template. The second task template is used to instruct the agent to perform a task based on the task description information corresponding to the second task template.
[0007] Thirdly, a computer-readable medium is provided having a computer program stored thereon, wherein the computer program, when executed by a processing device, implements the steps of the method described in the first aspect.
[0008] Fourthly, an electronic device is provided, comprising: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method described in the first aspect.
[0009] Fifthly, a computer program product is provided, comprising a computer program, wherein the computer program, when executed by a processor, implements the steps of the method described in the first aspect.
[0010] The above technical solution displays an interactive interface with a first task template. This first task template is obtained based on a trained template recommendation model, which is trained using object attribute information and candidate second task template information. The second task template instructs the agent to execute a task based on the corresponding task description information. The solution integrates object attribute information and task template information for task template recommendation. The template recommendation model can also effectively learn the relationship between the object and the user, ensuring accurate template recommendations that meet user needs. By combining object attribute information and template information, suitable task templates can be recommended in agent-based scenarios, thereby improving task execution quality and the overall interactive experience.
[0011] Other features and advantages of the technical solution will be described in detail in the following detailed implementation section. Attached Figure Description
[0012] The above and other features, advantages, and aspects of the technical solution will become more apparent when taken in conjunction with the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 This is a schematic diagram illustrating application scenarios of the task template recommendation method based on certain situations.
[0013] Figure 2 This is a flowchart illustrating the recommended methods for task templates based on certain circumstances.
[0014] Figure 3 This is a schematic diagram of the template recommendation model based on certain scenarios.
[0015] Figure 4 This is a schematic diagram of the architecture of a template recommendation system, shown under certain circumstances.
[0016] Figure 5 This is a schematic diagram of the task template recommendation device shown under certain circumstances.
[0017] Figure 6 This is a schematic diagram of the structure of an electronic device shown under certain circumstances. Detailed Implementation
[0018] The technical solution will now be described in more detail with reference to the accompanying drawings. Although certain scenarios are shown in the drawings, it should be understood that the technical solution can be implemented in various forms and should not be construed as limited to the scenarios described herein. Rather, these scenarios are provided to provide a more thorough and complete understanding of the technical solution. It should be understood that the accompanying drawings and the scenarios described are for illustrative purposes only and are not intended to limit the scope of protection of the technical solution.
[0019] It should be understood that the steps described in the method implementation may be performed in different orders and / or in parallel. Furthermore, the method implementation may include additional steps and / or omit the steps shown. The scope of the technical solution is not limited in this respect.
[0020] The term "comprising" and its variations as used herein can be open-ended, meaning "including but not limited to". The term "based on" can mean "at least partially based on". The term "one case" means "at least one case"; the term "another case" means "at least one additional case"; the term "some cases" means "at least some cases". Definitions of other terms will be given in the following description.
[0021] It should be noted that the concepts of "first" and "second" mentioned here are only used to distinguish different devices, modules or units, and are not used to limit the order of the functions performed by these devices, modules or units or their interdependencies.
[0022] It should be noted that the terms "one" and "more" used here are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0023] The names of messages or information exchanged between the multiple devices in the implementation are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0024] It is understandable that before using the technical solutions provided here, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in accordance with relevant laws and regulations, and their authorization should be obtained through appropriate means.
[0025] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose, based on the prompt message, whether to provide personal information to the software or hardware such as electronic devices, applications, servers, or storage media performing the operations described herein.
[0026] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0027] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of the technical solution. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the technical solution.
[0028] At the same time, it is understood that the data involved in the technical solution (including but not limited to the data itself, the acquisition or use of the data) should comply with the requirements of relevant laws, regulations and related provisions.
[0029] In some cases, the task template recommendation method provided herein can be executed via an electronic device, which can be at least one of a terminal device and a server. Figure 1 This is a diagram illustrating application scenarios of the task template recommendation method based on certain conditions. For example... Figure 1 As shown, the application scenario may include terminal device 101 and server 102, which can be connected via wired or wireless network. Terminal device 101 may have an intelligent agent platform installed. For example, the intelligent agent platform may be a computer program running through a Web (World Wide Web) browser; alternatively, it may be client software on the terminal device. Server 102 may be a backend server for the intelligent agent platform, providing backend services to the platform.
[0030] In some cases, an interactive interface for interaction between an object and an agent can be displayed on the terminal device 101. This interactive interface can be a graphical user interface provided for interaction between the object and the agent. The object can interact with the agent through the interactive interface displayed on the terminal device 101, instructing the agent to perform tasks. The terminal device 101 displays a first task template in the interactive interface. This first task template can be a task template recommended by the object, allowing the object to select the desired first task template and instruct the agent to perform tasks based on the selected first task template.
[0031] The first task template displayed can be obtained based on a trained template recommendation model. For example, terminal device 101 can send the object identifier corresponding to the object to server 102. Server 102 has a trained template recommendation model deployed in it. Server 102 inputs the object identifier into the trained template recommendation model, and the trained template recommendation model outputs the corresponding first task template.
[0032] It should be understood that the first task template displayed in the interactive interface can be one or more second task templates selected from the candidate second task templates. The first task templates can be sorted in descending order according to their degree of matching with the object and displayed in the interactive interface.
[0033] Figure 2 This is a flowchart illustrating the recommended methods for task templates based on certain circumstances. For example... Figure 2 As shown, a task template recommendation method is provided, which can be executed through a task template recommendation device, which can be implemented by software and / or hardware. For example... Figure 2 As shown, the method may include the following steps.
[0034] In step 210, an interactive interface is displayed, which is used for objects to interact with the intelligent agent.
[0035] Here, an intelligent agent can refer to a proxy capable of perceiving the environment and taking actions to achieve a specific goal. An intelligent agent can be software, hardware, or a system, possessing autonomy, adaptability, and interactivity. By perceiving changes in the environment (e.g., through sensors or data input), the intelligent agent makes judgments and decisions based on its learned knowledge and algorithms, and then executes actions to influence the environment or achieve predetermined goals.
[0036] Electronic devices can display an interactive interface for intelligent agents, allowing objects to interact with the intelligent agents. Here, "object" can refer to a user.
[0037] In step 220, a first task template is displayed in the interactive interface. The first task template is obtained based on a trained template recommendation model. The template recommendation model is trained based on the object attribute information of the object and the template information of the candidate second task template. The second task template is used to instruct the agent to perform the task based on the task description information corresponding to the second task template.
[0038] Here, the task template for an intelligent agent can refer to a structured, reusable configuration unit used to define the input specifications, processing logic, tool dependencies, output format, and behavioral constraints required by the agent when performing a certain type of task. By using task templates, the task understanding cost of the intelligent agent can be reduced, the consistency of the agent's output can be ensured, and modular combination and manual intervention and debugging can be facilitated.
[0039] For example, task templates may include task prompt templates, tool calling templates, workflow templates, and multimodal task configuration templates, etc.
[0040] The candidate second task template can refer to a usable task template provided by the agent platform. For example, the candidate second task template may include task templates for object creation, task templates shared by other objects, and task templates provided by the agent platform. The second task template is used to instruct the agent to perform a task based on the task description information corresponding to the second task template. The task description information corresponding to the second task template may include input specifications, processing logic, tool dependencies, output format, and behavioral constraints.
[0041] The interactive interface displayed on the electronic device may show a first task template, which can be obtained through a trained template recommendation model. For example, the first task template may include one or more task templates selected from candidate second task templates by the trained template recommendation model.
[0042] The trained template recommendation model can be obtained based on the object attribute information of the object and the template information of the candidate second task template. As some examples, the template recommendation model can be a Neural Matrix Factorization (NeuMF) model. The Neural Matrix Factorization model overcomes the limitations of a single method by fusing two different sub-networks (including generalized matrix factorization and multilayer perceptron) to simultaneously capture the linear and nonlinear relationships in the interaction between the object and the task template.
[0043] The object attribute information can include information describing the object, such as the object's historical query requests, the object's functional sequence, and the object's identity information. The template information of the second task template can include metadata information describing the second task template, such as the content included in the second task template (e.g., unique identifier, name, input specifications, output specifications, tool dependencies, project configuration prompts, execution logic, presets and strategies, etc.), tags, and categories.
[0044] Figure 3 This is a schematic diagram illustrating the structure of a template recommendation model based on certain scenarios. For example... Figure 3 As shown, the template recommendation model may include a first embedding layer, a second embedding layer, a Generalized Matrix Factorization (GMF) layer, a Multi-Layer Perceptron (MLP) layer, and a prediction layer. The first embedding layer processes the template information of the candidate second task template into a first feature vector, and the second embedding layer processes the object attribute information of the object into a second feature vector. The first and second embedding layers can be pre-trained text embedding models, which convert text-type object attribute information and template information into high-dimensional dense semantic vectors (including the first and second feature vectors).
[0045] The first eigenvector can be transformed into the fourth eigenvector used as input to the generalized matrix factorization layer and the sixth eigenvector used as input to the multilayer perceptron. The second eigenvector can be transformed into the third eigenvector used as input to the generalized matrix factorization layer and the fifth eigenvector used as input to the multilayer perceptron.
[0046] The third and fourth eigenvectors are input to the generalized matrix decomposition layer. In the generalized matrix decomposition layer, the third and fourth eigenvectors interact by multiplying element by element, simulating the dot product operation in matrix decomposition, thereby capturing the linear relationship between the object and the second task template.
[0047] The fifth and sixth feature vectors are input into a multilayer perceptron. The multilayer perceptron concatenates the fifth and sixth feature vectors to obtain the first concatenated vector. Then, the first concatenated vector is input into a multilayer feedforward network (such as layer 1, layer 2, ..., layer L) to learn the complex nonlinear relationship between the learning object and the second task template.
[0048] The outputs of the generalized matrix factorization layer and the multilayer perceptron are input to the prediction layer. The prediction layer obtains the prediction score corresponding to each second task template. The prediction score is used to characterize the object's interest in the second task template. The higher the prediction score, the greater the object's interest in the second task template.
[0049] Accordingly, the second task templates can be sorted in descending order based on the predicted scores, and the top-ranked second task templates can be designated as the first task templates, which are then displayed in the interactive interface. In this way, obtaining the first task templates through a trained template recommendation model can simultaneously capture the complex linear and non-linear relationships between objects and task templates. Furthermore, by combining object attribute information and template information, the displayed first task templates can better reflect the real-time task template requirements of the objects, thereby significantly improving the accuracy of task template recommendations.
[0050] It is worth noting that users can select any first task template as the target task template for the agent through the first task template selection operation, instructing the agent to perform tasks based on the target task template. The selection operation for the first task template can be a click operation on the first task template.
[0051] Therefore, by displaying an interactive interface and showing a first task template within it, the solution leverages a trained template recommendation model. This model is trained based on object attribute information and candidate second task template information. The second task template instructs the agent to execute a task based on the corresponding task description. The solution integrates object attribute information and task template information for task template recommendation. Furthermore, the template recommendation model effectively learns the relationship between the object and the user, ensuring accurate template recommendations that meet user needs. By combining object attribute information and template information, suitable task templates can be recommended in agent-based scenarios, thereby improving task execution quality and overall interactive experience. The task template recommendation method provided by this technical solution is applicable to various application scenarios such as content generation, workflow automation, multi-tool scheduling, and multimodal task parsing, providing support for the efficient and intelligent operation of general-purpose agents.
[0052] In some cases, the initial template recommendation model can be trained based on the object's attribute information, the template information of the candidate second task template, and the interaction information between the object and the second task template to obtain a trained template recommendation model.
[0053] Here, the interaction information between the object and the second task template may include the interaction actions between the object and the second task template, the number of interactions corresponding to the interaction actions, and the trigger time of the interaction actions.
[0054] The interaction between an object and a second task template can refer to various observable, recordable, and quantifiable behaviors performed by the object during the use, discovery, or management of the second task template. For example, interaction actions may include browsing, previewing, using, clicking, saving, sharing, liking, rating, indicating disinterest in the second task template, and creating the second task template, etc.
[0055] The number of interactions corresponding to an interactive action can refer to the total number of interactive actions performed by the object in relation to the second task template. For example, if the object uses the second task template A 8 times, then the interactive action for the second task template A is a use action, and the number of interactions corresponding to this use action is 8.
[0056] The trigger time for an interactive action can refer to the time when the interactive action is performed on the second task template. For example, if object time B uses the second task template A, then the interactive action for the second task template A is a use action, and the trigger time for this use action is time B.
[0057] It should be understood that training samples can be constructed based on object attribute information, template information, and interaction information. These training samples can then be used to train the initial template recommendation model, resulting in a fully trained template recommendation model. The initial template recommendation model can refer to a template recommendation model that has undergone preliminary training or one that has not been trained. Figure 3 As shown, the initial template recommendation model can include a neural matrix factorization model.
[0058] Therefore, by combining interactive information to train the template recommendation model, the first task template displayed can better meet the user's real and real-time task template needs, greatly improving the accuracy of task template recommendation.
[0059] In other cases, the interaction bias of an object towards a second task template can be obtained based on the interaction information between the object and the second task template. The object's attribute information and the template information of the second task template are input into the initial template recommendation model to obtain the output result of the initial template recommendation model after inference. The interaction bias is used as the supervision signal of the initial template recommendation model, and the model parameters of the initial template recommendation model are iteratively updated in combination with the output result to obtain the trained template recommendation model.
[0060] Here, the interaction information between the object and the second task template can include the interaction actions between the object and the second task template, the number of interactions corresponding to the interaction actions, and the trigger time of the interaction actions. Through the interaction information between the object and the second task template, the object's interaction bias towards each second task template can be obtained. Specifically, the interaction bias towards the second task template is used to characterize the object's level of interest in the second task template.
[0061] The collected object attribute information and the template information of the second task template can be input into the initial template recommendation model to obtain the output result of the initial template recommendation model after reasoning about the object attribute information and template information. The output result may include the prediction score of the initial template recommendation model for each second task template, which is used to characterize the degree of matching between the second task template and the object. For example, the higher the prediction score, the greater the degree of matching between the second task template and the object.
[0062] It should be understood that the collected object attribute information may include the object attribute information corresponding to all objects collected by the intelligent agent platform, and the collected template information of the second task template may include the template information corresponding to all second task templates included by the intelligent agent platform.
[0063] The supervision signal for a template recommendation model that starts with the degree of interaction bias can refer to using the degree of interaction bias as a label for object attribute information and template information to conduct supervised training on the template recommendation model, so that the prediction score output by the trained template recommendation model can be close to the degree of interaction bias.
[0064] It is worth noting that the degree of interaction bias for the second task template can be understood as the implicit score of the object for the second task template obtained through implicit interaction information. By using the degree of interaction bias as the initial supervision signal of the template recommendation model, and combining the output results to iteratively update the model parameters of the initial template recommendation model, the template recommendation model can be trained in a supervised manner, so that the predicted score output by the trained template recommendation model can be close to the implicit score.
[0065] In other cases, object attribute information and template information can be used as training data, and the degree of interaction bias can be used as the label of the training data to construct labeled training samples. Then, the labeled training samples are input into the initial template recommendation model to train the initial template recommendation model and obtain the trained template recommendation model.
[0066] In some cases, for each type of interactive action, the degree of action bias corresponding to the interactive action can be obtained based on the number of interactions and the corresponding time decay coefficient. The time decay coefficient is obtained based on the trigger time of the interactive action. Then, based on the degree of action bias corresponding to each type of interactive action, the degree of interaction bias of the object with respect to the second task template can be obtained.
[0067] Here, the time decay coefficient can be obtained by combining the trigger time of the interaction with the current time and a time decay function. The time decay function assigns an interaction weight that decreases over time based on the trigger time, so as to reflect that recently triggered interactions are more important than those triggered in the distant future. For example, the time decay function can include an exponential decay function.
[0068] As examples, the time interval between the trigger time and the current time of an interactive action can be determined based on the difference between the current time and the trigger time. Then, the time decay coefficient corresponding to the interactive action can be obtained based on the time interval and an exponential decay function. The time decay coefficient is used to emphasize the importance of recent interactive actions. It should be understood that the closer the trigger time is to the current time, the larger the corresponding time decay coefficient; conversely, the further the trigger time is from the current time, the smaller the corresponding time decay coefficient.
[0069] For each type of interactive action, the action bias can be obtained by multiplying the number of interactions for that type of action by the time decay coefficient. The action bias characterizes the degree of interest of the object represented by a given type of interactive action in the second task template. Alternatively, in other examples, the action bias can be obtained by multiplying the interaction weight, the number of interactions, and the time decay coefficient for each type of interactive action. The interaction weight can vary depending on the type of interactive action and can be set according to the specific circumstances.
[0070] For each second task template, the interaction bias of the object towards the second task template can be obtained based on the action bias corresponding to each type of interaction action for that second task template. For example, the interaction bias of the object towards the second task template can be obtained based on the sum of the action bias corresponding to each type of interaction action for that second task template.
[0071] In some cases, the degree of interaction bias of an object towards a second task template can be obtained through the following calculation formula, which may include:
[0072] in, This indicates the degree of interaction bias of object u towards the second task template i, where A represents the set of various types of interactive actions triggered by the second task template, and a represents the interactive action. This represents the interaction weight of interaction action 'a'. This represents the number of interactions corresponding to action a of object u in relation to the second task template i. Represents the time decay function. This indicates the trigger time corresponding to the interaction action a of object u with respect to the second task template i.
[0073] It should be understood that different types of interactive actions have different interaction weights; that is, different types of interactive actions correspond to different interaction weights. They can be different. Before using the interaction bias as the initial supervision signal for the template recommendation model, the interaction bias can be standardized so that the standardized interaction bias is on the same dimension as the output of the template recommendation model.
[0074] Therefore, by measuring the object's interaction bias towards the second task template, the implicit interaction information of the object can be quantified into an interaction bias that can be used as a supervision signal. Furthermore, considering the time decay effect, the importance of recently generated interaction actions can be emphasized, making the first task template obtained based on the trained template recommendation model more accurate.
[0075] In some cases, the weighted binary cross-entropy loss can be determined based on the degree of interaction bias and the output result, the ranking hinge loss can be determined based on the degree of interaction bias and the output result, and the total loss corresponding to the degree of interaction bias and the output result can be obtained based on the weighted binary cross-entropy loss and the ranking hinge loss. Based on the total loss, the model parameters of the initial template recommendation model are iteratively updated to obtain the trained template recommendation model.
[0076] Here, the Weighted Binary Cross-Entropy Loss (BCE Loss) is used to treat template recommendation as a binary classification problem, using weights to balance positive and negative samples. The weighted binary cross-entropy loss can be obtained by combining the interaction bias and output results with the weighted binary cross-entropy loss function. The Ranking Hinge Loss refers to a loss function used to learn ranking tasks. Ranking tasks typically include positive and negative samples. Generally, the template recommendation model should score positive samples significantly higher than negative samples. The ranking hinge loss enforces this constraint by introducing a margin. The corresponding ranking hinge loss can be obtained by combining the interaction bias and output results with the ranking hinge loss function.
[0077] By using the ranking hinge loss, semantic information can be fully utilized to ensure that the ranking results of the predicted scores output by the template recommendation model are as consistent as possible with the ranking results obtained based on semantic similarity. The ranking hinge loss can include a saliency filtering mechanism, that is, it is calculated for second task template pairs with sufficiently large semantic similarity differences to reduce noise interference. For example, for second task template pairs that meet preset conditions, the ranking hinge loss corresponding to the second task template pair that meets the preset conditions can be determined; for second task template pairs that do not meet the preset conditions, their corresponding ranking hinge loss is determined. Here, the preset conditions can refer to the absolute value of the difference between the predicted scores of the object for the second task template as a positive sample and the second task template as a negative sample being greater than a preset threshold.
[0078] The total loss corresponding to the degree of interaction bias and the output result can be obtained by summing the weighted binary cross-entropy loss and the sorting hinge loss. Alternatively, the total loss corresponding to the degree of interaction bias and the output result can also be obtained by summing the weighted binary cross-entropy loss and the sorting hinge loss with different weights.
[0079] It is worth noting that the total loss can be understood as the loss obtained through a hybrid loss function that includes weighted binary cross-entropy loss and sorting hinge loss.
[0080] The model parameters of the initial template recommendation model are iteratively updated using the obtained total loss until the template recommendation model meets the preset training conditions, thus obtaining the trained template recommendation model.
[0081] Therefore, a hybrid loss method combining weighted binary cross-entropy loss and ranking hinge loss can effectively optimize the template recommendation model. By introducing ranking hinge loss, the template recommendation model can learn user interaction patterns while also understanding the deeper meaning of the task template content, achieving a deep integration between interaction and task template content, making the displayed first task template more accurate. The hybrid loss method also makes the model training process more stable, reduces interference from noisy data, and greatly improves the robustness of the template recommendation model.
[0082] In some cases, the first template recommendation model can be trained based on the object's attribute information, the template information of the candidate second task template, and the interaction information between the object and the second task template to obtain the trained first template recommendation model. The model parameters corresponding to the trained first template recommendation model are stored in the database. The model parameters corresponding to the trained first template recommendation model are retrieved from the database and loaded into the online deployed second template recommendation model to obtain the trained template recommendation model.
[0083] Continuing with the example above, we can obtain the interaction bias of the object towards the second task template based on the interaction information between the object and the second task template. We then input the object's attribute information and the template information of the second task template into the first template recommendation model, obtaining the output of the first template recommendation model after inference. Using the interaction bias as the supervision signal for the first template recommendation model, we iteratively update the model parameters of the first template recommendation model based on the output, thus obtaining the trained first template recommendation model. In other words, the training process for the first template recommendation model can be the same as the training process for the initial template recommendation model.
[0084] After obtaining the first template recommendation model that has been trained, the model parameters corresponding to the first template recommendation model can be stored in the database. It should be understood that the model parameters corresponding to the first template recommendation model may include the model weights.
[0085] Accordingly, the model parameters corresponding to the first template recommendation model that has been trained can be read from the database, and then the read model parameters can be loaded into the second template recommendation model deployed online to obtain the trained template recommendation model. In other words, the second template recommendation model loaded with the model parameters corresponding to the first template recommendation model that has been trained can be used as the trained template recommendation model.
[0086] It should be understood that the first template recommendation model can be a template recommendation model deployed offline, while the second template recommendation model can be a template recommendation model deployed online and running, used to actually provide services. For example, the first and second template recommendation models can be template recommendation models with identical structures.
[0087] Figure 4 This is a schematic diagram of the architecture of a template recommendation system, shown under certain circumstances. For example... Figure 4 As shown, the template recommendation system can include a training architecture and an inference architecture. In other words, the template recommendation system provided by the technical solution is deployed using an architecture that separates training and inference.
[0088] In the training architecture, the query component responds to the training request by reading object attribute information, template information, and interaction information from the data warehouse used to store object attribute information, template information, and interaction information, and sends the object attribute information, template information, and interaction information as training data to the model training platform. The model training platform responds to the training request by training the first template recommendation model based on the object attribute information, template information, and interaction information, obtaining the trained first template recommendation model, and storing the model parameters of the trained first template recommendation model in the database.
[0089] In the inference structure, the model parameters of the first template recommendation model, which has been trained, are read from the database, and then loaded into the second template recommendation model. The agent can send a recommendation request to the second template recommendation model, which outputs a first task template and returns it to the agent, thereby displaying the first task template in the agent's interactive interface.
[0090] It is worth noting that the object attribute information, template information, and interaction information used to train the first template recommendation model can be object attribute information, template information, and interaction information generated within a certain time range. For example, it could be object attribute information, template information, and interaction information generated within one month.
[0091] After training the first template recommendation model, its parameters can be adjusted at preset intervals based on newly added object attribute information, template information, and interaction information within that preset time range. For example, the preset time range could be 24 hours. The adjusted model parameters are then stored in a database for loading by the online-deployed second template recommendation model. In other words, the first template recommendation model can be trained using a strategy combining full training and incremental fine-tuning.
[0092] For newly added object attribute information and template information, the embedding layer can be used to process the new information into corresponding feature vectors. For newly added interaction information, the corresponding interaction bias can be obtained based on the new interaction information.
[0093] Therefore, by adopting an architecture that separates training and inference, the template recommendation model can quickly respond to changes in user needs while also ensuring its stability and robustness. Furthermore, it decouples offline data processing, model training, and online inference services, giving the template recommendation system good scalability and engineering feasibility.
[0094] In some cases, the first task template corresponding to the object identifier can be searched in the cache based on the object identifier of the object. If the first task template is not found, in response to the object type of the object being a preset type, the object identifier is input into the trained template recommendation model to obtain the first task template output by the trained template recommendation model. In response to the object type of the object not being a preset type, the first task template is determined from the candidate second task templates according to preset rules.
[0095] Here, an object identifier can refer to a number or code used to uniquely identify an object. For example, an object identifier can be an object ID. For example, a terminal device can send a recommendation request to a template recommendation system, carrying the object identifier in the recommendation request.
[0096] The template recommendation system responds to recommendation requests by searching the cache for the first task template corresponding to the object identifier. The first task template stored in the cache can be obtained through a trained template recommendation model. It should be understood that the first task template stored in the cache can have an expiration date; that is, if the storage time of the first task template in the cache exceeds a specified period, the first task template can be deleted or marked as invalid. An invalid first task template is equivalent to being unavailable.
[0097] If the corresponding first task template is found in the cache, it can be returned to the terminal device for display in the interactive interface. If the corresponding first task template is not found in the cache, the object type can be further determined. If the object type is a preset type, the object identifier is input into the trained template recommendation model to obtain the first task template output by the trained template recommendation model. Here, the preset object type can refer to an object type that has interacted with the agent more than a preset threshold within a preset period. In other words, objects of the preset type can be understood as relatively active objects.
[0098] It should be understood that during the training phase of the template recommendation model, object identifiers can be used as a type of object attribute information. Therefore, the trained template recommendation model can learn the association between each object and the second task template. When an object identifier is input into the trained template recommendation model, the corresponding first task template can be obtained.
[0099] If the object type is not a preset type, the first task template can be determined from the candidate second task templates using preset rules. For example, the second task templates can be sorted in descending order according to their usage frequency, most recent update time, or human rating, and the top-ranked second task templates can be selected as the first task templates. It should be understood that an object whose type is not a preset type can be interpreted as a cold-start object. For objects whose type is not a preset type, the trained template recommendation model may not have learned the relevant patterns, so preset rules can be used to determine the first task template. Therefore, by combining caching during online inference with the mechanism of determining the first task template using preset rules, the stability and high availability of the template recommendation system can be guaranteed, ensuring that even cold-start users can obtain reasonable task template recommendations.
[0100] Figure 5 This is a schematic diagram of the task template recommendation device shown under certain circumstances. For example... Figure 5 As shown, a task template recommendation device 500 is provided, which may include: The first display module 501 is configured to display an interactive interface, which is used for objects to interact with intelligent agents. The second display module 502 is configured to display a first task template in the interactive interface, wherein the first task template is obtained based on a trained template recommendation model, the template recommendation model is trained based on the object attribute information of the object and the template information of the candidate second task template, and the second task template is used to instruct the agent to perform a task based on the task description information corresponding to the second task template.
[0101] In some cases, the task template recommendation device 500 may further include: The first training module is configured to train an initial template recommendation model based on the object's attribute information, the template information of the candidate second task template, and the interaction information between the object and the second task template, thereby obtaining the trained template recommendation model.
[0102] In some cases, the first training module may include: The first obtaining unit is configured to obtain the degree of interaction bias of the object towards the second task template based on the interaction information between the object and the second task template; The second obtaining unit is configured to input the object attribute information of the object and the template information of the second task template into the initial template recommendation model, and obtain the output result of the initial template recommendation model after inference; The third obtaining unit is configured to use the interaction bias degree as the supervision signal of the initial template recommendation model, and to iteratively update the model parameters of the initial template recommendation model in combination with the output result to obtain the trained template recommendation model.
[0103] In some cases, the interaction information includes the interaction actions between the object and the second task template, the number of interactions corresponding to the interaction actions, and the trigger time of the interaction actions; the first obtaining unit is specifically configured to: For each type of interactive action, the degree of action bias corresponding to the interactive action is obtained based on the number of interactions and the corresponding time decay coefficient. The time decay coefficient is obtained based on the trigger time of the interactive action. Based on the degree of action bias corresponding to each type of interactive action, the degree of interaction bias of the object with respect to the second task template is obtained.
[0104] In some cases, the third obtaining unit is specifically configured as follows: Based on the degree of interaction bias and the output result, the weighted binary cross-entropy loss is determined; Based on the degree of interaction bias and the output result, the sorting hinge loss is determined; Based on the weighted binary cross-entropy loss and the sorting hinge loss, the total loss corresponding to the degree of interaction bias and the output result is obtained; Based on the total loss, the model parameters of the initial template recommendation model are iteratively updated to obtain the trained template recommendation model.
[0105] In some cases, the task template recommendation device 500 may further include: The second training module is configured to train the first template recommendation model based on the object attribute information of the object, the template information of the candidate second task template, and the interaction information between the object and the second task template, so as to obtain the trained first template recommendation model. The storage module is configured to store the model parameters corresponding to the trained first template recommendation model in a database; The loading module is configured to retrieve the model parameters corresponding to the first template recommendation model that has been trained from the database, and load the model parameters into the second template recommendation model deployed online, thereby obtaining the template recommendation model that has been trained.
[0106] In some cases, the task template recommendation device 500 may further include: The lookup module is configured to search the cache for the first task template corresponding to the object identifier based on the object identifier of the object; The input module is configured to, in the event that the first task template is not found, input the object identifier into the trained template recommendation model in response to the object type being a preset type, thereby obtaining the first task template output by the trained template recommendation model; The determination module is configured to determine the first task template from the candidate second task templates according to preset rules in response to the object type to which the object belongs not being a preset type.
[0107] It should be understood that the execution logic of each functional module in the task template recommendation device 500 has been explained in detail in the section on the task template recommendation method, and can be referred to in the relevant description of the task template recommendation method.
[0108] The following is for reference. Figure 6 It shows an electronic device suitable for implementing the above-mentioned technical solution (e.g. Figure 1 The diagram below shows the structure of the terminal device or server 600. The terminal device may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Personal Computers), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs (Televisions), desktop computers, etc. Figure 6 The electronic device shown is merely an example and should not be construed as limiting its functionality or scope of use.
[0109] like Figure 6 As shown, electronic device 600 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. The random access memory 603 also stores various programs and data required for the operation of electronic device 600. The processing unit 601, ROM 602, and RAM 603 are interconnected via bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0110] Typically, the following devices can be connected to the input / output interface 605: input devices 606 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 607 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 608 including, for example, magnetic tape, hard disk, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 6 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0111] In particular, depending on certain circumstances, the processes described in the flowchart above can be implemented as computer software programs. For example, a computer program product is provided, comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowchart. This computer program can be downloaded and installed from a network via communication device 609, or installed from storage device 608, or installed from read-only memory 602. When the computer program is executed by processing device 601, it performs the functions defined in the above-described methods.
[0112] It should be noted that the aforementioned computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium may be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM, or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In one case, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In another case, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. The transmitted data signal can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (Radio Frequency), etc., or any suitable combination thereof.
[0113] In some implementations, terminal devices and servers can communicate using any currently known or future-developed network protocol, such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (LANs), wide area networks (WANs), the internet (e.g., the Internet), and end-to-end networks (e.g., ad-hoc end-to-end networks), as well as any currently known or future-developed networks.
[0114] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0115] The aforementioned computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to: display an interactive interface for interaction between an object and an agent; and display a first task template in the interactive interface, wherein the first task template is obtained based on a trained template recommendation model, the template recommendation model being trained based on object attribute information of the object and template information of candidate second task templates, and the second task template being used to instruct the agent to perform a task based on task description information corresponding to the second task template.
[0116] Computer program code for performing the above operations can be written in one or more programming languages or a combination thereof. These programming languages include, but are not limited to, object-oriented programming languages, as well as conventional procedural programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0117] The flowcharts and block diagrams in the accompanying figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products under various scenarios. In this respect, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the figures. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0118] The modules mentioned above can be implemented in software or hardware. In some cases, the name of a module does not necessarily limit the functionality of that module.
[0119] The functions described above can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field-Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application-Specific Standard Parts (ASSPs), Systems on Chips (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0120] In this context, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0121] The above description is merely illustrative and explains the technical principles employed. Those skilled in the art should understand that the scope of the technical solution is not limited to specific combinations of the above-described technical features, but also includes other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features provided herein that have similar functions.
[0122] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. Multitasking and parallel processing may be advantageous in certain environments. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limitations on the scope of the technical solution. Certain features described in the context of a single example can also be implemented in combination in a single example. Conversely, various features described in the context of a single example can also be implemented individually or in any suitable sub-combination in multiple examples.
[0123] Although the technical solution has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims. Regarding the aforementioned apparatus, the specific manner in which each module performs its operation has already been described in detail in the section concerning the method, and will not be elaborated upon here.
Claims
1. A task template recommendation method, comprising: Display an interactive interface, which is used for objects to interact with intelligent agents; The interactive interface displays a first task template, which is obtained based on a trained template recommendation model. The template recommendation model is trained based on the object attribute information of the object and the template information of the candidate second task template. The second task template is used to instruct the agent to perform a task based on the task description information corresponding to the second task template.
2. The method according to claim 1, wherein, The trained template recommendation model is obtained through the following steps: Based on the object attribute information of the object, the template information of the candidate second task template, and the interaction information between the object and the second task template, the initial template recommendation model is trained to obtain the trained template recommendation model.
3. The method according to claim 2, wherein, The initial template recommendation model is trained based on the object's attribute information, the template information of the candidate second task template, and the interaction information between the object and the second task template to obtain the trained template recommendation model, including: Based on the interaction information between the object and the second task template, the degree of interaction bias of the object towards the second task template is obtained; Input the object attribute information of the object and the template information of the second task template into the initial template recommendation model, and obtain the output result of the initial template recommendation model after inference; Using the degree of interaction bias as the supervision signal for the initial template recommendation model, and combining the output results, the model parameters of the initial template recommendation model are iteratively updated to obtain the trained template recommendation model.
4. The method according to claim 3, wherein, The interaction information includes the interaction actions between the object and the second task template, the number of interactions corresponding to the interaction actions, and the trigger time of the interaction actions; The step of obtaining the degree of interaction bias of the object towards the second task template based on the interaction information between the object and the second task template includes: For each type of interactive action, the degree of action bias corresponding to the interactive action is obtained based on the number of interactions and the corresponding time decay coefficient. The time decay coefficient is obtained based on the trigger time of the interactive action. Based on the degree of action bias corresponding to each type of interactive action, the degree of interaction bias of the object with respect to the second task template is obtained.
5. The method according to claim 3, wherein, The step of using the interaction bias degree as the supervision signal for the initial template recommendation model, and iteratively updating the model parameters of the initial template recommendation model in conjunction with the output results to obtain the trained template recommendation model includes: Based on the degree of interaction bias and the output result, the weighted binary cross-entropy loss is determined; Based on the degree of interaction bias and the output result, the sorting hinge loss is determined; Based on the weighted binary cross-entropy loss and the sorting hinge loss, the total loss corresponding to the degree of interaction bias and the output result is obtained; Based on the total loss, the model parameters of the initial template recommendation model are iteratively updated to obtain the trained template recommendation model.
6. The method according to any one of claims 1-5, wherein, The trained template recommendation model is obtained through the following steps: Based on the object attribute information of the object, the template information of the candidate second task template, and the interaction information between the object and the second task template, the first template recommendation model is trained to obtain the trained first template recommendation model. Store the model parameters corresponding to the first template recommendation model that has been trained in the database; The model parameters corresponding to the first template recommendation model that has been trained are obtained from the database, and the model parameters are loaded into the second template recommendation model deployed online to obtain the template recommendation model that has been trained.
7. The method according to any one of claims 1-5, wherein, The first task template is obtained through the following steps: Based on the object identifier of the object, find the first task template corresponding to the object identifier in the cache; If the first task template is not found, in response to the object type of the object being a preset type, the object identifier is input to the trained template recommendation model to obtain the first task template output by the trained template recommendation model. If the object type to which the object belongs is not a preset type, the first task template is determined from the candidate second task templates according to preset rules.
8. A task template recommendation device, comprising: The first display module is configured to display an interactive interface, which is used for objects to interact with intelligent agents; The second display module is configured to display a first task template in the interactive interface. The first task template is obtained based on a trained template recommendation model. The template recommendation model is trained based on the object attribute information of the object and the template information of the candidate second task template. The second task template is used to instruct the agent to perform a task based on the task description information corresponding to the second task template.
9. A computer-readable medium having a computer program stored thereon, wherein, When the computer program is executed by the processing device, it implements the steps of the method according to any one of claims 1-7.
10. An electronic device, comprising: A storage device on which computer programs are stored; A processing device for executing the computer program in the storage device to implement the steps of the method according to any one of claims 1-7.
11. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-7.