Cooking demand information processing method and device, electronic equipment and storage medium
By obtaining and analyzing cooking demand information, reasoning prompt information and scene prompt information, inputting a generative model to generate target cooking interaction information, solving the problem that the results in the prior art are inconsistent with the actual situation, and achieving cooking interactive content generation that is more in line with user expectations.
Patent Information
- Application Number
- CN202411724588.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-28
- Publication Date
- 2025-03-25
AI Technical Summary
When processing user's cooking demand information in the prior art, the query results do not match the user's actual cooking status, and the response strategy does not meet user expectations.
By obtaining cooking demand information, reasoning prompt information and scene prompt information, inputting a generative model to generate cooking interactive content, and obtaining the target cooking interactive information. The method includes providing corresponding prompt information and interactive content at different cooking stages (such as recipe generation, operation guidance, cooking evaluation).
Through reasoning prompt information and scene prompt information, the generative model can better understand the stage and expectation feedback of cooking demand information, and the generated target cooking interaction information is more in line with user expectations and actual needs.
Smart Images

Figure CN119692468A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information processing technology, and in particular to a cooking demand information processing method, device, electronic equipment and storage medium. Background Art
[0002] With the development of smart home appliances, users can answer questions during the cooking process by interacting with smart kitchen appliances. In related technologies, the way to process user cooking demand information is usually for the smart kitchen appliance to directly query the countermeasures of cooking needs in the networked state and push them to the user, which results in the query results not being consistent with the user's actual cooking situation, and the response strategy does not meet the user's expectations. Summary of the invention
[0003] In order to solve at least one of the technical problems mentioned above, the present disclosure proposes a cooking demand information processing method, device, electronic device and storage medium.
[0004] In one aspect, the present disclosure provides a cooking requirement information processing method, the method comprising:
[0005] Obtain cooking demand information;
[0006] Obtaining reasoning prompt information, where the reasoning prompt information indicates cooking interaction content output by the generative model;
[0007] Performing a cooking scene analysis on the cooking demand information to obtain scene prompt information, where the scene prompt information indicates a cooking stage corresponding to the cooking demand information;
[0008] The cooking requirement information, reasoning prompt information and scenario prompt information are input into the generative model to generate cooking interaction content and obtain the target cooking interaction information.
[0009] In an optional embodiment, the cooking requirement information includes at least one of the following modalities: text modality, image modality, and the target cooking interaction information includes at least one of the following modalities: text modality, image modality, and video modality.
[0010] In an optional embodiment, when the scene prompt information indicates that the cooking stage is a recipe generation stage, the scene prompt information further indicates keyword information required to generate the target recipe, and the method further includes:
[0011] Generate interactive prompt information based on the scenario prompt information, and the interactive prompt information is used to prompt the user to describe the keyword information;
[0012] Extracting text from user feedback information regarding interactive prompt information to obtain description information corresponding to keyword information;
[0013] Expand the scene prompt information based on the description information corresponding to the keyword information;
[0014] The cooking requirement information, reasoning prompt information and scenario prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained, including:
[0015] The cooking requirement information, the reasoning prompt information and the expanded scenario prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained, and the target cooking interaction information includes a target recipe.
[0016] In an optional embodiment, when the scene prompt information indicates that the cooking stage is the operation guidance stage, the scene prompt information further indicates the parameters of the target device being operated, and the method further includes:
[0017] Based on the cooking demand information and the scene prompt information, the retrieval information is obtained;
[0018] querying operation reference information based on the search information, the operation reference information indicating guidance information for cooking based on parameters of the target device;
[0019] The cooking requirement information, reasoning prompt information and scenario prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained, including:
[0020] The cooking demand information, reasoning prompt information, scenario prompt information and operation reference information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained. The target cooking interaction information includes teaching information for cooking using the equipment.
[0021] In an optional embodiment, the cooking requirement information includes a cooking image indicating a cooking result, and when the scene prompt information indicates that the cooking stage is a cooking evaluation stage, the scene prompt information further indicates reference evaluation information and food maturity attributes required for evaluating the cooked food.
[0022] The cooking requirement information, reasoning prompt information and scenario prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained, including:
[0023] The cooking image, reasoning prompt information and scene prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained. The target cooking interaction information includes evaluation information of the cooking result and / or image processing results of the cooking image.
[0024] In an optional embodiment, the cooking image, the reasoning prompt information, and the scene prompt information are input into the generative model to generate cooking interaction content to obtain target cooking interaction information, including performing at least one of the following operations by the generative model:
[0025] Extracting features of the cooking image to obtain target maturity features corresponding to the food in the cooking image; generating evaluation information of the cooking result based on the reference evaluation information, the food maturity attributes and the target maturity features;
[0026] Based on the cooking image and the evaluation information of the cooking result, image processing is performed on the cooking image to obtain an image processing result of the cooking image.
[0027] In an optional embodiment, the generative model is trained by the following method:
[0028] Obtaining training samples, where the training samples include at least one of the following: ingredient data, recipe data, cooking method data, cooking equipment operation data, and conversation data in ingredient cooking scenarios;
[0029] Input the training samples, reasoning prompt information, and scene prompt information into the generative model to obtain the generated results;
[0030] Adjust the parameters of the generative model based on the generated results.
[0031] In a second aspect, the present invention further provides a cooking demand information processing device, comprising:
[0032] A first acquisition module is used to acquire cooking demand information;
[0033] A second acquisition module is used to acquire reasoning prompt information, where the reasoning prompt information indicates the cooking interaction content output by the generative model;
[0034] An analysis module, used to perform cooking scene analysis on the cooking demand information to obtain scene prompt information, where the scene prompt information indicates a cooking stage corresponding to the cooking demand information;
[0035] The generation module is used to input cooking requirement information, reasoning prompt information and scene prompt information into the generative model to generate cooking interaction content and obtain target cooking interaction information.
[0036] In a third aspect, the present invention further provides an electronic device, comprising:
[0037] processor;
[0038] a memory for storing processor-executable instructions;
[0039] The processor is used to execute instructions to implement the above-mentioned cooking demand information processing method.
[0040] In a fourth aspect, the present invention further provides a storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the above-mentioned cooking requirement information processing method.
[0041] It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
[0042] The implementation of this disclosure has the following beneficial effects:
[0043] Acquire cooking requirement information; acquire reasoning prompt information, the reasoning prompt information indicating the cooking interaction content output by the generative model; perform cooking scene analysis on the cooking requirement information to obtain scene prompt information, the scene prompt information indicating the cooking stage corresponding to the cooking requirement information; input the cooking requirement information, the reasoning prompt information and the scene prompt information into the generative model to generate cooking interaction content, and obtain target cooking interaction information.
[0044] The present disclosure generates cooking interaction content by inputting reasoning prompt information indicating the cooking interaction content output by the generative model and scene prompt information indicating the cooking stage corresponding to the cooking requirement information together with the cooking requirement information into the generative model. The reasoning prompt information and the scene prompt information can enable the generative model to better understand the cooking stage targeted by the cooking requirement information and the feedback content expected by the cooking requirement information, so that the target cooking interaction information can better meet expectations.
[0045] Further features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments with reference to the attached drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions and advantages of the embodiments of the present application or the prior art, the following is a brief introduction to the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. The drawings herein are incorporated into the specification and constitute a part of the specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure, and do not constitute an improper limitation of the present disclosure.
[0047] Figure 1 is a schematic diagram of an implementation environment according to an exemplary embodiment;
[0048] Figure 2 is a flow chart of a cooking demand information processing method according to an exemplary embodiment;
[0049] Figure 3 is a flow chart of a method for processing cooking requirement information in a recipe generation phase according to an exemplary embodiment;
[0050] Figure 4is a flow chart of a method for processing cooking demand information in an operation guidance phase according to an exemplary embodiment;
[0051] Figure 5 is a flowchart of training a generative model according to an exemplary embodiment;
[0052] Figure 6 is a schematic diagram of a cooking demand information processing device according to an exemplary embodiment;
[0053] Figure 7 The invention is a block diagram of an electronic device for processing cooking requirement information according to an exemplary embodiment. DETAILED DESCRIPTION
[0054] The following will be combined with the drawings in the embodiments of this specification to clearly and completely describe the technical solutions in the embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of this specification, not all of the embodiments. Based on the embodiments in this specification, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0055] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product, or server that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products, or devices.
[0056] Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. The same reference numerals in the drawings represent elements with the same or similar functions. Although various aspects of the embodiments are shown in the drawings, the drawings are not necessarily drawn to scale unless otherwise indicated. The word "exemplary" is used specifically herein to mean "serving as an example, embodiment, or illustrative". Any embodiment described herein as "exemplary" is not necessarily to be construed as being superior or better than other embodiments.
[0057] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.
[0058] In addition, in order to better illustrate the present disclosure, numerous specific details are given in the following specific embodiments. It should be understood by those skilled in the art that the present disclosure can also be implemented without certain specific details. In some examples, methods, means, components and circuits well known to those skilled in the art are not described in detail in order to highlight the subject matter of the present disclosure.
[0059] See also Figure 1 , Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment. Figure 1 As shown, the application environment may include a server 01 and a terminal 02 .
[0060] In an optional embodiment, the server 01 can be used for computing and processing the cooking demand information processing method. Specifically, the server 01 can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.
[0061] In an optional embodiment, the terminal 02 can perform calculation processing in combination with the cooking demand information processing method of the server 01. Specifically, the terminal 02 can include but is not limited to electronic devices such as smart phones, desktop computers, tablet computers, laptop computers, smart speakers, digital assistants, augmented reality (AR) / virtual reality (VR) devices, smart wearable devices, etc. Optionally, the operating system running on the electronic device can include but is not limited to Android system, IOS system, Linux system, Windows system, Unix system, etc.
[0062] For example, cooking requirement information is obtained through terminal 02, and the cooking requirement information is sent to server 01. Server 01 obtains corresponding reasoning prompt information, and the reasoning prompt information indicates the cooking interaction content output by the generative model; and a cooking scene analysis is performed on the cooking requirement information to obtain scene prompt information, and the scene prompt information indicates the cooking stage corresponding to the cooking requirement information; the cooking requirement information, the reasoning prompt information and the scene prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained, and then the obtained target cooking interaction information is sent to terminal 02.
[0063] In addition, it should be noted that Figure 1 What is shown is only one application environment provided by the present disclosure. In actual application, other application environments may also be included.
[0064] In the embodiments of this specification, the server 01 and the terminal 02 may be directly or indirectly connected via wired or wireless communication, which is not limited in this disclosure.
[0065] Figure 2 is a flowchart of a cooking requirement information processing method according to an exemplary embodiment, the method comprising:
[0066] Step S201: Obtain cooking requirement information.
[0067] In the disclosed embodiment, the cooking demand information may be a cooking demand issued by the user at any stage of the cooking process. For example, the user's cooking process may be divided into steps such as recipe preparation, cooking operation, and achievement sharing in order. In the recipe preparation step, the cooking demand information may be a request for recipe generation; in the cooking operation step, the cooking demand information may be a request for inquiring about the specific implementation method of a certain cooking operation, and the cooking operation may be subdivided into steps such as ingredient selection, ingredient cleaning, ingredient processing, and ingredient cooking; in the achievement sharing step, the cooking demand information may be a request for evaluation or beautification of the cooking achievement.
[0068] In the disclosed embodiment, the cooking requirement information can be acquired by using a voice acquisition component, such as a microphone, to acquire the user's voice and analyze it to obtain the cooking requirement information. It can also be combined with an image acquisition component, such as a camera, to acquire images of ingredients in the user's cooking area or successful cooking, or to receive images uploaded by the user and analyze them to obtain the cooking requirement information. The above cooking requirement information acquisition methods are all performed with the authorization of the user.
[0069] Step S202: Obtain reasoning prompt information, where the reasoning prompt information indicates the cooking interaction content output by the generative model.
[0070] In the disclosed embodiment, the reasoning prompt information may be prompt information indicating the cooking interaction content output by the generative model. Since the expected feedback for cooking requirement information for different purposes is different, the reasoning prompt information matched by different cooking requirement information is different. The reasoning prompt information can make the cooking interaction content output by the generative model more in line with the user's expectations of the cooking requirement information.
[0071] Step S203: performing a cooking scene analysis on the cooking requirement information to obtain scene prompt information, where the scene prompt information indicates a cooking stage corresponding to the cooking requirement information.
[0072] In the disclosed embodiment, the scene prompt information may be prompt information indicating the cooking stage corresponding to the cooking demand information. The user's cooking process may be divided into steps such as recipe preparation, cooking operation and achievement sharing in order, and the corresponding stages are respectively the recipe generation stage, the operation guidance stage and the cooking evaluation stage. The cooking scene analysis of the cooking demand information may be to extract scene features of the cooking demand information to match the corresponding scene prompt information, or may be to fuse the cooking demand information with the corresponding reasoning prompt information to obtain the reasoning direction information, and match the corresponding scene prompt information according to the reasoning direction information.
[0073] Step S204: input the cooking requirement information, reasoning prompt information and scenario prompt information into the generative model to generate cooking interaction content, and obtain target cooking interaction information.
[0074] In the disclosed embodiment, the generative model can extract and fuse features of the input cooking requirement information, reasoning prompt information, and scene prompt information, so as to better understand the cooking stage targeted by the cooking requirement information and the feedback expected by the cooking requirement information. Specifically, the generative model can first integrate the cooking requirement information and the reasoning prompt information matching it to obtain the reasoning direction information, match the corresponding scene prompt information according to the reasoning direction information, and output the corresponding target cooking interaction information by understanding and reasoning the reasoning direction information and the corresponding scene prompt information.
[0075] In an optional embodiment, the cooking requirement information includes at least one of the following modalities: text modality, image modality, and the target cooking interaction information includes at least one of the following modalities: text modality, image modality, and video modality.
[0076] In the embodiment of the present disclosure, the cooking requirement information can be input into the generative model in the form of text mode, and can also be input into the generative model in the form of image mode; the target cooking interaction information output by the generative model can be output in the form of text mode, image mode or video mode. In other words, the generative model in the embodiment of the present disclosure has the ability to understand text from text, text from image, text from video and pictures.
[0077] Based on the above, it can be known that in the embodiments of the present disclosure, inputting cooking requirement information through text modality or image modality can facilitate the interaction between the user and the generative model, and outputting through text modality, image modality or video modality can facilitate the user to intuitively obtain the target cooking interaction information, thereby improving the adaptability of the target cooking interaction information.
[0078] In an optional embodiment, when the scene prompt information indicates that the cooking stage is a recipe generation stage, the scene prompt information further indicates keyword information required for generating a target recipe, and the keyword information may be information such as a recipe name keyword, an ingredient keyword, a seasoning keyword, or a cooking method keyword required for generating the target recipe. The above method further includes:
[0079] Step S301: Generate interactive prompt information according to the scene prompt information, where the interactive prompt information is used to prompt the user to describe the keyword information.
[0080] In the disclosed embodiment, the interactive prompt information can be delivered to the user through text display or voice broadcast. For example, when the cooking requirement information is a request to generate a target recipe, the user orally supplements the recipe name keywords and ingredient keywords in the keyword information, and the interactive prompt information can be interactive prompt information that prompts the user to describe the seasoning keywords or cooking method keywords through multiple rounds of inquiries.
[0081] Step S302: extracting text from the user's feedback information regarding the interactive prompt information to obtain description information corresponding to the keyword information.
[0082] In the disclosed embodiment, when the user describes the required keyword information by oral utterance, the user's oral content can be collected through a microphone to obtain the user's feedback information on the interactive prompt information, and the voice content can be extracted into text to obtain description information corresponding to the keyword information.
[0083] Step S303: Expanding the scene prompt information based on the description information corresponding to the keyword information.
[0084] In the disclosed embodiment, based on the description information corresponding to the keyword information, the extended scene prompt information may be text-organizing the description information corresponding to the keyword information to make the description information corresponding to the keyword information more standardized, and supplementing the missing keywords in the scene prompt information with the description information corresponding to the organized keyword information; based on the description information corresponding to the keyword information, the extended scene prompt information may also be scene prompt information corresponding to the description information matching the keyword information to enrich the scene prompt information required for generating a recipe.
[0085] In the embodiment of the present disclosure, when the scene prompt information indicates that the cooking stage is the recipe generation stage, the cooking requirement information, the reasoning prompt information and the scene prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained, including:
[0086] Step S304: input the cooking requirement information, the reasoning prompt information and the expanded scenario prompt information into the generative model to generate cooking interaction content, and obtain target cooking interaction information, which includes a target recipe.
[0087] In the disclosed embodiment, the generative model can perform feature extraction and feature fusion on the input cooking requirement information, reasoning prompt information and expanded scene prompt information, so as to better understand the recipe generation stage targeted by the cooking requirement information and the expected feedback of the cooking requirement information, and then perform reasoning related to recipe generation based on the fused information, and output target cooking interaction information including the target recipe. Optionally, the target recipe can be a standardized or templated recipe text content, or a recipe text image, or a video information indicating the cooking method of the target recipe.
[0088] In the disclosed embodiment, when the cooking requirement information also includes instructions for generating an operation demonstration video of a certain cooking stage of the target recipe, the generative model can also generate a video of the operation of the cooking stage in the target recipe and display it together with the target recipe.
[0089] In the disclosed embodiment, cooking requirement information, reasoning prompt information and expanded scenario prompt information are input into a generative model to generate cooking interactive content. The above information can also be used to conduct an online query, organize the queried recipe texts that match the recipe, and generate a target recipe text in combination with the above information. Alternatively, the above information can be used to conduct an online query, and the generated target recipe text or the queried recipe cooking operation video that matches the recipe is used as the target cooking interactive information.
[0090] Based on the above, it can be seen that in the embodiment of the present disclosure, by generating interactive prompt information, the user can be prompted to describe the keyword information to achieve the expansion of the scene prompt information; by inputting the cooking requirement information, reasoning prompt information and expanded scene prompt information into the generative model to generate cooking interactive content, it can facilitate the generative model to better understand the recipe generation stage targeted by the cooking requirement information, so that the generated target recipe is more in line with the cooking requirements.
[0091] In an optional embodiment, when the scene prompt information indicates that the cooking stage is the operation guidance stage, the scene prompt information further indicates the parameters of the target device being operated, and the operation guidance stage can be subdivided into the food washing stage, the food cooking stage, etc. The scene prompt information may indicate the parameters of the dishwasher being operated in the food washing stage, or may indicate the parameters of the cooking utensils being operated in the food cooking stage. The above method further includes:
[0092] Step S401: Obtaining search information based on cooking requirement information and scene prompt information.
[0093] In the disclosed embodiment, based on the cooking requirement information and the scene prompt information, the search information obtained can be obtained by text fusion of the cooking requirement information and the scene prompt information to obtain search information with richer search terms, so as to make the queried content more accurate.
[0094] Step S402: querying operation reference information based on the search information, where the operation reference information indicates guidance information for cooking based on parameters of the target device.
[0095] In the disclosed embodiment, the query method can be implemented through a retrieval-augmented generation (RAG) retrieval method, which retrieves relevant domain knowledge from an external knowledge source through retrieval information, links the latest information, and uses the retrieved matching information as operation reference information.
[0096] In the embodiment of the present disclosure, when the scene prompt information indicates that the cooking stage is the operation guidance stage, the cooking requirement information, the reasoning prompt information and the scene prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained, including:
[0097] Step S403: input the cooking requirement information, reasoning prompt information, scenario prompt information and operation reference information into the generative model to generate cooking interaction content, and obtain target cooking interaction information, which includes teaching information for cooking using the equipment.
[0098] In the disclosed embodiment, the cooking requirement information, the reasoning prompt information, the scene prompt information and the operation reference information are subjected to feature extraction and feature fusion, so as to better understand the operation guidance stage targeted by the cooking requirement information and the feedback expected by the cooking requirement information, and then the operation guidance-related reasoning is performed based on the fused information, and the teaching information for cooking using the equipment is output. Optionally, the teaching information can be standardized operation text content, or it can be a video image that guides the user to use the cooking equipment to perform the cooking operation.
[0099] In the disclosed embodiment, when the household devices connected to the home network include a target device, after instructional information for cooking using the device is generated, cooking instructions for controlling the target device to perform cooking operations can also be generated through the instructional information, so as to help the user better implement operational guidance.
[0100] Based on the above, it can be seen that in the embodiment of the present disclosure, by obtaining retrieval information based on cooking requirement information and scene prompt information, the information that can be queried is more in line with the teaching information of the cooking stage indicated by the cooking requirement; by inputting the cooking requirement information, reasoning prompt information, scene prompt information and operation reference information into the generative model to generate cooking interactive content, it can facilitate the generative model to better understand the operation guidance stage targeted by the cooking requirement information, so that the generated teaching information is more in line with the cooking requirements.
[0101] In an optional embodiment, the cooking requirement information includes a cooking image indicating the cooking result. When the scene prompt information indicates that the cooking stage is a cooking evaluation stage, the scene prompt information further indicates reference evaluation information and food maturity attributes required for evaluating the cooked food. The reference evaluation information may be an image of the dish corresponding to the cooking result under the optimal cooking conditions or the optimal cooking method, or a description of the characteristics of the dish under the optimal cooking conditions or the optimal cooking method. The food maturity attribute may be a dimension for evaluating the cooking result, such as evaluating the color, shape, and other dimensions of the cooking result.
[0102] In the embodiment of the present disclosure, when the scene prompt information indicates that the cooking stage is the cooking evaluation stage, the cooking requirement information, the reasoning prompt information and the scene prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained, including:
[0103] The cooking image, reasoning prompt information and scene prompt information are input into the generative model to generate cooking interaction content, and the target cooking interaction information is obtained. The target cooking interaction information includes evaluation information of the cooking result and / or image processing results of the cooking image.
[0104] In the embodiment of the present disclosure, the cooking image, the reasoning prompt information and the scene prompt information are input into the generative model to generate the cooking interaction content, and the target cooking interaction information is obtained, including performing at least one of the following operations by the generative model:
[0105] Feature extraction is performed on the cooking image to obtain target maturity features corresponding to the food in the cooking image; evaluation information on the cooking result is generated based on reference evaluation information, food maturity attributes and target maturity features.
[0106] In the disclosed embodiment, feature extraction of the cooking image can be performed from the evaluation dimension indicated by the food maturity attribute, such as food color feature, food shape feature, etc., to obtain the target maturity feature. The reference evaluation information, the food maturity attribute and the target maturity feature are input into the generative model to generate evaluation information of the cooking result.
[0107] Based on the cooking image and the evaluation information of the cooking result, image processing is performed on the cooking image to obtain an image processing result of the cooking image.
[0108] In the disclosed embodiment, the evaluation information of the cooking result can indicate the difference between the cooking result and the dish image under the optimal cooking conditions or the optimal cooking method. Based on the cooking image and the evaluation information of the cooking result, the cooking image is processed to obtain an optimized image processing result of the cooking image, making the cooking image more beautiful.
[0109] Based on the above, it can be seen that in the embodiment of the present disclosure, by generating evaluation information on the cooking results based on reference evaluation information, food maturity attributes and target maturity characteristics, the evaluation information can be enriched, making it easier for users to understand the advantages and disadvantages of the cooking results; by performing image processing on the cooking images based on the evaluation information of the cooking images and the cooking results, the image processing results of the cooking images are obtained, which can improve the display effect of the images and facilitate users to share the cooking images.
[0110] In an optional embodiment, the generative model is trained by the following method:
[0111] Step S501: Acquire training samples, where the training samples include at least one of the following: ingredient data, recipe data, cooking method data, cooking equipment operation data, and conversation data in ingredient cooking scenarios.
[0112] In the disclosed embodiment, the method for obtaining training samples can be to retrieve relevant field knowledge from an external knowledge source through a retrieval method generated by retrieval enhancement, link the latest information, and use the retrieved ingredient data, recipe data, cooking method data, cooking equipment operation data, and conversation data in ingredient cooking scenarios as training samples.
[0113] Step S502: input the training samples, reasoning prompt information, and scene prompt information into the generative model to obtain a generated result.
[0114] Step S503: adjusting the parameters of the generative model based on the generated result.
[0115] In the disclosed embodiment, loss information is determined based on the difference between the generated result and the actual result, and the parameters of the generative model are adjusted based on the loss information, thereby optimizing the performance of the generated result of the generative model until a preset stopping condition is reached to obtain a trained generative model.
[0116] In an embodiment of the present disclosure, when the training sample includes conversation data in a food cooking scenario, for each question in the training sample, a generation result including a positive preference answer and a negative preference answer is generated, wherein the positive preference answer is marked as a response that is more in line with user expectations, while the negative preference answer is the opposite; using a direct preference optimization method, the generative model parameters are optimized by comparing the differences between the positive and negative preference answers for each question; for a given question, when the generation result includes multiple potential answers, they are sorted according to the user's preference feedback on each answer, and a reinforcement learning method based on human feedback is used to reward model training, optimize the generative model parameters, and enable the generative model to generate answers that are more in line with user preferences.
[0117] Based on the above, it can be seen that in the embodiment of the present disclosure, by inputting training samples, reasoning prompt information, and scene prompt information into the generative model to obtain a generation result, and adjusting the parameters of the generative model based on the generation result, the generative model can be trained by integrating cooking-related knowledge or data, so that the output of the generative model is more in line with the cooking scene.
[0118] Figure 6 FIG. 1 is a block diagram of a cooking demand information processing device according to an exemplary embodiment. Figure 6 The device includes a first construction module 601, a second acquisition module 602, an analysis module 603 and a generation module 604, wherein:
[0119] The first acquisition module 601 is used to acquire cooking requirement information;
[0120] A second acquisition module 602 is used to acquire reasoning prompt information, where the reasoning prompt information indicates the cooking interaction content output by the generative model;
[0121] The analysis module 603 is used to perform cooking scene analysis on the cooking requirement information to obtain scene prompt information, where the scene prompt information indicates the cooking stage corresponding to the cooking requirement information;
[0122] The generation module 604 is used to input the cooking requirement information, the reasoning prompt information and the scene prompt information into the generative model to generate cooking interaction content and obtain target cooking interaction information.
[0123] In an optional embodiment, when the scene prompt information indicates that the cooking stage is a recipe generation stage, the scene prompt information further indicates keyword information required to generate the target recipe, and the above-mentioned device further includes:
[0124] The first generation submodule is used to generate interactive prompt information according to the scene prompt information, and the interactive prompt information is used to prompt the user to describe the keyword information;
[0125] A text extraction module is used to extract text from user feedback information regarding interactive prompt information to obtain description information corresponding to keyword information;
[0126] An extension module, used to extend scene prompt information based on description information corresponding to keyword information;
[0127] The generation module 604 also includes: a second generation submodule, which is used to input the cooking requirement information, the reasoning prompt information and the expanded scene prompt information into the generative model to generate cooking interaction content, and obtain target cooking interaction information, and the target cooking interaction information includes a target recipe.
[0128] In an optional embodiment, when the scene prompt information indicates that the cooking stage is the operation guidance stage, the scene prompt information further indicates the parameters of the target device being operated, and the above-mentioned apparatus further includes:
[0129] A retrieval information module, used to obtain retrieval information based on cooking requirement information and scene prompt information;
[0130] a query module, configured to query operation reference information based on the search information, the operation reference information indicating instruction information for cooking based on parameters of the target device;
[0131] The generation module 604 also includes: a third generation sub-module, which is used to input cooking requirement information, reasoning prompt information, scene prompt information and operation reference information into the generative model to generate cooking interaction content, and obtain target cooking interaction information, which includes teaching information for using the equipment for cooking.
[0132] In an optional embodiment, the cooking requirement information includes a cooking image indicating a cooking result, and when the scene prompt information indicates that the cooking stage is a cooking evaluation stage, the scene prompt information further indicates reference evaluation information and food maturity attributes required for evaluating the cooked food.
[0133] The generation module 604 also includes: a fourth generation sub-module, which is used to input the cooking image, reasoning prompt information and scene prompt information into the generative model to generate cooking interaction content, and obtain target cooking interaction information, which includes evaluation information on the cooking results and / or image processing results of the cooking images.
[0134] In an optional embodiment, the fourth generation submodule further includes:
[0135] A feature extraction module is used to extract features from the cooking image to obtain target maturity features corresponding to the food in the cooking image; based on the reference evaluation information, the food maturity attributes and the target maturity features, generate evaluation information on the cooking result;
[0136] The image processing module is used to perform image processing on the cooking image based on the cooking image and the evaluation information of the cooking result to obtain the image processing result of the cooking image.
[0137] In an optional embodiment, the above device further includes:
[0138] A third acquisition module is used to acquire training samples, where the training samples include at least one of the following: ingredient data, recipe data, cooking method data, cooking equipment operation data, and conversation data in ingredient cooking scenarios;
[0139] The generation result module is used to input the training samples, reasoning prompt information, and scene prompt information into the generative model to obtain the generation result;
[0140] The training module is used to adjust the parameters of the generative model based on the generation results.
[0141] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program with a predetermined function, and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware such as processing circuits or memories, or a combination thereof. Similarly, one processor or multiple processors or memories can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0142] In an exemplary embodiment, an electronic device is also provided, including: a processor; and a memory for storing instructions executable by the processor; wherein the processor is used for the instructions to implement the cooking requirement information processing method as in the embodiment of the present disclosure.
[0143] Figure 7 is a block diagram of an electronic device for processing cooking demand information according to an exemplary embodiment. The electronic device may be a terminal, and its internal structure diagram may be as shown in FIG. Figure 7As shown. The electronic device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a cooking demand information processing method is implemented. The display screen of the electronic device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the housing of the electronic device, or an external keyboard, touchpad or mouse, etc.
[0144] Those skilled in the art will understand that Figure 7 The structure shown in the figure is merely a block diagram of a partial structure related to the scheme of the present disclosure, and does not constitute a limitation on the electronic device to which the scheme of the present disclosure is applied. The specific electronic device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0145] In an exemplary embodiment, a storage medium is also provided. When instructions in the storage medium are executed by a processor of an electronic device, the electronic device can execute the cooking requirement information processing method in the embodiment of the present disclosure.
[0146] In an exemplary embodiment, a computer program product including instructions is also provided. When the computer program product is run on a computer, the computer is enabled to execute the cooking requirement information processing method in the embodiment of the present disclosure.
[0147] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present disclosure may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0148] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the claims.
[0149] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A cooking demand information processing method, characterized in that: The method comprises: Obtain cooking demand information; Acquire reasoning prompt information, where the reasoning prompt information indicates cooking interaction content output by the generative model; Performing a cooking scene analysis on the cooking requirement information to obtain scene prompt information, wherein the scene prompt information indicates a cooking stage corresponding to the cooking requirement information; The cooking requirement information, the reasoning prompt information and the scenario prompt information are input into the generative model to generate cooking interaction content to obtain target cooking interaction information.
2. The cooking demand information processing method according to claim 1, characterized in that: The cooking requirement information includes at least one of the following modes: text mode, image mode, and the target cooking interaction information includes at least one of the following modes: text mode, image mode, and video mode.
3. The cooking demand information processing method according to claim 1 or 2, characterized in that: In a case where the scene prompt information indicates that the cooking stage is a recipe generation stage, the scene prompt information further indicates keyword information required to generate a target recipe, and the method further includes: Generate interactive prompt information according to the scenario prompt information, wherein the interactive prompt information is used to prompt the user to describe the keyword information; Extracting text from feedback information from the user regarding the interactive prompt information to obtain description information corresponding to the keyword information; Expanding the scene prompt information based on the description information corresponding to the keyword information; The step of inputting the cooking requirement information, the reasoning prompt information and the scene prompt information into the generative model to generate cooking interaction content to obtain target cooking interaction information includes: The cooking requirement information, the reasoning prompt information and the expanded scenario prompt information are input into the generative model to generate cooking interaction content to obtain target cooking interaction information, where the target cooking interaction information includes the target recipe.
4. The cooking demand information processing method according to claim 1 or 2, characterized in that: In a case where the scene prompt information indicates that the cooking stage is an operation guidance stage, the scene prompt information further indicates a parameter of a target device to be operated, and the method further includes: Based on the cooking requirement information and the scene prompt information, obtaining retrieval information; querying operation reference information based on the search information, the operation reference information indicating guidance information for cooking based on parameters of the target device; The step of inputting the cooking requirement information, the reasoning prompt information and the scene prompt information into the generative model to generate cooking interaction content to obtain target cooking interaction information includes: The cooking requirement information, the reasoning prompt information, the scenario prompt information and the operation reference information are input into the generative model to generate cooking interaction content, and target cooking interaction information is obtained, wherein the target cooking interaction information includes the teaching information for cooking using the device.
5. The cooking demand information processing method according to claim 1 or 2, characterized in that: The cooking requirement information includes a cooking image indicating a cooking result, and when the scene prompt information indicates that the cooking stage is a cooking evaluation stage, the scene prompt information further indicates reference evaluation information and food maturity attributes required for evaluating the cooked food, The step of inputting the cooking requirement information, the reasoning prompt information and the scene prompt information into the generative model to generate cooking interaction content to obtain target cooking interaction information includes: The cooking image, the reasoning prompt information and the scene prompt information are input into the generative model to generate cooking interaction content to obtain target cooking interaction information, where the target cooking interaction information includes evaluation information of the cooking result and / or an image processing result of the cooking image.
6. The cooking demand information processing method according to claim 5, characterized in that: The step of inputting the cooking image, the reasoning prompt information, and the scene prompt information into the generative model to generate cooking interaction content to obtain target cooking interaction information includes performing at least one of the following operations by the generative model: Extracting features from the cooking image to obtain target maturity features corresponding to the food in the cooking image; generating evaluation information of the cooking result based on the reference evaluation information, the food maturity attribute and the target maturity feature; Based on the cooking image and the evaluation information of the cooking result, image processing is performed on the cooking image to obtain an image processing result of the cooking image.
7. The cooking demand information processing method according to claim 1, characterized in that: The generative model is trained by: Acquire training samples, where the training samples include at least one of the following: ingredient data, recipe data, cooking method data, cooking equipment operation data, and conversation data in ingredient cooking scenarios; Inputting the training sample, the reasoning prompt information, and the scene prompt information into the generative model to obtain a generation result; Parameters of the generative model are adjusted based on the generated results.
8. A cooking demand information processing device, characterized in that: The device comprises: A first acquisition module is used to acquire cooking demand information; A second acquisition module is used to acquire reasoning prompt information, where the reasoning prompt information indicates the cooking interaction content output by the generative model; an analysis module, configured to perform a cooking scene analysis on the cooking requirement information to obtain scene prompt information, wherein the scene prompt information indicates a cooking stage corresponding to the cooking requirement information; A generation module is used to input the cooking requirement information, the reasoning prompt information and the scene prompt information into the generative model to generate cooking interaction content and obtain target cooking interaction information.
9. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; Wherein, the processor is used for the instructions to implement the cooking requirement information processing method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that: When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the cooking requirement information processing method as described in any one of claims 1 to 7.