Cigarette sweetness knowledge graph construction method based on large language model
By constructing a knowledge graph of cigarette sweetness using a large language model, the problems of scattered and low-structured knowledge of cigarette sweetness are solved. This enables efficient integration and intelligent utilization of sweetness knowledge, improves the consistency and scalability of the knowledge graph, and adapts to the application needs of different tobacco companies.
Patent Information
- Application Number
- CN202610011667.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-06
- Publication Date
- 2026-02-13
AI Technical Summary
Existing knowledge about the sweetness of cigarettes is scattered, poorly structured, and inefficient for retrieval and application. The existing knowledge graphs also have poor consistency, failing to meet the tobacco industry's demand for structured and intelligent applications of sweetness knowledge.
A knowledge graph of cigarette sweetness is constructed using a large language model. By acquiring data, defining entity hierarchy and relationships, structured knowledge is extracted using preset prompt words and imported into a graph database. A quality assessment mechanism is used to ensure consistency and scalability.
It enables the systematic integration and sharing of sweetness knowledge, improves the consistency and scalability of the knowledge graph, simplifies the knowledge extraction process, reduces maintenance costs, and supports flexible application by different tobacco companies.
Smart Images

Figure CN121524366A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of tobacco industry, and particularly relates to a method for constructing a cigarette sweetness knowledge graph based on a large language model. BACKGROUND
[0002] In the tobacco industry, cigarette sweetness is a key sensory attribute that affects product quality and market competitiveness. With the popularization of low-foe harm reduction technology, the problem of insufficient cigarette sweetness has become increasingly prominent, and related research has covered multiple dimensions such as tobacco leaf varieties, spice addition, and production processes. However, existing cigarette sweetness knowledge is mainly scattered in unstructured carriers such as academic papers, patent documents, and technical reports, and there are defects such as knowledge fragmentation, low retrieval efficiency, and difficulty in achieving deep integration and intelligent application.
[0003] Existing knowledge graph construction methods rely heavily on traditional machine learning techniques, requiring a large amount of manual annotation and model training, resulting in complex and inefficient processes. At the same time, existing methods have not formed a standardized ontology system and quality evaluation mechanism, resulting in poor consistency and limited practicality of the constructed knowledge graph, which cannot meet the needs of the tobacco industry for structured and intelligent application of sweetness knowledge. SUMMARY
[0004] In view of the above, the present application aims to provide a method for constructing a cigarette sweetness knowledge graph based on a large language model to solve the aforementioned technical problems.
[0005] The technical solution adopted by the present application is as follows:
[0006] The present application provides a method for constructing a cigarette sweetness knowledge graph based on a large language model, which includes:
[0007] Obtaining cigarette sweetness knowledge data;
[0008] Defining the cigarette sweetness knowledge data to obtain entity levels and entity relationships;
[0009] Using a preset large language model to extract structured knowledge from the cigarette sweetness knowledge data according to the entity levels and entity relationships and preset prompt words;
[0010] Importing the structured knowledge into a preset graph database to obtain a cigarette sweetness knowledge graph.
[0011] Optionally, obtaining cigarette sweetness knowledge data includes:
[0012] Retrieving literature within a set time span from a literature database using a preset keyword to obtain target cigarette sweetness knowledge literature;
[0013] Retain the target cigarette sweet taste knowledge document with a correlation degree higher than a first preset threshold, and remove the target cigarette sweet taste knowledge document with a similarity degree higher than a second preset threshold, to obtain cigarette sweet taste knowledge data.
[0014] Optionally, the entity level includes five levels, wherein the root node is cigarette sweet taste knowledge, the first level is sweetener type, the second level is document name, the third level is sweetening component, the fourth level is sweetening component addition site, and the fifth level is sweetening component attribute.
[0015] Optionally, the preset prompt word at least includes sweetener name, sweetening component molecular formula, addition site, addition amount range, analysis instrument model, sensory evaluation index sweetener name, sweetening component molecular formula, addition site, addition amount range, analysis instrument model, and sensory evaluation index.
[0016] Optionally, a preset large language model is used to extract structured knowledge from the cigarette sweet taste knowledge data, including:
[0017] Batch knowledge extraction is performed by using a preset large language model to obtain an extraction result, wherein the model parameters include a temperature parameter and a maximum output length;
[0018] False data and error information in the extraction result are removed to obtain structured knowledge.
[0019] Optionally, the structured knowledge is imported into a preset graph database to obtain a cigarette sweet taste knowledge graph, including:
[0020] Based on the dual judgment of name similarity and attribute consistency, different expressions of the same entity node are identified, a cosine similarity algorithm is used for entity node alignment, and a cigarette sweet taste knowledge graph is obtained.
[0021] Optionally, the cigarette sweet taste knowledge graph construction method based on a large language model further includes: quality evaluation of the cigarette sweet taste knowledge graph, including:
[0022] A field coverage rate index and a semantic consistency index are calculated;
[0023] Based on the comprehensive score of the field coverage rate index and the semantic consistency index, and compared with a preset quality threshold, the knowledge nodes lower than the preset quality threshold are modified.
[0024] The above-mentioned scheme of the present application at least includes the following beneficial effects:
[0025] The above scheme of the present application acquires cigarette sweet taste knowledge data, defines the cigarette sweet taste knowledge data to obtain entity levels and entity relationships, extracts structured knowledge from the cigarette sweet taste knowledge data using a preset large language model according to the entity levels and entity relationships and a preset prompt word, and imports the structured knowledge into a preset graph database to obtain a cigarette sweet taste knowledge graph. The present application fills the blank of knowledge structured expression in this field, realizes systematic integration and sharing of sweet taste knowledge, ensures consistency and expansibility of the knowledge graph, can flexibly adapt to application requirements of different tobacco enterprises, supports rapid import of new added literature through an incremental knowledge updating mechanism, prolongs the life cycle of the knowledge graph, and reduces maintenance cost. BRIEF DESCRIPTION OF DRAWINGS
[0026] To make the objectives, technical solutions, and advantages of the present application clearer, the present application will be further described below in conjunction with the accompanying drawings, in which:
[0027] Figure 1 A flowchart of the cigarette sweet taste knowledge graph construction method based on a large language model provided by the embodiment of the present application is shown in FIG. 1. DETAILED DESCRIPTION
[0028] The embodiments of the present application will be described in detail below, and examples of the embodiments are shown in the accompanying drawings, in which the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions throughout. The embodiments described below by referring to the accompanying drawings are exemplary and are only used to explain the present application, and cannot be interpreted as a limitation on the present application.
[0029] The present application proposes an embodiment of a cigarette sweet taste knowledge graph construction method based on a large language model, specifically as shown in FIG. 1, which includes the following steps. Figure 1
[0030] Step 11, acquiring cigarette sweet taste knowledge data.
[0031] Step 12, defining the cigarette sweet taste knowledge data to obtain entity levels and entity relationships.
[0032] Step 13, extracting structured knowledge from the cigarette sweet taste knowledge data using a preset large language model according to the entity levels and entity relationships and a preset prompt word.
[0033] Step 14, importing the structured knowledge into a preset graph database to obtain a cigarette sweet taste knowledge graph.
[0034] A method for constructing a cigarette sweet taste knowledge graph based on a large language model is provided in this embodiment. The method solves the problems of scattered cigarette sweet taste knowledge, low degree of structuring, and poor retrieval application efficiency, and realizes efficient integration and intelligent utilization of cigarette sweet taste knowledge, thereby providing technical support for precise sweetening of the tobacco industry. At the same time, a standardized ontology system and quality evaluation process are established to improve the consistency and reliability of the knowledge graph.
[0035] The search range covers authoritative databases at home and abroad such as China Knowledge Network, Wanfang, Web of Science, etc. The search keywords include "cigarette sweet taste", "sweetening components", "tobacco spices", "cigarette sweetening process", etc. The time span is set to 2004-2024.
[0036] Specifically, a crawler program is written using Python, the database API is called to retrieve documents in batches, and the PDF full text is automatically downloaded. The crawler interval is set to 3 seconds to avoid triggering the database anti-crawling mechanism.
[0037] Through expert review using the Delphi method, documents with a relevance of less than 0.7 are excluded. Then, the files are preprocessed, and the MinerU software OCR technology is used to process the PDF documents in batches. Non-text information such as tables, formulas, and picture annotations is converted into structured Markdown format. The table data retains the original row and column relationship, and the formulas are embedded in the text in LaTeX format. The preprocessed data is de-duplicated, and the SimHash algorithm is used to calculate the text similarity. Documents with a similarity of ≥0.95 are excluded. The SimHash algorithm hash value bit number is set to 64 bits, and the Hamming distance threshold is set to 3.
[0038] The literature content is divided into different levels, and the root node is named as cigarette sweet taste knowledge;
[0039] The first level is named as sweetener type, including natural plant extracts, synthetic sweeteners, and other ontology concepts;
[0040] The second level is named as paper title, including specific research papers or scientific and technological literature on sweetener types;
[0041] The third level is defined as the sweetening components mentioned in the paper, involving chemical substances and sweetening flavor substances, mainly the substances that produce sweet taste in cigarette smoke during burning;
[0042] The fourth level is the site of the addition of sweetening components, involving concepts such as leaf groups (tobacco leaves, tobacco shreds), auxiliary materials (such as three papers and one stick) / spices (before burning), and mainly the addition sites of various sweetening components in cigarette sticks;
[0043] The fifth level is the various attributes of the sweetening ingredient, including aroma, characteristics, experimental methods, evaluation methods, cigarette aftertaste, application, addition method, addition amount and taste, sweetness persistence, relative sweetness, content and migration rate in smoke and tobacco, analysis method, and tobacco type.
[0044] It should be noted that the analysis method of the sweetening ingredient refers to the method used in the literature to analyze the sweetening ingredient, including: thermal cracking-gas chromatography mass spectrometry, GC-MS analysis, etc.; the experimental method of the sweetening ingredient refers to the method of preparing the sweetening ingredient in the laboratory, such as: supercritical CO2 extraction method; the flesh of momordica grosvenori is crushed, passed through a 40-mesh sieve. Accurately weigh 30.00g of momordica grosvenori powder, wrap it with filter paper and load it into a soxhlet extractor, add 200mL of anhydrous ethanol, heat reflux for 2h. Filter, distill the filtrate under reduced pressure until no ethanol flows out, obtain momordica grosvenori extract; Lentinus edodes is crushed into powder, 10g of Lentinus edodes, 5g of fructose, 3g of aspartic acid, 200g of propylene glycol, 200g of water, 0.2g of catalyst, 100℃ reaction for 3h, filtration, concentration to flowable paste, etc. Laboratory preparation method.
[0045] Further, the prompt words of the large language model are set. The prompt word is the core way for the user to interact with the large language model, and is an important "instruction" to guide the model to complete a specific task.
[0046] In this embodiment, the prompt words include sweetener type, paper title, sweetening ingredient name, advantages of sweetening ingredient, disadvantages of sweetening ingredient, experimental method of sweetening ingredient, evaluation method, cigarette aftertaste, application of sweetening ingredient, addition method of sweetening ingredient, addition amount and taste of sweetening ingredient, sweetness persistence, relative sweetness of sweetening ingredient, content and migration rate of sweetening ingredient in smoke and tobacco, analysis method of sweetening ingredient, aroma of sweetening ingredient, addition site of sweetening ingredient, tobacco type, clear knowledge extraction target and cigarette sweetness core term.
[0047] The output format of the prompt word is a JSON array, and each entity object contains "entity type", "entity name", "attribute value", "source document ID", and "confidence" five mandatory fields. For example: { "entity type": "sweetening ingredient", "entity name": "chlorogenic acid", "attribute value": { "addition amount": "0.05%-0.1%", "aroma characteristics": "fragrant type", "thermal stability": "stable below 120℃"}, "source document ID": "XXXX document", "confidence": 0.92.}.
[0048] The domestic large language model glm-4.5 is used to extract structured knowledge from the cigarette sweet taste knowledge data according to the prompt word. The model parameters are set to temperature 0.3 and maximum output length 2048 tokens to ensure the accuracy and simplicity of the extraction results. The batch processing mode is used, and each batch input is 50 Markdown format documents. The model extracts structured knowledge in parallel. Eighteen types of entities are extracted, including sweetener type, paper title, sweet component name, advantages of sweet component, disadvantages of sweet component, sweet component experimental method, evaluation method, cigarette aftertaste, application of sweet component, sweet component addition method, sweet component addition amount and taste, sweet persistence, relative sweetness of sweet component, content and migration rate of sweet component in tobacco tar, sweet component analysis method, sweet component aroma, sweet component addition site, and tobacco type.
[0049] Next, the extracted structured knowledge is audited. The extracted structured knowledge is audited and screened by manual comparison. The original text content is compared by manual comparison, and the error data is marked. The presence of information missing and false information generated by large model illusion is determined, and the data with obvious errors or large model illusion is removed. The Kappa coefficient is used to test the consistency of the annotations to ensure that the extracted knowledge conforms to the original text expression.
[0050] Finally, the structured knowledge is imported into the Neo4j graph database through the py2neo library to obtain the cigarette sweet taste knowledge graph. Here, based on the name similarity and attribute consistency double judgment, the cosine similarity algorithm is used to calculate the text similarity, and the threshold is set to 0.85 for entity alignment. A combination of rules and machine learning is used to handle synonymous entities such as "green acid" and "3-caffeoyl quinic acid".
[0051] The cigarette sweet taste knowledge graph construction method based on the large language model of the embodiment further includes quality evaluation of the cigarette sweet taste knowledge graph.
[0052] Field coverage and semantic consistency are used as dual evaluation indicators. Field coverage = actual extraction field number / total number of fields that should be extracted x 100%. The similarity between entity description and field standard term is calculated by a semantic consistency model. If the extraction result is highly similar to the relevant content of the original text in the semantic space, and its field has good coverage in the original text, it can be considered that the extraction result has high quality.
[0053] Likert five-point method is used for quantitative scoring, 1 point for very poor, 5 points for excellent, and the comprehensive score = field coverage index x 0.6 + semantic consistency index x 0.4.
[0054] Set the quality threshold to 3.0, below the threshold of the knowledge node needs to return to re-extraction or artificial correction, the final qualified and excellent data accounted for 84.6%.
[0055] Specifically, the field coverage mainly measures whether the extracted content is "covered" or "appeared" in the original text. The calculation formula is:
[0056] ;
[0057] Wherein, Ci represents the integrity score of the i-th field; the number of matching words: the number of words in the field appearing in the original text in each extraction data; the total number of field words: the total number of fields contained in each extraction data; multiply 5 to map each data quality to the evaluation quantization range of 0~5.
[0058] The integrity score of each entity extraction result is:
[0059] ;
[0060] Wherein, is the integrity score.
[0061] Semantic consistency evaluates the semantic relevance of the extraction result and the original document, not just the word matching. The cosine similarity calculation formula is:
[0062] ;
[0063] Wherein, S is the cosine similarity, A is the embedding vector of each extraction result, and B is the embedding vector of the document sentence or paragraph.
[0064] Calculate the semantic consistency score:
[0065] ;
[0066] Wherein, is the semantic consistency score. That is, the maximum (S) representing the most matched paragraph is taken, and the result is mapped to the evaluation quantization range of 0~5.
[0067] Finally, the quantization score of each entity extraction result is:
[0068] ;
[0069] Wherein, Q is the quantization score of each entity extraction result.
[0070] The method for constructing a cigarette sweetness knowledge graph based on a large language model in the above embodiment of the present application constructs a structured knowledge graph in the field of cigarette sweetness, fills the gap in the structured expression of knowledge in this field, and realizes the systematic integration and sharing of sweetness knowledge; the glm-4.5 large language model and the optimized prompt word scheme are used to simplify the knowledge extraction process, the artificial workload is reduced by more than 70% compared with traditional methods, and the knowledge extraction accuracy is 84.6%; the five-level ontology system and the standardized entity relationship are established to ensure the consistency and expansibility of the knowledge graph, and the application requirements of different tobacco enterprises can be flexibly adapted; the incremental knowledge updating mechanism supports the rapid import of new literature, prolongs the life cycle of the knowledge graph, and reduces the maintenance cost; the method can be migrated to other subfields of tobacco flavor, and provides a general technical framework for the construction of a tobacco industry knowledge graph.
[0071] In an embodiment of the present application, a computing device is also provided, comprising a processor and a memory storing a computer program, when the computer program is executed by the processor, the method as described in the above embodiments is executed. All implementation manners in the above method embodiments are applicable to this embodiment, and the same technical effects can also be achieved.
[0072] In an embodiment of the present application, a computer readable storage medium is also provided, storing instructions, when the instructions are executed on a computer, the computer executes the method as described in the above embodiments. All implementation manners in the above method embodiments are applicable to this embodiment, and the same technical effects can also be achieved.
[0073] Those skilled in the art can realize that the units and algorithm steps of the examples described in combination with the embodiments disclosed herein can be realized in electronic hardware or a combination of computer software and electronic hardware. Whether the functions are realized in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to realize the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.
[0074] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described system, device and unit can refer to the corresponding processes in the foregoing method embodiments, which will not be described here.
[0075] In the embodiments of the present application, it should be understood that the disclosed apparatus and method can be implemented in other manners. For example, the embodiments of the apparatus described above are merely schematic, and the division of the units is merely logical function division, and there can be another division manner in actual implementation. For example, a plurality of units or components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections can be indirect couplings or communication connections through some interfaces, devices or units, and can be in electrical, mechanical or other forms.
[0076] The units described as separate components can or can not be physically separate, and the components shown as units can or can not be physical units, i.e., can be located in one place, or can be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purposes of the embodiments.
[0077] In addition, each functional unit in the various embodiments of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit.
[0078] If the functions are implemented in the form of software function units and sold or used as independent products, they can be stored in a computer readable storage medium. Based on such understanding, the technical solutions of the present application essentially or the part that contributes to the prior art or part of the technical solutions can be embodied in the form of a software product. The computer software product is stored in a storage medium, and includes a plurality of instructions for causing a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: U disk, mobile hard disk, ROM, RAM, magnetic disk or optical disk, and various other media that can store program codes.
[0079] Moreover, it is pointed out that in the device and method of the present application, obviously, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions of the present application. Also, the steps of performing the above series of processes can naturally be executed in time sequence according to the order of description, but do not necessarily have to be executed in time sequence. Some steps can be executed in parallel or independently of each other. It can be understood by those skilled in the art that all or any steps or components of the method and device of the present application can be implemented in hardware, firmware, software, or a combination thereof, in any computing device (including a processor, a storage medium, etc.) or a network of computing devices, using the basic programming skills of those skilled in the art upon reading the description of the present application.
[0080] Therefore, the object of the present application can also be achieved by running a program or a set of programs on any computing device. The computing device can be a commonly known general-purpose device. Therefore, the object of the present application can also be achieved only by providing a program product containing program code for implementing the method or device. That is, such a program product also constitutes the present application, and a storage medium storing such a program product also constitutes the present application. Obviously, the storage medium can be any commonly known storage medium or any storage medium developed in the future. It is also pointed out that in the device and method of the present application, obviously, the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered as equivalent solutions of the present application. Also, the steps of performing the above series of processes can naturally be executed in time sequence according to the order of description, but do not necessarily have to be executed in time sequence. Some steps can be executed in parallel or independently of each other.
[0081] The above is the preferred embodiment of the present application. It should be pointed out that for those skilled in the art, several improvements and refinements can be made without departing from the principles of the present application, and these improvements and refinements should also be considered as the protection scope of the present application.
Claims
1. A method for constructing a knowledge graph of cigarette sweetness based on a large language model, characterized in that, include: Acquire knowledge data on the sweetness of cigarettes; The knowledge data on cigarette sweetness is defined to obtain entity hierarchy and entity relations; Based on the entity hierarchy and entity relationships, as well as preset prompt words, a preset large language model is used to extract structured knowledge from the cigarette sweetness knowledge data; The structured knowledge is imported into a preset graph database to obtain a knowledge graph of cigarette sweetness.
2. The method for constructing a cigarette sweetness knowledge graph based on a large language model according to claim 1, characterized in that, Obtain knowledge data on the sweetness of cigarettes, including: By using preset keywords to search for literature within a specified time span from the literature database, we can obtain literature on the target cigarette sweetness. Retain target cigarette sweetness knowledge literature with a relevance higher than the first preset threshold, and remove target cigarette sweetness knowledge literature with a similarity higher than the second preset threshold to obtain cigarette sweetness knowledge data.
3. The method for constructing a cigarette sweetness knowledge graph based on a large language model according to claim 1, characterized in that, The entity hierarchy consists of five levels, where the root node is knowledge of cigarette sweetness, the first level is the type of sweetener, the second level is the literature name, the third level is the sweetening component, the fourth level is the location where the sweetening component is added, and the fifth level is the attribute of the sweetening component.
4. The method for constructing a cigarette sweetness knowledge graph based on a large language model according to claim 1, characterized in that, The preset prompts include at least the name of the sweetener, the molecular formula of the sweetening component, the site of addition, the range of addition amount, the model of the analytical instrument, and the sensory evaluation index.
5. The method for constructing a cigarette sweetness knowledge graph based on a large language model according to claim 1, characterized in that, Structured knowledge is extracted from the cigarette sweetness knowledge data using a pre-defined large language model, including: A pre-defined large language model is used to extract knowledge in batches, and the extraction results are obtained. The model parameters include temperature parameters and maximum output length. By removing erroneous information and false data from the extraction results, structured knowledge is obtained.
6. The method for constructing a cigarette sweetness knowledge graph based on a large language model according to claim 1, characterized in that, The structured knowledge is imported into a preset graph database to obtain a cigarette sweetness knowledge graph, including: Based on the dual judgment of name similarity and attribute consistency, different descriptions of the same entity node are identified, and the cosine similarity algorithm is used to align entity nodes to obtain the cigarette sweetness knowledge graph.
7. The method for constructing a cigarette sweetness knowledge graph based on a large language model according to claim 1, characterized in that, Also includes: A quality assessment of the aforementioned cigarette sweetness knowledge graph was conducted, including: Calculate field coverage metrics and semantic consistency metrics; Based on the combined score of field coverage and semantic consistency metrics, and compared with a preset quality threshold, knowledge nodes that are below the preset quality threshold are corrected.