The high degree of personalized naming of takeaway dishes brings some difficulties to operations analysis, recall sequencing, background management and other businesses. This is the second article in the takeaway food knowledge Atlas series, which introduces the process and scheme of building a food standardization system from zero to one. The main technologies involved include entity extraction, text matching, relation classification in the NLP field, and image matching in the CV field. Finally, through the application practice of standard name in takeout business, the value and significance of the construction of standard name system are verified.

1. Background and objectives

As a core element in the process of takeout transaction, commodities determine the precision of supply and demand matching and directly affect whether the transaction can be achieved. There are hundreds of millions of online goods of food, dessert and beverage on takeout platform, many of which are the same goods with the same attribute information. Establishing standardized descriptions of products and aggregating the same products are the demands of many business scenarios.

Supply and marketing analysis scene: want to analyze what dishes are sold in wangjing’s stores, how many stores sell “scrambled eggs with tomatoes”?

Problems encountered: Because the dishes are non-standard, and the merchants have a high degree of personalized naming of dishes, so in the takeout platform, the same dish name appears different naming methods; For example, “scrambled eggs with tomatoes” includes scrambled eggs with tomatoes, scrambled eggs with small tomatoes, scrambled eggs with tomatoes, three unique dishes in Beijing ~ Scrambled eggs with tomatoes [regular and small dishes], etc., which cannot be simply aggregated by keywords.

Theme recommendation scene: Come up with a theme of dish size, quickly screen “crayfish”, “grilled fish”, “male chicken pot”, “braised chicken” and other popular dishes?

Problems encountered: The granularity of commodity classification is not fine enough to quickly find dishes suitable for granularity.

Single scene on merchant: For common dishes like “Shredded pork with Fish flavor”, labels of ingredients, taste, recipe, cuisine, meat and vegetable etc. are required to be recorded on each merchant’s list. The input cost is high. Can you choose “iPhone 12” like Taobao, its attributes can be automatically associated?

Problems encountered: The attributes of dishes are not standardized, and there is no correlation between dishes and attributes.

Based on the above business application pain points, start the standardization construction of takeaway goods. The goal is to establish standardized names of commodities, realize the aggregation of the same commodities, so as to provide concept division of reasonable granularity for business, and enable supply and marketing analysis at the operation end, personalized recall ordering at the user end, and label production at the business end.

2. Industry research

For the reference of the industry, we mainly refer to the construction of taobao standardized SPU. SPU determines what a commodity is in taobao system. It is the smallest unit of commodity information aggregation and consists of key attributes and binding attributes.

  • Key attributes: What defines and constrains a product, such as iPhone X, is the “Apple” brand and the “X” series.
  • Binding attribute: it is the supplement and refinement of key attributes. For example, after iPhone X has defined the product, other attributes, such as network model and screen size, are also determined. These attributes are further supplemented to gradually define a product.

It can be seen that The construction of SPU on Taobao is actually the construction of attributes. For example, Gree air conditioner S1240 is standardized and unique through “Gree” brand, “air conditioner” category and “S1240” model.

But for the catering industry, for the core attributes of the ingredients “beef”, the practice of “fried”, the taste of “spicy”, are unable to determine what is the dish, let alone unique; However, if the standardization is carried out through “stir-fried yellow beef”, the industry/users have a general understanding of it, and the relatively fixed food flavor is suitable for standardization. Therefore, Taobao is a standardized attribute, while catering is a standardized dish name, so we call it a standard dish name.

3. Problem analysis and challenges

Taobao’s standardization is mainly aimed at standard products, while catering standardization is aimed at non-standard products, which is difficult and faces challenges such as personalized problems, non-standard input, granularity without industry standards, and cognitive limitations.

3.1 Individuation problem

Catering businesses can customize production at a low cost with a high degree of personalization. The same dish may be named differently in different businesses, which requires a large number of synonyms to be aggregated, while the recall of synonyms is the biggest difficulty (how to dig out potential synonyms for labeling). For example, Beijing’s three special dishes – fried egg with tomato (small portion), fried egg with tomato (small portion), fried egg with tomato (small portion), fried egg with tomato (small portion), all represent the commodity “fried egg with tomato”.

3.2 Input is not standard

Key information is missing when the merchants input the commodity name, such as whether “Colorful fruit” is a fruit platter, drink or pizza, and “leek egg” is a bun or dumpling. In addition to the name of the product, it is necessary to deduce and complete the name with the help of merchant classification, tag and other relevant information in the left column of the product.

