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

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

Info

Publication number
CN115809755A
CN115809755A CN202310051264.9A CN202310051264A CN115809755A CN 115809755 A CN115809755 A CN 115809755A CN 202310051264 A CN202310051264 A CN 202310051264A CN 115809755 A CN115809755 A CN 115809755A
Authority
CN
China
Prior art keywords
food
text
carbon emission
vector
semantic recognition
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310051264.9A
Other languages
Chinese (zh)
Other versions
CN115809755B (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

Landscapes

  • Medical Treatment And Welfare Office Work (AREA)

Abstract

The application relates to the field of natural language processing, and provides a carbon emission accounting method based on semantic recognition, equipment and a storage medium, wherein food consumption data are obtained and comprise 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 the food material semantic recognition model; determining carbon emission data corresponding to food materials according to a food carbon emission database; therefore, the target carbon emission data of the food consumption data is determined, the food materials in the food consumption data do not need to be analyzed manually, the labor cost is reduced, the food materials in the food consumption data and the consumption of the food materials are determined by using the first menu text vector and the preset second menu text vector, and the completeness of the food material information in the determined food consumption data is improved.

Description

Carbon emission accounting method and equipment based on semantic recognition and storage medium
Technical Field
The present application relates to the field of natural language processing technologies, 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 patterns such as: high consumption of meat, low intake of vegetables, high intake of high-energy foods, etc., resulting in increased emission of greenhouse gases.
In the prior art, when the resident food consumption data are counted, the consumption amount of dishes and food materials contained in the dishes are mostly obtained by means of on-site research, so that the carbon emission of various food consumptions is calculated, the labor cost is high, the data samples and representativeness of manual confirmation are limited, the carbon emission of the resident food consumption cannot be timely and comprehensively calculated, and the information has the defects of hysteresis and accuracy.
Disclosure of Invention
The application provides a carbon emission accounting method and device based on semantic recognition and a storage medium, and aims to reduce the labor cost required for determining carbon emission data corresponding to food consumption data and improve the 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, including the following steps:
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 on the basis of a food material semantic recognition model;
determining carbon emission data corresponding to the food material 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 material and the consumption corresponding to the food material.
In a second aspect, the present application further 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 method for carbon emission accounting based on semantic recognition as described above.
In a third aspect, the present application further provides a computer readable storage medium, on which a computer program is stored, wherein the computer program, when executed by a processor, implements the steps of the carbon emission accounting method based on semantic recognition as described above.
The application provides a carbon emission accounting method, equipment and a storage medium based on semantic recognition, through vectorization processing of 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, food materials in the food consumption data and consumption of the food materials 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, the carbon emission accounting of the food consumption data is achieved, natural language processing is utilized to process the food consumption data, manual analysis of the food consumption data is not needed to determine the food materials, and labor cost is reduced; meanwhile, the food materials and the consumption of the food materials in the food consumption data are determined by using the first menu text vector and the preset second menu text vector, and the information integrity of determining the food material types 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 used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the description below are some embodiments of the present application.
FIG. 1 is a schematic flow chart illustrating steps of a semantic recognition-based carbon emission accounting method according to an embodiment of the present application;
FIG. 2 is a schematic diagram illustrating a scenario of a method for carbon emission accounting based on semantic recognition according to an embodiment of the present application;
fig. 3 is a block diagram illustrating a structure of a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The flowcharts shown in the figures are illustrative only and do not necessarily include all of the contents and operations/steps, nor do they necessarily have to be performed in the order described. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution order may be changed according to the actual situation.
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 and a desktop computer. The method can also be applied to a server, which can be an independent server, or a cloud server providing basic cloud computing services such as cloud service, a cloud database, cloud computing, a cloud function, cloud storage, network service, cloud communication, middleware service, domain name service, security service, content Delivery Network (CDN), big data and artificial intelligence platform, and the like.
The present application takes an example of applying a carbon emission accounting method based on semantic recognition to a terminal device, and some embodiments of the present application are described in detail with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
The carbon emission accounting method based on semantic recognition can be used for accounting and monitoring the carbon emission consumed by the residents, and green conversion of the resident food consumption can be guided by means of carbon label identification, low-carbon menus, carbon popularization mechanisms and the like.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating a carbon emission accounting method based on semantic recognition according to an embodiment of the present disclosure.
As shown in fig. 1, the carbon emission accounting method based on semantic recognition includes steps S101 to S105.
Step S101, food consumption data are obtained, and the food consumption data comprise dish text information.
Optionally, the food consumption data of the user is obtained at the food ordering platform server, where the food consumption data is within a target time range, the dishes ordered by the user and the ordered number of the dishes are determined to determine the food consumption of the user within the time range, and thus the carbon emission caused by the food consumption data of the user within the time range is detected. It is understood that the target time range is in units of one of year, month and day, and the target time range is not limited in the present application.
The food ordering platform server can be connected to terminals of catering mechanisms and terminals of food enterprises so as to acquire food consumption data corresponding to users from the terminals of the catering mechanisms and/or the terminals of the food enterprises.
Optionally, the food consumption data of the residents in the target area is obtained through a web crawler.
It is understood that the food consumption data includes dish text information, such as a dish name, so that the food material and the consumption amount of the food material in the food consumption data can be determined according to the dish text information.
Exemplarily, the dish text information comprises unstructured dish text information, the unstructured dish text information has a unified and clear data structure in the matching process of the unstructured dish text information, the unstructured dish text information has multiple expression modes, for example, problems of dialects, spoken expression modes and the like in various places, and the unstructured dish text information is difficult to match through 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, performing vectorization processing on the dish text information to obtain a first dish text vector.
In other embodiments, the dish text information is subjected to word segmentation processing based on a word segmentation network in the food material semantic recognition model to obtain a plurality of keywords, and the obtained keywords are subjected to coding processing based on a coding network in the food material semantic recognition model to obtain a first dish text vector corresponding to the dish text information.
Step S103, determining food materials in the food consumption data 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.
Illustratively, a first dish text vector is input into 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, thereby determining the food material and the consumption of the food material in the food consumption data.
It should be noted that the second menu text vector and the target menu have a corresponding relationship, so that the food material and the consumption amount of the food material 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 the 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: on the basis of a similarity calculation network of a food material semantic recognition model, similarity calculation is carried out on a first dish text vector and a plurality of preset second dish text vectors, and a target second dish text vector is determined; 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 the food materials and the consumption of the food materials in the food consumption data according to the mapping relation between the target menu and the food materials.
Exemplarily, a first menu text vector is input to a similarity calculation network to perform similarity calculation on the first menu text vector and a plurality of preset second menu text vectors, so as to determine a target second menu text vector, and a target menu corresponding to the target second menu text vector is determined in a menu information network to obtain food materials and consumption of the food materials in the food consumption data, wherein the similarity calculation is cosine similarity calculation.
It can be understood that the second menu text vector having the highest similarity to the first menu text vector is determined as the target second menu text vector.
The second menu text vector is determined according to the menu information, and the menu information includes food materials, ingredients, consumption of the food materials and the like required for making the menu, so that the consumption of the food materials and the consumption of the food materials corresponding to the target menu can be determined according to the target menu determined according to the second menu text vector, and the food materials and the consumption of the food materials in the food consumption data can be determined.
Illustratively, the second menu text vector is determined according to the sample menu information and can be stored in the menu database, so that when the food material semantic model receives the food consumption data, the food material semantic model can obtain the second menu text vector through the menu database to determine a target second menu text vector corresponding to the first menu 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 a second menu text vector is determined according to the obtained sample menu information, and a target second menu text vector is determined through similarity calculation between the second menu text vector and the first menu text vector, so that a target menu corresponding to the target second menu text vector can be determined, and food materials contained in the food consumption data and consumption of the food materials are determined according to information corresponding to the target menu.
Optionally, the network menu is obtained through a web crawler to obtain sample menu information.
It should be noted that the sample recipe information at least includes a name of a dish, a food material included in the dish, a consumption amount of the food material, a cooking manner of the dish, and the like, and therefore, after the target second dish text vector corresponding to the first dish text vector is determined and the target recipe corresponding to the target second dish text vector is determined, the food material corresponding to the dish in the food consumption data and the consumption amount of the food material can be determined, so that the information integrity of the relevant information such as the food material in the food consumption data is improved.
In some embodiments, 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, includes: carrying out word segmentation processing on the sample menu information based on a word segmentation network of the food material semantic recognition model to obtain a plurality of text keywords; coding the text keywords based on a coding network of a food material semantic recognition model to obtain first coding vectors corresponding to the text keywords; based on a weight calculation network of the food material semantic recognition model, carrying out weight calculation on the first coding vector and a preset first weight matrix to obtain a second coding vector; and determining a network based on a second text vector of the food material semantic recognition model, and performing prediction processing on the second encoding vector to obtain a second text vector.
Exemplarily, after the sample menu information is input into the food material semantic recognition model, the sample menu information is subjected to word segmentation processing to obtain a plurality of text keywords. In some embodiments, the sample recipe 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, performing word segmentation on the sample recipe information to obtain a plurality of text keywords includes: performing word segmentation on the sample menu information to at least obtain menu name keywords and food material name keywords in the menu text; the method comprises the following steps of coding text keywords based on a coding network of a food material semantic recognition model to obtain first coding vectors corresponding to the text keywords, wherein the coding network comprises: and coding the dish name keyword and the food material name keyword based on a coding network of the food material semantic recognition model to obtain a first coding vector corresponding to the dish name keyword and a first coding vector corresponding to the food material name keyword.
It can be understood that in the process of segmenting the dish information corresponding to each dish, the dish name keyword is extracted to enhance the relevance of the dish name and the context such as the food material name and the cooking mode.
For example, after the word segmentation is performed on the dish information corresponding to the dish tomato fried egg, text keywords such as tomato fried egg, tomato, need, preparation, egg, tomato, peanut oil and the like are obtained.
Illustratively, after obtaining a plurality of text keywords, each text keyword is encoded to obtain a first encoding vector, for example, the first encoding vector corresponding to tomato-fried egg is [1, 0] for the text keywords obtained as described above.
Exemplarily, after a first coding vector corresponding to a text keyword is obtained, a preset first weight matrix is used to perform weight calculation on the first coding vector to obtain a second coding vector. In some embodiments, the preset first weight matrix is determined by modeling the document after the menu information is participled according to the TF-IDF model; in other embodiments, the preset first weight matrix is determined according to the artificial labeling information, the preset first weight matrix is, for example, W [ V × N ], and when the first encoding vector corresponding to the text keyword is [1 × V ], a second encoding vector with a size of [1 × N ] is obtained, and as can be understood, the second encoding vector is the embedding information (embedding) corresponding to each text keyword.
Exemplarily, after the second encoding vector is obtained, the second encoding vector is subjected to prediction processing 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 all dimensions 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.
Illustratively, averaging the second encoding vectors to obtain hidden layer vectors, vector-multiplying the hidden layer vectors by a preset second weight matrix W' [ N × V ] to obtain target vectors with the size of [1 × V ], and calculating the target vectors by using an activation function to determine a V-dim probability distribution result in the target vectors, it can be understood that, in the process of determining the second text vectors, the first encoding vector corresponding to each keyword determined according to the recipe information is an on-hot code, that is, in the first encoding vector, each dimension represents a word, after obtaining the V-dim probability distribution result of the target vectors, the word indicated by the index with the highest probability can be determined as a predicted keyword, so that the second text vectors can be determined, and a target recipe corresponding to a recipe contained in the food consumption data can be determined according to the first text vectors and the second text vectors, so that the consumption and the consumption of the recipe required for making the recipe can be determined, and the consumption of the food can be determined only by determining the target recipe and the consumption of eggs required by the method, so that the consumption of the food product can be determined by the method and the method can avoid that the method can determine the consumption of the food product based on tomato and the egg.
It should be noted that the above process can be implemented by a framework of a skip-word model (skip-gram).
In a specific implementation, 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 input sample menu information in 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 food consumption data of a user are obtained, a target recipe is determined according to a first recipe text vector determined according to the food consumption data and a preset second recipe text vector, so that consumption of food materials and corresponding food materials in the food consumption data is determined according to the target recipe, for example, when a first recipe text vector indicating "tomato fried eggs" is determined in the food consumption data, by the method provided above, a second recipe text vector indicating "tomato fried eggs" is determined, so that the target recipe is determined to be "tomato fried eggs", and according to food materials and related information of consumption of the food materials, such as 120g of required eggs, 100g of tomatoes, 20g of edible oil, 3g of salt, and the like, included in the target recipe, the food materials corresponding to each common tomato fried egg dish in the food consumption data comprise tomatoes, edible oil and eggs, and the consumption of the food materials contained in the target recipe is determined, and the consumption of the food materials in each common tomato fried egg dish is the same as the consumption of the food materials included in the target recipe, so that the determined consumption data and the consumption of the food materials are achieved.
And S104, determining carbon emission data corresponding to the food material according to the food carbon emission database.
It should be noted that the carbon emission mentioned in the present application is the life cycle carbon emission of the food material, that is, the carbon emission caused by the life cycle of the food material during the production, transportation, consumption, etc. process is included.
Optionally, the existing food carbon emission database (double pyramid) is adjusted by obtaining food carbon emission literature information and corresponding research 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 tomato as an example of the food material, the carbon emission data of the tomatoes stored in the food carbon emission database can be shown in a carbon emission data table corresponding to each stage of the life cycle of the following tomatoes.
Carbon emission data table corresponding to each stage of life cycle of tomatoes
Stage of production Postharvest 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 unit of the carbon emission factor.
And (3) establishing a food carbon emission database according to carbon emission data of the food materials in different processing stages of each region determined by the investigation information of different regions so as to improve the reliability of the carbon emission data of the food materials and improve the reliability of the target carbon emission data of the 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 material and the consumption amount corresponding to the food material.
For example, after determining the food materials, the carbon emission data corresponding to the food materials, and the consumption amounts corresponding to the food materials 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 materials and the consumption amounts corresponding to the food materials.
It can be understood that the food consumption data further includes the ordered number of the dishes, and when the consumption corresponding to the food material is determined, the consumption corresponding to the food material is determined according to the ordered number and the consumption information required by the food material indicated by the recipe, 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 required in each tomato scrambled egg is 100g, and if the food consumption data includes 10 orders of tomato scrambled eggs, the consumption of tomatoes in the food consumption data is 1000g.
It should be noted that the dishes, the ordered number of dishes, and the consumption amount required for the food material indicated by the recipe are all exemplified, and the dishes, the ordered number of dishes, and the consumption amount required for the food material indicated by the recipe in the present application are not limited.
In some embodiments, determining target carbon emission data for food consumption data from the carbon emission data and consumption corresponding to the food material comprises: and performing product processing on the carbon emission data corresponding to the food materials and the consumption corresponding to the food materials to obtain target carbon emission data of the food consumption data.
For example, the product of the carbon emission data corresponding to the food material and the consumption of the food material can be calculated 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 stages.
Figure SMS_2
Represents the carbon emission factor (unit: kgCO2 e/kg) of food i at stage j,
Figure SMS_3
represents the mass (unit: kg) of the food i at stage j.
It will be appreciated that different life cycle phases are used to indicate that the food material is in different processes, such as a creation phase, a transportation and retail phase, etc.
In a specific implementation process, taking the order number of the dish tomato scrambled eggs of the food consumption data as 10 and the tomato required for each tomato scrambled egg in the target recipe as 100g as an example, the calculation process of the target carbon emission data corresponding to the tomato in the food consumption data is as follows:
(0.14kgCO2e/kg+0.19kgCO2e/kg+0.45kgCO2e/kg+2.3kgCO2e/kg)×0.1kg×10
=3.08kgCO2e。
the carbon emission accounting method based on semantic recognition provided in the foregoing embodiment determines the first menu text vector according to the food consumption data, so as to perform similarity calculation between the first menu text vector and the preset second menu text vector, so as to determine the target second menu text vector, thereby determining the corresponding target menu according to the target second menu text vector, and in the target menu, determine the corresponding food material and consumption of the food material, so as to determine the target carbon emission data of the food consumption data according to the consumption of the food material and consumption of the food material determined by the target menu, and process the food consumption data through natural language, without manually determining the food material and the corresponding consumption in the food consumption data, and at the same time, the dishes contained in the food consumption data are determined by using the first dish text vector, the target second dish text is determined by using the second dish text vector and the first dish text vector stored in the menu database, and the target menu is determined, so that the information such as the food materials and the consumption of the food materials in the food consumption data can be determined based on the information contained in the target menu, the information such as the food materials, ingredients and the consumption of the food materials in the determined food consumption data is complete, the problems that the ingredients of the dishes cannot be determined only according to the names of the dishes, the determined food materials are not uniform and the like are solved, the integrity of the information is improved, the limitation that the food materials are determined only through the names of the dishes is avoided, and the determined target carbon emission data is more reliable.
In other usage scenarios, please continue to refer to fig. 2, after the food material and the consumption amount of the food material of the food consumption data are determined, the nutritional data ingested by the user based on the food consumption data can 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 purpose that the nutrition intake of the user is more balanced when the carbon emission of the food consumption is reduced is achieved.
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 nutritional data according to the food consumption data, and determining the nutritional 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, through the mapping relation between the food materials and the nutrition data, the nutrition data ingested by the user based on the food consumption data can be determined based on the processing of the food consumption data.
Wherein, the nutrition data corresponding to the food consumption data can be determined as follows:
Figure SMS_4
wherein j is used to indicate the nutritional type (e.g., protein, fat);
Figure SMS_5
for indicating the content of j nutrient types (units: g) in the food consumption data; FW is used to indicate the type of food, i indicates the consumption of food (units: g); r% is used to indicate the comestible content of food material i,
Figure SMS_6
indicating the content of j nutritional types in 100g of food material i.
As can be appreciated, 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 it is determined that the target carbon emission data does not meet the carbon emission condition, the dishes in the food consumption data of the user are adjusted to make dish recommendation, so as to send the target dish information to the target user, thereby achieving 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 disclosure. 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 includes program instructions that, when executed, cause a processor to perform any one of the 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 on a storage medium, which when executed by the processor causes the processor to perform any one of the semantic recognition based carbon emission accounting methods.
The network interface is used for network communication, such as sending assigned tasks and the like. It will be appreciated by those skilled in the art that the configuration shown in fig. 3 is a block diagram of only a portion of the configuration associated with the present application, and is not intended to limit the computing device to which the present application may be applied, and that a particular computing device may include more or fewer components than shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a 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 execute the computer program stored in the memory to perform 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 on the basis of a food material semantic recognition model;
determining carbon emission data corresponding to the food material 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 corresponding to the food materials.
In one embodiment, the processor, when implementing a food material semantic recognition model based on determining a food material in the food consumption data and a consumption of the food material from the first dish text vector, is configured to implement:
based on a similarity calculation network of the food material semantic recognition model, similarity calculation is carried out on the first menu text vector and a plurality of preset second menu text vectors, and a target second menu text vector is determined;
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 the food materials in the food consumption data and the consumption of the food materials according to the mapping relation between the target menu and the food materials.
In one embodiment, the processor, when enabling determining the target carbon emission data of the food consumption data from the carbon emission data corresponding to the food material and the consumption corresponding to the food material, is configured to enable:
and performing product processing on the carbon emission data corresponding to the food materials and the consumption corresponding to the food materials to obtain target carbon emission data of the food consumption data.
In one embodiment, the processor, when implementing the semantic recognition based carbon emissions accounting method, is configured to implement:
determining nutritional data corresponding to the food consumption data according to the food materials determined by the food consumption data, the consumption of the food materials and the mapping relation between the food materials 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 the target user.
In one embodiment, the processor, when implementing the semantic recognition based carbon emissions 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 is configured to input the sample recipe information into a food material semantic recognition model to obtain a plurality of second dish text vectors corresponding to the sample recipe information, the processor is configured to:
performing word segmentation processing on the sample menu information based on a word segmentation network of the food material semantic recognition model to obtain a plurality of text keywords;
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;
based on the weight calculation network of the food material semantic recognition model, carrying out weight calculation on the first coding vector and a preset first weight matrix to obtain a second coding vector;
and determining a network based on a second text vector of the food material semantic recognition model, and predicting the second coding vector to obtain a second text vector.
In one embodiment, when the processor performs prediction processing on the second encoding vector to obtain a second text vector, the processor is configured to perform:
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 a probability distribution result 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 perform word segmentation on the sample recipe information to obtain a plurality of text keywords, and is configured to perform:
performing word segmentation processing on the sample menu information to at least obtain menu name keywords and food material name keywords in a menu text;
the processor is used for realizing that when the encoding network based on the food material semantic recognition model is realized and the text keywords are encoded to obtain first encoding vectors corresponding to the text keywords, the encoding network is used for realizing that:
and coding the dish name keyword and the food material name keyword based on a coding network of the food material semantic recognition model to obtain a first coding vector corresponding to the dish name keyword and a first coding vector corresponding to the food material name keyword.
It should be noted that, as is clearly understood by those skilled in the art, for convenience and simplicity of description, the specific working process of the computer device may refer to the corresponding process in the foregoing carbon emission accounting method embodiment based on semantic recognition, and details are not described herein again.
Embodiments of the present application further provide a computer-readable storage medium, on which a computer program is stored, where the computer program includes program instructions, and when the program instructions are executed, the method implemented by the computer program may refer to the various embodiments of the method for carbon emission accounting based on semantic recognition in the present application.
The computer-readable storage medium may be an internal storage unit of the computer device described in 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), and the like provided on the computer device.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application 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 and includes any and all possible combinations of one or more of the associated listed items. 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 phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or system comprising the element.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments. While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A carbon emission accounting method based on semantic recognition is characterized by comprising the following steps:
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 menu text vector and a plurality of preset second menu text vectors based on a food material semantic recognition model;
determining carbon emission data corresponding to the food material 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 corresponding to the food materials.
2. The semantic recognition based carbon emission accounting method of claim 1, wherein the determining of the food material in the food consumption data and the consumption of the food material according to 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, similarity calculation is carried out on the first dish text vector and a plurality of preset second dish text vectors, and a target second dish text vector is determined;
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 the food materials in the food consumption data and the consumption 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 the 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 performing product processing on the carbon emission data corresponding to the food materials and the consumption corresponding to the food materials 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 to 3, wherein the method further comprises:
determining nutritional data corresponding to the food consumption data according to the food materials determined by the food consumption data, the consumption of the food materials and the mapping relation between the food materials 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 the target user.
5. The semantic recognition based carbon emission accounting method of any one of claims 1-3, further comprising:
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.
6. The carbon emission accounting method based on semantic recognition as recited in claim 5, wherein the 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 comprises:
performing word segmentation processing on the sample menu information based on a word segmentation network of the food material semantic recognition model to obtain a plurality of text keywords;
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;
based on a weight calculation network of the food material semantic recognition model, carrying out weight calculation on the first coding vector and a preset first weight matrix to obtain a second coding vector;
and determining a network based on a second text vector of the food material semantic recognition model, and predicting the second coding vector to obtain a second text vector.
7. The carbon emission accounting method based on semantic recognition as recited in claim 6, wherein the performing prediction processing on the second encoding 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 a probability distribution result 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.
8. The carbon emission accounting method based on semantic recognition as recited in claim 6, wherein the word segmentation processing is performed on the sample menu information to obtain a plurality of text keywords, and comprises:
performing word segmentation processing on the sample menu information to at least obtain menu name keywords and food material name keywords in a menu text;
the method for coding the text keywords by the coding network based on the food material semantic recognition model to obtain first coding vectors corresponding to the text keywords comprises the following steps:
and coding the dish name keyword and the food material name keyword based on a coding network of the food material semantic recognition model to obtain a first coding vector corresponding to the dish name keyword and a first coding vector corresponding to the food material name keyword.
9. A computer arrangement, characterized in that the computer arrangement 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, carries out the steps of the method for carbon emission accounting based on semantic recognition according to any one of claims 1 to 8.
10. A computer-readable storage medium, having stored thereon a computer program, wherein the computer program, when being executed by a processor, carries out the steps of the method for carbon emission accounting based on semantic recognition according to any one of claims 1 to 8.
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 true CN115809755A (en) 2023-03-17
CN115809755B 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)

