An automatic meal ordering method and system based on natural language recognition

By analyzing user intent using natural language processing technology and combining semantic matching and recommendation algorithms, the system addresses the shortcomings of traditional meal ordering systems in terms of intelligence. It achieves intelligent dish recommendation and self-learning capabilities, thereby improving user experience and applicability.

CN120746772BActive Publication Date: 2025-11-14GUANGDONG KAMFU TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511148543.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-18
Publication Date
2025-11-14
Estimated Expiration
2045-08-18

Smart Images

  • Figure CN120746772B_ABST
    Figure CN120746772B_ABST
Patent Text Reader

Abstract

This invention provides an automatic ordering method and system based on natural language recognition, belonging to the technical field of natural language recognition. The method includes converting order data into natural language text; inputting the natural language text into a pre-trained preset processing model for intent recognition; extracting structured entities from the natural language text; constructing a structured menu knowledge base and matching the menu items in the structured menu knowledge base; sorting and recommending the menu items in the initially matched menu; updating the menu recommendation list based on the updated order data and the user dialogue context; updating the natural language text based on user behavior feedback; fine-tuning the model parameters of the preset processing model based on the updated natural language text; and performing the next round of menu recommendations based on the fine-tuned preset processing model. This invention has excellent interactive experience, intelligent decision-making capabilities, and self-learning capabilities, and is suitable for a wider range of user groups and practical application scenarios.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the technical field of natural language recognition, and specifically relates to an automatic meal ordering method and system based on natural language recognition. Background Technology

[0002] Traditional order placement systems often employ a structured operation method, requiring users to manually place orders through menus, dish numbers, dropdown menus, and checkboxes. This method involves numerous steps, relies heavily on the user's familiarity with the menu structure, lacks flexibility, and results in a poor user experience. Especially in scenarios with a large variety of dishes or frequently updated menus, the process of finding and selecting desired dishes becomes cumbersome, easily leading to misselections and incorrect information. Furthermore, traditional order placement systems generally lack intelligent capabilities, failing to provide personalized recommendations based on user history, taste preferences, health needs, or to understand ambiguous or context-dependent ordering intentions.

[0003] In addition, traditional systems are not user-friendly for special groups (such as the elderly, children, and visually impaired people). They rely on fixed input formats and do not support natural language or voice input, which limits their adaptability and popularity in diverse use scenarios. Summary of the Invention

[0004] To address the aforementioned technical problems, this invention provides an automatic ordering method and system based on natural language recognition. This system accurately analyzes the user's ordering intent using natural language processing technology, extracting key elements such as dish names, flavor preferences, ingredient restrictions, and quantities. Through semantic matching and recommendation algorithms, it intelligently recommends dishes or restaurants. This invention offers a superior interactive experience, intelligent decision-making capabilities, and self-learning abilities, making it suitable for a wider range of users and practical application scenarios, thus resolving the problems mentioned in the background section.

[0005] In a first aspect, the invention provides the following technical solution: an automatic meal ordering method based on natural language recognition, comprising:

[0006] Obtain the order data sent by the user and convert the order data into natural language text;

[0007] The natural language text is input into a pre-trained preset processing model for intent recognition to obtain the user's intent;

[0008] Extract structured entities from the natural language text;

[0009] A structured menu knowledge base is constructed, and the menu items in the structured menu knowledge base are matched based on the user intent and the structured entities to obtain an initial list of matched menu items.

[0010] Sort and recommend dishes in the initial matched dish list to output a recommended dish list;

[0011] The system updates user-submitted order data in real time, updates the recommended menu based on the updated order data and user dialogue context, obtains an updated list, collects user behavior feedback based on the updated list, updates the natural language text based on the user behavior feedback, fine-tunes the model parameters of the preset processing model based on the updated natural language text, and performs the next round of menu recommendations based on the fine-tuned preset processing model.

[0012] Compared with existing technologies, the beneficial effects of this application are as follows: This application can accurately analyze the user's ordering intent based on natural language processing technology, extract key elements such as dish name, flavor preference, ingredient taboos, and quantity, and realize intelligent recommendation of dishes or restaurants through semantic matching and recommendation algorithms. This invention has a good interactive experience, intelligent decision-making ability and self-learning ability, and is suitable for a wider range of user groups and practical application scenarios.

[0013] Preferably, the step of converting the order data into natural language text includes:

[0014] The type of the order data is identified. If the type of the order data is voice data, the voice data is converted into natural language text through the ASR module.

[0015] If the order data is image data, then the text information in the image data is identified by OCR and image classification methods to obtain natural language text;

[0016] If the order data is of the traditional text type, then the traditional text will be directly treated as natural language text.

[0017] Preferably, the step of inputting the natural language text into a pre-trained preset processing model for intent recognition to obtain the user intent includes:

[0018] The natural language text is input into a pre-trained BERT model to perform an overall understanding of the natural language text in order to identify user intent, wherein the user intent includes at least one of ordering food, recommending dishes, canceling an order, modifying an order, and querying dish information.

[0019] Preferably, the step of extracting structured entities from the natural language text includes:

[0020] The natural language text is segmented / vector encoded to obtain an encoded sequence. The encoded sequence is then labeled with BIO tags and decoded using CRF to obtain a structured entity. The structured entity includes at least one of the following: dish name, flavor preference, quantity, ingredient taboos, and dietary requirements.

[0021] Preferably, in the step of constructing a structured menu knowledge base, the structured menu knowledge base includes basic information about the menu and a semantic tag system related to user preferences. The basic information about the menu includes at least one of the following: menu name, main ingredients, side ingredients, flavor tags, calorie and nutritional information, and cuisine. The semantic tag system related to user preferences includes at least one of the following: category tags, attribute tags, and user dimension tags.

[0022] Preferably, the step of matching dishes in the structured menu knowledge base based on the user intent and the structured entities to obtain an initial list of matched dishes includes:

[0023] Keyword extraction is performed on the user intent and the structured entity to obtain target keywords;

[0024] Map the target keywords to attribute tags;

[0025] The search and similarity calculation are performed in the structured food knowledge base according to the attribute tags to obtain the matching similarity. :

[0026] ;

[0027] In the formula, This is a vector representation of the attribute label. A vector describing the dish. Calculate the norm;

[0028] Based on the matching similarity, the dishes in the structured dish knowledge base are sorted in descending order to obtain an initial list of matched dishes.

[0029] Preferably, the step of sorting and recommending the dishes in the initially matched dish list to output a recommended dish list includes:

[0030] Construct dish ranking features, wherein the dish ranking features include user behavior features, dish content features, contextual environment features, and system state features;

[0031] The initial matched dish list is weighted and scored based on the dish ranking features, and then sorted in descending order according to the weighted scores to obtain a sorted list.

[0032] The sorted list is subject to rule control and logical scheduling, and the MMR algorithm is used to perform Top-N reordering of the sorted list to obtain a recommended list of dishes.

[0033] Secondly, this invention provides the following technical solution: an automatic meal ordering system based on natural language recognition, the system comprising:

[0034] The conversion module is used to obtain the order data sent by the user and convert the order data into natural language text;

[0035] The recognition module is used to input the natural language text into a pre-trained preset processing model for intent recognition in order to obtain the user's intent;

[0036] Entity module, used to extract structured entities from the natural language text;

[0037] The matching module is used to build a structured menu knowledge base, and to match the menu items in the structured menu knowledge base based on the user intent and the structured entities to obtain an initial list of matched menu items.

[0038] The recommendation module is used to sort and recommend dishes in the initial matched dish list to output a recommended dish list;

[0039] The update module is used to update the order data sent by the user in real time. Based on the updated order data and the user dialogue context, the recommended dishes list is updated to obtain an updated list. User behavior feedback is collected based on the updated list. The natural language text is updated based on the user behavior feedback. The model parameters of the preset processing model are fine-tuned based on the updated natural language text. The next round of dish recommendations is performed based on the fine-tuned preset processing model.

[0040] Thirdly, the present invention provides the following technical solution: a computer, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the automatic meal ordering method based on natural language recognition as described above.

[0041] Fourthly, the present invention provides the following technical solution: a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-described automatic meal reporting method based on natural language recognition. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 The flowchart shows the automatic meal ordering method based on natural language recognition provided in Embodiment 1 of the present invention.

[0044] Figure 2 This is a structural block diagram of the automatic meal ordering system based on natural language recognition provided in Embodiment 2 of the present invention;

[0045] Figure 3 This is a schematic diagram of the hardware structure of a computer provided for another embodiment of the present invention.