3.3 There is no industry standard for particle size

In the standardized processing, there is no unified standard, particle size is difficult to control: too coarse easy to produce non-dish errors (for example: “spicy chicken” -> “chicken”), too detailed standard name cohesion is weak (for example: “traditional Yellow braised chicken [big bowl]” itself is too fine, need to be refined to “yellow braised chicken”).

3.4 Cognitive limitations

Chinese food culture is extensive and profound. For some minority dishes or local specialties that are not well known to the public, it is necessary to have certain professional background knowledge. For example, “fried chicken” is also a standard name.

4. Plan

The overall scheme of commodity standardization is shown in the figure: Firstly, based on the online total of hundreds of millions of commodities of delicious food and dessert drinks merchants, the main names of dishes are obtained through name cleaning, confidence discrimination and manual inspection. Through synonym mining, trunk names are further aggregated and compressed and mapped to standard names and subjects. For a single commodity, name correction, cleaning, through model matching, the establishment of commodity – standard name mapping; In order to meet the aggregation granularity requirements of different business scenarios, the hierarchical tree of standard name is further constructed through the relationship mining and in-depth traversal. The algorithm models involved in name aggregation, matching mapping and hierarchy construction are introduced respectively.

4.1 Name Aggregation

After cleaning the trunk name still exists a lot of synonyms, such as potato roast beef, beef roast potato, potato roast beef, small potato roast beef, said the same goods. The aim is to further improve the cohesion of names by exploring such potential synonyms. In the process of iteration, rule matching and semantic matching are adopted to mine potential synonyms. After aggregation, the main words are identified according to the popularity, and the original main words are mapped to the standard name subject. The two synonym mining methods are introduced as follows.

4.1.1 Rule Matching

In the first phase, the rule matching method is adopted to identify the components of the trunk names by using NER model, and to distinguish whether the two trunk names are synonymous by combining the attribute synonym table constructed by the knowledge graph.

As shown in the figure, “beef and potatoes” can be obtained by name resolution: beef – food material, cooking – method, potato – food material; “Potato roast beef” through the name of the resolution of potato – ingredients, roast – cooking, beef – ingredients. By comparing the two main names of the component words, potato and potato are a pair of synonyms, the other components are the same, and then we can get the synonym relationship between them.

In this way, a hundred thousand synonyms were mined. The popularity value is calculated according to the number of commodity supply covered by the standard name, and the more popular one is taken as the subject. After manual verification, it is added to the standard name system, which improves the degree of aggregation of names.

4.1.2 Semantic matching

Due to the limited number of synonyms excavated by rule matching, such as “Dan Dan Noodles” and “Dan Dan Soup noodles”, both Dan Dan noodles and Soup noodles can be identified into categories according to NER model. Thus, two trunk names cannot be synonymous.

In the second phase, we investigated some matching models and used BERT+DSSM semantic matching model to expand the coverage of synonymous relations by referring to the experience of search algorithm group. As shown in the figure, based on the synonyms accumulated in the first phase, millions of samples were constructed and a version of the basic model was trained by generating positive cases within the group and negative cases across the group. In order to further optimize the model performance, the sample data was iterated through active learning and data enhancement.

The method of active learning is to first use the basic model to delineate a batch of similar samples to be annotated and submit them to outsourcing annotation. The correctly annotated samples are added to the existing synonyms, and the incorrectly annotated samples are added to the training set as negative examples for optimization iteration of the model. Through active learning, 10,000 samples were supplemented, and the accuracy of the model was significantly improved.

Through further analysis of the results, we found a batch of distinctive Bad cases, such as braised lion’s head and braised lion’s head covered rice, Chinese toon mixed tofu and tofu mixed tofu, which all had high similarity in terms but different core ingredients. Based on this feature, a group of samples with high literal similarity are delineated according to literal distance, and the negative examples are identified by name analysis model. In this way, hundreds of thousands of samples are automatically added without increasing the labeling cost, which further improves the accuracy of the model.

Using semantic matching model, 100,000 synonyms are added to further improve the cohesion of standard names.

4.2 Matching Mapping

Based on the standard noun list and synonyms excavated, the mapping of “commodities-standard name” is established for hundreds of millions of online commodities (such as “signature egg fried small tomato (large portion)” is mapped to “tomato fried egg”), in order to achieve the standardized description and aggregation of the same commodities. The matching model of “text + image” is adopted to cover most of the online goods of food, dessert and beverage merchants.