Cited By (1)

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

Citations (7)

* 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
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
AU2021106485A4 (en) * 2020-10-20 2021-11-04 Discovery Limited A computer implemented system for measuring greenhouse gas emitting activities of a user
CN115660292A (en) * 2022-12-12 2023-01-31 广东工业大学 Carbon emission monitoring method and equipment based on catering consumption data processing

Patent Citations (7)

* 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
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
AU2021106485A4 (en) * 2020-10-20 2021-11-04 Discovery Limited A computer implemented system for measuring greenhouse gas emitting activities of a user
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
CN115660292A (en) * 2022-12-12 2023-01-31 广东工业大学 Carbon emission monitoring method and equipment based on catering consumption data processing

Cited By (2)

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

Also Published As

Publication number Publication date
CN115809755B (en) 2023-06-27

Similar Documents

Publication Publication Date Title
US8249954B2 (en) Third-party certification using enhanced claim validation
US10339498B2 (en) Information management system for product ingredients
CN109829108B (en) Information recommendation method and device, electronic equipment and readable storage medium
Nychas et al. Data science in the food industry
WO2021017306A1 (en) Personalized search method, system, and device employing user portrait, and storage medium
CN115660292B (en) Carbon emission monitoring method and equipment based on catering consumption data processing
US11436458B2 (en) Information management system for product ingredients to allow regulatory compliance checks
CN110851571B (en) Data processing method and device, electronic equipment and computer readable storage medium
CN115809755A (en) Carbon emission accounting method and equipment based on semantic recognition and storage medium
CN111582932A (en) Inter-scene information pushing method and device, computer equipment and storage medium
CN113836131A (en) Big data cleaning method and device, computer equipment and storage medium
US20180322511A1 (en) Information management system for product ingredients that produces hybrid data offerings combining product information data and analytic data
Gallo et al. Food recommendations for reducing water footprint
CN109472025B (en) Dish name extraction method and device
CN116775986A (en) Recipe recommendation method, electronic device and storage medium
CN114840759A (en) Recommendation method and device and computer readable storage medium
KR102413273B1 (en) Artificial intelligence-based operation method of fresh food distribution platform that predicts appropriate auction price by shelf life and supply
KR102413275B1 (en) Artificial intelligence-based method of operating fresh food distribution platform that predicts appropriate selling price by selling price of competitor
Chavan et al. Caritas-‘Serving Smiles’
He et al. Smart Diet Management Through Food Image and Cooking Recipe Analysis
EP4296913A1 (en) System and method for determining the environmental impact and sustainability score of a food item using a food ingredient repository
US11880393B1 (en) Apparatus and method for generating an ingredient chain
CN112016582B (en) Dish recommending method and device
US20220319698A1 (en) System and method for generating a ration protocol and instituting a desired endocrinal change
US20240144096A1 (en) An apparatus and method for generating an ingredient chain

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