Model training method and device
By automatically training the intelligent model with preset maps and user data, the problem of non-professional users finding it difficult to customize the model is solved, and the model is more accurately adapted to the user's personalized needs.
Patent Information
- Application Number
- CN202510122787.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-24
- Publication Date
- 2025-05-23
AI Technical Summary
The custom construction model of models in existing agents has flaws, and it is difficult for non-professional users to accurately shape models that meet their own needs through text descriptions.
By automatically training the model based on preset graphs and user data, the user's first habit library and sample data set are built, and the training model is fine-tuned to obtain a model that conforms to user habits.
This enables non-professional users to easily have exclusive models, and the models can more accurately adapt to the personalized needs of different users.
Smart Images

Figure CN120031067A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of electronic equipment, and specifically relates to a model training method and a device thereof. Background Art
[0002] An "agent" is a system or entity that perceives, makes decisions, and takes actions in a specific environment, and is commonly used in the fields of artificial intelligence, robotics, and computer science. It can be software (such as a virtual assistant) or hardware (such as a robot), and can continuously learn and optimize its own behavior through interaction. Based on accurate insights into user interests, hobbies, and preferences, the agent can filter and organize information for users, provide customized information services that meet the personalized needs of users, and effectively resolve the difficulties users face in the process of obtaining and managing information. In addition, in daily life, users have an increasing demand for diversified personalized services such as customized fitness plans, personalized diet recommendations, and exclusive travel plans. Intelligent agents can rely on their deep understanding of user preferences and needs to tailor personalized services and recommendations for users, further alleviating the pain points of users in obtaining personalized services.
[0003] Models are the core components of intelligent agents. In today's era of explosive information growth, users are stuck in the dilemma of screening and organizing massive amounts of information. With the rapid development of artificial intelligence technology, the widespread popularity of large language models, and the significant improvement of electronic devices in computing power, storage capacity, and battery life, favorable conditions have been created for running large models on electronic devices, making the terminal-side intelligent agent a realistic and feasible development direction, and intelligent agents for users themselves have emerged.
[0004] However, the current custom model building mode in the intelligent agent has obvious defects. Usually, users mainly use text descriptions to define the model in the intelligent agent that meets their own needs, but for ordinary users in non-related professional fields, it is difficult to accurately create a practical and efficient model that can deeply understand themselves with text. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a model training method and device thereof, which can automatically train the model based on preset graphs and user data, so that non-professional users can easily have their own exclusive models, and the model can more accurately adapt to the personalized needs of different users.
[0006] In a first aspect, an embodiment of the present application provides a model training method, the method comprising:
[0007] Based on the acquired graph and the user data of the user, a first habit library of the user is constructed, wherein the graph includes a correspondence between each preset scenario and an intent in a plurality of preset scenarios, and a correspondence between each intent and a service, and the first habit library includes first habit information corresponding to each preset scenario, and the first habit information includes a first service that the user is accustomed to using in the preset scenario, a first intent corresponding to the first service, and operation data of the user using the first service;
[0008] Building a first sample data set based on the first habit library, the first sample data set includes a plurality of first sample data, each of which includes at least one preset scene and first habit information corresponding to the preset scene;
[0009] The first model is fine-tuned and trained based on the first sample data set to obtain a second model that conforms to the user's habits.
[0010] In a second aspect, an embodiment of the present application provides a model training device, which is applied to a first electronic device, and the device includes:
[0011] A habit library construction module is used to construct a first habit library of the user based on the acquired graph and the user data of the user, wherein the graph includes a correspondence between each preset scene and an intent in a plurality of preset scenes, and a correspondence between each intent and a service, and the first habit library includes first habit information corresponding to each preset scene, and the first habit information includes a first service that the user is accustomed to using in the preset scene, a first intent corresponding to the first service, and operation data of the user using the first service;
[0012] A sample data construction module, used to construct a first sample data set based on the first habit library, the first sample data set including a plurality of first sample data, each of which includes at least one preset scene and first habit information corresponding to the preset scene;
[0013] The training module is used to fine-tune the first model based on the first sample data set to obtain a second model that conforms to the user's habits.
[0014] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor and a memory, wherein the memory stores programs or instructions that can be run on the processor, and when the program or instructions are executed by the processor, the steps of the method described in the first aspect are implemented.
[0015] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0016] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0017] In a sixth aspect, an embodiment of the present application provides a computer program product, which is stored in a storage medium and is executed by at least one processor to implement the method described in the first aspect.
[0018] In an embodiment of the present application, based on the acquired graph and the user's user data, a first habit library of the user is constructed, the graph is used to indicate the corresponding relationship between each preset scene and the intent, and the corresponding relationship between each intent and the service, the first habit library includes the first habit information corresponding to each preset scene, the first habit information includes the first service that the user is accustomed to using in the preset scene, the first intent corresponding to the first service, and the operation data of the user when using the first service; based on the first habit library, a first sample data set is constructed, the first sample data set includes multiple first sample data, each of which includes at least one preset scene and the first habit information corresponding to the preset scene; based on the first sample data set, the first model is fine-tuned and trained to obtain a first model that conforms to the user's habits. According to this embodiment, the model is automatically trained based on the preset graph and user data, so that non-professional users can easily have exclusive models, and the model can more accurately adapt to the personalized needs of different users. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Figure 1 is a flowchart of a model training method provided in some embodiments of the present application;
[0020] Figure 2 is a schematic diagram of the atlas provided in some embodiments of the present application;
[0021] Figure 3 is a flowchart of a model training method provided in some other embodiments of the present application;
[0022] Figure 4 is a schematic diagram of a model training device provided in some embodiments of the present application;
[0023] Figure 5 is a block diagram of an electronic device provided by some embodiments of the present application;
[0024] Figure 6 It is a schematic diagram of the structure of an electronic device provided in some embodiments of the present application. DETAILED DESCRIPTION
[0025] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0026] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0027] The model training method, device, electronic device, storage medium and program product provided in the embodiments of the present application are described in detail below in conjunction with the accompanying drawings through specific embodiments and their application scenarios.
[0028] It should be noted that the acquisition, storage, use and processing of data in the embodiments of the present application are in compliance with the relevant provisions of national laws and regulations.
[0029] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
[0030] The model training method provided in the embodiment of the present application can be applied to model training scenarios. For example, the model training scenarios include but are not limited to the scenarios of training the model in the intelligent agent. Figure 1-Figure 3 The model training method provided in the embodiment of the present application is described in detail. It should be noted that the model training method provided in the embodiment of the present application can be executed by an electronic device. In the embodiment of the present application, the model training method provided in the embodiment of the present application is described by taking the execution of the model training method by an electronic device as an example.
[0031] See also Figure 1 , is a flow chart of a model training method provided in an embodiment of the present application, the method is applied to a first electronic device, the first electronic device includes but is not limited to a mobile phone, a desktop computer, a tablet computer, a car computer and other devices. Figure 1 As shown, the method includes steps 110 to 130, which are described in detail below.
[0032] Step 110. Based on the acquired graph and the user's user data, construct the user's first habit library, the graph including the correspondence between each preset scenario and the intent in multiple preset scenarios, and the correspondence between each intent and the service, the first habit library including the first habit information corresponding to each preset scenario, the first habit information including the first service that the user is accustomed to using in the preset scenario, the first intent corresponding to the first service, and the operation data of the user when using the first service.
[0033] In some embodiments of the present application, the atlas is a atlas that is pre-set and stored in a specified location. Based on this, in the above step 110, the atlas can be obtained from the specified location.
[0034] In some embodiments of the present application, the spectrum is as follows Figure 2 The scenario-intent-service graph shown in FIG. 1 is used to indicate the correspondence between scenarios and intents and the correspondence between intents and services. Here, services refer to applications. Figure 2 As shown in , a graph is a topological graph composed of nodes and edges, where nodes represent objects and edges represent the relationship between objects. Figure 2 As shown, the nodes include scene nodes, intent nodes, and service nodes. Each scene node represents a preset scene, each intent node represents an intent, and each service node represents a service. The connecting lines between the nodes are the edges of the graph, and there is a corresponding relationship between the objects at both ends of each edge. For example, if there is a connecting line between the scene node 210 and the intent node 220, it means that the takeaway intent is the intent corresponding to the dining scene. For another example, if there is a connecting line between the service node 230 and the intent node 220, it means that Meituan Takeaway is the service corresponding to the takeaway intent.
[0035] In some embodiments of the present application, each node in the graph displays an identifier of the object represented. The identifier is a word, symbol, image, etc. used to represent the object, for example, Figure 2 The scene node 210 shown shows “dining scene”, the intention node 220 shows “takeaway intention”, and the service node 230 shows “Meituan takeaway”.
[0036] In some embodiments of the present application, user data refers to historical data collected in a multimodal data collection method during the user's interaction with the first electronic device that can fully reflect the user's habits and preferences. The user data includes but is not limited to user behavior data, user portrait data, and environmental data of the user's environment.
[0037] In some embodiments of the present application, user data includes multimodal user behavior data. Among them, the multimodal user behavior data includes multi-dimensional behavior data of users on the first electronic device and other devices associated with the first electronic device, wherein other devices associated with the first electronic device include but are not limited to wearable devices, etc. Exemplarily, the multi-dimensional behavior data includes but is not limited to operation behavior data, motion behavior data, physiological behavior data, etc. Among them, the operation behavior data includes but is not limited to click operations, sliding operations, input operations, etc. on the application, the motion behavior data includes but is not limited to the number of steps, motion trajectory, type of motion, etc., and the physiological behavior data includes but is not limited to heart rate, sleep monitoring data, etc. By using multimodal user behavior data as user data, it is helpful to comprehensively analyze the user's behavior pattern, life rhythm and health status, and to understand user needs and preferences more accurately. For example, based on the sensor on the first electronic device recording the sliding speed and dwell time of the user when browsing the web page, combined with the data such as the number of exercise steps and heart rate changes when running recorded by the smart watch associated with the first electronic device, the user's behavior pattern, life rhythm and health status can be comprehensively analyzed. Based on the voice assistant on the first electronic device recording the user's voice commands and conversation content, the behavioral data dimension can be further enriched. For example, if the user asks for recommendations on tourist attractions through voice, these voice information will also be included in the data collection scope, so that the user's needs and preferences can be understood more accurately.
[0038] In some embodiments of the present application, user data includes multi-source portrait data of the user. Multi-source portrait data refers to user portrait data obtained by integrating multi-source information related to the user obtained through legal channels. Multi-source portrait data can cover the user's basic personal information, social information, consumption information, and interest and hobby information, etc. Among them, personal basic information includes but is not limited to gender, age, birthday, etc., social information includes but is not limited to address book contact relationships, social platform interaction status, etc., consumption information includes but is not limited to online shopping records, payment preferences, etc., and interest and hobby information includes but is not limited to preference data of music, video, reading and other platforms. Using multi-source portrait data as user data can help build a comprehensive and detailed user portrait. For example, based on social information, the user's social circle and contact relationships can be determined, based on consumption information, the user's consumption habits and preferred brands can be determined, and based on interest and hobby information, the user's entertainment interests and hobbies can be determined.
[0039] In some embodiments of the present application, user data includes environmental data. Environmental perception data includes, but is not limited to, location information, time information, and environmental sensor data. Among them, location information includes, but is not limited to, location information obtained through technologies such as GPS positioning and indoor positioning, time information includes, but is not limited to, date, time period, etc., and environmental sensor data includes, but is not limited to, light intensity, temperature, humidity, etc. By using environmental data as user data, the user's behavior habits in a specific environment can be determined based on information about the user's location at different time periods, combined with environmental data, to help push accurate services to users. For example, when a user is in an office environment on a weekday afternoon, he or she may be more inclined to receive work-related information or services; when he or she is at home on a weekend evening and the light is dim, it may be more suitable to recommend leisure and entertainment content.
[0040] In some embodiments of the present application, after obtaining the graph and user data, the user data is processed locally on the first electronic device based on the graph to construct the user's first habit library. Processing the user data locally on the first electronic device can ensure data security and privacy.
[0041] In one embodiment of the present application, the first habit library is a habit library that can help users automatically run a service when each preset scenario occurs. The first habit library is a relational database, which includes the first habit information corresponding to each preset scenario. Among them, the first habit information includes the first service that the user is accustomed to using in the preset scenario, the first intention corresponding to the first service, and the operation data of the user when using the first service. Here, the operation data is data related to the operation of the first service. The first electronic device can automatically run the first service based on the operation data. Exemplarily, the data in the first habit library is stored in the data format shown in Table 1 below:
[0042] Table 1:
[0043] Scenario intention Serve Operational Data
[0044] Step 120: Construct a first sample data set based on the first habit library, where the first sample data set includes multiple first sample data, each of which includes at least one preset scene and first habit information corresponding to the preset scene.
[0045] In some embodiments of the present application, after obtaining the first habit library, multiple first sample data are constructed based on the first habit library, each first sample data includes a preset scene and first habit information corresponding to the preset scene, and a set consisting of multiple first sample data is used as a first sample data set.
[0046] Step 130. Fine-tune the first model based on the first sample data set to obtain a first model that meets user habits.
[0047] In some embodiments of the present application, the first model is a pre-set pre-trained model. For example, taking the training of the model in the agent through this embodiment as an example, the first model is a pre-set pre-trained large model in the agent.
[0048] In some embodiments of the present application, the first sample data set is used as training data to fine-tune the first model. During the fine-tuning training, each piece of the first sample data is input into the first model as a context information prompt to train the first model, so that the user's habits and preferences can be integrated into the first model, thereby forming a second model that conforms to the user's habits and preferences.
[0049] In some embodiments of the present application, in the process of fine-tuning the first model, transfer learning technology is used to combine the knowledge of the first model in the general field with the first sample data set that conforms to the user's habits and preferences. First, the first sample data set is preprocessed, including data cleaning, normalization and other operations, and then the preprocessed first sample data set is divided into a training set, a verification set and a test set according to a certain ratio. Then, the training set is used to fine-tune the first model. During the training process, the training parameters are adjusted according to the performance indicators of the verification set, such as the learning rate, the number of iterations, etc.; finally, the test set is used to evaluate the performance of the second model obtained after fine-tuning to ensure that the second model can accurately understand user needs and provide personalized services. The entire process is carried out locally on the first electronic device to avoid uploading user data to the network and effectively protect user privacy.
[0050] In this way, after fine-tuning, a second model that conforms to the user's habits and preferences can be obtained. In this way, the second model can be used to provide users with accurate services when specific scenarios occur.
[0051] The model training method provided in the embodiment of the present application builds a first habit library of the user based on the acquired graph and the user data of the user, the graph is used to indicate the corresponding relationship between each preset scene and the intention, and the corresponding relationship between each intention and the service, the first habit library includes the first habit information corresponding to each preset scene, the first habit information includes the first service that the user is accustomed to using in the preset scene, the first intention corresponding to the first service, and the operation data of the user when using the first service; based on the first habit library, a first sample data set is built, the first sample data set includes multiple first sample data, each of which includes at least one preset scene and the first habit information corresponding to the preset scene; based on the first sample data set, the first model is fine-tuned and trained to obtain a first model that conforms to the user's habits. According to this embodiment, the model is automatically trained based on the preset graph and user data, so that non-professional users can easily have exclusive models, and compared with the model built based on the description information input by the user, the model trained based on the graph and user data can more accurately adapt to the personalized needs of different users.
[0052] In some embodiments, before the above step 110, the following steps 210 to 230 may be used to construct a map.
[0053] Step 210: Obtain large-scale user data.
[0054] Market users refer to the set of all users within a specific business ecosystem, platform or market. Market user data refers to the data corresponding to market users. In this embodiment, market users refer to the set of users who use electronic devices, and market user data refers to the service-related data generated by market users when using electronic devices. For example, market user data includes relevant data collected by market users when using applications, and the relevant data includes but is not limited to application information of the application, user behavior data, environmental data, user portrait data, etc.
[0055] In some embodiments of the present application, for each user in the large disk of users, during the use of the electronic device, the service-related data can be uploaded to the cloud server, so that the large disk user data can be obtained from the cloud server in the above step 210.
[0056] Step 220: Based on the pre-divided multiple preset scenarios and the large-scale user data, determine the intention corresponding to each preset scenario.
[0057] In some embodiments of the present application, multiple preset scenes are multiple scenes pre-divided according to the set scene division rules. Among them, the scene division rules can be set based on experience or based on big data analysis results. For example, the scene division rules include subdividing the time dimension according to the user's daily schedule to obtain different scenes corresponding to different times. For example, according to the user's daily schedule, 5:00-9:00 is divided into morning scenes, 9:00-11:00 is divided into morning scenes, 11:00-14:00 is divided into dining scenes, and 14:00-17:00 is divided into afternoon scenes. For another example, the scene division rules include dividing the behavior dimension according to the user's daily behavior to obtain different scenes corresponding to different behaviors. For example, according to user behavior, travel scenes, business trip scenes, getting up scenes, shopping scenes and other scenes can be divided.
[0058] In some embodiments of the present application, after obtaining the mass user data, the mass user data is analyzed to determine the N applications most frequently used by the mass users, where N is a positive integer and the specific value of N can be set according to actual conditions, for example, N=300. After obtaining the N applications, the intents are summarized and classified based on the multiple preset scenarios divided above and the data corresponding to the N applications in the mass user data to obtain the intents corresponding to each preset scenario.
[0059] In some embodiments of the present application, for each preset scenario, the behavior and purpose of the user in using the application in the preset scenario can be determined by analyzing the data of the application used by the user in the preset scenario, and then the intention of the user in the preset scenario can be summarized, wherein one preset scenario can correspond to one or more intentions. For example, in a dining scenario, by analyzing the relevant data generated when the user uses the application in the scenario, it is summarized that the user's intention in the scenario includes takeaway meal intention and restaurant reservation intention, and the takeaway meal intention and restaurant reservation intention are determined as the intention corresponding to the dining scenario. For another example, in a travel scenario, by analyzing the relevant data generated by the majority of users when using the application in this scenario, it is concluded that the intentions of the majority of users in this scenario include navigation intention, traffic ticket booking intention, public transportation travel intention, etc., and the navigation intention, traffic ticket booking intention, public transportation travel intention, etc. are determined as the intentions corresponding to the travel scenario; for another example, in a business trip scenario, by analyzing the relevant data generated by the majority of users when using the application in this scenario, it is concluded that the intentions of the majority of users in this scenario include traffic accommodation booking intention, travel guide acquisition intention, language translation intention, etc., and the traffic accommodation booking intention, travel guide acquisition intention, language translation intention, etc. are determined as the intentions corresponding to the business trip scenario; for another example, in a shopping scenario, by analyzing the relevant data generated by the majority of users when using the application in this scenario, it is concluded that the intentions of the majority of users in this scenario include product search and purchase intention, store navigation intention, payment settlement intention, etc., and the product search and purchase intention, store navigation intention, payment settlement intention, etc. are determined as the intentions corresponding to the shopping scenario. In this way, for each preset scenario, each intention corresponding to the scenario is closely centered on the core needs and behavioral purposes of the user in the scenario, which is convenient for subsequent service matching.
[0060] Step 230: Based on the large-scale user data, determine the service corresponding to each intent.
[0061] Here, service refers to application program.
[0062] In some embodiments of the present application, based on the summarized intent and in combination with the function of each of the N applications, the N applications are classified into corresponding intents. Among them, one intent can correspond to one or more services. For example, Meituan Waimai, Ele.me, and Dianping, which provide takeaway services among the N applications, are determined as services corresponding to the takeaway meal intent, because the main function of the application that provides takeaway services is to meet the user's takeaway ordering needs. For another example, the application with restaurant information query and reservation functions among the N applications is determined as a service corresponding to the restaurant reservation intent. And so on, determine the service corresponding to each intent.
[0063] Step 240. Build a graph based on multiple preset scenarios, the intent corresponding to each preset scenario, and the service corresponding to each intent.
[0064] In some embodiments of the present application, after obtaining the intent corresponding to each preset scene in N preset scenes and the service corresponding to each intent, the following can be constructed based on the preset scenes, intents and services: Figure 2 A complete set of scenario-intention-service graphs is shown, which is a general graph for large-scale users. In some embodiments, in the above step 110, based on the graph and user data, a user's first habit library is constructed, including the following steps 1101-1104, which are described in detail below.
[0065] Step 1101. For each preset scene, based on user data, filter out the first service corresponding to the preset scene from the candidate service set, where the candidate service set is a set of services in the graph corresponding to the preset scene.
[0066] In some embodiments of the present application, the set of candidate services corresponding to the preset scenario is a set of all services corresponding to all intents under the preset scenario in the graph. Figure 2 ,The set of alternative services corresponding to the catering scenario includes all services corresponding to the takeaway intent and restaurant reservation intent in the graph.
[0067] In some embodiments of the present application, since the service corresponding to each preset scene in the graph is determined based on the user data of the general market, it is difficult to reflect the personalized needs of specific users. In view of this, for each preset scene, the set of alternative services corresponding to the preset scene in the graph is screened based on the user data of the user, so as to screen out the first service that meets the user's habits in the preset scene. In this way, the first model is subsequently trained based on the first service to obtain a second model that better meets the user's personalized needs. In addition, by screening the services, the amount of calculation of the first electronic device during subsequent fine-tuning training can also be reduced, thereby saving the computing resources of the first electronic device.
[0068] In some embodiments of the present application, for each preset scene, the first service corresponding to the preset scene may be determined through the following steps 310 to 330.
[0069] Step 310: For each service in the candidate service set, based on user data, determine a first probability of the service being used in a preset scenario and a total probability of the service being used in multiple preset scenarios.
[0070] In some embodiments of the present application, in the above step 310, the service data corresponding to the preset scenario can be first screened out from the user data according to the characteristics of the preset scenario, and then based on the service data, the first probability of the service being used in the preset scenario and the total probability of the service being used in multiple preset scenarios can be determined. Among them, the service data corresponding to the preset scenario refers to the data related to the service corresponding to the preset scenario that occurs in the preset scenario. For example, taking the dining scene as an example, the dining scene occurs from 11:00 to 14:00, and the services corresponding to the dining scene in the graph include Meituan Takeaway, Ele.me and Dianping. Based on this, the data related to Meituan Takeaway, Ele.me and Dianping that occur between 11:00 and 14:00 can be selected from the user data as the service data corresponding to the dining scene.
[0071] In some embodiments of the present application, for each service, the following steps 3111 to 3112 may be used to determine a first probability of the service being used in a preset scenario.
[0072] Step 3111. Based on the user data, determine a first total number of days that the service is used in a preset scenario and a second total number of days that the alternative service set is used in the preset scenario.
[0073] In some embodiments of the present application, the alternative service set includes one or more services. As long as any one or more services in the alternative service set are used, it is determined that the alternative service set is used. Based on this, when determining the second total number of days that the alternative service set is used in a preset scenario, the service data corresponding to the preset scenario can be divided by day to obtain the service data corresponding to each day. Then, based on the service data corresponding to each day, it is determined whether the user used any service in the alternative service set on that day, and further, the total number of days that the user used the alternative service set is determined, and this total number of days is determined as the second total number of days. Similarly, when determining the first total number of days corresponding to a service, based on the service data corresponding to each day, it is determined whether the user used the service on that day, so as to determine the total number of days that the user used the service, and this total number of days is determined as the first total number of days. Exemplarily, taking the dining scenario as an example, the alternative service set corresponding to the dining scenario includes Meituan Takeaway, Ele.me, and Dianping. The user data includes historical data for the previous two weeks. The service data corresponding to the dining scenario in the user data includes the relevant data of the user using Meituan Takeaway, Ele.me, and Dianping in the previous two weeks. Based on this service data, the total number of days that the user used Meituan Takeaway in the previous two weeks, the total number of days that the user used Ele.me, the total number of days that the user used Dianping, and the total number of days that the user used the alternative service set are respectively counted. Suppose it is determined that the total number of days that the user used Meituan Takeaway in the previous two weeks is 5 days, the total number of days that the user used Ele.me is 3 days, the total number of days that the user used Dianping is 3 days, and the total number of days that the user used the alternative service set is 10 days. Then, the first total number of days corresponding to Meituan Takeaway is 5 days, the first total number of days corresponding to Ele.me is 3 days, the first total number of days corresponding to Dianping is 3 days, and the second total number of days corresponding to the alternative service set is 10 days.
[0074] Step 3222. Determine the first probability of the service occurring in the preset scenario based on the ratio of the first total number of days and the second total number of days.
[0075] In some embodiments of the present application, after obtaining the first total number of days and the second total number of days, calculate the ratio of the first total number of days to the second total number of days. This ratio can reflect the preference degree of the user for the service in the preset scenario. The higher the ratio, the more inclined the user is to use the service in the preset scenario. Based on this, this ratio can be determined as the first probability of the service occurring in the preset scenario.
[0076] In some embodiments of the present application, the following formula (1) can be used to determine the first probability of the service occurring in the preset scenario:
[0077]
[0078] In the above formula (2), P scene represents the first probability of the service occurring in the preset scenario, clickDays serviceIndicates the total number of days the service is used in a preset scenario, clickDays sum Indicates the total number of days the alternative service set is used in a preset scenario. Exemplarily, taking the dining scenario as an example, assume that the total number of days of Meituan Takeout in the dining scenario is 5, the total number of days of Ele.me in the dining scenario is 3, the total number of days of Dianping in the dining scenario is 3, and the total number of days of the alternative service set in the dining scenario is 10. Then the first probability of Meituan Takeout occurring in the dining scenario is 5 / 10 = 0.5, the first probability of Ele.me occurring in the dining scenario is 3 / 10 = 0.3, and the first probability of Dianping occurring in the dining scenario is 3 / 10 = 0.3.
[0079] In an embodiment of the present application, the following steps 3121-step 3122 can be used to determine the total probability that the service is used in multiple preset scenarios:
[0080] Step 3121. Based on user data, determine the first total number of times the service is used and the second total number of times all services in the alternative service set are used.
[0081] In some embodiments of the present application, the first total number of times is the total number of times the service is used determined based on the service data corresponding to the preset scenario. The second total number of times is the sum value of the total number of times each service in the alternative service set is used determined based on the service data corresponding to the preset scenario. Exemplarily, continuing with the above dining scenario as an example, the service data corresponding to the dining scenario includes the relevant data of the user using Meituan Takeout, Ele.me, and Dianping in the previous two weeks. Based on this service data, the total number of times the user uses Meituan Takeout, the total number of times the user uses Ele.me, and the total number of times the user uses Dianping in the previous two weeks are respectively counted. Assume that it is determined that the total number of times the user uses Meituan Takeout in the previous two weeks is 30 times, the total number of times the user uses Ele.me is 30 times, and the total number of times the user uses Dianping is 20 times. Then the first total number of times corresponding to Meituan Takeout is 30 times, the first total number of times corresponding to Ele.me is 30 times, the first total number of times corresponding to Dianping is 20 times, and the second total number of times corresponding to the alternative service set is 30 + 30 + 20 = 80 times.
[0082] Step 3122. Based on the ratio of the first total number of times and the second total number of times, determine the total probability that the service is used in any scenario.
[0083] In some embodiments of the present application, the ratio of the first total number of times and the second total number of times is determined as the total probability that the service is used in any scenario. Based on this, the total probability that the service is used in any scenario is calculated according to the following formula (2):
[0084]
[0085] In the above formula (2), Pclick Indicates the total probability of the service being used in any scenario, clickNum service Indicates the total number of times the service is used in any scenario, clickNum sum Indicates the second total number of times all services in the alternative service set are used. For example, continuing with the above-mentioned catering scenario, assuming that it is determined that the first total number of times corresponding to Meituan Waimai is 30 times, the first total number of times corresponding to Ele.me is 30 times, and the first total number of times corresponding to Dianping is 20 times, and the second total number of times corresponding to the alternative service set is 30+30+20=80 times, then the total probability of Meituan Waimai being used in any scenario is 30 / 80=0.375, the total probability of Ele.me being used in any scenario is 30 / 80=0.375, and the total probability of Dianping being used in any scenario is 20 / 80=0.25.
[0086] Step 320: Based on the ratio of the first probability to the total probability, determine the weight of the service in the preset scenario.
[0087] In some embodiments of the present application, the ratio of the first probability to the total probability can characterize the scenario specificity of the service and can reflect the strength of the association between the service and the scenario. When the ratio is much greater than 1, it means that the probability of the service being used in this preset scenario is much higher than the probability in other scenarios, that is, the service has a strong scenario-specific nature and is a service that users are accustomed to using in the preset scenario. Based on this, the ratio of the first probability to the total probability can be determined as the weight of the service in the preset scenario. In this way, the weight of the service in the preset scenario can be calculated based on the following formula (3):
[0088]
[0089] In the above formula (3), W represents the weight of the service in the preset scenario.
[0090] Exemplarily, continuing with the above-mentioned catering scenario as an example, assuming that the first probability of Meituan Takeout occurring in the catering scenario is 5 / 10=0.5, the first probability of Ele.me occurring in the catering scenario is 3 / 10=0.3, the first probability of Dianping occurring in the catering scenario is 3 / 10=0.3, the total probability of Meituan Takeout being used in any scenario is 30 / 80=0.375, the total probability of Ele.me being used in any scenario is 30 / 80=0.375, and the total probability of Dianping being used in any scenario is 20 / 80=0.25. Then the weight of Meituan Takeout in the catering scenario is 0.5 / 0.375=1.33, the weight of Ele.me in the catering scenario is 0.3 / 0.375=0.8, and the weight of Dianping in the catering scenario is 0.3 / 0.25=1.2.
[0091] Step 330: Determine the service in the candidate service set whose weight is greater than the weight threshold as the first service corresponding to the preset scenario.
[0092] Here, the weight threshold is set according to actual conditions and is usually a value greater than or equal to 1.
[0093] For example, continuing with the above-mentioned catering scenario, assuming that the weight threshold is 1.3, the weight of Meituan Takeout in the catering scenario is 0.5 / 0.375=1.33, the weight of Ele.me in the catering scenario is 0.3 / 0.375=0.8, and the weight of Dianping in the catering scenario is 0.3 / 0.25=1.2, then Meituan Takeout in the alternative service set is determined as the first service in the catering scenario.
[0094] The weight determined in the above manner can characterize the relevance between the service and the preset scene. The larger the weight, the greater the relevance between the service and the preset scene, and the smaller the weight, the smaller the relevance between the service and the preset scene. Based on this, the services in the candidate service set are screened based on the weight and the weight threshold, and the first service that is strongly related to the preset scene can be obtained.
[0095] Step 1102. For each first service, determine the intent corresponding to the first service in the graph as the first intent corresponding to the first service.
[0096] Step 1103: For each first service, determine the operation data of the user using the first service based on the user data.
[0097] In some embodiments of the present application, for each first service, user behavior data related to the first service is screened out from user data, and operation data of the user using the first service is determined based on the screened user behavior data.
[0098] In one embodiment of the present application, the operation data includes operation targets, operation parameters and application information. Based on this, corresponding to each first service, the operation data of the first service can be determined through the following steps 410 to 420.
[0099] Step 410: Determine an operation target of the first service based on a preset scenario, a first intention corresponding to the first service, and the first service.
[0100] In some embodiments of the present application, the operation target of the first service is used to indicate the application to be operated. Based on this, a data combination of a preset scenario, the intent corresponding to the first service, and the first service in the order of scenario-intent-service can be used as the operation target of the first service.
[0101] For example, taking Meituan Takeaway as the first service in a catering scenario, the first intention corresponding to Meituan Takeaway is the takeaway meal intention. Based on this, the operation target of the first service is "catering scenario-takeaway meal scenario-Meituan Takeaway".
[0102] Step 420. Based on the first data related to the first service in the user data, determine the operation parameters and application information of the first service, the operation parameters include the user operation type and operation content, the operation content includes the location information and operation object of the user operation, and the application information is the information of the application that provides the first service.
[0103] Here, the user operation type refers to the type of operation performed by the user when using the first service, and the operation type includes but is not limited to click operation, sliding operation, input operation, etc. The location information of the user operation includes the starting location of the operation performed by the user when using the first service. The operation object refers to the object operated by the user in the first service when using the first service, such as buttons, input boxes and other controls.
[0104] In some embodiments of the present application, the application information includes, but is not limited to, the name and package name of the application that provides the first service. The application information of the first service can be obtained from the first data. For example, taking Meituan Takeout as the first service, the format of the application information of the first service finally obtained is as follows: {"appName":"Meituan Takeout","pkgName":'com.sankuai.meituan.takeoutnew'}. Among them, appName refers to the application name, and pkgName refers to the application package name.
[0105] In an embodiment of the present application, the first data includes user behavior data recorded by the user when using the first service. For example, the first service is Meituan Takeaway, which provides takeaway services. The first data may include relevant data on the user's behavior of searching for merchants, viewing dishes, adding to shopping carts, etc. in Meituan Takeaway, such as the time when the user operates the first service, the screen coordinate data corresponding to the operation, and the OCR (Optical Character Recognition) of the operation area. Based on this, the operation parameters and application information of the first service can be extracted from the first data. Among them, the operation object of the first service can be extracted based on the OCR content of the user's operation area in the first service. For example, the format of the final operation parameters is as follows: {operation type|operation parameters: {click|x: 110, y: 1120, content: add to shopping cart}}, where click indicates that the operation type is a click operation, x and y represent the page coordinates of the click, that is, the starting position of the click operation, and content is the operation object, that is, the content of the click.
[0106] In some embodiments of the present application, the first data may also be input into a big model, and the big model may be combined with relevant information of a preset scenario corresponding to the first service, relevant information of the intent corresponding to the first service, and operational semantic information of the first service to generate operating parameters of the first service.
[0107] Step 430: Determine the operation target, operation parameters and application information as the operation data when the user uses the first service.
[0108] In some embodiments of the present application, for each first service, after obtaining the operation target, operation parameters and application information corresponding to the first service, this information is stored in the first habit library as the operation data of the first service.
[0109] Step 1140. Build a first habit library of the user based on the first services, first intentions and operation data of the first services corresponding to multiple preset scenarios.
[0110] In some embodiments of the present application, the first service, the first intention, and the operation data of the first service corresponding to multiple preset scenarios may be stored in a database in a preset format, thereby obtaining a first habit library.
[0111] In some embodiments, in order to enable the first model finally obtained to output the most relevant service to the user in the scenario where the user is located, the first habit information also includes the weight of the first service and the weight of the first intention. Based on the acquired graph and the user data of the user in the first time period, the first habit library of the user is constructed, which also includes:
[0112] For each first intent, the weights and values of all first services corresponding to the first intent are determined as the weight of the first intent.
[0113] Exemplarily, the data stored in the first habit library is shown in Table 2 below:
[0114] Table 2:
[0115]
[0116]
[0117] In some embodiments, after obtaining the second model that conforms to the user's habits, the second model can recommend services to the user based on the scenario and automatically execute the corresponding services. Specifically, after obtaining the second model that conforms to the user's habits, in response to satisfying the trigger condition of the first preset scenario among multiple preset scenarios, the first preset scenario and the first habit information corresponding to the first preset scenario are input into the second model, and the third service that the user may use in the first preset scenario, the operation data of the third service and the reason why the user may use the third service are output; the first inquiry information is output, and the first inquiry information is used to inquire whether to execute the third service; in response to receiving the first input for indicating the execution of the third service, the third service is executed based on the operation data of the third service.
[0118] Among them, the first preset scene is any scene in the multiple preset scenes. The trigger condition of each preset scene in the multiple preset scenes is pre-set based on experience or based on big data analysis results. For example, the trigger condition of the morning scene is that the current time belongs to the time interval 5:00-9:00, the trigger condition of the morning scene is that the current time belongs to the time interval 9:00-11:00, the trigger condition of the dining scene is that the current time belongs to the time interval 11:00-14:00, and the trigger condition of the afternoon scene is that the current time belongs to the time interval 14:00-17:00.
[0119] For example, taking the trigger condition of satisfying the dining scene as an example, when the dining scene occurs, the second model will be triggered to run automatically. The input and output results of the second model are shown in Table 3 below:
[0120] Table 3:
[0121]
[0122] Among them, user query refers to the query information input by the user, which can be empty, that is, without user input, the second model can automatically output the results corresponding to the current scenario. The second model can output the services that may be used to the user through the user's first habit information in the first habit library, output the operation data of the service, and give reasons for the user to think that the output is reasonable. Detailed parameters and values cannot appear in the reasons. In addition, the second model can also provide inquiry and automation services to the user. If the first habit information is not formed in this scenario, it will not be output. In this way, the second model can deeply understand the personalized needs of users and provide intimate and accurate services.
[0123] In some embodiments, in order to enhance the user's humanistic care experience, see Figure 3 When performing model training, the following steps 510 to 530 may also be performed, which are described in detail below.
[0124] Step 510. Based on the graph and user data, construct the user's second habit library, the second habit library includes second habit information corresponding to each preset scenario, the second habit information includes the second intention, the second service corresponding to the second intention and the context data of the second service, the context data at least includes the user's preference under the second service.
[0125] In some embodiments of the present application, the second habit library focuses on recording the user's favorite tags in daily life, so that when a specific scenario occurs or when other users ask, they can give intimate answers based on the records in the second habit library. The second habit library is a relational database, in which each preset scenario corresponds to the second habit information. The second habit information includes the second intent, the second service corresponding to the second intent, and the contextual data of the second service, and the contextual data includes at least the user's preference under the second service. Among them, the second intent is the intent corresponding to the preset scenario in the graph. Exemplarily, the data in the second habit library is stored in the data format shown in Table 4 below:
[0126] Table 4:
[0127] Scenario intention Serve Preference
[0128] Step 520: Construct a second sample data set based on the second habit library, where the second sample data set includes multiple pieces of second sample data, each piece of second sample data includes at least one preset scene and second habit information corresponding to the preset scene.
[0129] In some embodiments of the present application, after obtaining the second habit library, multiple second sample data are constructed based on the second habit library, each second sample data has at least one preset scene and second habit information corresponding to the preset scene, and a set consisting of multiple second sample data is taken as a second sample set.
[0130] Step 530: Fine-tune the first model based on the second sample data set to obtain a third model that meets the user's preferences.
[0131] In some embodiments of the present application, after obtaining the second sample data set, similar to the way of training the second model, the second sample data set is used as training data to fine-tune the first model. During the fine-tuning training, each second sample data is input into the first model as a context information prompt to train the first model, so that the user's habits and preferences can be integrated into the first model, thereby forming a third model that conforms to the user's habits and preferences. The specific training process can be referred to the above description of step 130, and will not be described in detail here to avoid repetition.
[0132] In this way, the third model obtained after fine-tuning conforms to the user's habits and preferences. In this way, the intelligent agent can use the third model to give thoughtful answers that conform to the user's preferences when specific scenarios occur or when other users ask questions.
[0133] The model training method provided in the embodiment of the present application builds a second habit library of the user based on the graph and the user's user data, builds a second sample data set based on the second habit library, and fine-tunes the first model based on the second sample data set to obtain a third model that meets the user's preferences. According to this embodiment, the model is automatically trained based on the preset graph and user data, so that non-professional users can easily have an exclusive model, and the trained model can more accurately adapt to the personalized needs of different users. Moreover, the third model obtained based on the training can give intimate answers that meet the user's preferences when specific scenarios occur or when other users ask questions, thereby enhancing the user's humanistic care experience.
[0134] In some embodiments, in the above step 510, the user's second habit library can be constructed through the following steps 5111-5112.
[0135] Step 5111. For each preset scenario, determine the second intent corresponding to the preset scenario and the second service corresponding to the second intent based on the graph.
[0136] In some embodiments of the present application, for each preset scene, the intent in the graph corresponding to the preset scene is determined as the second intent corresponding to the preset scene, and for each second intent, the service in the graph corresponding to the second intent is determined as the second service.
[0137] Step 5112. For each second service, second data related to the second service in the user data is input into the large language model to obtain the user's preference for the second service.
[0138] In some embodiments of the present application, the second data is relevant data generated when the user uses the second service. Therefore, the second data can reflect the user's preference when using the second service. Based on this, the second data is input into the large language model. The second data is understood by the large language model to obtain the user's preference when using the second service.
[0139] For example, taking Meituan Takeaway, where the second service corresponds to the takeaway intention in the catering scenario, as an example, the second data includes the takeaway order information generated when the user uses the second service. The takeaway order information includes the name of the dish, description, user notes and other information. This information is input into the large language model, and the large language model is used to understand this information and summarize the user's ordering preferences when placing an order using the takeaway application. For example, the name of the dish marked in the takeaway order is "Spicy Beef Pizza", and the user's note is "No onions and green peppers, put more cheese". At this time, the large language model can derive the user's preferences as follows through the attention mechanism and semantic understanding: {"Taste preference": "Spicy"; "Ingredient preference": "Beef"; "Eating style": "Western food", "Avoidance": "Onions, green peppers"}.
[0140] In some embodiments, the contextual data of the second habit information also includes the user's geographic information and time information under the second service. Based on this, in the above step 510, the second habit library of the user is constructed based on the graph and the user data, and the following steps 5121-5122 are also included:
[0141] Step 5121. Obtain the time information and longitude and latitude coordinate information of the user when using the second service from the user data.
[0142] In some embodiments of the present application, the user data includes environmental data, which includes the time information and location information, i.e., longitude and latitude information, of the user when using the service. Based on this, the time information and longitude and latitude coordinate information of the user when using the second service can be obtained from the user data.
[0143] Step 5122. Convert the longitude and latitude coordinate information into semantic geographic information through reverse geographic analysis.
[0144] In one embodiment of the present application, since longitude and latitude coordinates are not easy to understand, in order to make the second custom information more popular and mobile, the coordinate information is converted into semantic geographic information such as "company", "shopping mall", and "community" through reverse geographic analysis.
[0145] Exemplarily, the data format of the second habit library is shown in Table 5 below:
[0146] Table 5:
[0147]
[0148] By adding geographic information and time information to the second habit information, more accurate user preferences can be obtained.
[0149] In some embodiments, after obtaining a third model that meets the user's preferences, the user's preference information can be output through the third model when a specific scenario occurs or when the user inquires. Specifically, after obtaining the third model that meets the user's preferences, in response to receiving the second inquiry information, a second preset scenario associated with the second inquiry information among multiple preset scenarios is determined; the inquiry information, the second preset scenario, and the second habit information corresponding to the second preset scene are input into the third model, and the user's preference in the second preset scenario is output. The second inquiry information can be a question for inquiring about the user's preferences.
[0150] For example, taking the case where the third model receives the second inquiry information such as “What takeaway do you want to eat now?”, the input and output of the third model are shown in Table 6 below:
[0151] Table 6:
[0152]
[0153] Among them, the "you" in the second inquiry information refers to the user corresponding to the third model. For example, if the third model is a model that meets the preferences of user A, then the "you" in the second inquiry information refers to user A. After receiving the second inquiry information, the third model answers the user's possible food preferences based on the content of the second habit library through the second model. If the second habit library indicates that the user often orders a certain kind of food at a specific time and place, such as eating Western takeout at noon in the company, when receiving such an inquiry, the third model can output the answer that he wants to eat Western takeout in the user's tone. If the second habit information is not formed in the scenario associated with the second inquiry information, no answer will be given.
[0154] In some embodiments, in order to facilitate other users to provide care to the user, the created third model and second habit library can be shared with other users through the first electronic device. In this way, other users can understand the user's habits and preferences based on the shared third model and second habit library, and thus provide care to the user based on the user's habits and preferences.
[0155] Since the third model and the second habit library carry a lot of user's private habit information, in order to prevent user privacy leakage and increase the social attributes of the intelligent body, the third model and the second habit library can be shared in an interactive way between two offline electronic devices. Specifically, the first electronic device can share the third model and the second habit library with other devices in the following way:
[0156] In response to a distance between the first electronic device and the second electronic device satisfying a preset condition, establishing a communication link between the first electronic device and the second electronic device based on near field communication;
[0157] Performing key negotiation with the second electronic device based on the communication link to obtain a shared key;
[0158] The second model and the second habit library are encrypted by using a shared key to obtain encrypted data;
[0159] The encrypted data is sent to the second electronic device via the communication link.
[0160] Here, the second electronic device is any electronic device supporting near field communication other than the first electronic device.
[0161] The preset condition is set in advance according to the actual situation. For example, the preset condition is that the distance between the first electronic device and the second electronic device is less than the distance threshold. Exemplarily, when the distance between the first electronic device and the second electronic device is less than the distance threshold, the first electronic device and the second electronic device exchange device information and negotiate encryption keys, generate a shared key through a specific encryption algorithm, and when the first electronic device and the second electronic device interact with each other, the shared key is used to encrypt the interacted data, thereby improving the security of the data and preventing the data from being stolen and tampered with. The encryption algorithm includes but is not limited to the AES encryption algorithm, which performs high-intensity encryption on the data to ensure the security of the data during transmission.
[0162] According to this embodiment, by sharing the third model and the second habit library through near-field communication, this touch interaction method can bring a new social experience to the user, enhance the interactive fun, and avoid the risk of information leakage during network transmission, prevent data theft and tampering, and protect user privacy and security.
[0163] In some embodiments, in order to further improve data security, the first electronic device may further perform the following steps before encrypting the third model and the second habit library using the shared key to obtain the encrypted data:
[0164] The obtained authentication information is authenticated.
[0165] When the identity authentication is passed, the third model and the second habit library are encrypted by the shared key to obtain encrypted data.
[0166] In some embodiments of the present application, when the first electronic device, as a source terminal, shares the second model and the second habit library with the second electronic device, a sharing interaction interface may pop up on the screen of the first electronic device to display the information to be shared. At this time, the user is forced to authenticate the identity. The user may choose one or more combinations such as password input, fingerprint recognition or face recognition for authentication. After the authentication is successful, the first electronic device encrypts and packages the third model and the second habit library, and transmits it to the second electronic device as the target terminal through the secure communication link of near field communication NFC. During the identity authentication process, if the user chooses fingerprint recognition, the first electronic device will collect the user's fingerprint information as the identity authentication information, and compare the identity authentication information with the locally stored fingerprint template. If the comparison fails, it can switch to the password input mode, and the user enters the password and verifies again. Only when the user successfully passes the identity authentication, the first electronic device will encrypt, package and send the third model and the second habit library. This can further improve the security of the data.
[0167] In some embodiments of the present application, after receiving the encrypted data, the second electronic device as the target terminal decrypts the encrypted data to obtain the third model and the second habit library, integrates the third model and the second habit library into the local social application framework, adds them to the friend list, and generates a corresponding intelligent entity icon. The user of the second electronic device can start an interactive dialogue by clicking on the intelligent entity icon. The third model answers questions about the preferences of the user of the first electronic device based on the second habit library, and helps the user of the second electronic device plan caring actions or surprise arrangements. For example, the user of the second electronic device clicks on the intelligent entity icon shared by a friend on the second electronic device, enters the interactive interface and asks "What movies do you like to watch recently?" At this time, the third model answers the types of movies or specific movie names that the user of the first electronic device may be interested in based on the user's movie preference information recorded in the second habit library, helping the user of the second electronic device to better understand the user's preferences, thereby planning more considerate caring actions or surprise arrangements for the user.
[0168] It should be noted that the first electronic device can also serve as a target terminal to receive models and habit libraries shared by other electronic devices.
[0169] The above solution can realize the sharing of intelligent agents between devices, which can promote in-depth understanding and interaction between users and expand the application value of intelligent agents in the social field.
[0170] The model training method provided in the embodiment of the present application can be executed by a model training device. In the embodiment of the present application, the method of executing model training by a model training device is taken as an example to illustrate the model training device provided in the embodiment of the present application.
[0171] See also Figure 4, is a schematic diagram of a model training device provided in an embodiment of the present application, wherein the device 400 is applied to a first electronic device, such as Figure 4 As shown, the device 400 includes the following modules:
[0172] A habit library building module 410 is used to build a first habit library of the user based on the acquired graph and the user data of the user, wherein the graph includes a correspondence between each preset scene and an intent in a plurality of preset scenes, and a correspondence between each intent and a service, and the first habit library includes first habit information corresponding to each preset scene, and the first habit information includes a first service that the user is accustomed to using in the preset scene, a first intent corresponding to the first service, and operation data of the user using the first service;
[0173] The sample data construction module 420 is used to construct a first sample data set based on the first habit library, where the first sample data set includes a plurality of first sample data, each of which includes at least one preset scene and first habit information corresponding to the preset scene;
[0174] The training module 430 is used to fine-tune the first model based on the first sample data set to obtain a second model that meets user habits.
[0175] In some embodiments, the habit library building module 410 is specifically used to:
[0176] For each preset scenario, based on user data, a first service corresponding to the preset scenario is selected from a set of candidate services, where the set of candidate services is a set of services corresponding to the preset scenario in the graph;
[0177] For each first service, determining the intent corresponding to the first service in the graph as the first intent corresponding to the first service;
[0178] For each first service, determining operation data of the user using the first service based on the user data;
[0179] A first habit library of the user is constructed based on the first services, first intentions and operation data of the first services corresponding to multiple preset scenarios.
[0180] In some embodiments, the habit library building module 410 is specifically used to:
[0181] Determine an operation target of the first service based on the preset scenario, the first intention corresponding to the first service, and the first service;
[0182] Determine, based on first data related to the first service in the user data, operation parameters and application information of the first service, where the operation parameters include a user operation type and operation content, the operation content includes location information and an operation object of the user operation, and the application information is information of an application program that provides the first service;
[0183] The operation target, operation parameter and application information are determined as the operation data when the user uses the first service.
[0184] In some embodiments, the habit library building module 410 is further used to build a second habit library of the user based on the graph and the user data, the second habit library including second habit information corresponding to each preset scenario, the second habit information including the second intent, the second service corresponding to the second intent, and the context data of the second service, the context data at least including the user's preference under the second service;
[0185] The sample data construction module 420 is further used to construct a second sample data set based on the second habit library, the second sample data set including a plurality of second sample data, each of which includes at least one preset scene and second habit information corresponding to the preset scene;
[0186] The training module 430 is further used to fine-tune the first model based on the second sample data set to obtain a third model that meets the user's preference.
[0187] In some embodiments, the habit library building module 410 is specifically used to:
[0188] For each preset scenario, determine a second intent corresponding to the preset scenario and a second service corresponding to the second intent based on the graph;
[0189] For each second service, second data related to the second service in the user data is input into the large language model to obtain the user's preference for the second service.
[0190] The model training device in the embodiment of the present application can be an electronic device, or a component in the electronic device, such as an integrated circuit or a chip. The electronic device can be a terminal, or other devices other than a terminal. Exemplarily, the electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, a vehicle-mounted electronic device, a mobile Internet device (Mobile Internet Device, MID), an augmented reality (augmented reality, AR) / virtual reality (virtualreality, VR) device, a robot, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and can also be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personalcomputer, PC), a television (television, TV), a teller machine or a self-service machine, etc., and the embodiment of the present application is not specifically limited.
[0191] The model training device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0192] The model training device provided in the embodiment of the present application can achieve Figures 1 to 3 To avoid repetition, the various processes implemented by the method embodiment are not described here.
[0193] Alternatively, if Figure 5 As shown, an embodiment of the present application also provides an electronic device 500, including a processor 501 and a memory 502, wherein the memory 502 stores programs or instructions that can be executed on the processor 501, and when the program or instructions are executed by the processor 501, the various steps of the above-mentioned model training method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, they are not described here.
[0194] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0195] Figure 6 A schematic diagram of the hardware structure of an electronic device to implement an embodiment of the present application.
[0196] The electronic device 600 includes but is not limited to: a radio frequency unit 601, a network module 602, an audio output unit 603, an input unit 604, a sensor 605, a display unit 606, a user input unit 607, an interface unit 608, a memory 609, and a processor 610.
[0197] Those skilled in the art will appreciate that the electronic device 600 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 610 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 6 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0198] The processor 610 is used to construct a first habit library of the user based on the acquired graph and the user data of the user, wherein the graph includes a correspondence between each preset scene and an intent in a plurality of preset scenes, and a correspondence between each intent and a service, and the first habit library includes first habit information corresponding to each preset scene, and the first habit information includes a first service that the user is accustomed to using in the preset scene, a first intent corresponding to the first service, and operation data of the user using the first service;
[0199] The processor 610 is further configured to construct a first sample data set based on the first habit library, where the first sample data set includes a plurality of first sample data, each of which includes at least one preset scene and first habit information corresponding to the preset scene;
[0200] The processor 610 is further configured to fine-tune the first model based on the first sample data set to obtain a second model that conforms to user habits.
[0201] In some embodiments, the processor 610 is specifically configured to:
[0202] For each preset scenario, based on user data, a first service corresponding to the preset scenario is selected from a set of candidate services, where the set of candidate services is a set of services corresponding to the preset scenario in the graph;
[0203] For each first service, determining the intent corresponding to the first service in the graph as the first intent corresponding to the first service;
[0204] For each first service, determining operation data of the user using the first service based on the user data;
[0205] A first habit library of the user is constructed based on the first services, first intentions and operation data of the first services corresponding to multiple preset scenarios.
[0206] In some embodiments, the processor 610 is specifically configured to:
[0207] Determine an operation target of the first service based on the preset scenario, the first intention corresponding to the first service, and the first service;
[0208] Determine, based on first data related to the first service in the user data, operation parameters and application information of the first service, where the operation parameters include a user operation type and operation content, the operation content includes location information and an operation object of the user operation, and the application information is information of an application program that provides the first service;
[0209] The operation target, operation parameter and application information are determined as the operation data when the user uses the first service.
[0210] In some embodiments, the processor 610 is further configured to construct a second habit library of the user based on the graph and the user data, where the second habit library includes second habit information corresponding to each preset scenario, the second habit information includes a second intent, a second service corresponding to the second intent, and context data of the second service, where the context data includes at least a preference of the user under the second service;
[0211] The processor 610 is further configured to construct a second sample data set based on the second habit library, where the second sample data set includes a plurality of second sample data, each of which includes at least one preset scene and second habit information corresponding to the preset scene;
[0212] The processor 610 is further configured to fine-tune the first model based on the second sample data set to obtain a third model that meets the user's preference.
[0213] In some embodiments, the processor 610 is specifically configured to:
[0214] For each preset scenario, determine a second intent corresponding to the preset scenario and a second service corresponding to the second intent based on the graph;
[0215] For each second service, second data related to the second service in the user data is input into the large language model to obtain the user's preference for the second service.
[0216] It should be understood that in the embodiments of the present application, the input unit 604 may include a Graphics Processing Unit (GPU) 6041 and a microphone 6042. The GPU 6041 processes the image data of static pictures or videos obtained by an image capturing device (such as a camera) in the video capture mode or the image capture mode. The display unit 606 may include a display panel 6061, and the display panel 6061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 607 includes at least one of a touch panel 6071 and other input devices 6072. The touch panel 6071 is also referred to as a touch screen. The touch panel 6071 may include two parts: a touch detection device and a touch controller. The other input devices 6072 may include, but are not limited to, a physical keyboard, function keys (such as volume control keys, switch keys, etc.), a trackball, a mouse, and a joystick, which will not be elaborated here.
[0217] The memory 609 can be used to store software programs and various data. The memory 609 mainly includes a first storage area for storing programs or instructions and a second storage area for storing data. Among them, the first storage area can store an operating system, applications or instructions required for at least one function (such as a sound playback function, an image playback function, etc.). In addition, the memory 609 may include a volatile memory or a non-volatile memory, or the memory 609 may include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically EPROM (EEPROM), or a flash memory. The volatile memory may be a Random Access Memory (RAM), a Static RAM (SRAM), a Dynamic RAM (DRAM), a Synchronous DRAM (SDRAM), a Double Data Rate SDRAM (DDR SDRAM), an Enhanced SDRAM (ESDRAM), a Synch link DRAM (SLDRAM), and a Direct Rambus RAM (DRRAM). The memory 609 in the embodiments of the present application includes, but is not limited to, these and any other suitable types of memories.
[0218] The processor 610 may include one or more processing units; optionally, the processor 610 integrates an application processor and a modem processor, wherein the application processor mainly processes operations related to an operating system, a user interface, and application programs, and the modem processor mainly processes wireless communication signals, such as a baseband processor. It is understandable that the modem processor may not be integrated into the processor 610.
[0219] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned model training method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0220] The processor is the processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory ROM, a random access memory RAM, a magnetic disk or an optical disk.
[0221] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned model training method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0222] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0223] An embodiment of the present application provides a computer program product, which is stored in a storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned model training method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0224] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0225] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0226] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A model training method, characterized in that: The method comprises: Based on the acquired graph and the user data of the user, a first habit library of the user is constructed, wherein the graph includes a correspondence between each preset scenario and an intent in a plurality of preset scenarios, and a correspondence between each of the intents and a service, and the first habit library includes first habit information corresponding to each of the preset scenarios, and the first habit information includes a first service that the user is accustomed to using in the preset scenario, a first intent corresponding to the first service, and operation data of the user using the first service; Building a first sample data set based on the first habit library, the first sample data set including a plurality of first sample data, each of the first sample data including at least one of the preset scenes and the first habit information corresponding to the preset scene; Fine-tune the first model based on the first sample data set to obtain a second model that conforms to the user's habits.
2. The method according to claim 1, characterized in that The step of constructing a first habit library of the user based on the graph and the user data includes: For each of the preset scenarios, based on the user data, a first service corresponding to the preset scenario is screened out from a set of candidate services, where the set of candidate services is a set of services in the graph corresponding to the preset scenario; For each of the first services, determining the intent corresponding to the first service in the graph as the first intent corresponding to the first service; For each of the first services, determining, based on the user data, operation data of the user using the first service; A first habit library of the user is constructed based on the first service, the first intention and the operation data of the first service corresponding to the multiple preset scenarios.
3. The method according to claim 2, characterized in that The determining, based on the user data, operation data of the first service includes: Determining an operation target of the first service based on the preset scenario, a first intention corresponding to the first service, and the first service; Determine, based on first data related to the first service in the user data, operation parameters and application information of the first service, wherein the operation parameters include a user operation type and operation content, the operation content includes location information and an operation object of the user operation, and the application information is information of an application program that provides the first service; The operation target, the operation parameter, and the application information are determined as operation data when the user uses the first service.
4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises: Based on the graph and the user data, construct a second habit library of the user, wherein the second habit library includes second habit information corresponding to each of the preset scenarios, the second habit information includes a second intent, a second service corresponding to the second intent, and context data of the second service, wherein the context data includes at least the user's preference for the second service; Building a second sample data set based on the second habit library, the second sample data set including a plurality of second sample data, each of the second sample data including at least one of the preset scenes and the second habit information corresponding to the preset scene; Fine-tune the first model based on the second sample data set to obtain a third model that meets the user's preference.
5. The method according to claim 4, characterized in that The step of constructing a second habit library of the user based on the graph and the user data includes: For each of the preset scenarios, determining a second intent corresponding to the preset scenario and a second service corresponding to the second intent based on the graph; For each of the second services, second data related to the second service in the user data is input into a large language model to obtain the user's preference for the second service.
6. A model training device, characterized in that: The device comprises: A habit library construction module, for constructing a first habit library of the user based on the acquired graph and the user data of the user, wherein the graph includes a correspondence between each preset scene and an intent in a plurality of preset scenes, and a correspondence between each of the intents and a service, and the first habit library includes first habit information corresponding to each of the preset scenes, and the first habit information includes a first service that the user is accustomed to using in the preset scene, a first intent corresponding to the first service, and operation data of the user using the first service; A sample data construction module, configured to construct a first sample data set based on the first habit library, wherein the first sample data set includes a plurality of first sample data, each of which includes at least one of the preset scenes and the first habit information corresponding to the preset scene; A training module is used to fine-tune the first model based on the first sample data set to obtain a second model that conforms to the user's habits.
7. The device according to claim 6, characterized in that The habit library construction module is specifically used for: For each of the preset scenarios, based on the user data, a first service corresponding to the preset scenario is screened out from a set of candidate services, where the set of candidate services is a set of services in the graph corresponding to the preset scenario; For each of the first services, determining the intent corresponding to the first service in the graph as the first intent corresponding to the first service; For each of the first services, determining, based on the user data, operation data of the user using the first service; A first habit library of the user is constructed based on the first service, the first intention and the operation data of the first service corresponding to the multiple preset scenarios.
8. The device according to claim 7, characterized in that The habit library construction module is specifically used for: Determining an operation target of the first service based on the preset scenario, a first intention corresponding to the first service, and the first service; Determine, based on first data related to the first service in the user data, operation parameters and application information of the first service, wherein the operation parameters include a user operation type and operation content, the operation content includes location information and an operation object of the user operation, and the application information is information of an application program that provides the first service; The operation target, the operation parameter, and the application information are determined as operation data when the user uses the first service.
9. The device according to any one of claims 6 to 8, characterized in that: The habit library building module is further used to build a second habit library of the user based on the graph and the user data, wherein the second habit library includes second habit information corresponding to each of the preset scenarios, the second habit information includes a second intent, a second service corresponding to the second intent, and context data of the second service, wherein the context data at least includes the user's preference under the second service; The sample data construction module is further used to construct a second sample data set based on the second habit library, the second sample data set including a plurality of second sample data, each of which includes at least one of the preset scenes and the second habit information corresponding to the preset scene; The training module is further used to fine-tune the first model based on the second sample data set to obtain a third model that meets the user's preferences.
10. The device according to claim 9, characterized in that The habit library construction module is specifically used for: For each of the preset scenarios, determining a second intent corresponding to the preset scenario and a second service corresponding to the second intent based on the graph; For each of the second services, second data related to the second service in the user data is input into a large language model to obtain the user's preference for the second service.