[0046] The present invention will be further described below with reference to the accompanying drawings and description. Detailed Implementation

[0047] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain embodiments of the present invention, and should not be construed as limiting the present invention.

[0048] In the description of the embodiments of the present invention, it should be understood that the terms "length", "width", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing the embodiments of the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the present invention.

[0049] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of embodiments of the present invention, "a plurality of" means two or more, unless otherwise explicitly specified.

[0050] In the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," "linking," "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments of the present invention according to the specific circumstances.

[0051] Example 1

[0052] In one embodiment of the present invention, such as Figure 1 As shown, an automatic meal ordering method based on natural language recognition includes:

[0053] S1. Obtain the order data sent by the user and convert the order data into natural language text;

[0054] Step S1 includes:

[0055] S11. Identify the type of the order data. If the type of the order data is voice data, convert the voice data into natural language text through the ASR module.

[0056] Specifically, the ASR module here refers to the Automatic Speech Recognition module, which can recognize speech and convert it into text data.

[0057] S12. If the type of the order data is image data, then the text information in the image data is identified by OCR method and image classification method to obtain natural language text;

[0058] Specifically, the image classification method involves classifying images using a pre-trained convolutional neural network (CNN). The pre-trained CNN is obtained by training the CNN by inputting image data into it. The OCR method and image classification algorithm used here are commonly used algorithms in the existing technology. The above method is used to identify menu images, QR code menus, or handwritten order information and convert them into text information.

[0059] S13. If the type of the order data is traditional text, then the traditional text will be directly treated as natural language text.

[0060] Specifically, in terms of traditional texts, it supports colloquial expressions and free word order.

[0061] S2. Input the natural language text into a pre-trained preset processing model for intent recognition to obtain the user's intent;

[0062] Step S2 includes:

[0063] The natural language text is input into a pre-trained BERT model to perform an overall understanding of the natural language text in order to identify user intent, wherein the user intent includes at least one of ordering food, recommending dishes, canceling an order, modifying an order, and querying dish information;

[0064] Specifically, the user intent here refers to the overall purpose of the information output by the user. After the BERT model recognizes the intent, the user intent can be represented by text. For example, if the user enters "order me a Kung Pao Chicken", the recognition result is: the intent is to order food. At the same time, the pre-trained BERT model here is obtained by inputting data from the food ordering domain into the existing BERT model for training.

[0065] S3. Extract structured entities from the natural language text;

[0066] Step S3 includes:

[0067] The natural language text is segmented / vector encoded to obtain an encoded sequence. The encoded sequence is then labeled with BIO tags and decoded with CRF to obtain a structured entity. The structured entity includes at least one of the following: dish name, flavor preference, quantity, ingredient taboos, and dietary requirements.

[0068] Specifically, for structured entities, the purpose is to identify the dish names, flavor preferences, quantities, ingredient restrictions, dietary needs, etc., involved in the user's statement. It can also extract key elements from the user input through existing Named Entity Recognition (NER) models. The pre-trained NER model here can be trained by inputting entity training data from the ordering domain into the existing NER model. The word segmentation / vector encoding here can be implemented by encoding through a pre-trained Word2Vec model, which converts natural language text into corresponding encoded vectors. The pre-trained Word2Vec model encoding is implemented by inputting text data into the model for training. The purpose of encoding is to obtain more accurate structured entities. BIO tagging is a commonly used natural language processing (NLP) tagging method in existing technologies. BIO tagging can represent the part-of-speech and morphological information of a word in a sentence. CRF decoding is the process of finding the most likely tag sequence in the tag sequence after BIO tagging using the existing Conditional Random Field (CRF) model, that is, finding the optimal tag sequence for a given input sequence. The optimal tag sequence obtained here is the structured entity.

[0069] S4. Construct a structured menu knowledge base, and match the menu items in the structured menu knowledge base based on the user intent and the structured entities to obtain an initial list of matched menu items.

[0070] The structured menu knowledge base includes basic information about the dishes and a semantic tag system related to user preferences. The basic information about the dishes includes at least one of the following: dish name, main ingredients, side ingredients, flavor tags, calorie and nutritional information, and cuisine. The semantic tag system related to user preferences includes at least one of the following: category tags, attribute tags, and user dimension tags.

