CN117195081B - 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 PDF

Info

Publication number
CN117195081B
CN117195081B CN202311466379.0A CN202311466379A CN117195081B CN 117195081 B CN117195081 B CN 117195081B CN 202311466379 A CN202311466379 A CN 202311466379A CN 117195081 B CN117195081 B CN 117195081B
Authority
CN
China
Prior art keywords
food
take
dish
target
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.)
Active
Application number
CN202311466379.0A
Other languages
Chinese (zh)
Other versions
CN117195081A (en
Inventor
周雅
刘秋丽
关爱群
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong University of Technology
Original Assignee
Guangdong University of Technology
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Guangdong University of Technology filed Critical Guangdong University of Technology
Priority to CN202311466379.0A priority Critical patent/CN117195081B/en
Publication of CN117195081A publication Critical patent/CN117195081A/en
Application granted granted Critical
Publication of CN117195081B publication Critical patent/CN117195081B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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 method 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

Food and beverage takeout package waste accounting method based on text mining
Technical Field
The application relates to the technical field of natural language processing, in particular to a food and beverage takeout package 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 packaged products, j is used for indicating target catering takeaway consumptionA 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.
According to the food take-out package waste accounting method based on text mining, the preset food classification model is trained by utilizing the acquired food names of various food take-out consumption categories, so that the trained food classification model is obtained, the acquired unstructured food take-out consumption data are converted into vectors based on the trained food classification model, text feature extraction is carried out based on a text mining technology, automatic and efficient classification of food take-out consumption dishes in the unstructured food take-out consumption data is achieved, and therefore package waste generated by food take-out consumption dishes of various food take-out consumption categories can be quantized accurately in real time, scientific support is provided for source reduction policy establishment of take-out package, and the method is favorable for carrying out fine management and source reduction of package waste and promoting green transformation and sustainable development of industry.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are needed in the description of the embodiments will be briefly described below.
Fig. 1 is a flowchart of steps of 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 flow chart of a method for accounting food and beverage takeout package waste based on text mining according to an embodiment of the present 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, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
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 present application. Fig. 2 is a flow chart of a method for accounting food and beverage takeout package waste based on text mining according to an embodiment of the present 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 type of take-out food consumption 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 vegetable name, i.e. when vector encoding is performed, each word in the vegetable name is used to encode, resulting in a corresponding vegetable 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.
The Query vector matrix and Key vector are described hereinThe matrix and Value vector matrix may be determined in accordance with the manner 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 consumption for take-out of foodLoss value of category and actual food and drink take-out consumption category,/->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 take-out package generated by the take-out dishes of chinese simple meal type and the take-out 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 method and the system can accurately and automatically quantify packaging waste generated by food take-out consumption dishes in various food take-out consumption categories in real time, provide scientific support for setting of source reduction policies of take-out packaging, are favorable for developing fine management and source reduction of the packaging waste, and promote green transformation and sustainable development of industries.
It is to be understood that the terminology used in the description of the present application 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 this 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 describing, and do not represent advantages or disadvantages of the embodiments. While the invention 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 invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (8)

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;
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 training of the preset dish classification model by using the dish name vector to obtain a trained dish classification model comprises the following steps:
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 based on:
wherein,for indicating the value of the target loss,/>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 output of 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 +.>The probability that the name of the dish belongs to the j-th food take-out consumption category is determined;
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.
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 set forth in claim 1, 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.
4. A method for accounting food and beverage takeout packaging waste based on text mining as set forth in claim 3, wherein said determining the result of calculating the degree of association corresponding to the element at each position in each of said dish name vectors based on the preset rule for calculating the degree of association according to the Query vector matrix, key vector matrix and Value vector matrix corresponding to each of said elements includes:
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.
5. The text-mining-based food take-out packaging waste accounting method of any one of claims 1-4, 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.
6. A method of calculating a food and beverage take-out packaging waste based on text mining according to any one of claims 1 to 4, 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.
7. The text-mining-based food and beverage takeout packaging waste accounting method as set forth in claim 6, wherein said accounting for food and beverage takeout packaging waste yield of said target food and beverage takeout consumer dishes based on said target food and beverage takeout consumer category's corresponding weight, number of used and probability of use, 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.
8. 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 4, 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.
CN202311466379.0A 2023-11-07 2023-11-07 Food and beverage takeout package waste accounting method based on text mining Active CN117195081B (en)

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 CN117195081A (en) 2023-12-08
CN117195081B true 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 (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
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

Family Cites Families (4)

* Cited by examiner, † Cited by third party
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
KR102236974B1 (en) * 2020-09-04 2021-04-06 주식회사 어니스트초이스 Method, device, and system ofquality classifying and selling packed meat based on image
CN112329836A (en) * 2020-11-02 2021-02-05 成都网安科技发展有限公司 Text classification method, device, server and storage medium based on deep learning
US11681997B2 (en) * 2021-09-30 2023-06-20 Toshiba Global Commerce Solutions Holdings Corporation Computer vision grouping recognition system

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11023814B1 (en) * 2020-02-18 2021-06-01 Coupang Corp. Computerized systems and methods for product categorization using artificial intelligence
CN112241913A (en) * 2020-12-07 2021-01-19 北京妙医佳健康科技集团有限公司 Ordering method and device
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)

* Cited by examiner, † Cited by third party
Title
Sharing tableware reduces waste generation, emissions and water consumption in China’s takeaway packaging waste dilemma;Ya Zhou et al;Nature Food;正文第552-561页 *
中国城市外卖包装垃圾空间异质性及影响因素;周雅 等;环境经济研究(第1期);第140-157页 *
基于生命周期评价法的 外卖食品包装能耗研究;罗紫倩;财经观察;第37卷(第1期);第111-124页 *

Also Published As

Publication number Publication date
CN117195081A (en) 2023-12-08

Similar Documents

Publication Publication Date Title
Afzaal et al. Tourism mobile app with aspect-based sentiment classification framework for tourist reviews
CN101620596B (en) Multi-document auto-abstracting method facing to inquiry
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
CN108733766A (en) A kind of data query method, apparatus and readable medium
KR102227552B1 (en) System for providing context awareness algorithm based restaurant sorting personalized service using review category
Özdağoğlu et al. Topic modelling-based decision framework for analysing digital voice of the customer
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
CN110955776A (en) Construction method of government affair text classification model
CN112765480A (en) Information pushing method and device and computer readable storage medium
WO2023020257A1 (en) Data prediction method and apparatus, and storage medium
CN115062732A (en) Resource sharing cooperation recommendation method and system based on big data user tag information
WO2021252419A1 (en) Document analysis architecture
CN113220872A (en) Document tag generation method and system and readable storage medium
CN111428007A (en) Cross-platform based synchronous push feedback method
CN117195081B (en) Food and beverage takeout package waste accounting method based on text mining
Chen et al. A probabilistic linguistic and dual trust network-based user collaborative filtering model
CN109670922A (en) Books are worth discovery method on a kind of line based on composite character
KR102358357B1 (en) Estimating apparatus for market size, and control method thereof
CN112989054B (en) Text processing method and device
Sakib et al. Assorted, archetypal and annotated two million (3a2m) cooking recipes dataset based on active learning
Abdullahi et al. Development of machine learning models for classification of tenders based on UNSPSC standard procurement taxonomy
CN107436919A (en) A kind of cloud manufacturer&#39;s standard service modeling method based on body and BOSS

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