Method, system and equipment for generating and recommending personalized recipes and medium
By acquiring and pre -processing user data, optimizing the recipe generation model, solving the problem of traditional recipe recommendation methods that cannot meet personalized needs, and achieve higher recommendation accuracy and practicality.
Patent Information
- Application Number
- CN202411420354.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-28
AI Technical Summary
Traditional recipe generation recommendation methods cannot effectively meet users' personalized needs, and the accuracy and practicality of recipe generation recommendations are not high.
By obtaining users' first data, second data, and current user data, data pre -processing is performed to obtain user characteristics data, continuously optimized the recipe generation model, and generate personalized recipe recommendation results.
It improves the accuracy and practicality of the recommendation of recipes, so that the recommended recipe can more adapt to the user's preferences and physical changes, and meet the user's personalized needs.
Smart Images

Figure CN119380933A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a method, system, device and medium for generating and recommending personalized recipes. Background Art
[0002] With the improvement of living standards, people pay more and more attention to the important impact of dietary nutrition on health, making recipe generation and recommendation more and more popular.
[0003] At present, the traditional recipe generation recommendation method mainly uses a simple rule engine to generate corresponding recommended recipes based on user input data. The recommended recipes provided by this method often cannot meet the personalized needs of users well, and the accuracy and practicality of the recipe generation recommendation are unsatisfactory.
[0004] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the invention
[0005] The purpose of the present invention is to solve one of the technical problems existing in the related art to at least a certain extent.
[0006] The main purpose of the embodiments of the present application is to propose a method for generating and recommending personalized recipes, which can improve the accuracy and practicality of recipe generation recommendations and better meet the personalized needs of users.
[0007] To achieve the above-mentioned purpose, one aspect of an embodiment of the present application proposes a method for generating and recommending personalized recipes, the method comprising:
[0008] Acquire first data, second data and current user individual data corresponding to the user, wherein the first data is used to record recipe data previously predicted and generated by a recipe generation model, and the second data is used to record actual recipe data of the user;
[0009] Performing data preprocessing on the current user individual data to obtain user characteristic data;
[0010] Continuously optimizing the recipe generation model according to the user feature data, the second data, and the first data to obtain an optimized recipe generation model;
[0011] The user feature data is input into the optimized recipe generation model to perform recipe prediction, and a recipe generation recommendation result output by the optimized recipe generation model is obtained.
[0012] In some embodiments, the preprocessing of the current user individual data to obtain user characteristic data includes:
[0013] Performing data cleaning on the current user individual data to obtain first volume data;
[0014] Standardizing the format and data of the first individual data to obtain second individual data;
[0015] Individual feature extraction is performed on the second individual data to obtain the user feature data.
[0016] In some embodiments, extracting individual features from the second individual data to obtain the user feature data includes:
[0017] Extracting derived features from the second individual data to obtain user derived features;
[0018] Extracting behavior features from the second individual data to obtain user behavior features;
[0019] The second individual data, the user-derived feature and the user behavior feature are concatenated and combined to obtain the user feature data.
[0020] In some embodiments, the continuously optimizing the recipe generation model according to the user feature data, the second data, and the first data to obtain an optimized recipe generation model includes:
[0021] Determine a first sub-loss value according to the first data and the second data;
[0022] Determining a second sub-loss value according to the user characteristic data;
[0023] According to the first sub-loss value and the second sub-loss value, the parameters of the recipe generation model are jointly optimized to obtain the optimized recipe generation model.
[0024] In some embodiments, the optimized recipe generation model includes a linear network framework and a deep network framework, and the step of inputting the user feature data into the optimized recipe generation model for recipe prediction to obtain a recipe generation recommendation result output by the optimized recipe generation model includes:
[0025] Inputting the user feature data into the linear network framework to extract linear features to obtain linear feature data;
[0026] Inputting the user feature data into the deep network framework to extract deep features and obtain deep feature data;
[0027] According to the linear feature data, a weighted sum calculation is performed on the deep feature data to obtain a recipe generation recommendation result output by the optimized recipe generation model.
[0028] In some embodiments, the step of inputting the user feature data into the linear network framework to extract linear features to obtain linear feature data includes:
[0029] Performing cross-feature combination on the user feature data to obtain combined feature data;
[0030] Logistic regression feature extraction is performed on the combined feature data to obtain the linear feature data.
[0031] In some embodiments, the step of inputting the user feature data into the deep network framework to extract deep features to obtain the deep feature data includes:
[0032] Performing feature dimensionality reduction on the user feature data to obtain a dimensionality reduction vector representation;
[0033] Complex feature extraction is performed on the reduced-dimensional vector representation to obtain the deep feature data.
[0034] To achieve the above purpose, another aspect of the embodiment of the present application proposes a personalized recipe generation recommendation system, including:
[0035] A first processing unit is used to obtain first data, second data and current user individual data corresponding to a user, wherein the first data is used to record recipe data previously predicted and generated by a recipe generation model, and the second data is used to record actual recipe data of the user;
[0036] A second processing unit, configured to perform data preprocessing on the current user individual data to obtain user characteristic data;
[0037] A third processing unit, configured to continuously optimize the recipe generation model according to the user feature data, the second data, and the first data to obtain an optimized recipe generation model;
[0038] The fourth processing unit is used to input the user feature data into the optimized recipe generation model to perform recipe prediction, and obtain the recipe generation recommendation result output by the optimized recipe generation model.
[0039] To achieve the above-mentioned purpose, another aspect of an embodiment of the present application provides an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above-mentioned method when executing the computer program.
[0040] To achieve the above objective, another aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described above is implemented.
[0041] The embodiments of the present application include at least the following beneficial effects:
[0042] The present application provides a method, system, device and medium for generating and recommending personalized recipes, wherein the generating and recommending method obtains first data, second data and current user individual data corresponding to a user, wherein the first data is used to record the recipe data previously predicted and generated by a recipe generation model, and the second data is used to record the actual recipe data of the user; the current user individual data is preprocessed to obtain user feature data; the recipe generation model is continuously optimized according to the user feature data, the second data and the first data to obtain an optimized recipe generation model; the user feature data is input into the optimized recipe generation model to perform recipe prediction, and a recipe generation recommendation result output by the optimized recipe generation model is obtained. The generating and recommending method optimizes and updates the recipe generation model in real time and continuously based on the second data and the first data before providing the recommended recipe to the user, and then generates the recipe generation recommendation result based on the optimized recipe generation model, which can make the recommended recipe generated by the recipe generation model continuously adapt to the user's preferences and changes in the user's physical condition, effectively improve the personalization of the recipe generation recommendation, better meet the user's personalized needs for the recipe generation recommendation, and the recipe generation recommendation has high accuracy and practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 It is a flowchart of a method for generating and recommending personalized recipes provided in an embodiment of the present application;
[0044] Figure 2 is a detailed flow chart of step S120 provided in an embodiment of the present application;
[0045] Figure 3 is a detailed flow chart of step A3 provided in an embodiment of the present application;
[0046] Figure 4 is a detailed flow chart of step S130 provided in an embodiment of the present application;
[0047] Figure 5 is a detailed flow chart of step S140 provided in an embodiment of the present application;
[0048] Figure 6 It is a schematic diagram of a framework of an optimized recipe generation model provided in an embodiment of the present application;
[0049] Figure 7 is a detailed flow chart of step C1 provided in an embodiment of the present application;
[0050] Figure 8is a detailed flow chart of step C2 provided in an embodiment of the present application;
[0051] Fig. 9 It is a schematic diagram of a framework of a personalized recipe generation and recommendation system provided in an embodiment of the present application;
[0052] Fig.10 It is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application is further described in detail below in conjunction with the accompanying drawings and examples. It should be understood that the specific embodiments described herein are only used to explain the present application and are not intended to limit the present application. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the embodiments of the present application. They are only examples of devices / equipment and methods consistent with some aspects of the embodiments of the present application as detailed in the attached claims.
[0054] It is understood that the terms "first", "second", etc. used in this application can be used to describe various concepts in this article, but unless otherwise specified, these concepts are not limited by these terms. These terms are only used to distinguish one concept from another concept. For example, without departing from the scope of the embodiment of the present application, the first information may also be referred to as the second information, and similarly, the second information may also be referred to as the first information. Depending on the context, the words "if" and "if" as used herein can be interpreted as "at the time of" or "when" or "in response to determination".
[0055] The terms "at least one", "multiple", "each", "any", etc. used in this application, at least one includes one, two or more, multiple includes two or more, each refers to each of the corresponding multiple, and any refers to any one of the multiple.
[0056] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.
[0057] At present, the traditional recipe generation and recommendation method mainly uses a simple rule engine to generate corresponding recommended recipes based on user input data. The recommended recipes provided by this method have the problem that the recommended recipes are relatively fixed and formulaic. It is unable to recommend corresponding recipes in a personalized manner based on user preferences, changes in user physical condition, health goals set by users, etc., and cannot better meet the personalized needs of users. The accuracy and practicality of personalized nutrition recipe generation recommendations are unsatisfactory.
[0058] In view of this, the present application provides a personalized recipe generation and recommendation method, system, device and medium, wherein the generation and recommendation method optimizes and updates the recipe generation model in real time and continuously based on the second data and the first data before providing the recommended recipe to the user, and then generates the recipe generation recommendation result based on the optimized recipe generation model, which can make the recommended recipes generated by the recipe generation model continuously adapt to the user's preferences and changes in the user's physical condition, effectively improve the personalization level of the recipe generation recommendation, better meet the user's personalized needs for the recipe generation recommendation, and the recipe generation recommendation has high accuracy and practicality.
[0059] A personalized recipe generation and recommendation method provided in an embodiment of the present application can be applied to a health management application scenario. In a health management application scenario, a health management service provider can deploy a continuously optimized recipe generation model in a health management server through the personalized recipe generation and recommendation method provided in an embodiment of the present application, and then generate recommended recipes based on the optimized recipe generation model obtained through continuous optimization based on the real-time data currently provided by the user, which can make the recommended recipes generated by the recipe generation model continuously adapt to the user's preferences and changes in the user's physical condition, effectively improve the personalization of the recipe generation recommendation, better meet the user's personalized needs for recipe generation recommendation, and the accuracy and practicality of the recipe generation recommendation are high.
[0060] A method for generating and recommending personalized recipes provided in an embodiment of the present application can be applied to a terminal or a server, and can also be software running in a terminal or a server. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, a smart speaker, a smart watch, and a car terminal, etc., but is not limited to this; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, and can also be configured as a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network; the software can be an application that implements the method, etc., but is not limited to the above forms.
[0061] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.
[0062] It should be noted that in each specific implementation of the present application, when it comes to the need to perform relevant processing based on data related to user identity or characteristics such as user information, user behavior data, user historical data, and user location information, the user's permission or consent will be obtained first, and the collection, use, and processing of these data will comply with relevant laws, regulations, and standards. In addition, when the embodiment of the present application needs to obtain the user's sensitive personal information, the user's separate permission or consent will be obtained through a pop-up window or by jumping to a confirmation page. After clearly obtaining the user's separate permission or consent, the necessary user-related data for the normal operation of the embodiment of the present application will be obtained.
[0063] Reference Figure 1 , Figure 1 is an optional flow chart of a method for generating and recommending personalized recipes provided in an embodiment of the present application. Figure 1 The method for generating recommendations may include but is not limited to steps S110 to S140.
[0064] Step S110, obtaining first data, second data and current user individual data corresponding to the user, wherein the first data is used to record the recipe data previously predicted and generated by the recipe generation model, and the second data is used to record the actual recipe data of the user;
[0065] In some embodiments, the first data is the recipe data previously predicted and generated by the recipe generation model, and the first data can be stored in the user terminal or database. Specifically, in special cases (such as when the user is a new user), when the user does not have the recipe data previously predicted and generated by the recipe generation model, the first data can be the first data corresponding to the user obtained by the recipe generation model by predicting and generating a recommended recipe in real time based on the input data provided by the new user (such as user hobbies, user physical condition data, etc.), or the preset recipe data template is determined as the first data of the user.
[0066] It is understandable that if the user has recipe data previously predicted and generated by the recipe generation model, then several recipe data previously predicted and generated by the recipe generation model can be determined as the user's first data. For example, the recipe generation recommendation result generated by the recipe generation model in the last recipe generation recommendation process can be determined as the user's first data, or the recipe generation recommendation result provided by the recipe generation model in the recent period can be determined as the user's first data. In addition, the recipe generation model in the embodiment of the present application can make recipe generation recommendations based on the data provided by the food database and the recipe database. Specifically, the food database includes the nutritional components and applicable populations of various types of food, wherein the nutritional components include calories, protein, fat, carbohydrates, vitamins, minerals, etc.; the recipe database includes multiple recipes, each recipe includes specific ingredients, nutritional components, nutritional effects and applicable populations, etc., which will not be repeated in this application.
[0067] It should be noted that the second data may be actual recipe data corresponding to the first data. Specifically, the user's actual recipe data may be the user's diet record corresponding to the recipe data provided by the recipe generation model. The actual recipe data and user change data may be provided by the user or collected through smart devices (such as smart bracelets, mobile phones, etc.).
[0068] It is worth mentioning that the current user individual data is used to record the current status data of the user. Specifically, the current user individual data includes user fixed data and user change data. The user fixed data includes user basic information and health status, and the user change data includes daily data related to the user's diet. Specifically, the user basic information in the embodiment of the present application may include at least one of age, gender, height, weight, health goals (such as weight loss, muscle gain, weight maintenance, weight gain, etc.), health needs (such as recuperation, spleen and stomach care, general health care, moisture removal, hair care, etc.), etc., and the health status may include at least one of allergy history, disease history, dietary preferences (such as vegetarian, lactose-free diet, etc.), nutritional needs (such as high protein, low carbon water, high vitamins, etc.); the user change data may include at least one of the user's weight change, exercise volume, sleep quality, hair volume change, etc. in the last two recipe recommendations.
[0069] Step S120: pre-process the current user individual data to obtain user characteristic data;
[0070] In an embodiment of the present application, step S120 is used to perform data preprocessing on the user's current individual user data, so as to generate user feature data that can be accurately understood and used by the recipe generation model. The user feature data in the embodiment of the present application may include user input features, user derived features and user behavior features.
[0071] Reference Figure 2 In some embodiments, the step S120 of preprocessing the current user individual data to obtain user characteristic data includes:
[0072] A1. Clean the current user individual data to obtain first volume data;
[0073] A2. Standardizing the format and data of the first individual data to obtain second individual data;
[0074] In the embodiment of the present application, the data cleaning in step A1 is used to remove noise and erroneous data in the current user individual data. Specifically, the data cleaning of step A1 may first be to perform an outlier detection on the current user individual data. Specifically, the outlier detection may be any one of Z-score anomaly detection or Grubbs anomaly detection. In the embodiment of the present application, Z-score anomaly detection is taken as an example. Specifically, a preset Z-score threshold is obtained. The Z-score threshold may be set according to actual conditions. For example, the Z-score threshold may be 2, 3, etc. Then, the mean and standard deviation of all data in the current user individual data are calculated. The Z-score of each data in the current user individual data is calculated based on the calculated mean and standard deviation. Data with a Z-score greater than or equal to the absolute value of the Z-score threshold is determined as an outlier and removed, and data with a Z-score less than the absolute value of the Z-score threshold in the current user individual data is retained. Then, after obtaining the current user individual data with the outlier removed, the data logical relationship of the current user individual data may be verified. Specifically, conditional logic may be set to remove logically abnormal data from the current user individual data and retain logically normal data in the current user individual data. Then, the current user individual data after the logically abnormal data is removed is determined as the first individual data. There are many ways to implement the specific conditional logic, which are not limited in the present application.
[0075] It is understandable that, since the data units, formats, ranges, etc. provided by different users may not be consistent, the embodiment of the present application can convert the data provided by the user into a unified format through the format and data standardization in step A2. Specifically, the format and data standardization in step A2 can first be to standardize the format of the first volume data, and then standardize the value range data of the first volume data after format standardization, wherein the format representation can be to unify the measurement units of the numerical type data in the first volume data through base conversion, for example, unify the measurement unit of the weight data in the first volume data into kilograms, unify the measurement unit of the height data in the first volume data into centimeters, and the rest of the first volume data in the first volume data is similar, which can be simply deduced by analogy to obtain the first volume data after format standardization; then, the value range data standardization can be based on any one of the minimum-maximum normalization (Min-MaxNormalization), Z score normalization, etc., to scale the data value of the first volume data after format standardization, so as to obtain the second volume data with data values scaled to between [0, 1].
[0076] Exemplarily, an equivalent expression for value range normalization may be:
[0077]
[0078] Among them, X normalize is a data value in the second volume; X is the value in the first volume that corresponds to X normalize Corresponding data value; X min is the minimum data value in the first volume; X max is the maximum data value in the first volume.
[0079] A3. Extract individual features from the second individual data to obtain the user feature data.
[0080] Reference Figure 3 In some embodiments, the step A3 of extracting individual characteristics from the second individual data to obtain the user characteristic data includes:
[0081] A31. Extracting derived features from the second individual data to obtain user derived features;
[0082] A32. Extracting behavior features from the second individual data to obtain user behavior features;
[0083] A33. Concatenate and combine the second individual data, the user-derived feature, and the user behavior feature to obtain the user feature data.
[0084] In the embodiment of the present application, the individual feature extraction in step A3 is used to extract features in the current user individual data, which can specifically be to extract user input features, user derived features and user behavior features. Specifically, the individual feature extraction in step A3 can first determine the second individual data as user input features; then based on the derived feature extraction in step A31, extract the user derived features in the second individual data, and the user derived features can specifically include BMI value, user's daily energy demand (Total Daily Energy Expenditure, TDEE), etc., wherein the BMI value can be calculated based on the weight data and height data in the second individual data, and the user's daily energy demand can be calculated based on the basal metabolic rate (Basal Metabolic Rate, BMR) and the activity coefficient, and the basal metabolic rate can be calculated by the Mifflin-St Jeor Equation; then, the behavior feature extraction in step A3 can be based on the user's historical behavior data, extract the user's long-term behavior from the second individual data, and determine the user's long-term behavior as a user behavior feature, for example, if a user often chooses high-protein food, the user behavior feature of the user can be marked as "preferring high protein".
[0085] It should be added that after obtaining the user input features, user derived features and user behavior features, the user input features, user derived features and user behavior features can be simply spliced and combined to obtain user feature data. There are many specific splicing and combination methods, which will not be repeated in this application.
[0086] Step S130: Continuously optimize the recipe generation model according to the user feature data, the second data and the first data to obtain an optimized recipe generation model;
[0087] In an embodiment of the present application, the recipe generation model may be an optimized recipe generation model corresponding to the previous recipe generation recommendation result obtained by the user. Step S130 may be that before providing the recipe generation recommendation result to the user, based on the second data fed back by the user, the first data is input into the optimized recipe generation model corresponding to the previous recipe generation recommendation result for continuous learning and optimization, so as to obtain the optimized recipe generation model.
[0088] Reference Figure 4 In some embodiments, the step S130, continuously optimizing the recipe generation model according to the user feature data, the second data and the first data to obtain an optimized recipe generation model, includes:
[0089] B1. determining a first sub-loss value according to the first data and the second data;
[0090] B2. determining a second sub-loss value according to the user characteristic data;
[0091] B3. According to the first sub-loss value and the second sub-loss value, the parameters of the recipe generation model are jointly optimized to obtain the optimized recipe generation model.
[0092] In an embodiment of the present application, the accuracy of the recipe data provided by the recipe generation model can be measured based on the second data. Specifically, for the recipe generation model, the accuracy of the recipe data it generates and provides can be measured by the consistency of the second data and the first data. The closer the second data is to the first data, the more accurate the recommended recipes provided by the recipe generation model are, and the better the reliability is; conversely, the closer the second data is to the first data, the less accurate the recommended recipes provided by the recipe generation model are, and the worse the reliability is. Therefore, in an embodiment of the present application, a loss value can be determined based on the second data and the first data, and the obtained loss value can be recorded as the first sub-loss value. For the loss function used to determine the first sub-loss value, it can specifically be any one of a 0-1 loss function, a square loss function, an absolute loss function, a logarithmic loss function, a cross entropy loss function, etc. The examples in this application are for illustration only and are not intended to limit this application.
[0093] It is understandable that step B2 can be to measure the practicality of the recipe data provided by the recipe generation model based on the user characteristic data. Specifically, for the recipe generation model, the practicality of the recipe data it generates and provides can be measured by the consistency between the user's fixed data and the user's variable data. For example, when the user's health goal is to lose weight, it can be measured by the weight corresponding to the health goal and the weight change in the user's variable data. Or, when the user's health need is hair care, it can be measured by the hair loss data corresponding to the health need and the hair loss change in the user's variable data. Therefore, in an embodiment of the present application, the second sub-loss value can be determined based on the user's characteristic data, and the loss function used by the second sub-loss value can be set according to the actual situation, and the present application is not limited here.
[0094] It should be noted that the accuracy and practicality of the recommended recipes provided by the recipe generation model can be determined based on the first sub-loss value and the second sub-loss value. Specifically, the overall loss value of the recipe generation model can be calculated based on the first loss value and the second sub-loss value, and the overall loss value of the recipe generation model can be recorded as the target loss value. The target loss value can be calculated by weighted summation, where the weights of each sub-loss value can be the same or different. After obtaining the target loss value of the recipe generation model, the relevant parameters of the recipe generation model can be updated through a back-propagation algorithm (such as the Adam back-propagation algorithm), thereby improving the recipe generation recommendation performance of the recipe generation model.
[0095] Step S140: input the user feature data into the optimized recipe generation model to perform recipe prediction, and obtain a recipe generation recommendation result output by the optimized recipe generation model.
[0096] In an embodiment of the present application, before providing recommended recipes to users, the recipe generation model can be continuously learned and optimized through the first data and the second data to obtain an optimized recipe generation model. The optimized recipe generation model can effectively capture current user needs. After the user feature data is input into the optimized recipe generation model, the recommended recipes predicted and generated by the recipe generation model (i.e., the recipe generation recommendation results) can make the recommended recipes generated by the recipe generation model continuously adapt to user preferences and changes in user physical conditions, effectively improve the personalization level of recipe generation recommendations, better meet users' personalized needs for recipe generation recommendations, and have high accuracy and practicality of recipe generation recommendations.
[0097] Reference Figure 5 and Figure 6 In some embodiments, the optimized recipe generation model includes a linear network framework and a deep network framework, and the step S140 of inputting the user feature data into the optimized recipe generation model for recipe prediction to obtain a recipe generation recommendation result output by the optimized recipe generation model includes:
[0098] C1. Inputting the user feature data into the linear network framework to extract linear features and obtain linear feature data;
[0099] Reference Figure 7 Further, the step C1, inputting the user feature data into the linear network framework to extract linear features to obtain linear feature data, includes:
[0100] C11, performing cross-feature combination on the user feature data to obtain combined feature data;
[0101] C12. Perform logistic regression feature extraction on the combined feature data to obtain the linear feature data.
[0102] In an embodiment of the present application, the optimized recipe generation model can be a Wide&Deep model, wherein the linear network framework can be the Wide network in the Wide&Deep model, and the deep network framework can be the Deep network in the Wide&Deep model.
[0103] It can be understood that step C11 can be to generate a feature column by cross-feature combination of each feature in the user feature data, and record the feature column as combined feature data, and specifically generate the feature column by cross-product transformation; step C12 can be based on the logistic regression part of the wide network, extract the linear combination relationship in the combined feature data, and then obtain the linear feature data. Specifically, the equivalent expression of the linear feature data can be:
[0104] y wide =wx+b
[0105] Among them, y wide is the linear feature data, w is the feature weight, x is the combined feature data, and b is the bias term.
[0106] C2. Inputting the user feature data into the deep network framework to extract deep features and obtain deep feature data;
[0107] Reference Figure 8 Further, the step C2, inputting the user feature data into the deep network framework to extract deep features to obtain deep feature data, includes:
[0108] C21, performing feature dimension reduction on the user feature data to obtain a dimension reduction vector representation;
[0109] C22. Perform complex feature extraction on the reduced-dimensional vector representation to obtain the deep feature data.
[0110] In an embodiment of the present application, step C21 can perform feature dimensionality reduction on the user features of the category type through an embedding layer (Embedding Layer) in a deep network, so as to obtain a low-dimensional continuous vector corresponding to the user feature data, and record the obtained low-dimensional continuous vector as a reduced-dimensional vector representation.
[0111] It is understandable that the complex feature extraction in step C22 can be performed by extracting complex features in the dimensionality reduction vector representation through several fully connected layers in the Deep network to obtain deep feature data, wherein each fully connected layer includes multiple neurons. In the embodiment of the present application, the number of fully connected layers in the Deep network and the number of neurons in each fully connected layer can be flexibly set according to the data complexity and scale of the user feature data, and the present application does not limit this.
[0112] C3. Perform a weighted sum calculation on the deep feature data based on the linear feature data to obtain a recipe generation recommendation result output by the optimized recipe generation model.
[0113] In an embodiment of the present application, after obtaining linear feature data through a linear network framework and deep feature data through a deep network framework, the linear feature data and the deep feature data can be input into an activation function, and then the recipe generation recommendation result output by the recipe generation model is optimized through a weighted summation calculation method, wherein the weights corresponding to the linear feature data and the deep feature data can be the same or different.
[0114] See also Fig. 9 The embodiment of the present application also provides a personalized recipe generation recommendation system, the generation recommendation system comprising:
[0115] A first processing unit 810 is used to obtain first data, second data and current user individual data corresponding to a user, wherein the first data is used to record recipe data previously predicted and generated by a recipe generation model, and the second data is used to record actual recipe data of the user;
[0116] The second processing unit 820 is used to perform data preprocessing on the current user individual data to obtain user characteristic data;
[0117] A third processing unit 830 is used to continuously optimize the recipe generation model according to the user feature data, the second data and the first data to obtain an optimized recipe generation model;
[0118] The fourth processing unit 840 is used to input the user feature data into the optimized recipe generation model to perform recipe prediction, and obtain a recipe generation recommendation result output by the optimized recipe generation model.
[0119] It can be understood that the contents of the above method embodiments are all applicable to the present system embodiments, the functions specifically implemented by the present system embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0120] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.
[0121] It can be understood that the contents of the above method embodiments are all applicable to the present device embodiments, the functions specifically implemented by the present device embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0122] See also Fig.10 , Fig.10 The hardware structure of an electronic device of an embodiment is illustrated, and the electronic device includes:
[0123] The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;
[0124] The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solutions provided in the embodiments of this specification are implemented by software or firmware, the relevant program codes are stored in the memory 902, and the processor 901 calls and executes the methods of the embodiments of this application;
[0125] Input / output interface 903, used to implement information input and output;
[0126] Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized by wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.);
[0127] A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904);
[0128] The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .
[0129] An embodiment of the present application further provides a computer-readable storage medium, which stores a computer program, and the computer program implements the above method when executed by a processor.
[0130] It can be understood that the contents of the above method embodiments are all applicable to the present storage medium embodiments, the functions specifically implemented by the present storage medium embodiments are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0131] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0132] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0133] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.
[0134] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0135] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.
[0136] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0137] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.
[0138] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0139] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0140] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0141] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.
[0142] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.
Claims
1. A method for generating and recommending personalized recipes, characterized in that: include: Acquire first data, second data and current user individual data corresponding to the user, wherein the first data is used to record recipe data previously predicted and generated by a recipe generation model, and the second data is used to record actual recipe data of the user; Performing data preprocessing on the current user individual data to obtain user characteristic data; Continuously optimizing the recipe generation model according to the user feature data, the second data, and the first data to obtain an optimized recipe generation model; The user feature data is input into the optimized recipe generation model to perform recipe prediction, and a recipe generation recommendation result output by the optimized recipe generation model is obtained.
2. The method for generating and recommending personalized recipes according to claim 1, characterized in that: The preprocessing of the current user individual data to obtain user characteristic data includes: Performing data cleaning on the current user individual data to obtain first volume data; Standardizing the format and data of the first individual data to obtain second individual data; Individual feature extraction is performed on the second individual data to obtain the user feature data.
3. The method for generating and recommending personalized recipes according to claim 2, characterized in that: The extracting individual features from the second individual data to obtain the user feature data includes: Extracting derived features from the second individual data to obtain user derived features; Extracting behavior features from the second individual data to obtain user behavior features; The second individual data, the user-derived feature and the user behavior feature are concatenated and combined to obtain the user feature data.
4. The method for generating and recommending personalized recipes according to claim 1, characterized in that: The method of continuously optimizing the recipe generation model according to the user feature data, the second data, and the first data to obtain an optimized recipe generation model includes: Determine a first sub-loss value according to the first data and the second data; Determining a second sub-loss value according to the user characteristic data; According to the first sub-loss value and the second sub-loss value, the parameters of the recipe generation model are jointly optimized to obtain the optimized recipe generation model.
5. The method for generating and recommending personalized recipes according to claim 1, characterized in that: The optimized recipe generation model includes a linear network framework and a deep network framework. The user feature data is input into the optimized recipe generation model to perform recipe prediction, and a recipe generation recommendation result output by the optimized recipe generation model is obtained, including: Inputting the user feature data into the linear network framework to extract linear features to obtain linear feature data; Inputting the user feature data into the deep network framework to extract deep features and obtain deep feature data; According to the linear feature data, a weighted sum calculation is performed on the deep feature data to obtain a recipe generation recommendation result output by the optimized recipe generation model.
6. The method for generating and recommending personalized recipes according to claim 5, characterized in that: The step of inputting the user feature data into the linear network framework to extract linear features and obtain linear feature data includes: Performing cross-feature combination on the user feature data to obtain combined feature data; Logistic regression feature extraction is performed on the combined feature data to obtain the linear feature data.
7. The method for generating and recommending personalized recipes according to claim 5, characterized in that: The step of inputting the user feature data into the deep network framework to extract deep features and obtain deep feature data includes: Performing feature dimensionality reduction on the user feature data to obtain a dimensionality reduction vector representation; Complex feature extraction is performed on the reduced-dimensional vector representation to obtain the deep feature data.
8. A personalized recipe generation recommendation system, characterized in that: include: A first processing unit is used to obtain first data, second data and current user individual data corresponding to a user, wherein the first data is used to record recipe data previously predicted and generated by a recipe generation model, and the second data is used to record actual recipe data of the user; A second processing unit, configured to perform data preprocessing on the current user individual data to obtain user characteristic data; A third processing unit, configured to continuously optimize the recipe generation model according to the user feature data, the second data, and the first data to obtain an optimized recipe generation model; The fourth processing unit is used to input the user feature data into the optimized recipe generation model to perform recipe prediction, and obtain the recipe generation recommendation result output by the optimized recipe generation model.
9. An electronic device, characterized in that: include: at least one processor; at least one memory for storing at least one program; When the at least one program is executed by the at least one processor, the at least one processor implements the method according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.