Dish matching method and system based on deep learning and vector database

Through the deep learning model, the dish data is text vectorized and the vector database is used for efficient search, which solves the problems of low computing efficiency, inaccurate similarity and poor scalability in traditional catering data management, and achieves efficient and accurate dish matching and query.

CN120493867APending Publication Date: 2025-08-15ACEWILL INFORMATION TECH BEIJING CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510677130.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-26
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

Traditional catering data management methods have low computational efficiency, inaccurate similarity calculations and poor scalability, making it difficult to meet the real-time query needs and dynamic updates of large-scale data.

Method used

The deep learning model is used to vectorize the dishes data, and the distributed vector database is used for efficient storage and retrieval. The matching dishes are calculated by cosine similarity, and combined with the system optimization design and label data expansion module, the rapid matching of dishes information is achieved.

Benefits of technology

It improves the calculation accuracy and query performance of dish matching, supports large-scale data processing, optimizes query efficiency and accuracy, reduces duplicate calculations, and supports dynamic data updates.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120493867A_ABST
    Figure CN120493867A_ABST
Patent Text Reader

Abstract

The invention provides a dish matching method and system based on deep learning and a vector database, and relates to the cross technical field of large model and business data analysis, the system comprises a data acquisition module, a data preprocessing module, a vector module, an interaction module and a vector indexing and retrieval module, according to the method, dish text vectorization is carried out by utilizing the deep learning model, and similar dishes are efficiently retrieved by virtue of the distributed vector database, so that large-scale data processing can be supported, the query performance is optimized, and the calculation precision is greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of the intersection of large models and commercial data analysis, and in particular to a dish matching method and system based on deep learning and vector database. Background Art

[0002] In recent years, the application of artificial intelligence (AI) and deep learning in commercial data analysis has become increasingly widespread, particularly in natural language processing (NLP) and vector retrieval. This has driven the rapid development of intelligent search, recommendation systems, and automated data analysis. In the restaurant industry, intelligent management and data analysis have become crucial tools for enhancing market competitiveness. For example, food delivery platforms, restaurant management systems, and food supply chain management all rely on efficient dish data analysis to optimize menu recommendations, inventory management, and market trend forecasting.

[0003] Traditional catering data management mainly relies on methods such as keyword matching and rule screening. These methods can meet basic needs under small-scale data sets, but when the data scale increases or the dish descriptions become more complex, traditional methods find it difficult to accurately measure the similarity between dishes.

[0004] Defects and shortcomings of existing technology: Low computational efficiency: Traditional keyword and rule matching methods require string comparison for each dish, resulting in high computational complexity and difficulty meeting the real-time query requirements of large-scale data. Traditional machine learning methods experience a significant increase in computational cost as data volumes increase, making them difficult to adapt to dynamically updating data environments.

[0005] Inaccurate similarity calculation: Keyword matching methods fail to capture the semantic information of dishes, resulting in recommended dishes that may be similar in name but significantly different in content. Rule matching methods rely too heavily on manual settings and struggle to adapt to the ever-changing new dishes and trends in the restaurant industry.

[0006] Poor scalability: Traditional methods typically store dish data based on relational databases or simple index structures, making it difficult to efficiently support large-scale data storage and query. Traditional machine learning methods often require retraining the model after adding new dish data, making it difficult for the system to quickly respond to data changes.

[0007] To address this issue, text vectorization methods based on deep learning have become a trend. In recent years, pre-trained language models (such as BERT and SentenceTransformer) have been widely used for text representation learning, enabling computation and retrieval of text data in the form of high-dimensional vectors. Furthermore, distributed vector databases (such as Qdrant, FAISS, and Milvus) provide efficient vector storage and retrieval capabilities, making it possible to calculate similarity on large-scale dish data. Summary of the Invention

[0008] The technical problem to be solved by the present invention is that traditional catering data management mainly relies on methods such as keyword matching and rule screening. These methods have low computational efficiency, inaccurate similarity calculation, and poor scalability. When the data scale increases or the dish description becomes more complex, these methods cannot meet basic needs under small-scale data sets.

[0009] In order to solve the above technical problems, the technical solution of the present invention is: A dish matching method based on deep learning and vector database includes the following steps Step 1: Use open-source menu data. The menu information in the open-source menu data includes but is not limited to the dish name, main ingredients, side dishes and seasonings, as well as the cooking process, taste, time consumption and difficulty of the dish; Step 2: De-duplicate and clean the data obtained in step 1, and replace synonyms; Step 3: Convert the dish data obtained in step 2 into vectors and store them in the database. Then, use the deep learning model to encode the dish names into standardized vectors. Step 4: Create an interactive interface with the user, the user enters the dish name, and the entered dish is encoded again; Step 5: Compare the dish data entered by the user with the dish data in the database and return the best matching dish information.