[0071] Specifically, category tags can be such as flavor or cuisine, attribute tags can be such as nutritional components or main / side ingredients, and user dimension tags can be such as high-calorie or low-fat user needs.

[0072] Step S4 includes:

[0073] S41. Extract keywords from the user intent and the structured entity to obtain target keywords.

[0074] S42. Map the target keywords to attribute tags;

[0075] Specifically, for example, if the extracted target keyword is "fat loss", the corresponding mapped attribute tag is "low fat". The mapping process can be carried out through pre-built mapping rules. For example, "light dishes" is mapped to "light", and "healthy dishes" is mapped to "less oil" and "less salt".

[0076] S43. Search and calculate similarity in the structured menu knowledge base according to the attribute tags to obtain the matching similarity. :

[0077] ;

[0078] In the formula, This is a vector representation of the attribute label. A vector describing the dish. Calculate the norm;

[0079] Specifically, the vector representation of the attribute tags can be converted into a vector representation using the one-hot encoding method in existing technology. The dish description vector specifically refers to the vector composed of descriptive words of the dish, which is used to describe the attributes of the dish. The dish description vector can be directly extracted from a pre-built dish description vector library. During the initial library construction process, a corresponding dish description vector can be manually added to each dish.

[0080] Meanwhile, during this process, multiple attribute labels are obtained, and each dish has a corresponding dish description vector.

[0081] S44. Based on the matching similarity, sort the dishes in the structured dish knowledge base in descending order to obtain an initial matching dish list;

[0082] Specifically, for example, if a user enters "recommended low-fat dishes", the attribute tag is mapped to "low-fat". By matching according to the tag, several candidate options can be generated, thus obtaining the initial list of matched dishes.

[0083] Specifically, since the matching similarity calculated above is the similarity between a single attribute label and a single dish description vector, this application uses a pre-sorting method to sort the dishes. The dishes are pre-sorted in descending order based on the matching similarity corresponding to a single attribute label to obtain a pre-sorted sequence. This pre-sorted sequence contains the same number of attribute labels. Then, each pre-sorted sequence is assigned a sorting value that is also in a decreasing distribution. Finally, the sorting values ​​corresponding to each dish description vector are added together to obtain a final sorting value. This final sorting value is then used to obtain the initial matched dish list. For example, assuming there are attribute labels A and B, and the structured dish knowledge base contains five dishes (i.e., five dish description vectors), the five dishes are dish 1, dish 2, dish 3, dish 4, and dish 5. First, for attribute label A, the matching similarity is calculated, and the dishes are sorted according to the size of the matching similarity. The five dishes are sorted in descending order to obtain the first pre-sorted sequence. Similarly, for attribute label B, the matching similarity is calculated, and the five dishes are sorted in descending order to obtain the second pre-sorted sequence. The first and second pre-sorted sequences do not interfere with each other. Then, according to the sorting size in the first pre-sorted sequence, values ​​are assigned from front to back, assuming they are assigned 0.5, 0.4, 0.3, 0.2, and 0.1 respectively. The second pre-sorted sequence is processed in the same way. Since there are two sequences, each dish has two sorting values. Then, the two sorting values ​​of dish 1 are added together. Similarly, dishes 2 to 5 are processed in the same way. Finally, each dish has a final sorting value. The dishes are sorted in descending order according to the final sorting values ​​to obtain the initial matching list. At the same time, if two dishes have the same final sorting value, the sorting relationship between the two dishes can be randomly determined.

[0084] Meanwhile, the above process is a semantic vector matching process. In practice, the initial list of matching dishes can also be determined by matching tags and rules. Based on user intent and preference tags, matching dishes can be quickly retrieved by filtering rules, and the initial list of matching dishes can be obtained by using ElasticSearch+DSL query or Pandas DataFrame filtering.

[0085] S5. Sort and recommend dishes in the initial matched dish list to output a recommended dish list;

[0086] Step S5 includes:

[0087] S51. Construct dish ranking features, wherein the dish ranking features include user behavior features, dish content features, contextual environment features, and system state features;

[0088] Specifically, user behavior characteristics here include historical ratings, order frequency, taste preferences, and click behavior; dish content characteristics include nutrition labels, calories, main ingredient types, and cuisine; contextual characteristics include time period, weather, holidays, and health advice; and system status characteristics include whether inventory is sufficient, whether the business is open, and whether there are limited-time promotions.

