Diet analysis and suggestion generation system, method, device and equipment
By building a large model system that includes the total review module, the nutrient module, the food review module and the dietary recommendation module, the problem of rigid analysis content of the existing dietary record tool app is solved, and personalized and targeted dietary analysis reports are realized, improving user experience and product retention.
Patent Information
- Application Number
- CN202411928646.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-05-06
AI Technical Summary
The diet analysis content of the existing diet record tool app is rigid and not highly targeted, and cannot effectively respond to subtle changes in user diet records, resulting in duplicate and boring output content.
It provides a diet analysis and recommendation generation system, including the total review module, the nutrient module, the food review module and the diet recommendation module, and uses the pre-trained big model to generate personalized diet analysis reports, including the target total review text, the nutrient evaluation text, the food review text and the diet recommendation text.
The generated dietary analysis reports are more targeted and personalized, and can change due to subtle changes in dietary records, avoid duplication and boredom, while reducing labor costs and increasing users' enthusiasm for dietary records.
Smart Images

Figure CN119943279A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of diet analysis, and in particular to a diet analysis and suggestion generating system, method, device and equipment. Background Art
[0002] In diet record tool apps, after users record their diet, they generally have a strong need for diet analysis because they lack the corresponding nutritional knowledge. They need the app to tell them whether their diet is correct and whether it can achieve the goal of gaining muscle or losing fat and weight. Although most general diet record tool apps have analysis functions, they are limited by technical implementation solutions and generally give some relatively fixed text suggestions based on some preset rule logic. In addition, most users find this function useful and can gain knowledge and information when they first use it, but they soon find that the content is repetitive and rigid and not very targeted.
[0003] In the related art, existing diet record tool apps use manually preset strategies to determine the output analysis content, and the degree of refinement of the strategy directly determines the diversity of the analysis. Because the number of strategies is generally limited, it is generally difficult to respond to all the refined changes in the input (diet record content), resulting in the output remaining unchanged when the input changes slightly because the same strategy is hit. In addition, at the text level, because the strategy itself needs to have a certain degree of universality, the output text also needs to have a certain degree of universality, resulting in relatively broad and mediocre text content. Summary of the invention
[0004] In view of this, the present invention provides a diet analysis and suggestion generation system, method, device and equipment to solve the problem that the diet analysis content of existing diet record tool apps is rigid and not targeted.
[0005] In a first aspect, the present invention provides a diet analysis and suggestion generation system, the system comprising an overall review module, a nutrient module, a food review module and a diet suggestion module:
[0006] The overall review module is used to obtain the basic information input by the user and record the food information; based on the basic information and the recorded food information, the pre-trained large model is called to generate the target overall review text corresponding to the basic information and the recorded food information;
[0007] The nutrient module is used to call the pre-trained large model based on the recorded food information to generate the basic information and the target nutrient evaluation text corresponding to the recorded food information;
[0008] The food review module is used to call the pre-trained large model based on the preset food level classification rules, record food information, screen the food to be optimized with the preset rating, and generate the target food review text corresponding to the food to be optimized;
[0009] The dietary advice module is used to call the pre-trained large model based on preset advice rules to generate target dietary advice text corresponding to basic information and recorded food information.
[0010] In the present invention, by constructing a diet analysis and suggestion generation system including an overall review module, a nutrient module, a food review module, and a diet suggestion module, and using the personalized text information generation capability of a large model, the generated diet analysis report includes a target overall review text, a target nutrient evaluation text, a target food review text, and a target diet suggestion text, which is more targeted and can have more personalized text content, and can produce changes in the report due to slight changes in recorded food, avoiding the boredom caused by excessive repetition. At the same time, compared with the text content under various conditions that needs to be pre-written in diet recording tool apps, it can also reduce labor costs, so that users can record their diet more because they can obtain more useful analysis guidance, thereby improving product retention.
[0011] In an optional embodiment, the food review module is used to expand and generate food review prompt words based on preset food level classification rules and using recorded food information;
[0012] Using the food review prompt words, call the pre-trained large model to output the initial food rating corresponding to the food review prompt words;
[0013] Based on the initial food ratings, filter out foods to be optimized that have received preset ratings;
[0014] Input the food review prompt words corresponding to the food to be optimized into the pre-trained large model to generate the initial food review text corresponding to the food to be optimized;
[0015] The initial food review text is checked for compliance and length constraints to obtain the target food review text.
[0016] In this method, the food review module expands the food review prompt words, uses the preset food level classification rules, calls the big model to output the corresponding rating of the food, generates corresponding food review texts for the two preset rated foods to be optimized, namely, optimizable and poor, and performs compliance verification, length constraint and other text post-processing before displaying them to the user. Each food review text output by the big model will have slight differences due to the input food review prompt words. The food review texts are more targeted, closer to the actual rating of the food consumed by the user, and closer to the user's demand for food ratings.
[0017] In an optional implementation, the diet suggestion module is used to determine whether there is a situation where a meal is not recorded based on the basic information;
[0018] When there is a situation where the meal is not recorded, based on the preset suggestion rules, expand and generate dietary suggestion prompt words;
[0019] Using the dietary suggestion prompt words, call the pre-trained large model to output the initial dietary suggestion text corresponding to the dietary suggestion prompt words;
[0020] The initial dietary recommendation text is checked for compliance and length constraints to obtain the target dietary recommendation text.
[0021] In this method, the dietary suggestion module is used to determine whether there are any unrecorded meals. If there are still meals that need to be recorded, the dietary suggestion prompt words are expanded and generated, and the large model is called to output the dietary suggestion text. After compliance verification, length constraint and other text post-processing, it is displayed to the user. Each dietary suggestion text output by the large model will have slight differences due to the input dietary suggestion prompt words. The dietary suggestion text is more targeted, closer to the user's actual three meals, and closer to the user's demand for dietary advice.
[0022] In a second aspect, the present invention provides a method for diet analysis and suggestion generation, which is applied to a diet analysis and suggestion generation system as described in any one of the first aspects, wherein the system includes an overall review module, a nutrient module, a food review module, and a diet suggestion module, and the method includes:
[0023] Get basic information entered by the user and record food information;
[0024] Use the summary module to generate the target summary text corresponding to the basic information and recorded food information;
[0025] Using the nutrient module, generate the target nutrient evaluation text corresponding to the basic information and recorded food information;
[0026] Using the food review module, filter out the food to be optimized with preset ratings, and generate target food review text corresponding to the food to be optimized;
[0027] Using the diet suggestion module, based on the preset suggestion rules, the pre-trained large model is called to generate the target diet suggestion text corresponding to the basic information and recorded food information;
[0028] The target overall review text, target nutrient evaluation text, target food review text and target diet suggestion text are displayed to the user.
[0029] In the present invention, a diet analysis and suggestion generation system is used, and a general review module, a nutrient module, a food review module, and a diet suggestion module are used to generate and display a diet analysis report containing a target general review text, a target nutrient evaluation text, a target food review text, and a target diet suggestion text, respectively, so that the diet report has stronger pertinence and can have more personalized text content, and can produce changes in the report due to subtle changes in recorded food, avoiding the boredom caused by excessive repetition. At the same time, compared to the use of diet record tool apps for diet recommendations, which require pre-written text content under various conditions, the use of a diet analysis and suggestion generation system can further reduce labor costs, and users can obtain more personalized diet analysis guidance, allowing users to record more of their diets, thereby improving the user stickiness and user retention of the diet analysis and suggestion generation system.
[0030] In an optional implementation, the foods to be optimized with preset ratings are screened and target food review texts corresponding to the foods to be optimized are generated, including:
[0031] Based on the preset food level classification rules, the recorded food information is used to expand and generate food review prompts;
[0032] Using the food review prompt words, call the pre-trained large model to output the initial food rating corresponding to the food review prompt words;
[0033] Based on the initial food ratings, filter out foods to be optimized that have received preset ratings;
[0034] Input the food review prompt words corresponding to the food to be optimized into the pre-trained large model to generate the initial food review text corresponding to the food to be optimized;
[0035] The initial food review text is checked for compliance and length constraints to obtain the target food review text.
[0036] In this method, the food review module is used to expand the food review prompt words, and the preset food level classification rules are used to call the big model to output the corresponding rating of the food. For the two preset ratings of optimized food, which are rated as optimizable and poor, the corresponding food review text is generated, and the text is post-processed such as compliance verification and length constraint before being displayed to the user. Each food review text output by the big model will have slight differences due to the input food review prompt words. The food review text is more targeted, closer to the actual rating of the food consumed by the user, and closer to the user's demand for food rating.
[0037] In an optional implementation, based on preset suggestion rules, a pre-trained large model is called to generate a target diet suggestion text corresponding to the basic information and the recorded food information, including:
[0038] Based on the preset suggestion rules, expand and generate dietary suggestion prompt words;
[0039] Using the dietary suggestion prompt words, call the pre-trained large model to output the initial dietary suggestion text corresponding to the dietary suggestion prompt words;
[0040] The initial dietary recommendation text is checked for compliance and length constraints to obtain the target dietary recommendation text.
[0041] In this method, the dietary suggestion module is used to determine whether there are any unrecorded meals. If there are still meals that need to be recorded, the dietary suggestion prompt words are expanded and generated, and the large model is called to output the dietary suggestion text. After compliance verification, length constraint and other text post-processing, it is displayed to the user. Each dietary suggestion text output by the large model will have slight differences due to the input dietary suggestion prompt words. The dietary suggestion text is more targeted, closer to the user's actual three meals, and closer to the user's demand for dietary advice.
[0042] In a third aspect, the present invention provides a diet analysis and suggestion generating device, the device comprising:
[0043] Information acquisition module, used to obtain basic information input by users and record food information;
[0044] The overall review generation module is used to generate a target overall review text corresponding to the basic information and the recorded food information using the overall review module;
[0045] A nutrient evaluation generation module is used to generate a target nutrient evaluation text corresponding to basic information and recorded food information using a nutrient module;
[0046] A food rating module is used to use the food review module to screen the food to be optimized with a preset rating, and generate a target food review text corresponding to the food to be optimized;
[0047] A dietary advice generation module is used to use the dietary advice module to call a pre-trained large model based on preset advice rules to generate a target dietary advice text corresponding to basic information and recorded food information;
[0048] The text display module is used to display the target overall evaluation text, target nutrient evaluation text, target food review text and target diet suggestion text to the user.
[0049] In a fourth aspect, the present invention provides a computer device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, the memory storing computer instructions, and the processor executing the dietary analysis and recommendation generation method of the above-mentioned second aspect or any corresponding embodiment thereof by executing the computer instructions.
[0050] In a fifth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the dietary analysis and recommendation generation method of the second aspect or any corresponding embodiment thereof.
[0051] In a sixth aspect, the present invention provides a computer program product, comprising computer instructions for causing a computer to execute the dietary analysis and recommendation generation method of the second aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0053] Figure 1 Schematic diagram of the architecture of a diet analysis and recommendation generation system according to an embodiment of the present invention.
[0054] Figure 2 4 is a schematic diagram of a food analysis function interface according to an embodiment of the present invention.
[0055] Figure 3 4 is a flowchart of a method for diet analysis and recommendation generation according to an embodiment of the present invention.
[0056] Figure 4 4 is a system block diagram of personalized diet analysis and recommendation generation using a large model according to an embodiment of the present invention.
[0057] Figure 5 4 is a structural block diagram of a device for diet analysis and recommendation generation according to an embodiment of the present invention.
[0058] Figure 6 It is a schematic diagram of the hardware structure of a computer device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0060] In the related art, existing diet record tool apps use manually preset strategies to determine the output analysis content, and the degree of refinement of the strategy directly determines the diversity of the analysis. Because the number of strategies is generally limited, it is generally difficult to respond to all the refined changes in the input (diet record content), resulting in the output remaining unchanged when the input changes slightly because the same strategy is hit. In addition, at the text level, because the strategy itself needs to have a certain degree of universality, the output text also needs to have a certain degree of universality, resulting in relatively broad and mediocre text content.
[0061] To solve the above problems, a diet analysis and suggestion generation system is provided in an embodiment of the present invention. The diet analysis and suggestion generation system in this embodiment is suitable for the use scenario in which users use diet record tool apps to record diets to obtain corresponding diet suggestions. The present invention provides a diet analysis and suggestion generation system, by constructing a diet analysis and suggestion generation system including a general review module, a nutrient module, a food review module and a diet suggestion module, using the personalized text information generation capability of a large model, and generating a diet analysis report including a target general review text, a target nutrient evaluation text, a target food review text and a target diet suggestion text, which has stronger pertinence and can have more personalized text content, and can produce changes in the report due to subtle changes in recorded food, avoiding the boredom caused by excessive repetition. At the same time, compared with the text content under various conditions that needs to be pre-written by diet record tool apps, it can also reduce labor costs, so that users can record their diet more because they can obtain more useful analysis guidance, thereby improving product retention.
[0062] According to an embodiment of the present invention, an embodiment of a diet analysis and recommendation generating system is provided. Figure 1 is a schematic diagram of the architecture of a diet analysis and recommendation generation system according to an embodiment of the present invention. Figure 1 As shown, the diet analysis and recommendation generation system includes an overall review module 1, a nutrient module 2, a food review module 3 and a diet recommendation module 4: the overall review module 1 is used to obtain the basic information and recorded food information input by the user; based on the basic information and recorded food information, a pre-trained large model is called to generate a target overall review text corresponding to the basic information and recorded food information; the nutrient module 2 is used to call a pre-trained large model based on the recorded food information to generate a target nutrient evaluation text corresponding to the basic information and recorded food information; the food review module 3 is used to call a pre-trained large model based on a preset food level classification rule and the recorded food information to screen out foods to be optimized with a preset rating, and generate a target food review text corresponding to the foods to be optimized; the diet recommendation module 4 is used to call a pre-trained large model based on a preset recommendation rule to generate a target diet recommendation text corresponding to the basic information and recorded food information.
[0063] In an optional embodiment, the target summary text includes summary information on the user's daily dietary intake, the target nutrient evaluation text includes at least one of the nutrients and nutrient proportion information corresponding to the recorded food information, and the target dietary recommendation text includes dietary recommendations for the next meal.
[0064] In an optional embodiment, the food review module 3 is used to expand and generate food review prompt words based on preset food level classification rules and recorded food information; use the food review prompt words to call a pre-trained large model to output an initial food rating corresponding to the food review prompt words; based on the initial food rating, screen and obtain foods to be optimized with preset ratings; input the food review prompt words corresponding to the foods to be optimized into the pre-trained large model to generate initial food review texts corresponding to the foods to be optimized; perform compliance checks and length constraints on the initial food review texts to obtain target food review texts.
[0065] In this method, the food review module expands the food review prompt words, uses the preset food level classification rules, calls the big model to output the corresponding rating of the food, generates corresponding food review texts for the two preset rated foods to be optimized, namely, optimizable and poor, and performs compliance verification, length constraint and other text post-processing before displaying them to the user. Each food review text output by the big model will have slight differences due to the input food review prompt words. The food review texts are more targeted, closer to the actual rating of the food consumed by the user, and closer to the user's demand for food ratings.
[0066] In an optional embodiment, the dietary advice module 4 is used to determine whether there are any unrecorded meals based on basic information; when there are any unrecorded meals, expand and generate dietary advice prompt words based on preset advice rules; use the dietary advice prompt words to call a pre-trained large model to output an initial dietary advice text corresponding to the dietary advice prompt words; perform compliance verification and length constraints on the initial dietary advice text to obtain a target dietary advice text.
[0067] In this method, the dietary suggestion module is used to determine whether there are any unrecorded meals. If there are still meals that need to be recorded, the dietary suggestion prompt words are expanded and generated, and the large model is called to output the dietary suggestion text. After compliance verification, length constraint and other text post-processing, it is displayed to the user. Each dietary suggestion text output by the large model will have slight differences due to the input dietary suggestion prompt words. The dietary suggestion text is more targeted, closer to the user's actual three meals, and closer to the user's demand for dietary advice.
[0068] In one implementation scenario, Figure 2 is a schematic diagram of a food analysis function interface according to an embodiment of the present invention. Figure 2As shown, there are a total of 4 modules in the food analysis page that call the large model.
[0069] The first module is the general review module 1, which compares the total calories of the recorded food with the daily intake target, nutrient ratio and other dimensions, and displays the general review text generated by the large model below the quantitative chart. The generation method of the general review text includes: first obtaining the necessary information, then expanding and rewriting this information into the prompt words input by the large model, calling any mainstream large model in the form of an interface through the prompt words, and then the system receives the answer text of the large model, and finally displays it to the user after performing compliance verification, length constraint and other text post-processing. Among them, the large model used in the present invention is not restricted, and all mainstream large models include Wenxin Yiyan, Tongyi Qianwen, GPT, etc., and the model size is not strictly limited, generally 7B or 14B. The type and size of the model will slightly affect the specific output content, but will not affect the logic, nor will it produce a significant difference in the effect. When using the large model, you can directly use the original pre-trained model and official interface of these large models, or you can use the chat text and diet content for further fine-tuning.
[0070] Exemplarily, (1) the necessary information includes basic information and recorded food information. The basic information includes the user's daily target calorie count, target three major nutrient ratios, expected total intake ratios for three meals, age, gender, BMI and other basic information. The recorded food information includes the total calories of the recorded food, the total amount of each of the three major nutrients, the total amount of dietary fiber, the richness of food types, and which meal of the day is currently recorded.
[0071] (2) Expanding and rewriting the prompt words include: expanding the necessary information mentioned above into a persona, such as "I am a 28-year-old woman with a BMI of 24.1. I expect to consume 1,500 calories today", rewriting the recorded food information into, for example, "I have finished breakfast and lunch, and have consumed a total of 1,200 calories, including 300 calories of rice and 200 calories of scrambled eggs with tomatoes", and then expanding some additional rules such as "Dietary fiber intake should be greater than 10g, and carbohydrate intake exceeding 50% is unhealthy", etc., and combining them into a complete prompt word.
[0072] (3) Compliance verification: When the big model is output, it is subject to a real-time machine review algorithm to verify whether it is outputting content related to food evaluation, especially intercepting pornographic, terrorist, and political content.
[0073] (4) Length constraint: When the length exceeds 150 characters, the text is truncated at the nearest punctuation mark to prevent the user from seeing too long text and reducing the desire to read. The specific steps include: when the length of the text output by the large model exceeds 150 characters, search backward from the 150th character to the nearest punctuation mark, discard all text after the punctuation mark when the search is found, and only show the user all text from the beginning to the punctuation mark. The specific number of characters is not limited in the present invention.
[0074] The second module is the nutrient module 2. Similar to the overall evaluation module, the nutrient module 2 displays the nutrient evaluation text generated by the large model below the nutrient ratio chart. The nutrient evaluation text is generated by first obtaining the necessary information, then expanding and rewriting this information into prompt words for the large model input, and calling any mainstream large model in the form of an interface through the prompt words. The system then receives the answer text of the large model, and finally displays it to the user after text post-processing such as compliance verification and length constraints.
[0075] The third module is the food review module 3. Food is divided into three levels: good, optimizable, and bad, which are increasingly unfavorable to fat loss, weight loss and health. The two levels of optimizable and bad food will generate corresponding food review texts, which mainly include why it is bad and what food it should be replaced with. Food review module 3 first obtains the complete list of food recorded by the user today, and then generates a prompt word for rating all foods, and then calls any mainstream large model in the form of an interface through the prompt word, and then the large model returns the ratings of all foods in turn. Then, all foods A, B, C, etc. rated as optimizable and bad are screened out, and the comment prompt words are first generated and input into the large model in turn, and then the large model generates the comment text for each food, and finally displays it to the user after text post-processing such as compliance verification and length constraints.
[0076] In one example, the prompt word format is as follows:
[0077] Prompt word = """
[0078] I want to have a set of eating rules for my app (a food tracking app) that can help me identify whether a food is "good" or "acceptable" or "bad" so that our app can provide relevant recommendations to the user.
[0079] #rule
[0080] 1. The grain rule: Whole grains are always better than refined grains.
[0081] 2. Freshness rules: Fresh fruit is always better than juice, whether fresh or processed, because the integrity of the fruit plays an important role in maintaining the nutritional value of the fruit.
[0082] 3. The lean meat rule: Lean meat without the skin is always better than fatty meat (such as bacon or certain fatty parts of the animal, such as brisket).
[0083] 4. The fat-free rule: Low-fat and low-sugar versions are always preferred over full-fat and sugary options.
[0084] 5. Good fat rule: Unsaturated fats are always better than saturated fats. Trans fats should always be avoided.
[0085] 6. Natural food rule: Natural food is always more popular than unnatural food.
[0086] 7. Low glycemic index rule: Low glycemic index foods are more popular than high glycemic index foods.
[0087] 8. Low sodium rule: Low sodium foods are always preferred.
[0088] #Workflow
[0089] 1. If the food doesn’t break any rules, say “good.” A single, generic food is usually “good.”
[0090] 2. If a food violates one of the above rules, you need to provide alternative suggestions. For example: If someone cooks with butter, you can suggest "butter is high in saturated fat, which is not good for the cardiovascular system. Try olive oil and safflower oil because they contain healthy unsaturated fats."
[0091] 3. Your suggestion should point out the shortcomings of the original food and introduce healthier options. Healthier options not only refer to healthier foods, but also better cooking techniques (steaming is better than frying), better versions (low-fat versions, etc.), better parts (beef tenderloin is better than pork belly), etc.
[0092] 4. Suggestions should be concise and easy to understand. The length of each suggestion should be within 20 words.
[0093] 51. If the food is only a minor violation of the rules, say "acceptable."
[0094] #Task
[0095] -Judge whether the food you entered violates the rules. If not, say "good". If yes, give 3 different suggestions (from different dimensions). Output strictly in the specified format, without any extra content.
[0096] #Output format
[0097] -If the food is a good choice: ["good"]
[0098] - If there is any violation: ["Suggestion_1","Suggestion_2","Suggestion_3"]
[0099] # Output example
[0100] -Good Choices: ["Good"]
[0101] -If the food is a sugary grain: ["Potatoes are high in carbs; choose sweet potatoes for a lower glycemic index.","Try baking rather than boiling to retain more nutrients.","Add leafy greens for a balanced, fiber-rich side dish."]
[0102] """
[0103] The fourth module is the dietary suggestion module 4, which is used to provide suggestions on what to eat for the next meal when the user still has unrecorded meals on the day. For example, when breakfast is recorded but lunch and dinner are not recorded, the dietary suggestions are suggestions on how to eat lunch; when lunch is recorded but dinner is not recorded, the dietary suggestions are suggestions on how to eat dinner; if all three meals are recorded, no dietary suggestions are provided. The dietary suggestion module 4 first determines whether dietary suggestions need to be provided. When necessary, it obtains different user input information and suggestion rule information according to which meal suggestions need to be provided. The above information is rewritten into a prompt word provided to the large model, and then any mainstream large model is called in the form of an interface through the prompt word, and then the large model returns the corresponding answer, and finally displays it to the user after text post-processing such as compliance verification and length constraint.
[0104] In one example, the prompt word format is as follows:
[0105] Prompt word = """
[0106] #Assignment: Calories and Macronutrients Guide
[0107] Provides personalized recommendations on remaining calorie intake and macronutrient balance based on an individual's target intake.
[0108] #Workflow
[0109] 1. Collect users’ target intake and actual intake data.
[0110] {User_Input_Format_Description}
[0111] 2. Evaluate whether your calorie intake is on target:
[0112] - If within 20%, you should give him / her positive feedback. For example, if the target calories for breakfast and lunch are 1000 kcal, and the person consumes 1100 kcal (10% above the 1000 kcal target), you should say: You have met the calorie target well.
[0113] -If the deviation is between 20-30%, you should say "It looks like your intake was slightly lower / higher than planned by xxx%. Making a small adjustment to your next meal will help you feel better."
[0114] -If the deviation is more than 30%, you should say "It looks like you consumed significantly less / more than planned xxx%. Adjusting your next meal slightly could help keep you in balance."
[0115] 3. You can then start analyzing whether this person is adhering to their macronutrient ratio goals based on what they ate today.
[0116] -You need to compare each macronutrient you consume to your goals.
[0117] -However, you only need to point out the one macronutrient that deviated the most from the target and give your advice. For example, if the person should eat 100g carbs, 100g protein, 100g fat for breakfast and lunch, but he actually ate 120g carbs, 150g protein and 200g fat, then you only need to point out that his / her fat intake was significantly higher than planned, without mentioning the excess of carbs and protein. In this case, you can say: Your fat intake was significantly higher than 100% of the plan. A small change to the next meal will make you feel great. "
[0118] - If the deviation from goal for any macronutrient is less than 30%, say "You are doing a good job of adhering to your macronutrient goal. Keep up the good work!" (You can change this from time to time)
[0119] - If intake of any macronutrient is more than 30% off target, but less than 50%, simply pick the one macronutrient that was off the most and say "it looks like your carb / protein / fat intake was xxx% lower / higher than planned, adjusting your next meal will get everything back on track".
[0120] -If intake of any macronutrient is more than 50% off target, simply pick the one macronutrient that deviated the most and say "It looks like your carb / protein / fat intake was xxx% lower / higher than planned. A small adjustment to your next meal will make you feel fine.".
[0121] #Output
[0122] 1. If an offset is detected, point out at least one food that could be contributing to this imbalance. For example, if a calorie surplus is detected and you notice that the person ate a cheeseburger (clearly high in calories), you should point out this food as a possible "culprit" and offer the person a better alternative or diet tip. If a calorie deficit is detected, give another piece of advice accordingly.
[0123] 2. Maintain a supportive and constructive tone:
[0124] - Use phrases such as “Well done!”, “Slight adjustments to… may be beneficial”, “Optimizing your…intake will improve your diet.”
[0125] 3. Tell the person how much xx% his / her calorie or macronutrient intake is above / below their goal.
[0126] 4. JSON output format example:
[0127] {{
[0128] "Calorie Advice":"So far, your calorie intake is slightly above your goal by xx% (xxxkcal). Adjusting your next meal will get everything going smoothly. Cheeseburgers are high in calories, consider eating less or eating a chicken burger instead.",
[0129] "Macronutrient Advice":"You have followed the macronutrient plan pretty well so far, well done! However, it appears that your fat intake is slightly higher than planned by xx% (xxx grams), adjusting your next meal will get everything going smoothly. Try replacing the pork tenderloin with lean ground beef for a clean protein intake."
[0130] }}
[0131] #constraint
[0132] 1. Perform dietary assessments based solely on foods consumed by the user; recommend that new food choices should be introduced.
[0133] 2. Communicate the assessment and recommendations succinctly within the 60-word limit, ensuring comprehensiveness by integrating quantitative data and qualitative guidance.
[0134] """
[0135] The diet analysis and suggestion generation system provided in this embodiment, by constructing a diet analysis and suggestion generation system including an overall review module, a nutrient module, a food review module and a diet suggestion module, uses the personalized text information generation capability of a large model, and generates a diet analysis report including a target overall review text, a target nutrient evaluation text, a target food review text and a target diet suggestion text, which is more targeted and can have more personalized text content, and can produce changes in the report due to slight changes in the recorded food, avoiding the boredom caused by excessive repetition. At the same time, compared with the text content under various conditions that needs to be pre-written in diet recording tool apps, it can also reduce labor costs, so that users can record their diet more because they can obtain more useful analysis guidance, thereby improving product retention.
[0136] According to an embodiment of the present invention, an embodiment of a diet analysis and recommendation generation method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0137] In this embodiment, a diet analysis and suggestion generation method is provided, which can be used in the above-mentioned diet analysis and suggestion generation system. The system includes an overall review module, a nutrient module, a food review module and a diet suggestion module. Figure 3 is a flow chart of a method for diet analysis and recommendation generation according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0138] Step S301, obtaining basic information input by the user and recording food information.
[0139] Step S302, using the review module, generating a target review text corresponding to the basic information and the recorded food information.
[0140] In the embodiment of the present invention, the target summary text includes summary information of the user's daily dietary intake.
[0141] Step S303, using the nutrient module, generating a target nutrient evaluation text corresponding to the basic information and the recorded food information.
[0142] In the embodiment of the present invention, the target nutrient evaluation text includes nutrients and nutrient ratio information corresponding to the recorded food information.
[0143] Step S304: using the food review module, filter out the food to be optimized with a preset rating, and generate a target food review text corresponding to the food to be optimized.
[0144] In the embodiment of the present invention, the target food review text includes food rating information corresponding to the recorded food information.
[0145] Specifically, the above step S304 includes:
[0146] Based on the preset food level classification rules, the recorded food information is used to expand and generate food review prompts;
[0147] Using the food review prompt words, call the pre-trained large model to output the initial food rating corresponding to the food review prompt words;
[0148] Based on the initial food ratings, filter out foods to be optimized that have received preset ratings;
[0149] Input the food review prompt words corresponding to the food to be optimized into the pre-trained large model to generate the initial food review text corresponding to the food to be optimized;
[0150] The initial food review text is checked for compliance and length constraints to obtain the target food review text.
[0151] In this method, the food review module is used to expand the food review prompt words, and the preset food level classification rules are used to call the big model to output the corresponding rating of the food. For the two preset ratings of optimized food, which are rated as optimizable and poor, the corresponding food review text is generated, and the text is post-processed such as compliance verification and length constraint before being displayed to the user. Each food review text output by the big model will have slight differences due to the input food review prompt words. The food review text is more targeted, closer to the actual rating of the food consumed by the user, and closer to the user's demand for food rating.
[0152] Step S305, using the diet suggestion module, based on preset suggestion rules, calling the pre-trained large model, and generating a target diet suggestion text corresponding to the basic information and recorded food information.
[0153] In the embodiment of the present invention, the target diet suggestion text includes diet suggestions for the next meal.
[0154] Specifically, the above step S305 includes:
[0155] Based on the preset suggestion rules, expand and generate dietary suggestion prompt words;
[0156] Using the dietary suggestion prompt words, call the pre-trained large model to output the initial dietary suggestion text corresponding to the dietary suggestion prompt words;
[0157] The initial dietary recommendation text is checked for compliance and length constraints to obtain the target dietary recommendation text.
[0158] In this method, the dietary suggestion module is used to determine whether there are any unrecorded meals. If there are still meals that need to be recorded, the dietary suggestion prompt words are expanded and generated, and the large model is called to output the dietary suggestion text. After compliance verification, length constraint and other text post-processing, it is displayed to the user. Each dietary suggestion text output by the large model will have slight differences due to the input dietary suggestion prompt words. The dietary suggestion text is more targeted, closer to the user's actual three meals, and closer to the user's demand for dietary advice.
[0159] Step S306, displaying the target overall review text, target nutrient evaluation text, target food review text and target diet suggestion text to the user.
[0160] In one implementation scenario, Figure 4 is a system block diagram of diet analysis and recommendation generation using a large model according to an embodiment of the present invention, such as Figure 4 As shown, the dietary analysis and suggestion generation method using the big model includes: in the general review stage, the general review text is obtained through information acquisition, prompt word generation, big model answer and compliance verification, length constraint and other text post-processing. In the nutrient stage, the nutrient text is obtained through information acquisition, prompt word generation, big model answer and compliance verification, length constraint and other text post-processing. In the food review stage, the food list is obtained, the rating prompt word is generated, and the rating of the food is judged by the big model. When the food rating is equal to good, the food review is ended; when the food rating is not equal to good, the food review prompt word is generated, the big model answers the review prompt word, and the food review text is generated and subjected to compliance verification, length constraint and other text post-processing. In the dietary suggestion stage, when judging whether dietary suggestions are needed, when the user does not have a regular meal on the day and does not record it, it is confirmed that dietary suggestions are not needed, and the dietary suggestions are ended; when the user has a regular meal on the day and does not record it, it is confirmed that dietary suggestions are needed, information acquisition is performed, prompt words are generated, and the big model answers the dietary suggestion prompt word, and the dietary suggestion text is generated and subjected to compliance verification, length constraint and other text post-processing.
[0161] The diet analysis and suggestion generation method provided in this embodiment utilizes a diet analysis and suggestion generation system, and utilizes a summary module, a nutrient module, a food review module, and a diet suggestion module to respectively generate and display a diet analysis report including a target summary text, a target nutrient evaluation text, a target food review text, and a target diet suggestion text, so that the diet report has stronger pertinence and can have more personalized text content, and can produce changes in the report due to slight changes in the recorded food, thus avoiding the boredom caused by excessive repetition. At the same time, compared to the use of diet recording tool apps for diet recommendations, which require pre-written text content under various conditions, the use of a diet analysis and suggestion generation system can further reduce labor costs, and users can obtain more personalized diet analysis guidance, allowing users to record more of their diets, thereby improving the user stickiness and user retention of the diet analysis and suggestion generation system.
[0162] In this embodiment, a diet analysis and suggestion generating device is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and will not be repeated hereafter. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0163] This embodiment provides a diet analysis and suggestion generating device, such as Figure 5 As shown, including:
[0164] Information acquisition module 501 is used to acquire basic information input by the user and record food information. Figure 3 Step S301 of the illustrated embodiment will not be described in detail here.
[0165] The overall review generating module 502 is used to generate the target overall review text corresponding to the basic information and the recorded food information by using the overall review module. Figure 3 Step S302 of the illustrated embodiment will not be described in detail here.
[0166] The nutrient evaluation generation module 503 is used to generate the target nutrient evaluation text corresponding to the basic information and the recorded food information using the nutrient module. Figure 3 Step S303 of the illustrated embodiment will not be described in detail here.
[0167] The food rating module 504 is used to use the food review module to screen the food to be optimized with a preset rating and generate a target food review text corresponding to the food to be optimized. Figure 3 Step S304 of the illustrated embodiment will not be described in detail here.
[0168] The dietary suggestion generation module 505 is used to use the dietary suggestion module to call the pre-trained large model based on the preset suggestion rules to generate a target dietary suggestion text corresponding to the basic information and the recorded food information, wherein the target dietary suggestion text includes the dietary suggestion for the next meal. Figure 3 Step S305 of the illustrated embodiment will not be described in detail here.
[0169] The text display module 507 is used to display the target overall evaluation text, target nutrient evaluation text, target food review text and target diet suggestion text to the user. Figure 3 Step S306 of the illustrated embodiment will not be described in detail here.
[0170] In some optional implementations, the food rating module 504 includes:
[0171] The food review prompt word expansion unit is used to expand and generate food review prompt words based on preset food level classification rules and using recorded food information.
[0172] The first model calling unit is used to use the food review prompt words to call the pre-trained large model and output the initial food rating corresponding to the food review prompt words.
[0173] The food screening unit to be optimized is used to screen the food to be optimized with a preset rating based on the initial food rating.
[0174] The food review text generation unit is used to input the food review prompt words corresponding to the food to be optimized into the pre-trained large model to generate the initial food review text corresponding to the food to be optimized.
[0175] The first text post-processing unit is used to perform compliance check and length constraint on the initial food review text to obtain the target food review text.
[0176] In some optional implementations, the dietary advice generating module 505 includes:
[0177] The dietary suggestion prompt word expansion unit is used to expand and generate dietary suggestion prompt words based on preset suggestion rules.
[0178] The second model calling unit is used to use the dietary suggestion prompt words to call the pre-trained large model and output the initial dietary suggestion text corresponding to the dietary suggestion prompt words.
[0179] The second text post-processing unit is used to perform compliance check and length constraint on the initial diet suggestion text to obtain a target diet suggestion text.
[0180] The further functional description of each of the above modules and units is the same as that of the above corresponding embodiments and will not be repeated here.
[0181] The dietary analysis and recommendation generation device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC (Application Specific Integrated Circuit) circuit, a processor and memory that executes one or more software or fixed programs, and / or other devices that can provide the above functions.
[0182] The embodiment of the present invention also provides a computer device having the above Figure 5 The dietary analysis and recommendation generating device shown.
[0183] See also Figure 6 , Figure 6 is a schematic diagram of the structure of a computer device provided by an optional embodiment of the present invention, such as Figure 6 As shown, the computer device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. Various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process the instructions executed in the computer device, including instructions stored in or on the memory to display the graphical information of the GUI on an external input / output device (such as, a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple computer devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 6 A processor 10 is taken as an example.
[0184] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0185] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.
[0186] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the computer device, etc. In addition, the memory 20 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 optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the computer device 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.
[0187] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0188] The computer device also includes an input device 30 and an output device 40. The processor 10, the memory 20, the input device 30 and the output device 40 may be connected via a bus or other means. Figure 6 The example of connecting through bus is taken in the following.
[0189] The input device 30 can receive input digital or character information, and generate key signal input related to the user settings and function control of the computer device, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator bar, one or more mouse buttons, a trackball, a joystick, etc. The output device 40 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The above-mentioned display device includes but is not limited to a liquid crystal display, a light emitting diode, a display and a plasma display. In some optional embodiments, the display device can be a touch screen.
[0190] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.
[0191] A part of the present invention may be applied as a computer program product, such as a computer program instruction, which, when executed by a computer, can call or provide the method and / or technical solution according to the present invention through the operation of the computer. Those skilled in the art should understand that the existence of the computer program instruction in a computer-readable medium includes, but is not limited to, a source file, an executable file, an installation package file, etc., and accordingly, the way in which the computer program instruction is executed by the computer includes, but is not limited to: the computer directly executes the instruction, or the computer compiles the instruction and then executes the corresponding compiled program, or the computer reads and executes the instruction, or the computer reads and installs the instruction and then executes the corresponding installed program. Here, the computer-readable medium may be any available computer-readable storage medium or communication medium accessible to the computer.
[0192] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A dietary analysis and recommendation generation system, characterized in that: The system includes an overall review module, a nutrient module, a food review module and a diet suggestion module: The overall review module is used to obtain basic information and recorded food information input by the user; based on the basic information and the recorded food information, call the pre-trained large model to generate a target overall review text corresponding to the basic information and the recorded food information; The nutrient module is used to call the pre-trained large model based on the recorded food information to generate the target nutrient evaluation text corresponding to the basic information and the recorded food information; The food review module is used to use the recorded food information based on the preset food level classification rules, call the pre-trained large model, screen the food to be optimized with the preset rating, and generate the target food review text corresponding to the food to be optimized; The dietary advice module is used to call the pre-trained large model based on preset advice rules to generate a target dietary advice text corresponding to the basic information and the recorded food information.
2. The system according to claim 1, characterized in that The food review module is used to expand and generate food review prompt words based on the preset food level classification rules and using the recorded food information; Using the food review prompt word, calling the pre-trained large model, and outputting the initial food rating corresponding to the food review prompt word; Based on the initial food rating, screening foods to be optimized with preset ratings; Inputting the food review prompt words corresponding to the food to be optimized into the pre-trained large model to generate the initial food review text corresponding to the food to be optimized; The initial food review text is subjected to compliance check and length constraint to obtain a target food review text.
3. The system according to claim 1, characterized in that The dietary suggestion module is used to determine whether there is any unrecorded meal based on the basic information; When there is a situation where the meal is not recorded, based on the preset suggestion rules, expand and generate dietary suggestion prompt words; Using the dietary suggestion prompt words, calling the pre-trained large model, and outputting the initial dietary suggestion text corresponding to the dietary suggestion prompt words; The initial dietary advice text is subjected to compliance check and length constraint to obtain a target dietary advice text.
4. A method for dietary analysis and recommendation generation, characterized in that: Applied to the diet analysis and suggestion generation system as claimed in any one of claims 1 to 3, the system comprises an overall review module, a nutrient module, a food review module and a diet suggestion module, the method comprises: Get basic information entered by the user and record food information; Using the review module, generating a target review text corresponding to the basic information and the recorded food information; Using the nutrient module, generating a target nutrient evaluation text corresponding to the basic information and the recorded food information; Using the food review module, screen the food to be optimized with a preset rating, and generate a target food review text corresponding to the food to be optimized; Using the diet suggestion module, based on preset suggestion rules, calling the pre-trained large model, generating a target diet suggestion text corresponding to the basic information and the recorded food information, wherein the target diet suggestion text includes a diet suggestion for the next meal; The target overall review text, target nutrient evaluation text, target food review text and target diet suggestion text are displayed to the user.
5. The method according to claim 4, characterized in that The screening of the food to be optimized with a preset rating and generating a target food review text corresponding to the food to be optimized includes: Based on the preset food grade classification rules, the recorded food information is used to expand and generate food review prompt words; Using the food review prompt word, calling the pre-trained large model, and outputting the initial food rating corresponding to the food review prompt word; Based on the initial food rating, screen and obtain the food to be optimized with a preset rating; input the food review prompt words corresponding to the food to be optimized into the pre-trained large model to generate the initial food review text corresponding to the food to be optimized; The initial food review text is subjected to compliance check and length constraint to obtain a target food review text.
6. The method according to claim 4, characterized in that Based on the preset suggestion rules, calling the pre-trained large model to generate the target diet suggestion text corresponding to the basic information and the recorded food information includes: Based on the preset suggestion rules, expand and generate dietary suggestion prompt words; Using the dietary suggestion prompt words, calling the pre-trained large model, and outputting the initial dietary suggestion text corresponding to the dietary suggestion prompt words; The initial dietary advice text is subjected to compliance check and length constraint to obtain a target dietary advice text.
7. A dietary analysis and recommendation generating device, characterized in that: The device comprises: Information acquisition module, used to obtain basic information input by users and record food information; A summary evaluation generating module, used to generate a target summary evaluation text corresponding to the basic information and the recorded food information by using the summary evaluation module; A nutrient evaluation generation module, used to generate a target nutrient evaluation text corresponding to the basic information and the recorded food information using a nutrient module; A food rating module is used to use the food review module to screen the food to be optimized with a preset rating, and generate a target food review text corresponding to the food to be optimized; A dietary suggestion generation module, configured to utilize the dietary suggestion module to call the pre-trained large model based on preset suggestion rules to generate a target dietary suggestion text corresponding to the basic information and the recorded food information; The text display module is used to display the target overall evaluation text, target nutrient evaluation text, target food review text and target diet suggestion text to the user.
8. A computer device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the dietary analysis and recommendation generation method according to any one of claims 4 to 6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions for causing a computer to execute the dietary analysis and recommendation generation method according to any one of claims 4 to 6.
10. A computer program product, characterized in that The method comprises computer instructions for causing a computer to execute the diet analysis and recommendation generating method according to any one of claims 4 to 6.