[0010] Preferably, in step 5, the cosine similarity method is used to compare the similarity between the dish name input by the user and the dish names in the database, and the dishes with similarity higher than a threshold are screened out.

[0011] Preferably, the threshold is set to 0.9.

[0012] This application also provides a dish matching system based on deep learning and vector database, including A data acquisition module, which is used for merchants to upload menu data by themselves; A data preprocessing module, which is used to remove duplicates and clean the dish information data and replace synonyms; A vector module, which is used to vectorize the cleaned dish data, store the generated vectors in the Qdrant database, and use a deep learning model to standardize the dish names into vector encodings; An interactive module, which is used to establish an interactive interface with the user and re-encode the dish data input by the user; The vector indexing and retrieval module is used to search the database based on the data input by the user and return the most matching dish information.

[0013] Preferably, it also includes a system optimization design module, which is used for local caching.

[0014] Preferably, it also includes a label data expansion module, which is used to update different dimensions of the dish data and update the code according to the different dimensions.

[0015] Compared with the prior art, the present invention has the following beneficial effects: The present invention provides a dish matching method and system based on deep learning and vector database. The system uses a deep learning model to vectorize dish text and uses a distributed vector database to efficiently retrieve similar dishes. This method can improve calculation accuracy, optimize query performance, and support large-scale data processing.

[0016] The data preprocessing module and vectorization module in this application support batch processing of JSONL format data, use deep learning models for text vectorization, and greatly improve work efficiency through multi-threaded optimization processing.

[0017] The vector indexing and retrieval module in this application stores dish feature vectors based on Qdrant, uses cosine similarity for efficient retrieval, and provides a similarity threshold screening mechanism to improve the accuracy of matching results.

[0018] The system optimization design module in this application introduces a model local caching mechanism to reduce repeated calculations, support GPU acceleration and FP16 calculations, improve query performance, and has a complete error handling mechanism.

[0019] This application adds a label data expansion module, designs a multi-dimensional dish feature representation, implements a fast matching mechanism for special categories, and optimizes query efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a flowchart of a dish matching method based on deep learning and vector database; Figure 2 This is a system framework diagram of a dish matching system based on deep learning and vector database; Figure 3 This is an interface diagram of the interactive module of a dish matching system based on deep learning and vector database. DETAILED DESCRIPTION

[0021] The following is a further description of specific embodiments of the present invention in conjunction with the accompanying drawings. It should be noted that the description of these embodiments is intended to facilitate understanding of the present invention and does not constitute a limitation of the present invention. In addition, the technical features involved in the various embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.

[0022] like Figure 1 As shown, the present invention discloses a method for calculating dish labels based on deep learning and vector database, comprising the following steps: Step 1: Use open source menu data. The menu information in the open source menu data includes but is not limited to the name of the dish, the main ingredients, side dishes and seasonings of the dish, as well as the dish's craftsmanship, taste, time consumption and difficulty.

[0023] Step 2: De-duplicate and clean the data obtained in step 1, and perform synonym replacement, such as replacing tomato with tomato, replacing potato with potato, etc., and support batch processing of dish data in JSONL format.

[0024] Step 3: Extract the dish names obtained in step 2, and perform text vectorization on the dish names through a deep learning model. Preferably, the present application uses a deep learning model (SentenceTransformer) to perform standardized vector encoding on the dish names, and generates a 1792-dimensional vector for each dish name. This architecture is often used in the field of natural language processing (NLP), and is a library that represents (embeds) dense vectors of sentences or paragraphs. This framework is particularly suitable for tasks such as semantic similarity comparison, search, and clustering because it can convert text into fixed-length vectors that capture the semantic information of the text. Further preferably, the Qdrant vector database uses the HNSW (Hierarchical Navigable Small World) index configuration. HNSW is an efficient approximate nearest neighbor search algorithm that effectively optimizes the vector search performance of the Qdrant vector database.

[0025] Step 4: Create an interface that can interact with the user. The user enters the name of the dish, and the input dish name is encoded using the encoding method of step 3.

[0026] Step 5: Perform similarity matching between the dish data input by the user and the dish data in the database, and return the dish information with the highest similarity. Preferably, in step 5, the cosine similarity method is used to compare the similarity between the dish name input by the user and the dish name in the database, and the dishes with similarity above a threshold are screened out.