[0089] S52. The initial matched dish list is weighted and scored based on the dish sorting features, and the initial matched dish list is sorted in descending order according to the weighted score to obtain a sorted list.

[0090] Specifically, the weighted scoring process here is as follows: First, the dish ranking features are normalized and their dimensions are standardized. The processed user behavior feature values ​​are used as the initial scores. Based on the descriptions in the user behavior features, if a user has a high historical rating for a particular dish, a high order frequency, a good taste preference, or many clicks, then the corresponding user behavior feature value is assigned a higher weight; conversely, it is assigned a lower weight. For dish content features, if the user's intent matches the dish content features well, then the dish content feature value is assigned a higher weight; conversely, it is assigned a lower weight. Contextual features include time period, weather, holidays, and health advice. The time period specifically refers to the time period in which the user is currently ordering food; the weather specifically refers to the weather on the day the user orders food; the holiday specifically refers to whether the day the user orders food is a holiday; and the health advice specifically refers to the healthiness of the dishes ordered by the user. If the current time period is a normal dining time and a certain dish is suitable for consumption during normal dining time, then the contextual features corresponding to that dish are given a higher weight. Similarly, the same applies to the weather, holidays, and health advice. As for the system status features, if a certain dish is out of stock, or the corresponding store is not open, or there is no limited-time promotion, then the feature value of the system status feature of the corresponding dish is given a lower weight; otherwise, it is given a higher weight. The weighted scoring process can be completed through the above steps.

[0091] S53. Perform rule control and logical scheduling on the sorted list, and use the MMR algorithm to perform Top-N re-sorting on the sorted list to obtain a recommended list of dishes.

[0092] Specifically, the rule control and logic scheduling here are as follows: set up an availability filter to filter out sold-out dishes, adjust the diversity of results to prevent recommendations from being too concentrated on the same type of dishes, and optimize user goal scheduling by prioritizing dishes that are more compatible with the user's "diet goals". For example, if the user sets the goal as "high protein and fat loss", the score of related dishes can be dynamically increased.

[0093] In this context, user intent can be varied. To ensure the diversity of recommended dishes, it is necessary to recommend various types of dishes based on user intent during the actual recommendation process. This is the result diversity adjustment process. The matching degree can be determined by calculating the cosine similarity between the user's dietary goals and the dish descriptions. The higher the similarity, the higher the matching degree. The dynamic adjustment process is as follows: if the user sets corresponding goals, such as high protein or low fat, the score of dishes with high protein or low fat is multiplied by a dynamic adjustment factor greater than 1 to increase the dish score.

[0094] S6. Update the order data sent by the user in real time, update the recommended dishes list according to the updated order data and the user dialogue context to obtain an updated list, collect user behavior feedback based on the updated list, update the natural language text based on the user behavior feedback, fine-tune the model parameters of the preset processing model based on the updated natural language text, and perform the next round of dish recommendations based on the fine-tuned preset processing model.

[0095] The process involves updating the order data based on the user's dialogue context and the content the user is currently sending. Specifically, the dialogue context refers to the order content output by the user in the current round of ordering. The above steps are repeated based on the order data to update the recommended menu. Then, based on collected user behavior feedback, the user's natural language text is updated accordingly. The pre-set processing model is trained based on the updated natural language text feedback, i.e., the model parameters of the pre-set processing model are fine-tuned. This process is repeated several times, with each round of menu recommendations involving model fine-tuning to improve the model's recommendation accuracy.

[0096] Specifically, this invention can also achieve continuous semantic tracking, that is, maintain the current user's intent, handle user operations such as adding, modifying, and canceling, and perform intent recognition in conjunction with context to improve the ability to understand continuous dialogue. For example, "I want a Kung Pao Chicken" → "Change to non-spicy" → "Add a soup". This invention can automatically identify and dynamically update. In addition, by collecting user behavior feedback, which includes at least one of click, order placement, rating, and modification operations, and through a continuous learning mechanism, it can achieve personalized evolution capabilities, update and train the model, and improve long-term recommendation accuracy and user satisfaction.

