CN117195081A - Food and beverage takeout package waste accounting method based on text mining - Google Patents
Food and beverage takeout package waste accounting method based on text mining Download PDFInfo
- Publication number
- CN117195081A CN117195081A CN202311466379.0A CN202311466379A CN117195081A CN 117195081 A CN117195081 A CN 117195081A CN 202311466379 A CN202311466379 A CN 202311466379A CN 117195081 A CN117195081 A CN 117195081A
- Authority
- CN
- China
- Prior art keywords
- food
- take
- target
- dish
- consumption
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 235000013305 food Nutrition 0.000 title claims abstract description 280
- 235000013361 beverage Nutrition 0.000 title claims abstract description 85
- 238000000034 method Methods 0.000 title claims abstract description 44
- 238000005065 mining Methods 0.000 title claims abstract description 29
- 239000002699 waste material Substances 0.000 title claims abstract description 20
- 239000013598 vector Substances 0.000 claims abstract description 169
- 238000013145 classification model Methods 0.000 claims abstract description 60
- 235000013311 vegetables Nutrition 0.000 claims abstract description 47
- 239000010816 packaging waste Substances 0.000 claims abstract description 46
- 238000012545 processing Methods 0.000 claims abstract description 18
- 238000004806 packaging method and process Methods 0.000 claims abstract description 13
- 238000012549 training Methods 0.000 claims abstract description 10
- 230000011218 segmentation Effects 0.000 claims abstract description 8
- 239000011159 matrix material Substances 0.000 claims description 57
- 238000004364 calculation method Methods 0.000 claims description 42
- 238000009826 distribution Methods 0.000 claims description 32
- 230000004913 activation Effects 0.000 claims description 11
- 238000013528 artificial neural network Methods 0.000 claims description 10
- 238000005520 cutting process Methods 0.000 claims description 8
- 238000010606 normalization Methods 0.000 claims description 7
- 238000013507 mapping Methods 0.000 claims description 4
- 230000006870 function Effects 0.000 description 12
- 235000012631 food intake Nutrition 0.000 description 8
- 230000008569 process Effects 0.000 description 7
- 230000009467 reduction Effects 0.000 description 5
- 238000011161 development Methods 0.000 description 3
- 230000018109 developmental process Effects 0.000 description 3
- 238000007726 management method Methods 0.000 description 3
- 239000000463 material Substances 0.000 description 3
- 235000012054 meals Nutrition 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 239000000203 mixture Substances 0.000 description 2
- 238000011002 quantification Methods 0.000 description 2
- 230000009466 transformation Effects 0.000 description 2
- 238000013473 artificial intelligence Methods 0.000 description 1
- 235000021168 barbecue Nutrition 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 235000021403 cultural food Nutrition 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 235000013312 flour Nutrition 0.000 description 1
- 238000009472 formulation Methods 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000003058 natural language processing Methods 0.000 description 1
- 235000014594 pastries Nutrition 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
- 235000014102 seafood Nutrition 0.000 description 1
- 235000011888 snacks Nutrition 0.000 description 1
- 238000003860 storage Methods 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Medical Treatment And Welfare Office Work (AREA)
Abstract
The application provides a food and beverage takeout package waste accounting method based on text mining, which comprises the following steps: acquiring dish names of various food and drink take-out consumption categories, package data corresponding to each food and drink take-out consumption category and unstructured food and drink take-out consumption data; word segmentation and coding processing are carried out on the vegetable names, so that vegetable name vectors are obtained; training a preset dish classification model by using a dish name vector; based on the trained dish classification model, classifying and predicting the food take-out consumption categories of the target food take-out consumption dishes, and determining the target food take-out consumption categories corresponding to the target food take-out consumption dishes; and calculating the food and beverage takeout packaging waste yield of the target food and beverage takeout consumption dishes according to the packaging data corresponding to the target food and beverage takeout consumption categories. The application can accurately and automatically quantify takeaway packaging waste in real time, and provides scientific basis for making packaging waste management and plastic pollution treatment countermeasures.
Description
Technical Field
The application relates to the technical field of natural language processing, in particular to a food and drink takeout packaging waste accounting method based on text mining.
Background
With the rapid development of electronic commerce and fast-paced life style, online dining takeaway service is vigorously developed, and exponentially growing disposable packaging waste is generated, so that the negative influence on resource environment is increasingly prominent. And take-out packaging products are various in variety, and the types, materials, specifications and the like of the packaging products are greatly different. The different types of food and beverage takeouts are consumed, and packages of different types, materials, quantities and specifications are used, so that the takeout packages have different waste production compositions. Since urban takeaway consumption characteristics are affected by local consumption habits and food culture, the amount of urban takeaway packaging waste produced is highly heterogeneous. Meanwhile, online dining take-away consumption data typically exists in the form of large-scale unstructured text, i.e., without a unified format. The prior art is difficult to directly analyze the food takeout consumption data, so that the quantification of packaging wastes is difficult to be carried out according to the types of dishes.
Disclosure of Invention
The application provides a food and beverage takeout packaging waste accounting method based on text mining, which aims to realize real-time, accurate and automatic quantification of takeout packaging waste and provides scientific basis for making packaging waste management and plastic pollution treatment countermeasures.
The application provides a food and beverage takeout package waste accounting method based on text mining, which comprises the following steps:
acquiring dish names under various food and drink take-out consumption categories, package data corresponding to each food and drink take-out consumption category and unstructured food and drink take-out consumption data;
word segmentation and coding processing are carried out on the vegetable names, so that vegetable name vectors corresponding to the vegetable names are obtained;
training a preset dish classification model by using the dish name vector to obtain a trained dish classification model;
based on the trained dish classification model, classifying and predicting the target food take-out consumption dishes in the food take-out consumption data, and determining the target food take-out consumption categories corresponding to the target food take-out consumption dishes;
and calculating the food and beverage takeout packaging waste yield of the target food and beverage takeout consumption dishes according to the packaging data corresponding to the target food and beverage takeout consumption categories.
In some embodiments, word segmentation and encoding are performed on the vegetable names to obtain vegetable name vectors corresponding to the vegetable names, including:
cutting a text corresponding to the names of the dishes into a plurality of word units;
determining the use frequency of each word unit, and dividing the word units with the use frequency greater than or equal to a frequency threshold value into a first word list;
based on a maximum probability calculation model, performing cutting processing on word units with the use frequency smaller than a frequency threshold value to obtain a plurality of sub word units, and dividing the sub word units into a second word list;
and determining a dish name vector corresponding to the dish name according to the mapping result of the word units in the first word list and the second word list.
In some embodiments, training a preset dish classification model using a dish name vector to obtain a trained dish classification model, comprising:
performing association degree calculation on elements at each position in each dish name vector based on an association degree calculation layer of a preset dish classification model to obtain a position weight vector corresponding to each element;
based on an addition normalization layer and a feedforward neural network layer of a preset dish classification model, vector addition is carried out on the dish name vector and the position weight vector, and a target dish name vector is obtained;
determining a relative score vector of a dish name corresponding to a target dish name vector belonging to each food takeout consumption category based on a fully connected neural network layer of a preset dish classification model;
based on the activation function, determining a predicted probability distribution result of the dish names belonging to each food take-out consumption category according to the relative score vector;
determining a target loss value according to an actual probability distribution result and a predicted probability distribution result based on a preset loss value calculation rule;
and carrying out parameter adjustment processing on the preset dish classification model according to the target loss value to obtain a trained dish classification model.
In some embodiments, based on a correlation degree calculation layer of a preset dish classification model, performing correlation degree calculation on elements at each position in each dish name vector includes:
determining a Query vector matrix, a Key vector matrix and a Value vector matrix corresponding to elements at each position in each dish name vector according to the dish name vector and the corresponding preset weight matrix;
based on a preset association degree calculation rule, determining an association degree calculation result corresponding to the elements at each position in each dish name vector according to a Query vector matrix, a Key vector matrix and a Value vector matrix corresponding to each element.
In some embodiments, based on a preset association degree calculation rule, determining a calculation result of the association degree corresponding to the element at each position in each dish name vector according to a Query vector matrix, a Key vector matrix and a Value vector matrix corresponding to each element, including:
determining a correlation degree calculation result corresponding to the elements at each position in the vegetable name vector sequence based on the following steps:
wherein corelation is used to indicate the Correlation degree calculation result, softmax is used to indicate the normalized exponential function, Q is used to indicate the Query vector matrix,for indicating transpose of Key vector matrix, V for indicating Value vector matrix, ++>Is a preset parameter.
In some embodiments, determining the target loss value from the actual probability distribution result and the predicted probability distribution result based on a preset loss value calculation rule includes:
determining a target loss value based on:
wherein,for indicating a target loss value,/->For indicating the corresponding food take-out consumption category of the dish name +.>Is the result of the predictive probability distribution of the activation function output,/->For indicating->The j-th vector element of (a) and +.>For determining whether the dish name belongs to a j-th food takeout consumption category; />For indicating->The j-th vector element of (a) and +.>For determining the probability that the dish name belongs to the j-th food take-out consumption category.
In some embodiments, based on the trained dish classification model, performing classification prediction of a target food take-out consumption dish in the food take-out consumption data for the food take-out consumption class, the determining a target food take-out consumption class corresponding to the target food take-out consumption dish includes:
based on a vector coding layer of a trained dish classification model, coding a target dish name corresponding to a target food take-out consumption dish, and based on an activation function, determining a predicted probability distribution result of the target food take-out consumption dish belonging to each food take-out consumption category according to the coded target dish name;
based on the filter, determining that the food take-out consumption category with the highest probability in the predicted probability distribution results of the target food take-out consumption dishes belonging to all food take-out consumption categories is the target food take-out consumption category corresponding to the target food take-out consumption dishes.
In some embodiments, calculating the food and beverage take-out packaging waste yield of the target food and beverage take-out consumer good based on the packaging product specification data corresponding to the target food and beverage take-out consumer class comprises:
and according to the weight, the use quantity information and the use probability of the packaged products corresponding to the target food take-out consumption categories and the target food take-out consumption categories, calculating the food take-out packaging waste yield of the target food take-out consumption dishes.
In some embodiments, accounting for the target take-away food product for take-away packaging waste yield based on the weight, number and probability of use of the packaged product corresponding to the target take-away food product category and the target take-away food product category comprises:
calculating the yield of food and drink takeout packaging waste of target food and drink takeout consumption dishes based on the following steps:
the PW is used for indicating the yield of the food and beverage takeout packaging waste; i is used for indicating a packaged product, j is used for indicating a target food and beverage takeout consumption category;weight information for indicating packaged product i +.>Information indicating the number of uses of the packaged product i in the target take-away consumer category j, +.>For indicating the probability of use of the packaged product i in the target take-away consumer category j.
In some embodiments, the right food take-out consumption category corresponding to the target area is determined according to the food take-out consumption category corresponding to the food take-out consumption data in the target area.
The application provides a food take-out package waste accounting method based on text mining, which is characterized in that a preset food classification model is trained by utilizing the acquired food names of various food take-out consumption types to obtain a trained food classification model, so that the acquired unstructured food take-out consumption data are converted into vectors based on the trained food classification model, and text feature extraction is carried out based on a text mining technology, and automatic and efficient classification of food take-out consumption dishes in the unstructured food take-out consumption data is realized, thereby being capable of accurately quantifying package waste generated by food take-out consumption dishes of various food take-out consumption types in real time, providing scientific support for setting of a source reduction policy of take-out package, being beneficial to developing fine management and source reduction of the package waste, and promoting green transformation and sustainable development of industry.
Drawings
In order to more clearly illustrate the technical solution of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described.
Fig. 1 is a flowchart of steps in a method for accounting for food and beverage takeout packaging waste based on text mining according to an embodiment of the present application.
Fig. 2 is a schematic flow chart of a method for accounting food and beverage takeout package waste based on text mining according to an embodiment of the application.
Detailed Description
The following description of the embodiments of the present application will be made clearly and fully with reference to the accompanying drawings, in which it is evident that the embodiments described are some, but not all embodiments of the application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The flow diagrams depicted in the figures are merely illustrative and not necessarily all of the elements and operations/steps are included or performed in the order described. For example, some operations/steps may be further divided, combined, or partially combined, so that the order of actual execution may be changed according to actual situations.
The application provides a food and beverage takeout package waste accounting method based on text mining. The food and beverage takeout package waste accounting method based on text mining can be applied to terminal equipment, and the terminal equipment can be electronic equipment such as a tablet computer, a notebook computer and a desktop computer. The cloud server can be applied to a server, and can be a single server or a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDNs), basic cloud computing services such as big data and artificial intelligence platforms and the like.
Some embodiments of the present application are described in detail below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
Referring to fig. 1 and 2, fig. 1 is a flowchart illustrating steps of a method for accounting food and beverage takeout package waste based on text mining according to an embodiment of the application. Fig. 2 is a schematic flow chart of a method for accounting food and beverage takeout package waste based on text mining according to an embodiment of the application.
As shown in fig. 1, the method for accounting for food and beverage takeout package waste based on text mining includes steps S101 to S105.
Step S101, acquiring dish names under various food and drink take-out consumption categories, package data corresponding to the food and drink take-out consumption categories and unstructured food and drink take-out consumption data.
Illustratively, the names of dishes in a plurality of food takeout consumption categories are obtained, and the package data corresponding to each food takeout consumption category is obtained, and it is understood that the package data corresponding to the food takeout consumption category is used for indicating at least one of the material, the weight, the number of use and the frequency of use of the package product used by the dishes in the food takeout consumption category. It should be noted that, a plurality of dishes are corresponding to one food takeout consumption category, and therefore, a plurality of dish names are corresponding to one food takeout consumption category.
By way of example, corresponding food takeout consumption categories are obtained through predefined food takeout consumption category obtaining rules, wherein the obtained food takeout consumption categories are mutually exclusive food takeout consumption categories, that is, the cuisines indicated by the food takeout consumption categories are different. Specifically, the food and beverage takeaway consumption categories include, but are not limited to, forensic cuisine, seafood and barbecue, chinese simple meal, flour dumplings, chinese snack, baked pastries, drinks, and the like.
Illustratively, after obtaining the food take-out consumption categories, determining packaging data used by each food take-out consumption category, wherein the packaging data includes, but is not limited to, types, weights, numbers, and probabilities of use of packaged products used by dishes in each food take-out consumption category.
In a specific embodiment, the names of dishes under different food and drink take-out consumption categories are obtained according to at least one of industry reports, publications, documents and journals, and package data used by the different food and drink take-out consumption categories are obtained. Or, in a preset dish name corpus, acquiring the food take-out consumption categories corresponding to the plurality of dish names so as to acquire the dish names under different food take-out consumption categories; and acquiring the food and beverage takeout consumption categories corresponding to the package data in a preset package data knowledge base, so as to acquire the package data used by different food and beverage takeout consumption categories. It can be appreciated that if the preset dish name corpus and/or the package data knowledge base does not exist, a corresponding dish name corpus can be constructed according to the acquired dish names under different food take-out consumption categories, and/or the package data knowledge base can be constructed according to the acquired package data used for acquiring different food take-out consumption categories, so that data acquisition can be conveniently performed next time.
By way of example, the take-out food consumption data is obtained from the take-out platform, and it can be understood that the take-out food consumption data is used for indicating dishes consumed by a user, and in the take-out platform of the application scene of the application, the take-out food consumption data is unstructured text data and the obtained unstructured text data cannot be directly processed, so that the unstructured take-out food consumption data needs to be processed through a trained dish classification model to determine the food take-out consumption category corresponding to the target take-out food in the take-out food consumption data.
And step S102, performing word segmentation and coding processing on the vegetable names to obtain vegetable name vectors corresponding to the vegetable names.
Illustratively, the coding model is used for word segmentation and coding processing on the vegetable names so as to obtain vegetable name vectors corresponding to the vegetable names.
In one embodiment, word segmentation and encoding are performed on the vegetable names to obtain vegetable name vectors corresponding to the vegetable names, including: cutting a text corresponding to the names of the dishes into a plurality of word units; determining the use frequency of each word unit, and dividing the word units with the use frequency greater than or equal to a frequency threshold value into a first word list; based on a maximum probability calculation model, performing cutting processing on word units with the use frequency smaller than a frequency threshold value to obtain a plurality of sub word units, and dividing the sub word units into a second word list; and determining a dish name vector corresponding to the dish name according to the mapping result of the word units in the first word list and the second word list.
In a specific implementation process, the coding model cuts the text corresponding to the menu name into a plurality of word units, wherein the text length of the word units obtained by cutting is shorter than the text length of the text corresponding to the menu name.
Determining the use frequency of each word unit, dividing the word units with the use frequency greater than or equal to the frequency threshold into a first word list, simultaneously, based on a maximum probability calculation model, performing cutting processing on the word units with the use frequency smaller than the frequency threshold again to obtain a plurality of sub word units, dividing the sub word units into a second word list,
that is, common words form a first vocabulary, and unusual words are cut according to a maximum probability algorithm to obtain a plurality of sub-word units so as to form a second vocabulary.
Each word unit in the first vocabulary and the second vocabulary is mapped to a unique integer ID. And determining codes corresponding to the plurality of word units cut in the menu name text according to the mapping result of the word units. The codes are formed into a vector of fixed dimensions to initially determine a vector representation of the dish name. Meanwhile, in order to distinguish the relation between words at different positions in the input dish names, the corresponding vector of each word is added with the corresponding position coding vector so as to represent the sequence information of the words in the dish names. And finishing vector coding processing on the dish names through the processing to obtain dish name vectors.
And step S103, training a preset dish classification model by using the dish name vector to obtain a trained dish classification model.
The training method comprises the steps of training a preset dish classification model by using a dish name vector to adjust parameters of the preset dish classification model, and obtaining a trained dish classification model, so that the trained dish classification model can further encode the dish name vector, and further mining of the dish name semantic representation is achieved.
In some embodiments, training a preset dish classification model using a dish name vector to obtain a trained dish classification model, comprising: performing association degree calculation on elements at each position in each dish name vector based on an association degree calculation layer of a preset dish classification model to obtain a position weight vector corresponding to each element; based on an addition normalization layer and a feedforward neural network layer of a preset dish classification model, vector addition is carried out on the dish name vector and the position weight vector, and a target dish name vector is obtained; determining a relative score vector of dishes corresponding to the target dish name vector belonging to each food and beverage takeout consumption category based on a fully connected neural network layer of a preset dish classification model; based on the activation function, determining a predicted probability distribution result of the dishes belonging to each food and beverage takeout consumption category according to the score vector; determining a target loss value according to an actual probability distribution result and a predicted probability distribution result based on a preset loss value calculation rule; and carrying out parameter adjustment processing on the preset dish classification model according to the target loss value to obtain a trained dish classification model.
The vegetable name vector is illustratively formed by a plurality of elements, and after the vegetable name vector is input into a correlation degree calculation layer of a preset vegetable classification model, the correlation degree among the elements at each position in the vegetable name vector is calculated so as to determine a position weight vector corresponding to each element. It will be appreciated that the position weight vector is used to represent the importance of the elements at each position of the dish name vector, which can help the dish classification model to better understand the relationships and importance in the input dish text vector sequence. Specifically, the position weight vector corresponding to each element in each position is obtained by comparing the elements in each position in the vegetable name vector and calculating the association degree between the elements, and the calculated association degree is used for weighted average, so that the position weight vector can consider the information of each position in the whole vegetable name vector, and is not limited to the context.
The actual probability distribution result can be determined according to the obtained names of the dishes in various food takeout consumption categories.
In some embodiments, based on a correlation degree calculation layer of a preset dish classification model, performing correlation degree calculation on elements at each position in each dish name vector includes: determining a Query vector matrix, a Key vector matrix and a Value vector matrix corresponding to elements at each position in each dish name vector according to the dish name vector and the corresponding preset weight matrix; based on a preset association degree calculation rule, determining an association degree calculation result corresponding to the elements at each position in each dish name vector according to a Query vector matrix, a Key vector matrix and a Value vector matrix corresponding to each element.
In a specific implementation process, taking the vegetable name X as an example, the corresponding vegetable name vector is x= = (in the following),/>,…,/>N is used for indicating the number of keywords in the menu name. Each keyword is represented by a one-hot vector, and under the condition that the dimension is k, the word embedding matrix corresponding to X is A= (-I/O)>,/>,…,/>Wherein A is a matrix of dimension N x k, each row corresponding to a vector representation of a keyword in the input sentence, ">Is a k-dimensional vector for indicating the corresponding +.>. It will be appreciated that N may also be used to indicate the number of words in the menu name, i.e. each word in the menu name is used in vector encodingAnd (5) coding to obtain a corresponding dish name vector X.
Determining a corresponding Query vector matrix, a Key vector matrix and a Value vector matrix according to the following formula:
wherein Q, K, V is used to indicate a Query vector matrix, a Key vector matrix, and a Value vector matrix, respectively, A is the word embedding matrix provided above,、/>、/>the method is used for indicating an N multiplied by k dimensional weight matrix corresponding to the Query vector matrix, an N multiplied by k dimensional weight matrix corresponding to the Key vector matrix and an N multiplied by k dimensional weight matrix corresponding to the Value vector matrix respectively.
In some embodiments, based on a preset association degree calculation rule, determining a calculation result of the association degree corresponding to the element at each position in each dish name vector according to a Query vector matrix, a Key vector matrix and a Value vector matrix corresponding to each element, including:
determining a correlation degree calculation result corresponding to the elements at each position in the vegetable name vector based on the following steps:
wherein corelation is used to indicate the Correlation degree calculation result, softmax is used to indicate the normalized exponential function, Q is used to indicate the Query vector matrix,for indicating transpose of Key vector matrix, V for indicating Value vector matrix, ++>Is a preset parameter.
It should be noted that, the Query vector matrix, the Key vector matrix, and the Value vector matrix may be determined according to the methods provided above,is an adjustable empirical parameter, in particular, +.>The number of exercises and the results can be changed.
After determining the position weight vectors corresponding to the elements at each position in the dish name vector, adding the dish name vector and the position weight vector into an addition normalization layer and a feedforward neural network layer, carrying out vector addition on the dish name vector and the position weight vector in the addition normalization layer, and carrying out normalization processing, so that the dish name vector has a fixed mean value and standard deviation, and specifically, the mean value is 0, and the standard deviation is 1. And in the feedforward neural network layer, vector addition and normalization processing are carried out on the normalized vegetable name vector again to obtain a target vegetable name vector.
The method comprises the steps of inputting a target vegetable name vector into a fully-connected neural network layer to conduct classified prediction of food take-out consumption categories according to the target vegetable name vector, wherein in the fully-connected neural network layer, a relative score vector of the vegetable corresponding to the target vegetable name vector belonging to each food take-out consumption category is predicted according to the target vegetable name vector, the score vector is converted into an i-dimensional vector (i is used for indicating the number of the food take-out consumption categories) through a softmax activation function, and each dimension is used for representing the probability of the current food take-out consumption category of the vegetable name corresponding to the target vegetable name vector, so that a predicted probability distribution result of the vegetable name belonging to each food take-out consumption category is obtained.
And calculating a target loss value according to the predicted probability distribution result and the actual probability distribution result of the dish name X. With the parameter of optimizing the dish classification model of predetermineeing according to the target loss value, it can understand that the dish classification model of training can fully consider the semantic information and realize dish name text mining.
In some embodiments, determining the target loss value from the actual probability distribution result and the predicted probability distribution result based on a preset loss value calculation rule includes:
determining a target loss value based on:
wherein,for indicating a target loss value,/->The method comprises the steps of indicating the food take-out consumption category actually corresponding to the vegetable name; />The result is a predicted probability distribution output by the activation function; />For indicating->The j-th vector element of (a) and +.>For determining whether the dish name belongs to a j-th food takeout consumption category; />For indicating->The j-th vector element of (a) and +.>For determining the probability that the dish name belongs to the j-th food take-out consumption category.
In particular, the method comprises the steps of,predicting a loss value of a consumption category and an actual food takeout consumption category for food takeout, +.>Is an i-dimensional vector for indicating the type of take-out consumption of the restaurant to which the dish corresponding to the name of the dish actually belongs. />J-th node of (a)>Indicating whether the dish corresponding to the dish name belongs to the j-th food takeout consumption category, if +.>If the number is 1, the dishes belong to the j-th food take-out consumption category; if->And if the number is 0, the dish does not belong to the j-th food take-out consumption category. />An i-dimensional vector is output for the softmax function to indicate the predicted probability distribution result. />J-th node of (a)>And the probability that the name of the dish belongs to the j-th food take-out consumption category is represented.
And determining a target loss value through the calculation rule, and carrying out parameter adjustment on a preset dish classification model based on the target loss value to obtain a trained dish classification model.
Step S104, based on the trained dish classification model, classifying and predicting the food take-out consumption categories of the target food take-out consumption dishes in the food take-out consumption data to obtain target food take-out consumption categories corresponding to the target food take-out consumption dishes.
By way of example, through the trained dish classification model, classification prediction of the target food take-out consumption dishes in the food take-out consumption data can be performed to determine the target food take-out consumption categories to which the target food take-out consumption dishes belong.
In a specific implementation process, online food take-out consumption data are acquired in a take-out platform, so that target food take-out consumption dishes are acquired in real time. It can be understood that the obtained food and beverage takeout consumption data is unstructured text data, and the trained dish classification model can process the unstructured text data to classify and predict target food and beverage takeout consumption dishes in the food and beverage takeout consumption data, so that quantitative calculation of packaging wastes corresponding to different dishes in the online food and beverage takeout consumption data is realized.
In some embodiments, the method further comprises: and determining the regional food and beverage take-out consumption category corresponding to the target region according to the food and beverage take-out consumption category corresponding to the food and beverage take-out consumption data in the target region.
By way of example, the identification of the take-out consumption categories of cities and areas can be realized through the dish classification model, so that take-out packaging waste of different area dish classification categories can be accurately quantified, the structural characteristics and key areas of the food and beverage take-out packaging waste are identified, and scientific support is provided for the establishment of source reduction policy of food and beverage take-out packaging.
In some embodiments, based on the trained dish classification model, performing classification prediction of a target food take-out consumption dish in the food take-out consumption data for the food take-out consumption class, the determining a target food take-out consumption class corresponding to the target food take-out consumption dish includes: based on a vector coding layer of a trained dish classification model, coding a target dish name corresponding to a target food take-out consumption dish, and based on an activation function, determining a predicted probability distribution result of the target food take-out consumption dish belonging to each food take-out consumption category according to the coded target dish name; based on the filter, determining that the food take-out consumption category with the highest probability in the predicted probability distribution results of the target food take-out consumption dishes belonging to all food take-out consumption categories is the target food take-out consumption category corresponding to the target food take-out consumption dishes.
Illustratively, inputting the target food name of the target food take-out consumer food into a trained food classification model, and carrying out coding processing on the target food name of the target food take-out consumer food through a vector coding layer of the trained food classification model.
Based on the activation function, obtaining a plurality of to-be-selected catering take-out consumption categories by classifying and predicting the names of the dishes after the encoding treatment; it can be understood that each of the to-be-selected food and beverage take-out consumption categories has a corresponding probability score, so that a predicted probability distribution result of the target food and beverage take-out consumption dishes belonging to each food and beverage take-out consumption category is obtained; inputting the predicted probability distribution results of the target food and beverage take-out consumption dishes belonging to the food and beverage take-out consumption categories into a filter, and determining the food and beverage take-out consumption category corresponding to the highest probability in the predicted probability distribution results as the target food and beverage take-out consumption category of the target food and beverage take-out consumption dishes in the filter.
Step 105, calculating the food take-out packaging waste yield of the target food take-out consumption dishes according to the packaging data corresponding to the target food take-out consumption categories.
For example, in step S101, the package data corresponding to each of the takeout food consumption categories is determined, so that after determining the target takeout food consumption category of the target takeout food, the yield of the takeout food package waste of the target takeout food can be determined according to the package data corresponding to the target takeout food consumption category.
In some embodiments, calculating the food and beverage take-out packaging waste yield of the target food and beverage take-out consumption dishes from the packaging data corresponding to the target food and beverage take-out consumption category comprises: and according to the weight, the use quantity and the use probability of the packaged products corresponding to the target food take-out consumption categories and the target food take-out consumption categories, calculating the food take-out packaging waste yield of the target food take-out consumption dishes.
It should be understood that the package data includes, but is not limited to, a unit weight of the packaged product, usage amount information corresponding to the packaged product, and usage probability corresponding to the packaged product; after the packaged products used by the target food take-out consumer dishes are determined, the food take-out packaging waste yield can be determined according to the unit weight, the use quantity and the use probability corresponding to the packaged products.
In some embodiments, accounting for target food take-out consumption waste yield from target food take-out consumption categories and weight, number and probability of use of packaged products corresponding to the target food take-out consumption categories includes: calculating the yield of food and drink takeout packaging waste of target food and drink takeout consumption dishes based on the following steps:
the PW is used for indicating the yield of the food and beverage takeout packaging waste; i is used for indicating the packaged product; j is used for indicating the target food and drink take-out consumption category;weight information for indicating the packaged product i; />The information is used for indicating the use quantity of the packaged product i in the target food takeout consumption category j; />For indicating the probability of use of the packaged product i in the target take-away consumer category j.
The following describes, with reference to table 1, a food and drink take-out packaging waste of food and drink take-out consumer dishes, the food and drink take-out consumer class of which is chinese simple food.
It should be understood that the data provided in table 1 is example 1.
Table 1: data sheet of packaged products for Chinese simple meal and drink
According to the data in the table, ordering a Chinese simple food type food takeout consumption vegetable, wherein 72.54g of food takeout packaging waste is produced; ordering a serving of food-like food takeaway consumer dishes, and generating 22.9g of food-takeaway packaging waste.
It should be noted that, the person skilled in the art can calculate the data different from the data provided in example 1 according to the method provided above, and example 1 is only an example and does not limit the waste of the takeout package generated by the takeout dishes of chinese simple meal type and the takeout dishes of drink type in the present application.
According to the food and beverage takeout package waste accounting method based on text mining, the preset food and beverage takeout consumption model is trained by utilizing the acquired food names under various food and beverage takeout consumption categories and package data corresponding to the food and beverage takeout consumption categories, so that the trained food and beverage takeout consumption data in the form of unstructured text data can be converted into vectors through the trained food and beverage takeout consumption model, text feature extraction is performed based on a text mining technology, automatic and efficient classification of food and beverage takeout consumption foods is achieved, and meanwhile, package waste generated by corresponding food and beverage takeout consumption foods can be determined according to classification results of the food and beverage takeout consumption foods based on the acquired package data. The application can accurately and automatically quantify the packaging waste generated by the food takeout consumption dishes in various food takeout consumption categories in real time, provides scientific support for the formulation of the source reduction policy of takeout packaging, is favorable for developing the fine management and source reduction of the packaging waste, and promotes the green transformation and sustainable development of the industry.
It is to be understood that the terminology used in the description of the application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this specification and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in the present specification and the appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes such combinations. It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present application are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments. While the application has been described with reference to certain preferred embodiments, it will be understood by those skilled in the art that various changes and substitutions of equivalents may be made and equivalents will be apparent to those skilled in the art without departing from the scope of the application. Therefore, the protection scope of the application is subject to the protection scope of the claims.
Claims (10)
1. The food and beverage takeout package waste accounting method based on text mining is characterized by comprising the following steps of:
acquiring dish names under various food and drink take-out consumption categories, package data corresponding to each food and drink take-out consumption category and unstructured food and drink take-out consumption data;
word segmentation and coding processing are carried out on the vegetable names, so that vegetable name vectors corresponding to the vegetable names are obtained;
training a preset dish classification model by using the dish name vector to obtain a trained dish classification model;
based on the trained dish classification model, classifying and predicting the food take-out consumption categories of the target food take-out consumption dishes in the food take-out consumption data, and determining target food take-out consumption categories corresponding to the target food take-out consumption dishes;
and calculating the food and beverage takeout packaging waste yield of the target food and beverage takeout consumption dishes according to the target food and beverage takeout consumption category and the packaging data corresponding to the target food and beverage takeout consumption category.
2. The method for accounting food and beverage takeout packaging waste based on text mining as set forth in claim 1, wherein the step of performing word segmentation and encoding processing on the vegetable names to obtain vegetable name vectors corresponding to the vegetable names includes:
cutting the text corresponding to the menu name into a plurality of word units;
determining the use frequency of each word unit, and dividing the word units with the use frequency greater than or equal to a frequency threshold value into a first word list;
based on a maximum probability calculation model, performing cutting processing on the word units with the use frequency smaller than the frequency threshold value to obtain a plurality of sub word units, and dividing the sub word units into a second vocabulary;
and determining a dish name vector corresponding to the dish name according to the mapping result of the word units in the first word list and the second word list.
3. A method for accounting for food and beverage takeout packaging waste based on text mining as in claim 1, wherein said training a pre-set dish classification model using said dish name vector to obtain a trained dish classification model includes:
performing association degree calculation on elements at each position in each dish name vector based on an association degree calculation layer of the preset dish classification model to obtain a position weight vector corresponding to each element;
based on an addition normalization layer and a feedforward neural network layer of the preset dish classification model, vector addition is carried out on the dish name vector and the position weight vector, and a target dish name vector is obtained;
determining a relative score vector of a dish name corresponding to the target dish name vector belonging to each food takeout consumption category based on a fully connected neural network layer of the preset dish classification model;
based on an activation function, determining a predicted probability distribution result of the dish names belonging to each food and beverage takeout consumption category according to the relative score vector;
determining a target loss value according to an actual probability distribution result and the predicted probability distribution result based on a preset loss value calculation rule;
and carrying out parameter adjustment processing on the preset dish classification model according to the target loss value to obtain a trained dish classification model.
4. A method for accounting for food and beverage takeout packaging waste based on text mining as set forth in claim 3, wherein said correlation calculation layer for calculating the correlation of elements at each position in each of said dish name vectors based on said preset dish classification model includes:
determining a Query vector matrix, a Key vector matrix and a Value vector matrix corresponding to elements at each position in each dish name vector according to the dish name vector and the corresponding preset weight matrix;
based on a preset association degree calculation rule, determining an association degree calculation result corresponding to the elements at each position in each dish name vector according to a Query vector matrix, a Key vector matrix and a Value vector matrix corresponding to each element.
5. The method for accounting food and beverage takeout packaging waste based on text mining according to claim 4, wherein the determining the association degree calculation result corresponding to the elements at each position in each dish name vector according to the Query vector matrix, key vector matrix and Value vector matrix corresponding to each element based on the preset association degree calculation rule comprises:
determining a correlation degree calculation result corresponding to the elements at each position in the vegetable name vector based on the following formula:
wherein corelation is used to indicate the Correlation degree calculation result, softmax is used to indicate the normalized exponential function, Q is used to indicate the Query vector matrix,transpose for indicating the Key vector matrix, V for indicating the Value vector matrix,/and>is a preset parameter.
6. A method of accounting for food and beverage takeout packaging waste based on text mining as set forth in claim 3, wherein said determining a target loss value based on said actual probability distribution result and said predicted probability distribution result based on a preset loss value calculation rule includes:
determining the target loss value based on:
wherein,for indicating said target loss value,/or->For indicating the type of food takeaway consumption to which the vegetable name actually corresponds, < >>Is the result of the predictive probability distribution of the activation function output,/->For indicating->The j-th vector element of (a) and +.>For determining whether the dish name belongs to a j-th food takeout consumption category; />For indicating->The j-th vector element of (a) and +.>And determining the probability that the name of the dish belongs to the j-th food take-out consumption category.
7. The text-mining-based food take-out packaging waste accounting method of any one of claims 1-5, wherein the determining a target food take-out consumption category corresponding to the target food take-out consumption category based on the trained food classification model to classify and predict the target food take-out consumption category in the food take-out consumption data comprises:
based on a vector coding layer of the trained dish classification model, coding a target dish name corresponding to the target food take-out consumption dish, and based on an activation function, determining a predicted probability distribution result of the target food take-out consumption dish belonging to each food take-out consumption class according to the coded target dish name;
based on the filter, determining that the food take-out consumption category with the highest probability in the predicted probability distribution results of the food take-out consumption categories belongs to the target food take-out consumption category corresponding to the target food take-out consumption category.
8. A method of calculating a food and beverage take-out packaging waste based on text mining according to any one of claims 1 to 5, wherein calculating a food and beverage take-out packaging waste yield of the target food and beverage take-out consumption dishes based on the target food and beverage take-out consumption category and the packaging data corresponding to the target food and beverage take-out consumption category comprises:
and according to the weight, the use quantity and the use probability of the packaged products corresponding to the target food takeout consumption category and the target food takeout consumption category, calculating the food takeout packaging waste yield of the target food takeout consumption dishes.
9. The text-mining-based food and beverage takeout packaging waste accounting method as set forth in claim 8, wherein said accounting for food and beverage takeout packaging waste yield of said target food and beverage takeout consumer dishes based on the weight, number of uses and probability of use of said target food and beverage takeout consumer category and the packaged product corresponding to said target food and beverage takeout consumer category includes:
accounting for food take-out packaging waste yield of the target food take-out consumer dishes based on:
the PW is used for indicating the yield of the food and beverage takeout packaging waste; i is used for indicating the packaged product; j is used for indicating the target food and drink take-out consumption category;weight information for indicating the packaged product i; />The information is used for indicating the use quantity of the packaged product i in the target food takeout consumption category j; />For indicating the probability of use of the packaged product i in the target take-away consumer category j.
10. A method of accounting for food and beverage takeaway packaging waste based on text mining as set forth in any one of claims 1 to 5, wherein said method further includes:
determining the regional food and beverage take-out consumption category corresponding to the target region according to the food and beverage take-out consumption category corresponding to the food and beverage take-out consumption data in the target region.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311466379.0A CN117195081B (en) | 2023-11-07 | 2023-11-07 | Food and beverage takeout package waste accounting method based on text mining |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311466379.0A CN117195081B (en) | 2023-11-07 | 2023-11-07 | Food and beverage takeout package waste accounting method based on text mining |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117195081A true CN117195081A (en) | 2023-12-08 |
CN117195081B CN117195081B (en) | 2024-02-27 |
Family
ID=88985387
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311466379.0A Active CN117195081B (en) | 2023-11-07 | 2023-11-07 | Food and beverage takeout package waste accounting method based on text mining |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117195081B (en) |
Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120303412A1 (en) * | 2010-11-24 | 2012-11-29 | Oren Etzioni | Price and model prediction system and method |
CN112241913A (en) * | 2020-12-07 | 2021-01-19 | 北京妙医佳健康科技集团有限公司 | Ordering method and device |
US11023814B1 (en) * | 2020-02-18 | 2021-06-01 | Coupang Corp. | Computerized systems and methods for product categorization using artificial intelligence |
US20220138423A1 (en) * | 2020-11-02 | 2022-05-05 | Chengdu Wang'an Technology Development Co., Ltd. | Deep learning based text classification |
CN114579720A (en) * | 2022-02-17 | 2022-06-03 | 中国长江三峡集团有限公司 | Hydropower project progress intelligent assessment method based on text mining |
CN115660292A (en) * | 2022-12-12 | 2023-01-31 | 广东工业大学 | Carbon emission monitoring method and equipment based on catering consumption data processing |
CN115809755A (en) * | 2023-02-02 | 2023-03-17 | 广东工业大学 | Carbon emission accounting method and equipment based on semantic recognition and storage medium |
US20230098811A1 (en) * | 2021-09-30 | 2023-03-30 | Toshiba Global Commerce Solutions Holdings Corporation | Computer vision grouping recognition system |
US20230267704A1 (en) * | 2020-09-04 | 2023-08-24 | Honestchoice Co.,Ltd | Method, device, and system ofquality classifying and selling packed meat based on image |
CN116757059A (en) * | 2023-04-27 | 2023-09-15 | 零碳产业运营中心(深圳)有限公司 | Carbon accounting method, device and related medium based on product type and process |
CN116824566A (en) * | 2023-05-25 | 2023-09-29 | 浪潮金融信息技术有限公司 | Production date identification method, system, equipment and medium for product package |
-
2023
- 2023-11-07 CN CN202311466379.0A patent/CN117195081B/en active Active
Patent Citations (11)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120303412A1 (en) * | 2010-11-24 | 2012-11-29 | Oren Etzioni | Price and model prediction system and method |
US11023814B1 (en) * | 2020-02-18 | 2021-06-01 | Coupang Corp. | Computerized systems and methods for product categorization using artificial intelligence |
US20230267704A1 (en) * | 2020-09-04 | 2023-08-24 | Honestchoice Co.,Ltd | Method, device, and system ofquality classifying and selling packed meat based on image |
US20220138423A1 (en) * | 2020-11-02 | 2022-05-05 | Chengdu Wang'an Technology Development Co., Ltd. | Deep learning based text classification |
CN112241913A (en) * | 2020-12-07 | 2021-01-19 | 北京妙医佳健康科技集团有限公司 | Ordering method and device |
US20230098811A1 (en) * | 2021-09-30 | 2023-03-30 | Toshiba Global Commerce Solutions Holdings Corporation | Computer vision grouping recognition system |
CN114579720A (en) * | 2022-02-17 | 2022-06-03 | 中国长江三峡集团有限公司 | Hydropower project progress intelligent assessment method based on text mining |
CN115660292A (en) * | 2022-12-12 | 2023-01-31 | 广东工业大学 | Carbon emission monitoring method and equipment based on catering consumption data processing |
CN115809755A (en) * | 2023-02-02 | 2023-03-17 | 广东工业大学 | Carbon emission accounting method and equipment based on semantic recognition and storage medium |
CN116757059A (en) * | 2023-04-27 | 2023-09-15 | 零碳产业运营中心(深圳)有限公司 | Carbon accounting method, device and related medium based on product type and process |
CN116824566A (en) * | 2023-05-25 | 2023-09-29 | 浪潮金融信息技术有限公司 | Production date identification method, system, equipment and medium for product package |
Non-Patent Citations (3)
Title |
---|
YA ZHOU ET AL: "Sharing tableware reduces waste generation, emissions and water consumption in China’s takeaway packaging waste dilemma", NATURE FOOD, pages 552 - 561 * |
周雅 等: "中国城市外卖包装垃圾空间异质性及影响因素", 环境经济研究, no. 1, pages 140 - 157 * |
罗紫倩: "基于生命周期评价法的 外卖食品包装能耗研究", 财经观察, vol. 37, no. 1, pages 111 - 124 * |
Also Published As
Publication number | Publication date |
---|---|
CN117195081B (en) | 2024-02-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Afzaal et al. | Tourism mobile app with aspect-based sentiment classification framework for tourist reviews | |
CN109447266B (en) | Agricultural scientific and technological service intelligent sorting method based on big data | |
CN106055661B (en) | More interest resource recommendations based on more Markov chain models | |
KR102227552B1 (en) | System for providing context awareness algorithm based restaurant sorting personalized service using review category | |
CN112765480B (en) | Information pushing method and device and computer readable storage medium | |
CN104834747A (en) | Short text classification method based on convolution neutral network | |
CN111400507B (en) | Entity matching method and device | |
US9069880B2 (en) | Prediction and isolation of patterns across datasets | |
US11379665B1 (en) | Document analysis architecture | |
CN101782998A (en) | Intelligent judging method for illegal on-line product information and system | |
CN108596637B (en) | Automatic E-commerce service problem discovery system | |
KR20230142754A (en) | Document analysis using model intersections | |
Baishya et al. | SAFER: sentiment analysis-based fake review detection in e-commerce using deep learning | |
CN111428007A (en) | Cross-platform based synchronous push feedback method | |
WO2021252419A1 (en) | Document analysis architecture | |
CN115129994A (en) | Commodity recommendation method and device, electronic equipment and readable storage medium | |
CN117195081B (en) | Food and beverage takeout package waste accounting method based on text mining | |
CN109670922A (en) | Books are worth discovery method on a kind of line based on composite character | |
CN117670439A (en) | Restaurant recommendation method and system based on user portrait | |
WO2024002216A1 (en) | Service problem attribution method and device | |
KR102358357B1 (en) | Estimating apparatus for market size, and control method thereof | |
Abdullahi et al. | Development of machine learning models for classification of tenders based on UNSPSC standard procurement taxonomy | |
CN115860283A (en) | Contribution degree prediction method and device based on portrait of knowledge worker | |
CN112989054B (en) | Text processing method and device | |
Sakib et al. | Assorted, archetypal and annotated two million (3a2m) cooking recipes dataset based on active learning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |