Recipe recommendation method and device, storage medium and electronic equipment
By obtaining sentence information to identify therapeutic intentions and determine physical conditions, a large language model is used to recommend recipes with therapeutic effect labels. This solves the problem of insufficient accuracy of existing recipe recommendation systems under therapeutic needs and achieves efficient therapeutic recipe recommendations.
Patent Information
- Application Number
- CN202510783075.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-09-26
AI Technical Summary
Existing recipe recommendation systems lack accuracy, especially in scenarios based on natural language dialogue, and are unable to flexibly and efficiently meet users' dietary needs.
By obtaining sentence information, recognizing dietary therapy intentions and determining corresponding physical condition information, we can recommend target recipes. We use large language models and prompts to rewrite and recognize information, and accurately recommend recipes corresponding to dietary therapy effect labels.
It has achieved accurate recipe recommendations in the context of dietary therapy needs, greatly improving user satisfaction.
Smart Images

Figure CN120708813A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of data processing, and in particular to a recipe recommendation method, device, storage medium and electronic device. Background Art
[0002] Current user recipe recommendation systems can be divided into two categories:
[0003] (1) The user fills in the body-related information according to the specified template, and the system recommends recipes based on the predefined body information based on rules or algorithms.
[0004] (2) Recipe recommendation based on natural language dialogue. Currently, recipe recommendation functions based on user queries are provided in the fields of kitchen appliances and smart assistants.
[0005] The recipe recommendation method described above has poor recommendation accuracy. Summary of the Invention
[0006] The purpose of the present invention is to provide a recipe recommendation method, device, storage medium and electronic device that can improve the accuracy of recipe recommendations.
[0007] In order to achieve the above objectives, the technical solutions adopted in the embodiments of the present application are as follows:
[0008] In a first aspect, an embodiment of the present application provides a recipe recommendation method, the method comprising:
[0009] Get the corresponding statement information;
[0010] In response to the statement information containing dietary therapy intention information, determining corresponding physical sign condition information based on the dietary therapy intention information;
[0011] A target diet is recommended based on the physical condition information.
[0012] In an optional embodiment, in response to the statement information containing dietary therapy intention information, the step of determining corresponding physical sign condition information based on the dietary therapy intention information includes:
[0013] In the case where the sentence information includes dietary therapy intention information, determining the physical sign keywords of the sentence information;
[0014] Comparing the physical sign keyword with various preset physical sign keywords;
[0015] Acquire a target preset physical sign keyword consistent with the physical sign keyword from each of the preset physical sign keywords;
[0016] The target preset physical sign keyword is used as the physical sign condition information corresponding to the sentence information.
[0017] In an optional embodiment, the step of recommending a target diet based on the physical condition information includes:
[0018] Determining a target preset diet therapy effect tag corresponding to the physical sign condition information from a diet therapy effect tag set, wherein the diet therapy effect tag set includes a plurality of preset diet therapy effect tags, each of the preset diet therapy effect tags corresponding to different physical sign condition information and a corresponding recipe;
[0019] Determining a plurality of first recipes corresponding to the preset target therapeutic effect labels;
[0020] The plurality of the first recipes are used as target recipes corresponding to the physical sign condition information.
[0021] In an optional embodiment, the method further comprises:
[0022] For each first recipe, determining a matching degree between the first recipe and each of the preset recipes in the recipe database;
[0023] Based on the respective matching degrees, a corresponding target recipe is obtained from the first recipe for recommendation.
[0024] In an optional embodiment, the method further comprises:
[0025] Determine a first prompt, wherein the first prompt includes first role information, first skill information corresponding to the first role information, and first process information, the first role information indicates a reply recipient of the dietary therapy intention information, the first skill information indicates rewriting the sentence information to identify the user's dietary therapy intention, and the first process information indicates determination logic for determining whether the sentence information contains dietary therapy intention information;
[0026] Based on the first prompt and the sentence information, a large language model is used to determine whether the sentence information contains dietary therapy intention information.
[0027] In an optional embodiment, in response to the statement information containing dietary therapy intention information, the step of determining corresponding physical sign condition information based on the dietary therapy intention information includes:
[0028] Determine a second prompt, wherein the second prompt includes second role information, second skill information corresponding to the second role information, and second process information, the second role information indicates a reply recipient for the physical condition information, the second skill information instructs the second role information to rewrite the sentence information and identify the physical condition information based on the rewritten sentence information, and the second process information indicates determination logic for determining corresponding physical condition information based on the dietary therapy intention information;
[0029] Based on the second prompt, dietary therapy intention information and sentence information, the corresponding physical sign condition information is determined through a large language model.
[0030] In an optional embodiment, the step of determining a target preset diet therapy effect label corresponding to the physical sign condition information from the diet therapy effect label set includes:
[0031] Determine a third prompt, wherein the third prompt includes third role information, third skill information corresponding to the third role information, and third process information, the third role information indicates a reply object of the target preset diet therapy effect label, the third skill information indicates rewriting the sentence information so that the sentence information fully and clearly expresses the user's request, and the third process information indicates a determination logic for determining the target preset diet therapy effect label corresponding to the physical sign condition information;
[0032] Based on the third prompt, the sentence information and the physical sign condition information, the target preset diet therapy effect label corresponding to the physical sign condition information is determined through a large language model.
[0033] In a second aspect, an embodiment of the present application provides a recipe recommendation device, comprising:
[0034] Acquisition module, used to obtain corresponding statement information;
[0035] a response module, configured to, in response to the statement information containing the dietary therapy intention information, determine corresponding physical sign condition information based on the dietary therapy intention information;
[0036] A recommendation module for recommending target recipes based on the physical condition information
[0037] In a third aspect, an embodiment of the present application provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the recipe recommendation method when executing the computer program.
[0038] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the recipe recommendation method when executed by a processor.
[0039] This application has the following beneficial effects:
[0040] This application obtains corresponding sentence information, responds to the dietary therapy intention information contained in the sentence information, determines the corresponding physical condition information based on the dietary therapy intention information, and recommends target recipes based on the physical condition information, thereby achieving accurate recommendation of recipes in scenarios with dietary therapy needs, greatly improving user satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. It should be understood that the following drawings only illustrate certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other relevant drawings can be obtained based on these drawings without paying any creative work.
[0042] Figure 1 A block diagram of an electronic device provided by an embodiment of the present invention;
[0043] Figure 2 One of the flow charts of a recipe recommendation method provided by an embodiment of the present invention;
[0044] Figure 3 A second flow chart of a recipe recommendation method provided by an embodiment of the present invention;
[0045] Figure 4 A third flow chart of a recipe recommendation method provided by an embodiment of the present invention;
[0046] Figure 5 A fourth flow chart of a recipe recommendation method provided by an embodiment of the present invention;
[0047] Figure 6 A fifth flow chart of a recipe recommendation method provided by an embodiment of the present invention;
[0048] Figure 7 A sixth flow chart of a recipe recommendation method provided by an embodiment of the present invention;
[0049] Figure 8 Flowchart 7 of a recipe recommendation method provided by an embodiment of the present invention;
[0050] Figure 9 This is a structural block diagram of a recipe recommendation device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0051] To make the objectives, technical solutions, and advantages of the embodiments of the present invention more clear, the technical solutions of the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings herein can be arranged and designed in various different configurations.
[0052] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention as claimed, but rather merely represents selected embodiments of the present invention. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of the present invention without creative effort shall fall within the scope of protection of the present invention.
[0053] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, it does not require further definition or explanation in subsequent drawings.
[0054] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear, the orientation or position relationship indicated is based on the orientation or position relationship shown in the accompanying drawings, or is the orientation or position relationship in which the product of the invention is usually placed when in use. It is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, it should not be understood as a limitation on the present invention.
[0055] In addition, the terms "first", "second", etc., if used, are merely used to distinguish and describe, and should not be understood as indicating or implying relative importance.
[0056] It should also be noted that, in the description of this application, unless otherwise expressly specified or limited, the terms "disposed," "installed," "connected," and "connected" should be understood in a broad sense. For example, they can refer to fixed connections, detachable connections, or integral connections; they can refer to mechanical connections or electrical connections; they can refer to direct connections or indirect connections through an intermediate medium; and they can refer to internal connections between two components. Those skilled in the art will understand the specific meanings of the above terms in this application based on the specific circumstances.
[0057] After extensive research, the inventors found that current user recipe recommendation systems can be divided into two categories:
[0058] (1) The user fills in the body-related information according to the specified template, and the system recommends recipes based on the predefined body information based on rules or algorithms.
[0059] (2) Recipe recommendation based on natural language dialogue. Currently, recipe recommendation functions based on user queries are provided in the fields of kitchen appliances and smart assistants.
[0060] The method of users filling in relevant physical information based on predefined templates has great limitations on usage scenarios. It is impossible to recommend target recipes in natural language dialogue scenarios, making the recommendation method relatively rigid, inflexible and inefficient.
[0061] Use general recommendation algorithms for recipe recommendations: Recipes recommended by general recommendation algorithms are often popular recipes, which cannot meet the needs of health and diet therapy.
[0062] In view of the discovery of the above problems, the present embodiment provides a recipe recommendation method, device, storage medium and electronic device, which can obtain corresponding sentence information, respond to the dietary therapy intention information contained in the sentence information, determine the corresponding physical sign condition information based on the dietary therapy intention information, and recommend target recipes based on the physical sign condition information, thereby achieving accurate recommendation of recipes in scenarios with dietary therapy needs, greatly improving user satisfaction. The solution provided by this embodiment is elaborated in detail below.
[0063] This embodiment provides an electronic device that can recommend recipes. In one possible implementation, the electronic device can be a user terminal, such as, but not limited to, a server, a smartphone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile internet device (MID), etc.
[0064] Please refer to Figure 1 , Figure 1 The electronic device 100 provided in the embodiment of the present application is shown in FIG. Figure 1 More or fewer components than shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0065] The electronic device 100 includes a memory 120 and a processor 130 .
[0066] The memory 120 and the processor 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The processor 130 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the processor 130.
[0067] The memory 120 may be, but is not limited to, a random access memory (RAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.
[0068] Please refer to Figure 2 , Figure 2 For application Figure 1 A flowchart of a recipe recommendation method for the electronic device 100 is provided, and the method including each step is described in detail below.
[0069] S201: Obtain corresponding statement information.
[0070] S202: In response to the statement information containing dietary therapy intention information, corresponding physical sign condition information is determined based on the dietary therapy intention information.
[0071] S203: Recommending a target diet based on the physical condition information.
[0072] There are many ways to obtain the response sentence information. In one implementation, based on a text input method, the response sentence information is obtained based on the input text information, which is usually input through keyboard input or text file reading.
[0073] In another implementation, a text signal is captured by a microphone and converted into text information as corresponding sentence information.
[0074] In another implementation, text is extracted from the image using optical character recognition technology as corresponding sentence information.
[0075] In another implementation, multimodal input is combined with multiple input methods, such as voice, text, and images, to obtain corresponding sentence information. Alternatively, real-time interactive scenarios, such as intelligent voice assistants, are used to obtain response sentence information.
[0076] For example, the sentence information of "I drank a lot of wine, what kind of food is suitable for me" is obtained, and it is determined that the sentence information contains dietary therapy intention information, and based on the dietary therapy intention information, the corresponding physical sign condition information is determined to be "drank alcohol", and then the target recipe is recommended based on the physical sign condition information of "drank alcohol".
[0077] If it is determined that the sentence information does not contain therapeutic intent, there is no need to recommend a recipe.
[0078] Through the recipe recommendation method provided in this application, recipes will be recommended to users only when the users have the intention of dietary therapy, and accurate recommendations can be made based on the users' physical condition information, so that recipes can be accurately recommended to users when the users have dietary therapy needs, greatly improving user satisfaction with recipe recommendations.
[0079] In response to the sentence information containing the dietary therapy intention information, there are multiple implementations for determining the corresponding physical condition information based on the dietary therapy intention information. In one implementation, for example, Figure 3 As shown, the following steps are included:
[0080] S301: When the sentence information includes dietary therapy intention information, determine the sign keywords of the sentence information.
[0081] S302: Compare the physical sign keyword with various preset physical sign keywords.
[0082] S303: Acquire a target preset physical sign keyword that is consistent with the physical sign keyword from each preset physical sign keyword.
[0083] S304: Using the target preset physical sign keyword as the physical sign status information corresponding to the sentence information.
[0084] When determining that the sentence information contains dietary therapy intention information, the user often expresses the reason for the dietary therapy intention by introducing the key conditions of the body. Therefore, the user's physical condition information can be determined through the sentence information.
[0085] By determining the physical condition information in the sentence information and using it for recipe recommendation, the accuracy of the recipe recommendation can be improved.
[0086] Exemplarily, when the sentence information obtained is "I drank a lot of wine and got two blisters on my mouth. What kind of food is suitable to eat?", after determining that the sentence information contains the intention of diet therapy, the physical sign keywords in the sentence information are determined, wherein the physical sign keywords in the sentence information include "drank a lot of wine" and "got two blisters on my mouth". When the preset physical sign keywords include drinking, blisters, and getting angry, the consistency of "drank a lot of wine" with the preset physical sign keywords is determined, and the target preset physical sign keyword "drinking" that is consistent with "drank a lot of wine" is determined. The consistency of "got two blisters on my mouth" with the preset physical sign keywords is determined, and the target preset physical sign keyword "blisters" that is consistent with "got two blisters on my mouth" is determined.
[0087] In response to the sentence information containing the dietary therapy intention information, in another implementation manner of determining the corresponding physical condition information based on the dietary therapy intention information, as Figure 4 As shown, the following steps are included:
[0088] S401: Determine the second prompt.
[0089] Among them, the second prompt includes second role information, second skill information corresponding to the second role information, and second process information. The second role information indicates the reply object of the physical sign condition information, the second skill information indicates the second role information to rewrite the sentence information, and identify the physical sign condition information corresponding to the rewritten sentence information. The second process information indicates the determination logic of the corresponding physical sign condition information based on the diet therapy intention information.
[0090] S402: Based on the second prompt, the dietary therapy intention information and the sentence information, the corresponding physical sign condition information is determined through the large language model.
[0091] Based on the set second prompt, dietary therapy intention information and sentence information, the corresponding physical sign status information is determined, and the user's physical sign status information can be quickly determined. When the acquired sentence information contains dietary therapy intention information, the physical sign status information can be quickly determined directly through the set second prompt, without spending a lot of time on comparison and determination, which can improve the efficiency and accuracy of determining the physical sign status information.
[0092] For example, the second prompt is designed as follows:
[0093] ##Role
[0094] Natural language processing expert, especially good at extracting user physical condition information
[0095] Skills
[0096] Rewrite the current request based on multiple rounds of conversation history and the current user request
[0097] Accurately identify user's physical condition-related information based on rewritten questions
[0098] ##Rules
[0099] ###Task 1: Rewrite the question
[0100] 1. If the current query is a greeting or meaningless text, there is no need to rewrite the question and return to the original question directly
[0101] 2. When question rewriting is required, supplement the implicit omissions and reference information in the query, and ensure that the rewritten query is clear and has the same semantics as the original query.
[0102] 3. The rewritten query should fully and clearly express the user's request without relying on historical conversations
[0103] 4. Don’t make any fictitious extensions or imaginations when rewriting
[0104] ###Task 2: Diet therapy label classification
[0105] 1. Based on the rewritten query, extract the user's physical condition information to assist in determining the type of diet therapy
[0106] ##Workflow
[0107] -Step 1: Rewrite the query based on the conversation history and current user request
[0108] -Step 2: Extract user’s physical condition information based on the rewritten query
[0109] -Step 3: Return the conversation analysis results in the specified JSON format
[0110] ##Task Example 1:
[0111] ###Current round of query:
[0112] I drank a lot of wine and got two blisters on my mouth. What kind of food should I eat?
[0113] ###Analysis results:
[0114] {"Rewritten Query": "I drank a lot of alcohol, what should I eat?", "Physical Condition": ["The user drank a lot of alcohol", "There are blisters on the mouth"]}
[0115] ##Task Description
[0116] As a role<role>, master <skil1s>, strictly abide by <rules>,according to <workflow>Make a reply, return only the final result, don't think about the process##start the task.
[0117] ##Start the task
[0118] ###Historical Dialogue
[0119] ###Current round of query
[0120] XXXX
[0121] Output
[0122] In the second prompt, ##Role is the second role information, ##Skills is the second skill information corresponding to the second role information, and ##Workflow is the second process information corresponding to the second role information.
[0123] There are many ways to implement the target recipe recommendation based on physical condition information. In one implementation, Figure 5 As shown, the following steps are included: S501: determining a target preset diet therapy effect label corresponding to the physical sign condition information from a diet therapy effect label set.
[0124] The diet therapy effect label set includes a plurality of preset diet therapy effect labels, and each preset diet therapy effect label corresponds to different physical condition information and a corresponding recipe.
[0125] S502: Determine a plurality of first recipes corresponding to preset target therapeutic effect labels.
[0126] S503: Using the plurality of first recipes as target recipes corresponding to the physical sign condition information.
[0127] It should be noted that the diet therapy effect tag set may include multiple diet therapy tags, for example, diet therapy effect tags include replenishing qi and blood, dispelling cold and dampness, regulating and warming the uterus, etc.
[0128] There is a corresponding relationship between each diet therapy effect label and different physical condition information, and there is also a corresponding relationship between each diet therapy effect label and a recipe.
[0129] Based on the correspondence between each therapeutic effect tag in the therapeutic effect tag set and the recipes and physical condition information, multiple first recipes corresponding to the user's physical condition information can be quickly and accurately determined and recommended.
[0130] For example, if the dietary effect tag is hangover relief, and the corresponding physical condition information includes "drinking" and "alcohol drinking," then if the user's physical condition information is "drinking" or "alcohol drinking," the dietary effect tag corresponding to this physical condition information can be determined to be "hangover relief." The dietary effect tag "hangover relief" corresponds to at least one recipe, such as "Beef Stewed with Radish" or "West Lake Beef Soup," which have hangover relief and sobering effects. These recipes are then designated as target recipes for the physical condition information "drinking" or "alcohol drinking."
[0131] In order to meet the application scenarios of specific enterprises, such as Figure 6 As shown, the following steps are included:
[0132] S601: For each first recipe, determine the matching degree between the first recipe and each preset recipe in the recipe database.
[0133] S602: Based on each matching degree, obtain the corresponding target recipe from the first recipe for recommendation.
[0134] When an enterprise application recommends recipes, the recipes ultimately recommended to users are selected from the enterprise's private recipe database. The recipes recommended by the large language model based on therapeutic effect tags may not be included in the enterprise's recipe database. In this case, the most suitable recipes need to be selected from the enterprise's recipe database as the final recommendation result.
[0135] Based on the recipe database, one implementation method for obtaining the corresponding target recipe from each first recipe may be:
[0136] The recipe database contains multiple preset recipes. For the first recipe, the matching degree between the first recipe and each preset recipe is calculated. When the preset recipes include the first preset recipe, the second preset recipe and the third preset recipe, the matching degree between the first recipe and each preset recipe is calculated as the first matching degree, the second matching degree and the third matching degree. The preset recipe corresponding to the maximum matching degree is obtained from the first matching degree, the second matching degree and the third matching degree and recommended as the target recipe.
[0137] Another implementation method of obtaining the corresponding target recipe from each first recipe may be:
[0138] A fourth prompt is determined, and based on the fourth prompt, the first recipes, and the recipe database, a corresponding target recipe is obtained from each first recipe.
[0139] The fourth prompt can be designed as follows:
[0140] ##Role
[0141] -Natural language processing experts, especially good at selecting the target recipe that best meets the requirements from the preset recipes based on the customer's dietary effect labels and recommended recipes
[0142] Skills
[0143] -Rewrite the current request based on Duolun conversation history and current user request
[0144] - Based on the customer's diet effect label and first recipe, select the target recipe that best meets the requirements from the preset recipes
[0145] ##Rules
[0146] ###Task: Select target recipe
[0147] 1. Analyze the given enterprise preset recipe data to identify the health benefits, main ingredients and nutritional value of each dish
[0148] 2. Based on the customer's diet effect label and the first recipe, select the target recipe that best meets the user's needs from the company's preset recipes, and return up to 5 recipes
[0149] ##Workflow
[0150] -Step 1. Understand the user's needs based on the conversation history and current user request
[0151] -Step 2. Based on the rewritten query, the customer's dietary effect label, and the first recipe recommended by the large language model, identify the target recipe in the company's preset recipes that best meets the user's needs
[0152] ##Task Example:
[0153] ###Current round of query:
[0154] I drank a lot of wine and got two blisters on my mouth. What should I eat?
[0155] ###User dietary effect tags: ["relieves hangover", "reduces heat and relieves dryness"]
[0156] ###The first recipe recommended by the large language model: beef soup, cold beef
[0157] ###Preset recipes in the recipe database:
[0158] [{"Preset Recipe ID: 1554, Preset Recipe Name: West Lake Beef Soup, Main Ingredients: Soft Tofu, 200g, Nutritional Information": Low Fat: 1.19g per 100g, Dietary Effect Tags: Reduces Heat and Moisturizes Dryness, Increases Appetite, Strengthens the Spleen and Stomach, Endocrine, Calms the Liver and Calms Wind, Sobers Up Hangovers}];
[0159] [{"Preset Recipe ID": 12898, Preset Recipe Name: Asparagus Beef Roll, Main Ingredients: Beef Tenderloin, 150g, Nutritional Information: Protein: 11.05g per 100g, Niacin: 3.73mg per 100g, Dietary Effect Label: Reduces Heat and Moisturizes, Promotes the Production of Body Fluids and Quenches Thirst}];
[0160] [{"Preset Recipe ID": 23394, Preset Recipe Name: Goji Berry and Chinese Yam Beef Soup, Main Ingredients: Beef, 300g, Nutritional Information: Low Fat: 1.32g per 100g, Dietary Effect Tags: Low Fat, Low Carbohydrate, Low Iodine, Low Sodium, Low Purine}]
[0161] ###Analysis results:
[0162] {target recipe: "West Lake Beef Soup"};
[0163] ##Task Description
[0164] As a role <role>, master <skliis>, strictly abide by <rules>,according to <workfolw>When responding, only return the final result, don't think about the process
[0165] ##Start the task
[0166] ###Current round of query
[0167] XXXX
[0168] ###User dietary therapy effect label
[0169] XXXXX
[0170] ###Large language model recommends the first recipe:
[0171] XXXX
[0172] ###Recipe Database Preset Recipes
[0173] XXXX
[0174] Output
[0175] Another way to determine the target preset diet therapy effect label corresponding to the physical condition information from the diet therapy effect label set may be as follows: Figure 7 As shown, the following steps are included:
[0176] S701: Determine the third prompt.
[0177] Among them, the third prompt includes third role information, third skill information corresponding to the third role information, and third process information. The third role information indicates the reply object of the target preset diet therapy effect label, the third skill information indicates to rewrite the sentence information so that the sentence information expresses the user's demands completely and clearly, and the third process information indicates the determination logic of the target preset diet therapy effect label corresponding to the physical sign condition information.
[0178] S702: Based on the third prompt, the sentence information and the physical sign condition information, the target preset diet therapy effect label corresponding to the physical sign condition information is determined through the large language model.
[0179] The design of the third prompt can be as follows:
[0180] ##Role
[0181] -Natural language processing expert, particularly good at identifying users' TCM health tags based on their physical condition information
[0182] Skills
[0183] -Rewrite the current request based on multiple rounds of conversation history and the current user request
[0184] -Hangover sobering up
[0185] ##Rules
[0186] ###Task 1: Rewrite the question
[0187] 1. If the current query is a greeting or meaningless text, there is no need to rewrite the question and return to the original question directly
[0188] 2. When question rewriting is required, supplement the implicit omissions and reference information in the query, and ensure that the rewritten query is clear and has the same semantics as the original query.
[0189] 3. The rewritten query should fully and clearly express the user's request without relying on historical conversations
[0190] 4. Don’t make any fictitious extensions or imaginations when rewriting
[0191] ###Task 2: Classification of dietary therapy effect labels
[0192] 1. Based on the rewritten query, according to the given user's physical condition information and candidate TCM health and diet therapy tags, determine the TCM health and diet therapy tags that match the user's physical condition
[0193] 2. Recipe recommendation: Based on the extracted therapeutic effect tags and other user requirements, two target recipes that meet the user's needs are given
[0194] ###Dietary therapeutic effect label set:
[0195] ["Replenishes Qi and Blood", "Dispels Cold and Dampness", "Regulates and Warms the Uterus", "Sobers Up from Hangovers"]
[0196] ##Workflow
[0197] -Step 1. Rewrite the query based on the conversation history and current user request
[0198] -Step 2. Identify the user's TCM health and diet therapy tag based on the rewritten query, user's physical condition, and health and diet therapy system
[0199] -3. Recommend 2 target recipes that meet the user's needs based on the user's health and diet tags and user query
[0200] ##Task Example 1:
[0201] ###Current round of query:
[0202] I drank a lot of wine and my mouth is full of bubbles. What kind of beef dish would be suitable?
[0203] ###User's vital signs information:
[0204] ["Drank some wine", "two bubbles formed on my mouth"]
[0205] ###Analysis results:
[0206] {"Rewritten Query":"I drank a lot of wine, what kind of food would be suitable for me? "TCM health tags": ["Hangover sobering"] "Recommended recipes": ["Beef stewed with radish" "West Lake beef soup"]}
[0207] ###Task Description
[0208] As a role <role>Proficient in <skil1s>, strictly abide by <rules>according to <workflow>When responding, only return the final result, don't think about the process
[0209] ##Start the task
[0210] ###Historical Dialogue
[0211] ###Current round of query
[0212] XXXX
[0213] ##User's vital signs information:
[0214] XXXXX
[0215] ## Output results
[0216] In the third prompt, ##Role is the third role information, ##Skills is the third skill information corresponding to the third role information, and ##Workflow is the third process information corresponding to the third role information.
[0217] There are many ways to determine whether the sentence information contains therapeutic intention information. In one implementation, Figure 8 As shown, the following steps are included:
[0218] S801: Determine the first prompt.
[0219] Among them, the first prompt includes the first role information, the first skill information corresponding to the first role information, and the first process information. The first role information indicates the reply object of the diet therapy intention information, the first skill information indicates the rewriting of the sentence information to identify the user's diet therapy intention, and the first process information indicates the determination logic for judging whether the sentence information contains diet therapy intention information.
[0220] S802: Based on the first prompt and the sentence information, determine whether the sentence information contains dietary therapy intention information through a large language model.
[0221] For example, the design of the first prompt can be as follows:
[0222] ##Role
[0223] Natural language processing expert, particularly good at identifying and classifying symptoms of traditional Chinese medicine therapy and health preservation
[0224] Skills
[0225] Based on the multi-round conversation history and the current user request, the current request is rewritten. Based on the rewriting question, the user's dietary therapy intention is accurately identified for label classification and recipe recommendation.
[0226] ##Rules
[0227] ###Task 1: Rewrite the question
[0228] 1. If the current query is a greeting or meaningless text, there is no need to rewrite the question and return to the original question directly
[0229] 2. When question rewriting is required, supplement the implicit omissions and reference information in the query, and ensure that the rewritten query is clear and has the same semantics as the original query.
[0230] 3. The rewritten query should fully and clearly express the user's request without relying on historical conversations
[0231] 4. Don’t make any fictitious extensions or imaginations when rewriting
[0232] ##Task 2: Classification of dietary therapy effect labels
[0233] 1. Based on the rewritten query, determine the dietary therapy intention and whether the user has the need to recommend Chinese medicine health diet recipes
[0234] 2. Judgment of dietary therapy intention:
[0235] (1) Based on the rewritten query, determine whether it contains symptoms and clearly indicate that you want to know what to eat for dietary therapy
[0236] (2) If the user's question does not include symptoms or the user's question does not clearly indicate that they want to know what to eat for dietary therapy, it is considered that the user has no need for dietary therapy, and the return intention is "No". (3) Please note that if the user only wants to know the treatment or conditioning methods for the symptoms, it is considered that the user has no need for dietary therapy, and the return intention is "No".
[0237] ##Workflow
[0238] Step 1. Rewrite the query based on the conversation history and current user request
[0239] Step 2. Identify user intent based on the rewritten query
[0240] Step 3: Return the conversation analysis results in the specified JSON format
[0241] ##Task Example 1:
[0242] ###Current round of query:
[0243] I've drunk a lot of wine, what kind of food would be suitable?
[0244] ###Analysis results:
[0245] {"Rewritten Query":"I drank a lot of wine, what kind of food would be suitable for me?","Dietary Therapy Intention":"Yes"}
[0246] ##Task Description
[0247] As a role <role>, master <skills>, strictly abide by <rules>,according to <workflow>When responding, only return the final result, don't think about the process
[0248] ##Start the task
[0249] ###Historical Dialogue
[0250] ###Current round of query:
[0251] XXXX
[0252] Output
[0253] Please refer to Figure 9 The embodiment of the present application also provides an application Figure 1 The recipe recommendation device 110 of the electronic device 100 includes:
[0254] Acquisition module 111, used to acquire corresponding statement information;
[0255] A response module 112 is configured to respond to the statement information containing the dietary therapy intention information and determine corresponding physical sign condition information based on the dietary therapy intention information;
[0256] The recommendation module 113 is used to recommend a target recipe based on the physical condition information.
[0257] The present application further provides an electronic device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer-executable instructions, which, when executed by the processor 130, implement the recipe recommendation method.
[0258] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by the processor 130, the recipe recommendation method is implemented.
[0259] In the embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architectures, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or action, or can be implemented using a combination of dedicated hardware and computer instructions.
[0260] In addition, the functional modules in each embodiment of the present application can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module 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 is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0261] It should be noted that, in this document, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprise," "include," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. In the absence of further limitations, an element defined by the phrase "comprising a ..." does not exclude the presence of other identical elements in the process, method, article, or device comprising the element.
[0262] The above descriptions are merely examples of various embodiments of the present application, but the scope of protection of the present application is not limited thereto. Any modifications or substitutions that can be readily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included within the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.< / workflow> < / rules> < / skills> < / role> < / workflow> < / rules> < / role> < / workfolw> < / rules> < / skliis> < / role> < / workflow> < / rules> < / role>
Claims
1. A recipe recommendation method, characterized in that: The method comprises: Get the corresponding statement information; In response to the statement information containing dietary therapy intention information, determining corresponding physical sign condition information based on the dietary therapy intention information; A target diet is recommended based on the physical condition information.
2. The method according to claim 1, characterized in that The step of determining corresponding physical condition information based on the dietary therapy intention information in response to the dietary therapy intention information being included in the sentence information includes: In the case where the sentence information includes dietary therapy intention information, determining the physical sign keywords of the sentence information; Comparing the physical sign keyword with various preset physical sign keywords; Acquire a target preset physical sign keyword consistent with the physical sign keyword from each of the preset physical sign keywords; The target preset physical sign keyword is used as the physical sign condition information corresponding to the sentence information.
3. The method according to claim 1, characterized in that The step of recommending a target diet based on the physical condition information includes: Determining a target preset diet therapy effect tag corresponding to the physical sign condition information from a diet therapy effect tag set, wherein the diet therapy effect tag set includes a plurality of preset diet therapy effect tags, each of the preset diet therapy effect tags corresponding to different physical sign condition information and a corresponding recipe; Determining a plurality of first recipes corresponding to the preset target therapeutic effect labels; The plurality of the first recipes are used as target recipes corresponding to the physical sign condition information.
4. The method according to claim 3, characterized in that The method further comprises: For each first recipe, determining a matching degree between the first recipe and each of the preset recipes in the recipe database; Based on the respective matching degrees, a corresponding target recipe is obtained from the first recipe for recommendation.
5. The method according to claim 1, wherein The method further comprises: Determine a first prompt, wherein the first prompt includes first role information, first skill information corresponding to the first role information, and first process information, the first role information indicates a reply recipient of the dietary therapy intention information, the first skill information indicates rewriting the sentence information to identify the user's dietary therapy intention, and the first process information indicates determination logic for determining whether the sentence information contains dietary therapy intention information; Based on the first prompt and the sentence information, a large language model is used to determine whether the sentence information contains dietary therapy intention information.
6. The method according to claim 1, characterized in that The step of determining corresponding physical condition information based on the dietary therapy intention information in response to the dietary therapy intention information being included in the sentence information includes: Determine a second prompt, wherein the second prompt includes second role information, second skill information corresponding to the second role information, and second process information, the second role information indicates a reply recipient for the physical condition information, the second skill information instructs the second role information to rewrite the sentence information and identify the physical condition information based on the rewritten sentence information, and the second process information indicates determination logic for determining corresponding physical condition information based on the dietary therapy intention information; Based on the second prompt, dietary therapy intention information and sentence information, the corresponding physical sign condition information is determined through a large language model.
7. The method according to claim 3, characterized in that The step of determining a target preset diet therapy effect label corresponding to the physical sign condition information from the diet therapy effect label set includes: Determine a third prompt, wherein the third prompt includes third role information, third skill information corresponding to the third role information, and third process information, the third role information indicates a reply object of the target preset diet therapy effect label, the third skill information indicates rewriting the sentence information so that the sentence information fully and clearly expresses the user's request, and the third process information indicates a determination logic for determining the target preset diet therapy effect label corresponding to the physical sign condition information; Based on the third prompt, the sentence information and the physical sign condition information, the target preset diet therapy effect label corresponding to the physical sign condition information is determined through a large language model.
8. A recipe recommendation device, characterized in that: The device comprises: Acquisition module, used to obtain corresponding statement information; a response module, configured to, in response to the statement information containing the dietary therapy intention information, determine corresponding physical sign condition information based on the dietary therapy intention information; A recommendation module is used to recommend a target recipe based on the physical condition information.
9. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
10. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method according to any one of claims 1 to 7 when executing the computer program.