[0097] In summary, the automatic ordering method based on natural language recognition in the above embodiments of the present invention can accurately analyze the user's ordering intent based on natural language processing technology, extract key elements such as dish name, flavor preference, ingredient taboos, and quantity, and realize intelligent recommendation of dishes or restaurants through semantic matching and recommendation algorithms. The present invention has good interactive experience, intelligent decision-making ability and self-learning ability, and is suitable for a wider range of user groups and practical application scenarios.

[0098] Example 2

[0099] like Figure 2 As shown, in Embodiment 2 of the present invention, an automatic meal ordering system based on natural language recognition is provided. The system includes:

[0100] The conversion module 1 is used to obtain the order data sent by the user and convert the order data into natural language text;

[0101] The recognition module 2 is used to input the natural language text into a pre-trained preset processing model for intent recognition in order to obtain the user intent;

[0102] Entity module 3 is used to extract structured entities from the natural language text;

[0103] Matching module 4 is used to construct a structured menu knowledge base, and to match the menu items in the structured menu knowledge base based on the user intent and the structured entities to obtain an initial list of matched menu items.

[0104] Recommendation module 5 is used to sort and recommend dishes in the initial matched dish list to output a recommended dish list;

[0105] The update module 6 is used to update the order data sent by the user in real time. Based on the updated order data and the user dialogue context, the recommended dishes list is updated to obtain an updated list. User behavior feedback is collected based on the updated list. The natural language text is updated based on the user behavior feedback. The model parameters of the preset processing model are fine-tuned based on the updated natural language text. The next round of dish recommendations is performed based on the fine-tuned preset processing model.

[0106] The conversion module 1 includes:

[0107] The first conversion submodule is used to identify the type of the order data. If the type of the order data is voice data, the voice data is converted into natural language text through the ASR module.

[0108] The second conversion submodule is used to identify the text information in the image data through OCR and image classification methods if the type of the order data is image data, so as to obtain natural language text.

[0109] The third conversion submodule is used to directly treat the traditional text as natural language text if the type of the order data is traditional text.

[0110] The identification module 2 is specifically used for:

[0111] The natural language text is input into a pre-trained BERT model to perform an overall understanding of the natural language text in order to identify user intent, wherein the user intent includes at least one of ordering food, recommending dishes, canceling an order, modifying an order, and querying dish information.

[0112] The entity module 3 is specifically used for:

[0113] The natural language text is segmented / vector encoded to obtain an encoded sequence. The encoded sequence is then labeled with BIO tags and decoded using CRF to obtain a structured entity. The structured entity includes at least one of the following: dish name, flavor preference, quantity, ingredient taboos, and dietary requirements.

[0114] The matching module 4 includes:

[0115] The first matching submodule is used to extract keywords from the user intent and the structured entity to obtain target keywords;

[0116] The second matching submodule is used to map the target keywords to attribute tags;

[0117] The third matching submodule is used to perform retrieval and similarity calculation in the structured menu knowledge base according to the attribute tags to obtain the matching similarity. :

[0118] ;

[0119] In the formula, This is a vector representation of the attribute label. A vector describing the dish. Calculate the norm;

[0120] The fourth matching submodule is used to sort the dishes in the structured dish knowledge base in descending order based on the matching similarity to obtain an initial matching dish list.

[0121] The recommendation module 5 includes:

[0122] The first recommendation submodule is used to construct dish ranking features, wherein the dish ranking features include user behavior features, dish content features, contextual environment features, and system state features;

[0123] The second recommendation submodule is used to assign a weighted score to the initial matched dish list based on the dish ranking features, and to sort the initial matched dish list in descending order according to the weighted score to obtain a sorted list.

[0124] The third recommendation submodule is used to perform rule control and logical scheduling on the sorted list, and to use the MMR algorithm to perform Top-N re-sorting of the sorted list to obtain a dish recommendation list.

[0125] In other embodiments of the present invention, the present invention provides the following technical solution: a computer, including a memory 102, a processor 101, and a computer program stored in the memory 102 and executable on the processor 101, wherein the processor 101 executes the computer program to implement the automatic meal reporting method based on natural language recognition as described above.

[0126] Specifically, the processor 101 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits that can be configured to implement the embodiments of the present invention.

