CN115809755B - Carbon emission accounting method, equipment and storage medium based on semantic recognition - Google Patents

Carbon emission accounting method, equipment and storage medium based on semantic recognition Download PDF

Info

Publication number
CN115809755B
CN115809755B CN202310051264.9A CN202310051264A CN115809755B CN 115809755 B CN115809755 B CN 115809755B CN 202310051264 A CN202310051264 A CN 202310051264A CN 115809755 B CN115809755 B CN 115809755B
Authority
CN
China
Prior art keywords
food
text
carbon emission
dish
food material
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
CN202310051264.9A
Other languages
Chinese (zh)
Other versions
CN115809755A (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 CN202310051264.9A priority Critical patent/CN115809755B/en
Publication of CN115809755A publication Critical patent/CN115809755A/en
Application granted granted Critical
Publication of CN115809755B publication Critical patent/CN115809755B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/80Management or planning
    • Y02P90/84Greenhouse gas [GHG] management systems

Abstract

The application relates to the field of natural language processing and provides a carbon emission accounting method, equipment and a storage medium based on semantic recognition, wherein the application obtains food consumption data, and the food consumption data comprises dish text information; vectorizing the dish text information to obtain a first dish text vector; determining food materials and consumption of the food materials according to the first dish text vector and a preset second dish text vector based on a food material semantic recognition model; determining carbon emission data corresponding to food materials according to the food carbon emission database; therefore, the target carbon emission data of the food consumption data is determined, food materials in the food consumption data are not required to be analyzed manually, the labor cost is reduced, the consumption of the food materials and the food materials in the food consumption data is determined by using the first dish text vector and the preset second dish text vector, and the integrity of determining the food material information in the food consumption data is improved.

Description

Carbon emission accounting method, equipment and storage medium based on semantic recognition
Technical Field
The present disclosure relates to the field of natural language processing, and in particular, to a method, an apparatus, and a storage medium for carbon emission accounting based on semantic recognition.
Background
Food consumption has a significant impact on climate change, unbalanced food consumption structures such as: high meat consumption, low vegetable intake, high-energy food intake, etc., resulting in increased emission of greenhouse gases.
In the prior art, when resident food consumption data are counted, most of the resident food consumption data are obtained by means of on-site investigation, so that carbon emission of various food consumption is calculated, the labor cost is high, manually-confirmed data samples and representativeness are limited, the carbon emission of resident food consumption cannot be timely and comprehensively calculated, and hysteresis and accuracy of information are insufficient.
Disclosure of Invention
The application provides a carbon emission accounting method, equipment and a storage medium based on semantic recognition, which aim to reduce labor cost required for determining carbon emission data corresponding to food consumption data and improve efficiency and accuracy of carbon emission data calculation.
In a first aspect, the present application provides a carbon emission accounting method based on semantic recognition, the carbon emission accounting method based on semantic recognition including the steps of:
acquiring food consumption data, wherein the food consumption data comprises dish text information;
vectorizing the dish text information to obtain a first dish text vector;
determining food materials in the food consumption data and consumption of the food materials according to the first dish text vector and a plurality of preset second dish text vectors based on a food material semantic recognition model;
determining carbon emission data corresponding to the food materials according to a food carbon emission database;
and determining target carbon emission data of the food consumption data according to the carbon emission data corresponding to the food materials and the consumption amount corresponding to the food materials.
In a second aspect, the present application also provides a computer device comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program when executed by the processor implements the steps of the semantic recognition based carbon emission accounting method as described above.
In a third aspect, the present application also provides a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the semantic recognition based carbon emission accounting method as described above.
According to the carbon emission accounting method, equipment and storage medium based on semantic recognition, vectorization processing is carried out on food consumption data, after a first dish text vector corresponding to the food consumption data is obtained, the first dish text vector is input into a food material semantic recognition model, so that food materials and consumption of the food materials in the food consumption data are determined according to the first dish text vector and a preset second dish text vector, and therefore target carbon emission data of the food consumption data can be obtained after the carbon emission data corresponding to the food materials are determined, accounting of carbon emission of the food consumption data is achieved, and the food consumption data are processed by natural language processing, so that the food materials are determined without manually analyzing the food consumption data, and labor cost is reduced; meanwhile, the consumption of food materials and the consumption of the food materials in the food consumption data are determined by using the first dish text vector and the preset second dish text vector, so that the information integrity of determining the types of the food materials and the consumption of the food materials in the food consumption data is improved.
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 introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application.
FIG. 1 is a schematic flow chart of a method for accounting carbon emissions based on semantic recognition according to an embodiment of the present application;
FIG. 2 is a schematic diagram of a scenario of a semantic recognition-based carbon emission accounting method according to an embodiment of the present application;
fig. 3 is a schematic block diagram of a computer device 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 embodiment of the application provides a carbon emission accounting method based on semantic recognition, computer equipment and a computer readable storage medium. The carbon emission accounting method based on semantic recognition can be applied to terminal equipment, and the terminal equipment can be electronic equipment such as a tablet computer, a notebook computer, a desktop computer and the like. 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.
The application takes a carbon emission accounting method based on semantic recognition as an example and applies the carbon emission accounting method to terminal equipment, and some embodiments of the application are described in detail with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
The carbon emission accounting method based on semantic recognition can account and monitor carbon emission of resident food consumption, and can guide green transformation of resident food consumption by means of carbon label identification, a low-carbon menu, a carbon general mechanism and the like.
Referring to fig. 1, fig. 1 is a schematic flow chart of a carbon emission accounting method based on semantic recognition according to an embodiment of the present application.
As shown in fig. 1, the carbon emission accounting method based on semantic recognition includes steps S101 to S105.
Step S101, food consumption data is acquired, wherein the food consumption data comprises dish text information.
Optionally, the food consumption data of the user is obtained at the food ordering platform server, wherein the food consumption data is in a target time range, and dishes ordered by the user and the ordered number of the dishes are determined, so that the food consumption of the user in the time range is determined, and carbon emission caused by the food consumption data of the user in the time range is detected. It will be appreciated that the target time range is in units of one of year, month, and day, and the present application is not limited to the target time range.
The food ordering platform server can be connected to terminals of the catering institutions and terminals of the food enterprises, so that food consumption data corresponding to users can be obtained from the terminals of the catering institutions and/or the terminals of the food enterprises.
Optionally, the food consumption data of the residents in the target area are obtained through the web crawler.
It will be appreciated that the food consumption data includes a menu text message, such as a menu name, to enable the determination of the food material and the consumption of the food material in the food consumption data based on the menu text message.
The unstructured dish text information comprises unstructured dish text information, a data structure which is not uniform and clear for the unstructured dish text information exists in the matching process of the unstructured dish text information, and the unstructured dish text information has various expression modes, such as dialects, spoken expression modes and the like, and the unstructured dish text information is difficult to match in a general matching mode.
And step S102, vectorizing the dish text information to obtain a first dish text vector.
Optionally, based on the text coding model, vectorizing the dish text information to obtain a first dish text vector.
In other embodiments, word segmentation processing is performed on the dish text information based on a word segmentation network in the food material semantic recognition model to obtain a plurality of keywords, and encoding processing is performed on each obtained keyword based on an encoding network in the food material semantic recognition model to obtain a first dish text vector corresponding to the dish text information.
Step S103, based on a food material semantic recognition model, determining food materials in the food consumption data and consumption amounts of the food materials according to the first dish text vector and a preset second dish text vector.
The first dish text vector is input to the food material semantic recognition model, so that the food material semantic recognition model determines a second dish text vector matched with the first dish text vector according to the first dish text vector and the second dish text vector, and the food material and the consumption amount of the food material in the food consumption data are determined.
It should be noted that, the second menu text vector has a corresponding relationship with the target menu, so that the consumption of food materials and food materials in the food consumption data can be determined according to the first menu text vector, the second menu text vector and the target menu.
In some embodiments, determining food material and consumption of the food material in the food consumption data from the first dish text vector based on the food material semantic recognition model comprises: based on a similarity calculation network of the food material semantic recognition model, performing similarity calculation on the first dish text vector and a plurality of preset second dish text vectors, and determining a target second dish text vector; determining a target menu corresponding to the target second menu text vector based on a menu information network of the food material semantic recognition model; and determining food materials and consumption of the food materials in the food consumption data according to the mapping relation between the target menu and the food materials.
The first dish text vector is input to a similarity calculation network to calculate the similarity between the first dish text vector and a plurality of preset second dish text vectors, so as to determine a target second dish text vector, and a target menu corresponding to the target second dish text vector is determined in a menu information network, so that the consumption of food materials in food consumption data is obtained, wherein the similarity calculation is cosine similarity calculation.
It can be appreciated that the second dish text vector with the highest similarity to the first dish text vector is determined as the target second dish text vector.
The second menu text vector is determined according to menu information, and the menu information includes food materials, ingredients, consumption amounts of the food materials, and the like required for making the menu, so that the consumption amounts of the food materials and the food materials in the food consumption data can be determined by determining the consumption amounts of the food materials and the food materials corresponding to the target menu according to the target menu determined by the second menu text vector.
The second dish text vector is determined according to the sample menu information, and can be stored in a menu database, so that when the food material semantic model receives the food consumption data, the food material semantic model can acquire the second dish text vector through the menu database to determine a target second dish text vector corresponding to the first dish text vector.
In some embodiments, the method further comprises: acquiring sample menu information; and inputting the sample menu information into the food material semantic recognition model to obtain a plurality of second menu text vectors corresponding to the sample menu information.
It can be understood that the second menu text vector is determined according to the obtained sample menu information, so that the target second menu text vector is determined through similarity calculation between the second menu text vector and the first menu text vector, so that the target menu corresponding to the target second menu text vector can be determined, and the food materials and the consumption of the food materials contained in the food consumption data are determined according to the information corresponding to the target menu.
Optionally, the web crawler is used for acquiring a web menu to obtain sample menu information.
It should be noted that, the sample menu information at least includes a menu name, a food material contained in the menu, a consumption amount of the food material, a cooking mode of the menu, and the like, so that after determining the target second menu text vector corresponding to the first menu text vector and determining the target menu corresponding to the target second menu text vector, the consumption amount of the food material and the food material corresponding to the menu in the food consumption data can be determined, so as to promote the information integrity of the relevant information such as the food material in the determined food consumption data.
In some embodiments, inputting the sample recipe information into the food material semantic recognition model to obtain a plurality of second menu text vectors corresponding to the sample recipe information, including: word segmentation processing is carried out on the sample menu information based on a word segmentation network of the food material semantic recognition model, so that a plurality of text keywords are obtained; coding the text keywords based on a coding network of the food material semantic recognition model to obtain first coding vectors corresponding to the text keywords; weight calculation is carried out on the first coding vector and a preset first weight matrix based on a weight calculation network of the food material semantic recognition model, so that a second coding vector is obtained; and carrying out prediction processing on the second coding vector based on a second text vector determination network of the food material semantic recognition model to obtain a second text vector.
For example, after the sample menu information is input into the food material semantic recognition model, word segmentation processing is performed on the sample menu information, so as to obtain a plurality of text keywords. In some embodiments, the sample menu information includes dish information corresponding to a plurality of dishes, and the dish information corresponding to each dish is segmented to obtain a plurality of text keywords corresponding to the dish information of each dish.
In some embodiments, word segmentation is performed on the sample menu information to obtain a plurality of text keywords, including: word segmentation processing is carried out on the sample menu information, and at least a menu name keyword and a food material name keyword in a menu text are obtained; encoding the text keywords based on the encoding network of the food material semantic recognition model to obtain first encoding vectors corresponding to the text keywords, wherein the encoding network comprises the following steps: and encoding the vegetable name keywords and the food name keywords based on the encoding network of the food semantic recognition model to obtain first encoding vectors corresponding to the vegetable name keywords and first encoding vectors corresponding to the food name keywords.
It can be understood that in the process of word segmentation of the dish information corresponding to each dish, the dish name keywords are extracted to enhance the correlation between the dish name and the context such as the food name, the cooking mode and the like.
For example, after the word segmentation is performed on the dish information corresponding to the dish tomato-fried eggs, text keywords such as tomato-fried eggs, tomatoes, needs, preparations, eggs, tomatoes, peanut oil and the like are obtained.
For example, after obtaining a plurality of text keywords, each text keyword is subjected to coding processing to obtain a first coding vector, for example, the first coding vector corresponding to the tomato fried chicken egg is [1,0,0,0,0,0,0,0].
After obtaining the first coding vector corresponding to the text keyword, the weight calculation is performed on the first coding vector by using a preset first weight matrix to obtain a second coding vector. In some embodiments, the preset first weight matrix is determined by modeling a document after the menu information is segmented according to a TF-IDF model; in other embodiments, the preset first weight matrix is determined according to the manual labeling information, where the preset first weight matrix is, for example, W [ v×n ], and when the first coding vector corresponding to the text keyword is [1×v ], a second coding vector with a size of [1×n ] is obtained, and it can be understood that the second coding vector is embedded information (embedding) corresponding to each text keyword.
Illustratively, after the second encoded vector is obtained, a prediction process is performed on the second encoded vector to obtain a second text vector.
In some embodiments, performing prediction processing on the second encoded vector to obtain a second text vector includes: determining a hidden layer vector corresponding to the second coding vector; carrying out weight calculation on the hidden layer vector and a preset second weight matrix to obtain a target vector; determining probability distribution results of each dimension in the target vector based on the activation function; and determining a second text vector according to the target vector and the probability distribution result.
The method comprises the steps of averaging a second coding vector to obtain a hidden layer vector, carrying out vector multiplication on the hidden layer vector and a preset second weight matrix W' [ N ] V ] to obtain a target vector with the size of [1 x V ], calculating the target vector by using an activation function, determining a V-dim probability distribution result in the target vector, and understanding that in the process of determining the second text vector, a first coding vector corresponding to each keyword determined according to dish information is ont-hot coding, namely, in the first coding vector, each dimension represents a word, then after the V-dim probability distribution result of the target vector is obtained, the word indicated by the index (index) with the largest probability is the predicted keyword, so that a second text vector can be determined, and a target menu corresponding to dishes contained in food consumption data is determined according to the first text vector and the second text vector, in order to manufacture the dishes and dishes with the required by the target text, namely, the dishes with the required food names being limited, and the dishes can be manufactured by the method, and the dishes with the limited dishes can be manufactured by the method, and the limited dishes can be avoided when the dishes with the limited dishes are manufactured by the limited dishes, and the limited dishes can be manufactured by the limited dishes.
It should be noted that the above procedure may be implemented through a skip-gram framework.
In a specific implementation process, as shown in fig. 2, fig. 2 is a flowchart of a carbon emission method based on food consumption data processing according to an embodiment of the present application. Analyzing the input sample menu information by the food material semantic recognition model, obtaining a plurality of second menu text vectors, and storing the second menu text vectors into a menu database to serve as preset second menu text vectors; after the food consumption data of the user is obtained, determining a target menu according to the first dish text vector determined according to the food consumption data and the preset second dish text vector, so as to determine the consumption of food materials and corresponding food materials in the food consumption data according to the target menu, for example, when determining the first dish text vector used for indicating 'home tomato stir-fried egg' in the food consumption data, determining the second dish text vector used for indicating 'tomato stir-fried egg' according to the method provided by the method, so as to determine the target menu as 'tomato stir-fried egg', and determining the consumption of food materials and food materials in the food consumption data according to related information such as 120g of required eggs, 100g of tomatoes, 20g of edible oil, 3g of salt and the like in the target menu, wherein the consumption of food materials corresponding to each home tomato stir-fried egg in the food consumption data comprises eggs, tomatoes, edible oil and salt, and simultaneously, the consumption of food materials in each home tomato stir-fried egg dish is the same as the consumption of food materials contained in the target menu, so as to realize the determination of the consumption of food materials and food materials in the food consumption data.
Step S104, determining carbon emission data corresponding to the food materials according to a food carbon emission database.
It should be noted that the carbon emissions mentioned in the present application are life cycle carbon emissions of the food material, that is, carbon emissions caused during life cycle of the production, transportation, consumption, etc. of the food material are included.
Optionally, the existing food carbon emission database (double emission) is adjusted by acquiring food carbon emission literature information and corresponding investigation information to construct a food carbon emission database, so that carbon emission data corresponding to food materials in the food consumption data can be determined. Taking the food material tomatoes as an example, the carbon emission data of the tomatoes stored in the food carbon emission database can be shown in the carbon emission data table corresponding to each stage of the life cycle of the tomatoes.
Carbon emission data table corresponding to each stage of life cycle of tomatoes
Production phase Post-mining treatment stage Transport retail phase Consumption stage
0.14 kgCO2e/kg 0.19 kgCO2e/kg 0.45 kgCO2e/kg 2.3kgCO2e/kg
Wherein kgCO2e/kg is used to indicate the corresponding units of carbon emission factor.
And constructing a food carbon emission database according to carbon emission data caused by food materials determined by investigation information of different areas in different processing stages of each area, so as to improve the reliability of the carbon emission data of the food materials, thereby improving the reliability of target carbon emission data of food consumption data.
Step S105, determining target carbon emission data of the food consumption data according to the carbon emission data corresponding to the food materials and the consumption amount corresponding to the food materials.
For example, after determining the food material, the carbon emission data corresponding to the food material, and the consumption amount corresponding to the food material included in the food consumption data, the target carbon emission data of the food consumption data can be determined according to the carbon emission data corresponding to the food material and the consumption amount corresponding to the food material.
It can be understood that the food consumption data further includes a number of orders of dishes, and when determining the consumption corresponding to the food material, the consumption corresponding to the food material is determined according to the number of orders and consumption information required by the food material indicated by the menu, so as to determine the target emission data according to the carbon emission data corresponding to the food material and the consumption corresponding to the food material. For example, the consumption of tomatoes per serving of tomato fried egg dishes is 100g, and if the food consumption data includes a number of orders for tomato fried egg dishes of 10, the consumption of tomatoes in the food consumption data is 1000g.
The dishes, the number of ordered dishes, and the consumption amount of the food indicated by the recipe are all exemplified, and the dishes, the number of ordered dishes, and the consumption amount of the food indicated by the recipe are not limited in the present application.
In some embodiments, determining target carbon emission data for food consumption data from the carbon emission data for food material and the consumption amount for food material comprises: and multiplying the carbon emission data corresponding to the food material and the consumption corresponding to the food material to obtain target carbon emission data of the food consumption data.
For example, the product calculation process of the carbon emission data corresponding to the food material and the consumption amount corresponding to the food material may be as follows:
Figure SMS_1
wherein CF represents target carbon emission data of food consumption data, i represents food material type, and j represents different life cycle phases.
Figure SMS_2
Represents the carbon emission factor (unit: kgCO2 e/kg) of food i in j-phase, for example>
Figure SMS_3
Representing the mass of food i at stage j (unit: kg).
It will be appreciated that different lifecycle stages are used to indicate that the food material is in different processes, such as a generation stage, a shipping retail stage, etc.
In a specific implementation process, taking the order number of dishes of food consumption data, namely tomato fried eggs, as 10, and taking 100g of tomatoes required for each part of tomato fried eggs in a target recipe as an example, the calculation process of target carbon emission data corresponding to tomatoes in the food consumption data is shown as the following formula:
(0.14kgCO2e/kg+0.19kgCO2e/kg+0.45kgCO2e/kg+2.3kgCO2e/kg)×0.1kg×10
=3.08kgCO2e。
according to the carbon emission accounting method based on semantic recognition, the first dish text vector is determined through the food consumption data, so that similarity calculation is carried out between the first dish text vector and the preset second dish text vector, and the target second dish text vector is determined, so that a corresponding target menu is determined according to the target second dish text vector, consumption of corresponding food materials and food materials is determined in the target menu, consumption of the corresponding food materials and the food materials is determined according to the consumption of the food materials determined by the target menu, the food consumption data is processed through natural language, food materials and corresponding consumption in the food consumption data are not required to be confirmed manually, simultaneously, dishes contained in the food consumption data are determined by the first dish text vector, and the target second dish text is determined by the second dish text vector and the first dish text vector stored in the menu database, so that the target menu is determined, and the consumption of the food materials and the food materials in the food consumption data can be determined based on the information contained in the target menu, the consumption of the food materials and the food materials can be determined, the consumption of the food materials in the determined food materials and the food materials can be prevented from being more completely due to the fact that the food materials in the food consumption data, the food materials in the food consumption data can not be completely determined, the food ingredients can be prevented from being completely determined according to the consumption information, and the food ingredients can not be completely determined, and the food ingredients can be prevented from being completely determined, and the food consumption is prevented from being completely determined.
In other usage scenarios, please continue to refer to fig. 2, after determining the food material and the consumption amount of the food material of the food consumption data, the nutritional data ingested by the user based on the food consumption data can also be determined according to the consumption amount of the food material and the consumption amount of the food material, so that personalized menu recommendation can be performed on the user according to the nutritional data ingested by the user and the target carbon emission data of the food consumption data, and the nutritional ingestion of the user is more balanced when the carbon emission of the food consumption is reduced.
In some embodiments, the method further comprises: determining food materials, consumption of the food materials and a mapping relation between the food materials and the nutrition data according to the food consumption data, and determining the nutrition data corresponding to the food consumption data; determining target dish information according to the target carbon emission data and the nutrition data; and determining a target user according to the food consumption data, and recommending target dish information to the target user.
By way of example, by the mapping relationship of the food material and the nutritional data, it is also possible to determine nutritional data ingested by the user based on the food consumption data based on the processing of the food consumption data.
Wherein, the nutritional data corresponding to the determined food consumption data can be represented by the following formula:
Figure SMS_4
wherein j is used to indicate the type of nutrition (e.g., protein, fat);
Figure SMS_5
content (unit: g) for indicating the j nutrition type in the food consumption data; FW is used for indicating the type of food material, i indicates the consumption amount (unit: g) of the food material; r% is used to indicate the edible content of food material i,>
Figure SMS_6
for indicating the content of the j nutrition type in 100g of food material i.
It can be appreciated that, by determining the nutritional data of the food consumption data according to the above formula, and determining the target dish information according to the target carbon emission data, for example, when it is determined that the nutritional data does not meet the preset intake nutritional condition and the target carbon emission data does not meet the carbon emission condition, the dish is adjusted based on the food consumption data of the user, so as to perform dish recommendation, so as to send the target dish information to the target user, thereby realizing the effects of adjusting the dietary structure of the user and reducing the carbon emission.
Referring to fig. 3, fig. 3 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a server or a terminal.
As shown in fig. 3, the computer device includes a processor, a memory, and a network interface connected by a system bus, wherein the memory may include a storage medium and an internal memory.
The storage medium may store an operating system and a computer program. The computer program comprises program instructions that, when executed, cause the processor to perform any of a number of semantic recognition based carbon emission accounting methods.
The processor is used to provide computing and control capabilities to support the operation of the entire computer device.
The internal memory provides an environment for the execution of a computer program in a storage medium that, when executed by a processor, causes the processor to perform any of a number of semantic recognition-based carbon emission accounting methods.
The network interface is used for network communication such as transmitting assigned tasks and the like. It will be appreciated by those skilled in the art that the structure shown in fig. 3 is merely a block diagram of some of the structures associated with the present application and is not limiting of the computer device to which the present application may be applied, and that a particular computer device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
It should be appreciated that the processor may be a central processing unit (Central Processing Unit, CPU), but may also be other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field-programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, or the like. Wherein the general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein in one embodiment the processor is configured to run a computer program stored in the memory to implement the steps of:
acquiring food consumption data, wherein the food consumption data comprises dish text information;
vectorizing the dish text information to obtain a first dish text vector;
determining food materials in the food consumption data and consumption of the food materials according to the first dish text vector and a plurality of preset second dish text vectors based on a food material semantic recognition model;
determining carbon emission data corresponding to the food materials according to a food carbon emission database;
and determining target carbon emission data of the food consumption data according to the carbon emission data corresponding to the food materials and the consumption amount corresponding to the food materials.
In one embodiment, the processor is configured to, when implementing a food material semantic recognition model, determine food material in the food consumption data and a consumption amount of the food material according to the first dish text vector, implement:
based on a similarity calculation network of the food material semantic recognition model, performing similarity calculation on the first dish text vector and a plurality of preset second dish text vectors, and determining a target second dish text vector;
determining a target menu corresponding to the target second menu text vector based on a menu information network of the food material semantic recognition model; and determining food materials in the food consumption data and the consumption amount of the food materials according to the mapping relation between the target menu and the food materials.
In one embodiment, the processor, when implementing the target carbon emission data for determining the food consumption data from the carbon emission data for the food material and the consumption amount for the food material, is configured to implement:
and multiplying the carbon emission data corresponding to the food material and the consumption corresponding to the food material to obtain target carbon emission data of the food consumption data.
In one embodiment, the processor, when implementing the semantic recognition based carbon emission accounting method, is configured to implement:
determining nutritional data corresponding to the food consumption data according to the food material determined by the food consumption data, the consumption of the food material and the mapping relation between the food material and the nutritional data;
determining target dish information according to the target carbon emission data and the nutrition data;
determining a target user from the food consumption data;
and recommending the target dish information to a target user.
In one embodiment, the processor, when implementing the semantic recognition based carbon emission accounting method, is configured to implement:
acquiring sample menu information;
and inputting the sample menu information into a food material semantic recognition model to obtain a plurality of second menu text vectors corresponding to the sample menu information.
In one embodiment, when the processor inputs the sample menu information into the food material semantic recognition model to obtain a plurality of second menu text vectors corresponding to the sample menu information, the processor is configured to implement:
based on the word segmentation network of the food material semantic recognition model, carrying out word segmentation processing on the sample menu information to obtain a plurality of text keywords;
based on the coding network of the food material semantic recognition model, coding the text keywords to obtain first coding vectors corresponding to the text keywords;
performing weight calculation on the first coding vector and a preset first weight matrix based on a weight calculation network of the food material semantic recognition model to obtain a second coding vector;
and carrying out prediction processing on the second coding vector based on a second text vector determination network of the food material semantic recognition model to obtain a second text vector.
In one embodiment, the processor is configured to, when implementing prediction processing on the second encoded vector to obtain a second text vector, implement:
determining a hidden layer vector corresponding to the second coding vector;
carrying out weight calculation on the hidden layer vector and a preset second weight matrix to obtain a target vector;
determining probability distribution results of each dimension in the target vector based on an activation function;
and determining the second text vector according to the target vector and the probability distribution result.
In one embodiment, the processor is configured to, when implementing word segmentation processing on the sample recipe information to obtain a plurality of text keywords, implement:
performing word segmentation processing on the sample menu information to at least obtain a menu name keyword and a food name keyword in a menu text;
the processor is used for realizing when realizing a coding network based on the food material semantic recognition model and coding the text keywords to obtain a first coding vector corresponding to the text keywords:
and based on the coding network of the food material semantic recognition model, coding the dish name keywords and the food material name keywords to obtain first coding vectors corresponding to the dish name keywords and first coding vectors corresponding to the food material name keywords.
It should be noted that, for convenience and brevity of description, the specific working process of the computer device described above may refer to the corresponding process in the foregoing embodiment of the carbon emission accounting method based on semantic recognition, which is not described herein again.
Embodiments of the present application also provide a computer readable storage medium having a computer program stored thereon, where the computer program includes program instructions, and where the method implemented when the program instructions are executed may refer to various embodiments of the method for calculating carbon emissions based on semantic recognition of the present application.
The computer readable storage medium may be an internal storage unit of the computer device according to the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, which are provided on the computer device.
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 (9)

1. A carbon emission accounting method based on semantic recognition, comprising:
acquiring food consumption data, wherein the food consumption data comprises dish text information;
vectorizing the dish text information to obtain a first dish text vector;
determining food materials in the food consumption data and consumption of the food materials according to the first dish text vector and a plurality of preset second dish text vectors based on a food material semantic recognition model;
determining carbon emission data corresponding to the food materials according to a food carbon emission database;
determining target carbon emission data of the food consumption data according to the carbon emission data corresponding to the food materials and the consumption amount corresponding to the food materials;
the determining, based on the food material semantic recognition model, the food material in the food consumption data and the consumption amount of the food material according to the first dish text vector and a plurality of preset second dish text vectors includes:
determining at least one menu corresponding to the food consumption data according to the first menu text vector and a plurality of preset second menu text vectors stored in a menu knowledge base based on a food material semantic recognition model, wherein the menu comprises at least one food material, the consumption amount of the food material, at least one ingredient and the consumption amount of the ingredient;
the determining target carbon emission data of the food consumption data according to the carbon emission data corresponding to the food material and the consumption amount corresponding to the food material includes:
determining target carbon emission data of the food consumption data according to the carbon emission data corresponding to the food material, the consumption amount corresponding to the food material, the carbon emission data corresponding to the ingredients and the consumption amount corresponding to the ingredients;
the method further comprises the steps of:
determining nutritional data corresponding to the food consumption data according to the food material, the consumption corresponding to the food material, the ingredients and the consumption corresponding to the ingredients;
determining target dish information according to the target carbon emission data and the corresponding nutrition data corresponding to the food consumption data;
and determining a target user according to the food consumption data, and recommending the target dish information to the target user.
2. The semantic recognition-based carbon emission accounting method of claim 1, wherein the determining food materials in the food consumption data and the consumption amount of the food materials from the first dish text vector based on a food material semantic recognition model comprises:
based on a similarity calculation network of the food material semantic recognition model, performing similarity calculation on the first dish text vector and a plurality of preset second dish text vectors, and determining a target second dish text vector;
determining a target menu corresponding to the target second menu text vector based on a menu information network of the food material semantic recognition model; and determining food materials in the food consumption data and the consumption amount of the food materials according to the mapping relation between the target menu and the food materials.
3. The semantic recognition-based carbon emission accounting method of claim 1, wherein the determining target carbon emission data of the food consumption data according to the carbon emission data corresponding to the food material and the consumption amount corresponding to the food material comprises:
and multiplying the carbon emission data corresponding to the food material and the consumption corresponding to the food material to obtain target carbon emission data of the food consumption data.
4. A semantic recognition based carbon emission accounting method according to any one of claims 1-3, wherein the method further comprises:
acquiring sample menu information;
and inputting the sample menu information into a food material semantic recognition model to obtain a plurality of second menu text vectors corresponding to the sample menu information.
5. The semantic recognition-based carbon emission accounting method of claim 4, wherein the inputting the sample recipe information into a food material semantic recognition model to obtain a plurality of second menu text vectors corresponding to the sample recipe information comprises:
based on the word segmentation network of the food material semantic recognition model, carrying out word segmentation processing on the sample menu information to obtain a plurality of text keywords;
based on the coding network of the food material semantic recognition model, coding the text keywords to obtain first coding vectors corresponding to the text keywords;
performing weight calculation on the first coding vector and a preset first weight matrix based on a weight calculation network of the food material semantic recognition model to obtain a second coding vector;
and carrying out prediction processing on the second coding vector based on a second text vector determination network of the food material semantic recognition model to obtain a second text vector.
6. The semantic recognition-based carbon emission accounting method of claim 5, wherein the performing prediction processing on the second encoded vector to obtain a second text vector comprises:
determining a hidden layer vector corresponding to the second coding vector;
carrying out weight calculation on the hidden layer vector and a preset second weight matrix to obtain a target vector;
determining probability distribution results of each dimension in the target vector based on an activation function;
and determining the second text vector according to the target vector and the probability distribution result.
7. The semantic recognition-based carbon emission accounting method of claim 5, wherein the word segmentation processing is performed on the sample recipe information to obtain a plurality of text keywords, comprising:
performing word segmentation processing on the sample menu information to at least obtain a menu name keyword and a food name keyword in a menu text;
the coding network based on the food material semantic recognition model codes the text keywords to obtain first coding vectors corresponding to the text keywords, and the coding network comprises:
and based on the coding network of the food material semantic recognition model, coding the dish name keywords and the food material name keywords to obtain first coding vectors corresponding to the dish name keywords and first coding vectors corresponding to the food material name keywords.
8. A computer device, characterized in that it comprises a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein the computer program, when executed by the processor, implements the steps of the semantic recognition based carbon emission accounting method according to any one of claims 1 to 7.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium has stored thereon a computer program, wherein the computer program, when executed by a processor, implements the steps of the semantic recognition based carbon emission accounting method according to any one of claims 1 to 7.
CN202310051264.9A 2023-02-02 2023-02-02 Carbon emission accounting method, equipment and storage medium based on semantic recognition Active CN115809755B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310051264.9A CN115809755B (en) 2023-02-02 2023-02-02 Carbon emission accounting method, equipment and storage medium based on semantic recognition

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310051264.9A CN115809755B (en) 2023-02-02 2023-02-02 Carbon emission accounting method, equipment and storage medium based on semantic recognition

Publications (2)

Publication Number Publication Date
CN115809755A CN115809755A (en) 2023-03-17
CN115809755B true CN115809755B (en) 2023-06-27

Family

ID=85487339

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310051264.9A Active CN115809755B (en) 2023-02-02 2023-02-02 Carbon emission accounting method, equipment and storage medium based on semantic recognition

Country Status (1)

Country Link
CN (1) CN115809755B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117195081B (en) * 2023-11-07 2024-02-27 广东工业大学 Food and beverage takeout package waste accounting method based on text mining

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109325132A (en) * 2018-12-11 2019-02-12 平安科技(深圳)有限公司 Expertise recommended method, device, computer equipment and storage medium
AU2021106485A4 (en) * 2020-10-20 2021-11-04 Discovery Limited A computer implemented system for measuring greenhouse gas emitting activities of a user

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110738051A (en) * 2019-09-17 2020-01-31 北京三快在线科技有限公司 Dish name entity identification method and device, electronic equipment and storage medium
CN111738541A (en) * 2020-05-08 2020-10-02 北京三快在线科技有限公司 Method and device for acquiring store food quality information and electronic equipment
CN112528654A (en) * 2020-12-15 2021-03-19 作业帮教育科技(北京)有限公司 Natural language processing method and device and electronic equipment
CN113204618A (en) * 2021-04-30 2021-08-03 平安科技(深圳)有限公司 Information identification method, device and equipment based on semantic enhancement and storage medium
CN115660292B (en) * 2022-12-12 2023-08-01 广东工业大学 Carbon emission monitoring method and equipment based on catering consumption data processing

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109325132A (en) * 2018-12-11 2019-02-12 平安科技(深圳)有限公司 Expertise recommended method, device, computer equipment and storage medium
AU2021106485A4 (en) * 2020-10-20 2021-11-04 Discovery Limited A computer implemented system for measuring greenhouse gas emitting activities of a user

Also Published As

Publication number Publication date
CN115809755A (en) 2023-03-17

Similar Documents

Publication Publication Date Title
US8249954B2 (en) Third-party certification using enhanced claim validation
US9811593B2 (en) Cooking recipe information providing device, cooking recipe information providing method, program, and information storage medium
CN109829108B (en) Information recommendation method and device, electronic equipment and readable storage medium
CN110580278B (en) Personalized search method, system, equipment and storage medium according to user portraits
CN110196904B (en) Method and device for acquiring recommendation information and computer readable storage medium
WO2016107326A1 (en) Search recommending method and device based on search terms
CN111400507B (en) Entity matching method and device
CN108038161A (en) Information recommendation method, device and computing device based on photograph album
CN109345317B (en) Method and device for determining taste preference information of user
CN115809755B (en) Carbon emission accounting method, equipment and storage medium based on semantic recognition
CN115660292B (en) Carbon emission monitoring method and equipment based on catering consumption data processing
CN106452809B (en) Data processing method and device
CN111737473B (en) Text classification method, device and equipment
CN110851571A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN110929764A (en) Picture auditing method and device, electronic equipment and storage medium
CN113220657A (en) Data processing method and device and computer equipment
CN112488781A (en) Search recommendation method and device, electronic equipment and readable storage medium
CN110502623A (en) Intelligent answer method, electronic device, computer equipment and readable storage medium storing program for executing
CN113935401A (en) Article information processing method, article information processing device, article information processing server and storage medium
CN109472025B (en) Dish name extraction method and device
CN114840759A (en) Recommendation method and device and computer readable storage medium
EP3929931A1 (en) Dish nutritional value estimation
CN113821641A (en) Method, device, equipment and storage medium for medicine classification based on weight distribution
CN111444345A (en) Dish name classification method and device
CN110766512A (en) Order processing method and device, electronic equipment and storage medium

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