4.2.1 Text Matching

The text matching process is shown in Figure 4, which includes recall and sorting as a whole. First of all, the description information such as specification and weight in the commodity name is cleaned, the cleaned commodity name and standard name are sliced 2-gram, and the standard name to be matched is recalled by associating the same slice. Based on the standard name of recall, the Top 20 standard names are retained by calculating Jaccard distance. On this basis, BERT vectorization model was used to generate vector representations of commodity names and Cosine vector names. By calculating Jaccard literal distance and Cosine vector similarity, the standard names with the highest comprehensive scores were obtained.

Among them, BERT vectorization model is based on the semantic matching model mentioned above, and is transformed into an asymmetric standard name matching model by cascade one-dimensional type coding to distinguish standard name and commodity name. The reason for this transformation is that, unlike synonymous matching, the matching of standard name is asymmetric. For example, “Fragrant Guozhi” should be matched with the relatively abstract standard name “Guozhi”, rather than a more specific standard name “five fragrant Guozhi”. After modification, the matching accuracy is improved significantly.

4.2.2 Image matching

Due to the limited length of dish names and the non-standard naming of merchants, only the information obtained from dish names is limited, and the matching of standard names cannot be established. By introducing product picture information, the matching accuracy and coverage of products with incomplete text information can be improved.

Image matching adopts multi-classification model. According to the top-level and second-level of standard name hierarchy aggregation (see level 3 for construction), standard name labels to be matched are selected and sample sets are constructed according to text matching results. Due to the large scale non – manual sample labeling, it is inevitable to solve the problem of sample noise. In this scenario, there are two main sources of noise: first, incomplete text information leads to sample label errors; Second, due to the high degree of top-level and secondary polymerization, the classification granularity is too coarse and multiple labels need to be subdivided. To solve these problems, the method of sample and model iterative optimization was adopted to train the initial model according to the basic sample set, mining noise data with the model, and fine-tuning the model after manual verification. In this way, the model optimization with low annotation cost is realized.

The image classification model selects Basebone network Efficientnet which fine-adjusts the parameters of MBConv module, and determines the optimal combination by adjusting the resolution, depth and width of the network. In noise mining method, metric-Learn method is firstly used to Learn the clustering center of each category, and the mean, variance and median of the distance between the samples in the category and the clustering center. Studies on the prediction of classification model on validation set, O2U-NET and Forgetting Event are used to excavate sample noise. The model was optimized by the above method to improve the robustness of noise samples.

4.3 Hierarchy Construction

In the recommendation scenario, products need to be aggregated at a reasonable granularity to ensure personalized and diversified user experience. For the scenario of commodity list sorting, too thick existing categories will lead to insufficient diversity, and too thin standard names will lead to repeated results. The goal is to create a hierarchical commodity system that provides a reasonable aggregation granularity for the business. Through relationship mining and hierarchy traversal, a hierarchy tree of ten thousand vertices is constructed to support the on-line and optimization of commodity list, food list, interactive recommendation and other businesses. The construction methods include rule matching and model discrimination, which are introduced respectively.

4.3.1 Rule Matching

The rule matching method is based on the existing NER model and attribute lexicon, through the method of structured matching, mining the relationship between the top and bottom of a hundred thousand levels, and further traversing the standard name hierarchy tree generating ten thousand levels of vertices. This method is relatively simple and based on the existing work, has a short development cycle, quickly supports the launch of the project in the early stage, and has achieved obvious business benefits.

4.3.2 Model discrimination

Due to the error of NER model and the lack of attribute word relations, the relationship mined by rule matching method is limited, and generalization needs to be further improved through discriminant model. The relational classification model based on BERT is shown in Figure 8. A pair of standard names of classification are splicing with [SEP] and [CLS] identifier is added at the beginning. After encoding the stitching result, the Embedding is passed into BERT model, and the [CLS] bit Embedding is extracted. Then a full connection layer and Softmax layer are connected to output relational classification results. Standard name relations include: synonym, superior, subordinate, no relation, a total of four categories.

Sample data includes two parts: simple cases and difficult cases. The simple cases are based on existing synonyms, superior and subordinate levels, and the cross generation of no relation between synonym groups, and a total of millions of samples are constructed. On this basis, the existing vectorization model was further used to recall the standard name pairs with high similarity, and outsourced to label their categories. The second type of sample is more close to the actual classification scene, and belongs to the classification of high degree of confusion.

The first type of samples was used to pre-train the first version of the model, and on this basis, the second type of samples were used to fine-tune the model to further improve the accuracy of the classification model. After manual verification, the relation of ten thousand words is further added.

5. Application in takeaway business

As the middle layer of category and commodity, the standard name provides more abundant and reasonable aggregation granularity for business, supports the strategy optimization of traffic transformation and the development of series of product forms. By accessing the standard name hierarchy, commodity list can realize the aggregation of reasonable granularity of commodities and solve the problem of online commodity duplication. As the basic data, the standard name supports the development and launch of the food ranking list and helps improve the decision-making efficiency of users. In view of the commodities currently accessed by users, relevant commodities can be recalled with standard names to realize interactive recommendation. As an important basic data, standard name supports product form diversification and recommendation strategy optimization, which is of great value and significance for improving user stickiness and traffic conversion and building a user-friendly platform ecology for merchants.

6. Summary and outlook

At present, the basic system construction has been completed, and it has been successfully applied to different scenarios and achieved business benefits. The standard name hierarchy system has been built, covering the vast majority of takeout online goods. As the basic and characteristic data, the standard name is applied to business scenarios such as commodity list and food list on the client side to support strategy optimization and bring traffic revenue. At the same time, it also supports SaaS ordering recommendation model optimization across departments in the form of service interfaces to improve user experience and business benefits.

As an important commodity characteristic data, standard name is widely used in business scenarios. In the future work, continuous iterative optimization is needed to ensure the accuracy and quality of the standard name. At the same time, deepen the business understanding, optimize the hierarchical system according to business needs, provide more reasonable aggregation granularity for business, and improve conversion benefits; In addition, it focuses on building a batch of standard names with strong user perception and high supply coverage, so as to reduce the access cost of the business side and improve the income.

6.1 Thesaurus and synonym optimization

The construction of the standard noun list is not accomplished overnight, but needs long-term iteration and optimization. In view of the non-dishes and non-standard errors in the standard noun list, as well as insufficient and excessive synonym aggregation, the method of algorithm delineation + manual annotation is adopted to mine potential synonyms and delineate problematic phrases through the model. After manual verification, batch supplement and modification, continuous optimization of thesaurus and synonyms.

6.2 Rationalization of hierarchy

Currently, the standard name hierarchy is generated directly through rules and models, with low human participation and insufficient integration with business scenarios. The following will be combined with business needs, clear pruning, polymerization granularity criteria, rationalization of hierarchy structure, optimize the rationality of hierarchy. In this way, different business applications can be supported flexibly and efficiently, and the landing effect can be improved.

6.3 Core standard name construction

There are as many as 200,000 standard names, which cause some selection costs and inconvenience for business applications. According to the business needs, the standard names with strong user perception, high supply coverage and high quality are selected as the core standard names for key construction. The core standards are lightweight and refined to meet business needs, helping businesses reduce access costs and increase profits.

7. References

  • [1] Devlin J, Chang M W, Lee K, et al. BERT: Research on deep Bidirectional Transformers [J]. ArXiv Preprint arXiv:1810.04805, 2018.
  • [2] Lample G, Ballesteros M, Subramanian S, Neural architectures for entity-recognition based on architectures [J]. ArXiv Preprint arXiv:1603.01360, 2016.
  • [3] Chen Q, Zhu X, Ling Z, et al. Enhanced lstm for natural language inference[J]. arXiv preprint arXiv:1609.06038, 2016.
  • [4] Huang P S, He X, Gao J, et al. Learning deep structured semantic models for web search using clickthrough data[C]//Proceedings of the 22nd ACM international conference on Information & Knowledge Management. 2013: 2333-2338.
  • [5]Tan M , Le Q V . EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks[J]. 2019.

8. Author introduction

Liu Liu, MAO, Chong Jin, Xiao Xing, etc., are from the United States group takeout technology team.

Read more technical articles from meituan’s technical team

Front end | | algorithm back-end | | | data security operations | iOS | Android | test

| in the public bar menu dialog reply goodies for [2020], [2019] special purchases, goodies for [2018], [2017] special purchases such as keywords, to view Meituan technology team calendar year essay collection.

| this paper Meituan produced by the technical team, the copyright ownership Meituan. You are welcome to reprint or use the content of this article for non-commercial purposes such as sharing and communication. Please mark “Content reprinted from Meituan Technical team”. This article shall not be reproduced or used commercially without permission. For any commercial activity, please send an email to [email protected] for authorization.