[0127] The memory 102 may include a large-capacity memory for data or instructions. For example, and not limitingly, the memory 102 may include a hard disk drive (HDD), a floppy disk drive, a solid-state drive (SSD), flash memory, an optical disk drive, a magneto-optical disk drive, magnetic tape, or a Universal Serial Bus (USB) drive, or a combination of two or more of these. Where appropriate, the memory 102 may include removable or non-removable (or fixed) media. Where appropriate, the memory 102 may be internal or external to a data processing device. In a particular embodiment, the memory 102 is non-volatile memory. In a particular embodiment, the memory 102 includes read-only memory (ROM) and random access memory (RAM). Where appropriate, the ROM may be a mask-programmed ROM, a programmable read-only memory (PROM), an erasable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), an electrically alterable read-only memory (EAROM), or flash memory, or a combination of two or more of these. Where appropriate, the RAM can be Static Random-Access Memory (SRAM) or Dynamic Random-Access Memory (DRAM). DRAM can be Fast Page Mode Dynamic Random Access Memory (FPMDRAM), Extended Data Out Dynamic Random Access Memory (EDODRAM), Synchronous Dynamic Random-Access Memory (SDRAM), etc.

[0128] The memory 102 can be used to store or cache various data files that need to be processed and / or used for communication, as well as possible computer program instructions executed by the processor 101.

[0129] The processor 101 reads and executes the computer program instructions stored in the memory 102 to implement the above-mentioned automatic meal ordering method based on natural language recognition.

[0130] In some embodiments, the computer may further include a communication interface 103 and a bus 100. For example, Figure 3 As shown, the processor 101, memory 102, and communication interface 103 are connected through bus 100 and complete communication with each other.

[0131] The communication interface 103 is used to enable communication between the various modules, devices, units, and / or equipment in the embodiments of the present invention. The communication interface 103 can also enable data communication with other components such as external devices, image / data acquisition devices, databases, external storage, and image / data processing workstations.

[0132] Bus 100 includes hardware, software, or both, that couples components of a computer device together. Bus 100 includes, but is not limited to, at least one of the following: data bus, address bus, control bus, expansion bus, and local bus. For example, and not as a limitation, bus 100 may include an Accelerated Graphics Port (AGP) or other graphics bus, an Extended Industry Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industry Standard Architecture (ISA) bus, an InfiniBand interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a Video Electronics Standards Association Local Bus (VLB) bus, or other suitable buses, or a combination of two or more of these. Where appropriate, bus 100 may include one or more buses. Although specific buses are described and illustrated in the embodiments of the present invention, the present invention is contemplated by any suitable bus or interconnect.

[0133] The computer can execute the automatic meal ordering method based on natural language recognition of the present invention based on natural language recognition, based on the automatic meal ordering system obtained from the natural language recognition system, thereby realizing automatic meal ordering based on natural language recognition.

[0134] In some further embodiments of the present invention, in conjunction with the above-described automatic meal ordering method based on natural language recognition, the present invention provides the following technical solution: a storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the above-described automatic meal ordering method based on natural language recognition.

[0135] Those skilled in the art will understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can mean any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.

[0136] More specific examples of readable media (a non-exhaustive list) include: electrical connections (electronic devices) with one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.

[0137] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0138] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0139] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these all fall within the protection scope of the present invention. Therefore, the protection scope of this invention patent should be determined by the appended claims.

Claims

1. An automatic meal ordering method based on natural language recognition, characterized in that, include: Obtain the order data sent by the user and convert the order data into natural language text; The natural language text is input into a pre-trained preset processing model for intent recognition to obtain user intent: the natural language text is input into a pre-trained BERT model to perform overall understanding of the natural language text in order to identify user intent, wherein the user intent includes at least one of ordering food, recommending dishes, canceling orders, modifying orders, and querying dish information; Extract structured entities from the natural language text; A structured menu knowledge base is constructed. Based on the user intent and the structured entities, the menu items in the knowledge base are matched to obtain an initial list of matched menu items. Keywords are extracted from the user intent and the structured entities to obtain target keywords. These target keywords are mapped to attribute tags. The menu items are then searched and similarity calculated within the structured menu knowledge base according to the attribute tags to obtain the matching similarity. : In the formula, This is a vector representation of the attribute tag. This is a vector describing the dish. Norm calculation; Based on the matching similarity, the dishes in the structured dish knowledge base are sorted in descending order to obtain an initial list of matched dishes; The dishes in the initial matched dish list are sorted and recommended to output a recommended dish list: A dish sorting feature is constructed, which includes user behavior features, dish content features, contextual environment features, and system state features; based on the dish sorting feature, the initial matched dish list is weighted and scored, and then sorted in descending order according to the weighted score to obtain a sorted list; the sorted list is subject to rule control and logical scheduling, and the MMR algorithm is used to perform a Top-N re-sorting of the sorted list to obtain a recommended dish list; The system updates user-submitted order data in real time, updates the recommended menu based on the updated order data and user dialogue context, obtains an updated list, collects user behavior feedback based on the updated list, updates the natural language text based on the user behavior feedback, fine-tunes the model parameters of the preset processing model based on the updated natural language text, and performs the next round of menu recommendations based on the fine-tuned preset processing model.