[0027] Specifically, They are respectively the dish name vector pre-uploaded to the database and the dish name vector entered by the user.

[0028] Cosine similarity calculation formula: Vector dot product:

[0029] Vector modulus:

[0030] Further preferably, the similarity threshold in step 5 is set to 0.9, which can ensure successful dish matching with high accuracy.

[0031] Experiment: We randomly selected 100 dishes and set different similarity thresholds. Thresholds of 0.9 and 0.95 gave the highest accuracy, while a threshold of 0.9 gave a higher matching rate, so we chose 0.9 as the threshold.

[0032] like Figure 2 As shown, the present application also discloses a dish labeling system based on deep learning and vector database, which includes the following modules: Data acquisition module: The data acquisition module is used for merchants to upload menu data by themselves (if not uploaded, open source menu data will be used by default). Menu data includes but is not limited to dish name, main ingredients, side ingredients, seasoning, process, taste, time consumption, difficulty and other dish information.

[0033] The data preprocessing module is used to deduplicate and clean the dish information data, and perform synonym replacement, such as replacing tomato with tomato, replacing potato with potato, etc., and supports batch processing of dish data in JSONL format.

[0034] The vector module is used to vectorize the cleaned dish names, encode the dish names into standardized vectors using a deep learning model, and then store the generated high-dimensional text vectors in the Qdrant vector database. This application uses a deep learning model (SentenceTransformer) to encode the dish names into standardized vectors.

[0035] Interaction modules, such as Figure 3 As shown, the interactive module is used to establish an interactive interface with the user and re-encode the dish data input by the user; The vector indexing and retrieval module searches the database based on user input and returns the most matching dish information. The user enters a dish name, which is vectorized using the SentenceTransformer model. The text vector is then compared to vectors in the database. The database is searched for the vector with the highest cosine similarity, which must be greater than a threshold of 0.9. The searched vector is then used to index the dish name and its corresponding label, returning the dish with the highest similarity.

[0036] Furthermore, the system also includes a system optimization design module, which is used to locally cache the SentenceTransformer model and supports GPU acceleration and half-precision (FP16) calculations. It has a complete error handling and retry mechanism to improve system stability and can quickly import the local cache model for text vectorization. In addition, the application also includes a label data expansion module, which is used to expand the dish label data. Users can expand the dish label database by repeatedly uploading different dish label data, which is conducive to improving the accuracy of dish matching results and labeling results.

[0037] The embodiments of the present invention are described in detail above with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. It is apparent to those skilled in the art that various changes, modifications, substitutions, and variations to these embodiments may be made without departing from the principles and spirit of the present invention, and these changes and modifications still fall within the scope of protection of the present invention.

Claims

1. A dish matching method based on deep learning and vector database, characterized by: The following steps are included Step 1: Use open-source menu data. The menu information in the open-source menu data includes but is not limited to the dish name, main ingredients, side dishes and seasonings, as well as the cooking process, taste, time consumption and difficulty of the dish; Step 2: De-duplicate and clean the data obtained in step 1, and replace synonyms; Step 3: Convert the dish data obtained in step 2 into vectors and store them in the database. Then, use the deep learning model to encode the dish names into standardized vectors. Step 4: Create an interactive interface with the user, the user enters the dish name, and the entered dish is encoded again; Step 5: Compare the dish data entered by the user with the dish data in the database and return the best matching dish information.

2. The dish matching method based on deep learning and vector database according to claim 1, characterized in that: In step 5, the cosine similarity method is used to compare the similarity between the dish name input by the user and the dish names in the database, and the dishes with similarity higher than a threshold are screened out.

3. The dish matching method based on deep learning and vector database according to claim 2, characterized in that: The threshold is set to 0.

9.

4. A dish matching system based on deep learning and vector database, characterized by: include A data acquisition module, which is used for merchants to upload menu data by themselves; A data preprocessing module, which is used to remove duplicates and clean the dish information data and replace synonyms; A vector module, which is used to vectorize the cleaned dish data, store the generated vectors in the Qdrant database, and use a deep learning model to standardize the dish names into vector encodings; An interactive module, which is used to establish an interactive interface with the user and re-encode the dish data input by the user; The vector indexing and retrieval module is used to search the database based on the data input by the user and return the most matching dish information.

5. The dish matching system based on deep learning and vector database according to claim 4, characterized in that: It also includes a system optimization design module, which is used for local cache.

6. The dish matching system based on deep learning and vector database according to claim 5, characterized in that: It also includes a label data expansion module, which is used to update different dimensions of dish data and update the encoding according to different dimensions.