2. The automatic meal ordering method based on natural language recognition according to claim 1, characterized in that, The step of converting the order data into natural language text includes: The type of the order data is identified. If the type of the order data is voice data, the voice data is converted into natural language text through the ASR module. If the order data is image data, then the text information in the image data is identified by OCR and image classification methods to obtain natural language text; If the order data is of the traditional text type, then the traditional text will be directly treated as natural language text.

3. The automatic meal ordering method based on natural language recognition according to claim 1, characterized in that, The step of extracting structured entities from the natural language text includes: The natural language text is segmented / vector encoded to obtain an encoded sequence. The encoded sequence is then labeled with BIO tags and decoded using CRF to obtain a structured entity. The structured entity includes at least one of the following: dish name, flavor preference, quantity, ingredient taboos, and dietary requirements.

4. The automatic meal ordering method based on natural language recognition according to claim 1, characterized in that, In the step of constructing a structured food knowledge base, the structured food knowledge base includes basic information about the dishes and a semantic tag system related to user preferences. The basic information about the dishes includes at least one of the following: dish name, main ingredients, side ingredients, flavor tags, calorie nutrition, and cuisine. The semantic tag system related to user preferences includes at least one of the following: category tags, attribute tags, and user dimension tags.

5. An automatic meal ordering system based on natural language recognition, characterized in that, The system includes: The conversion module is used to obtain the order data sent by the user and convert the order data into natural language text; The recognition module is used to input the natural language text into a pre-trained preset processing model for intent recognition to obtain user intent: it is used to input the natural language text into a pre-trained BERT model to perform overall understanding of the natural language text in order to identify user intent, wherein the user intent includes at least one of ordering food, recommending dishes, canceling orders, modifying orders, and querying dish information; Entity module, used to extract structured entities from the natural language text; The matching module is used to construct a structured menu knowledge base. Based on the user intent and the structured entities, it matches the menu items in the knowledge base to obtain an initial list of matched menu items. It then extracts keywords from the user intent and the structured entities to obtain target keywords; maps the target keywords to attribute tags; and performs a search and similarity calculation within the structured menu knowledge base according to the attribute tags to obtain a matching similarity score. : In the formula, This is a vector representation of the attribute tag. This is a vector describing the dish. Norm calculation; Based on the matching similarity, the dishes in the structured dish knowledge base are sorted in descending order to obtain an initial list of matched dishes; The recommendation module is used to sort and recommend dishes in the initial matched dish list to output a recommended dish list: It constructs dish sorting features, which include user behavior features, dish content features, contextual environment features, and system state features; it assigns a weighted score to the initial matched dish list based on the sorting features, and then sorts the initial matched dish list in descending order according to the weighted score to obtain a sorted list; it performs rule control and logical scheduling on the sorted list, and uses the MMR algorithm to perform a Top-N re-sorting of the sorted list to obtain the recommended dish list; The update module is used to update the order data sent by the user in real time. Based on the updated order data and the user dialogue context, the recommended dishes list is updated to obtain an updated list. User behavior feedback is collected based on the updated list. The natural language text is updated based on the user behavior feedback. The model parameters of the preset processing model are fine-tuned based on the updated natural language text. The next round of dish recommendations is performed based on the fine-tuned preset processing model.

6. A computer comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the automatic meal reporting method based on natural language recognition as described in any one of claims 1 to 4.

7. A storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the automatic meal ordering method based on natural language recognition as described in any one of claims 1 to 4.

Citation Information

Patent Citations

  • Shopping guide method and system based on large language model

    WO2025118742A1