Automatic discrimination method for pre-packaged food labels based on large language models
By constructing a domain-knowledge-enhanced discrimination model and a food ingredient knowledge graph, the problem of insufficient contextual logical reasoning in food label discrimination is solved, achieving accurate discrimination and improved interpretability of food label information.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SCIENCE & TECHNOLOGY RESEARCH CENTER OF CHINA CUSTOMS
- Filing Date
- 2025-11-13
- Publication Date
- 2026-04-10
AI Technical Summary
Existing technologies lack the ability to reason logically within the context of food labels, and cannot identify implicit misleading information and deep semantic contradictions, resulting in an inability to accurately determine logical conflicts between product claims and ingredient information.
A domain-knowledge-enhanced discriminative model is constructed using a large language model. By acquiring structured food label data, focus statements are generated and logical consistency scores are calculated. Evidence classification and reasoning are performed in conjunction with a food component knowledge graph to generate an interpretable report.
It enables accurate identification of food label information, improves the accuracy, efficiency and interpretability of the identification results, can identify implicit misleading information and compliance with numerical claims, and ensures the initial reliability of data processing and the accuracy of final judgment.
Smart Images

Figure CN121117221B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of food label identification, in particular to an automatic identification method for pre-packaged food labels based on a large language model. BACKGROUND
[0002] In recent years, with the excellent performance of large-scale pre-training language models in natural language understanding and reasoning tasks, automatic methods based on large language models have been gradually introduced into the field of food label identification. The advantage of the method based on large language models in food label identification lies in its strong semantic understanding and reasoning ability. The large language model can analyze the natural language claims into structured verification propositions, identify the variants of the wording and generate specific verification conditions. In addition, the large language model is easy to be linked with domain knowledge base, named entity recognition and rule template, so as to realize the cross-paragraph association and reasoning of the claims, ingredients and measurement information at the semantic level.
[0003] In the prior art, the automatic identification of pre-packaged food label claims mainly relies on optical character recognition to extract label text, and then uses keyword matching, rule-based pattern recognition or simple numerical threshold comparison to determine the claims and label content.
[0004] The core defect of the above prior art is the lack of the ability to conduct dynamic logical reasoning based on context, so it cannot find "implicit misleading" or deep semantic / common sense contradictions. The specific manifestations are as follows:
[0005] 1. The system can identify the claims on the label and some ingredients in the ingredient list at the same time, but cannot infer the logical conflict between them based on the functional attributes of the ingredients and common sense, so it cannot identify the expressions that are misleading to consumers;
[0006] 2. The existing method can identify numbers and keywords, but cannot determine whether the numerical value is sufficient to support the claim described in the text;
[0007] Therefore, an automatic identification method for pre-packaged food labels based on a large language model is provided. SUMMARY
[0008] The present application aims to provide an automatic identification method for pre-packaged food labels based on a large language model to solve the problems raised in the background art.
[0009] To achieve the above-mentioned purpose, the present application aims to provide an automatic identification method for pre-packaged food labels based on a large language model, comprising the following steps:
[0010] S1, obtaining structured food label data, the food label data at least containing separated product claim text and ingredient list text;
[0011] S2, a domain knowledge enhanced discriminant model is constructed, the product claim text is input into the domain knowledge enhanced discriminant model, the discriminant model can analyze the semantics of the product claim text and classify, and the final focus statement for verifying the authenticity of the claim is generated;
[0012] S3, the final focus statement and the ingredient list text are jointly input into the domain knowledge enhanced discriminant model, the discriminant model retrieves the ingredients related to the focus statement in the ingredient list text, and obtains the evidence classification result by using the pre-constructed food ingredient knowledge graph;
[0013] S4, based on the evidence classification result and the claim classification result, a logic consistency score is generated by using the domain knowledge enhanced discriminant model, a judgment result about the authenticity of the claim is output based on the logic consistency score, and an explainability report is generated.
[0014] As a further improvement of the technical solution, in S2, the specific steps of constructing the domain knowledge enhanced discriminant model are as follows:
[0015] A preset base model is selected, and a structured domain knowledge base is constructed, the content in the knowledge base includes the application conditions of the functional claims of nutritional ingredients and the functional attribute classification of key ingredients, training data is generated based on the domain knowledge base, and the base model is modified using the training data, thereby generating the domain knowledge enhanced discriminant model.
[0016] As a further improvement of the technical solution, in S2, the specific steps of generating the final focus statement for verifying the authenticity of the claim are as follows:
[0017] S21, the discriminant model classifies the input product claim text according to the intention, maps it to a plurality of predefined claim types, and generates a claim classification result;
[0018] S22, according to the classification result, the discriminant model retrieves the corresponding abstract verification rule from the preset claim type and abstract verification rule mapping table;
[0019] S23, the discriminant model substitutes the specific entities and context information in the current claim into the retrieved abstract verification rule, generates a preliminary focus statement of the current claim which can be verified, and introduces a semantic consistency checking loop for optimization to generate the final focus statement.
[0020] As a further improvement of the technical solution, in S23, the specific steps of introducing the semantic consistency checking loop for optimization to generate the final focus statement are as follows:
[0021] S231, after generating the preliminary focus statement, the discriminant model compares the preliminary focus statement with the product claim text for semantic consistency, and calculates a semantic consistency score;
[0022] S232. If the semantic consistency score is lower than the semantic consistency threshold, the discriminant model will reclassify and validate the initial focus statement until the semantic consistency score is not lower than the semantic consistency threshold or the maximum number of iterations is reached. Then the loop ends and the current optimal focus statement is output as the final focus statement.
[0023] S233. When outputting the final focus statement, determine the reason for generating the focus statement by the model.
[0024] As a further improvement to this technical solution, in step S3, the evidence classification results include supporting evidence, neutral evidence, and contradictory evidence.
[0025] As a further improvement to this technical solution, in step S3, the specific steps of the discriminative model retrieving components related to the focus statement from the ingredient list text and using a pre-constructed food ingredient knowledge graph to assist in obtaining the evidence classification result are as follows:
[0026] S31. Take the final focus statement and ingredient list text as input, use named entity recognition to extract initial candidate ingredient entities from the ingredient list text, and map them to candidate ingredient entities in the food ingredient knowledge graph;
[0027] S32. Based on candidate component entities, retrieve several evidence items related to the final focus statement in a domain knowledge-enhanced discriminative model;
[0028] S33. Construct an evidence feature vector for each evidence item, and calculate the local support for each evidence item based on the feature vector. ;
[0029] S34. Generate a local support set based on the local support of all evidence items, and calculate the global consistency score of the focus claims using a hierarchical aggregation strategy. ;
[0030] S35. Determine the first support decision threshold. The first contradiction threshold Global consistency score With the first support threshold The first contradiction threshold Comparison:
[0031] like If so, it is considered supporting evidence; if If the evidence is contradictory, it is considered contradictory; otherwise, it is considered neutral.
[0032] As a further improvement to this technical solution, the evidence feature vector includes a semantic entailment component. , atlas relationship support component , measurement consistency component , source credibility component , and time traceability component .
[0033] As a further improvement of the technical solution, in the S34, a hierarchical aggregation strategy is adopted to calculate the global consistency score of the focus statement The specific implementation steps are as follows:
[0034] S341, group all evidence items according to the credibility level of their evidence sources, and form several evidence groups;
[0035] S342, aggregate the local support degree of all evidence items in each evidence group, and calculate the intra-group aggregated support degree of the evidence group ;
[0036] S343, aggregate the intra-group aggregated support degrees of the evidence groups As input, a model based on Bayesian opinion updating is used for inter-group aggregation to calculate the global consistency score .
[0037] As a further improvement of the technical solution, in the S4, based on the evidence classification result and the claimed classification result, the specific steps of generating the logical consistency score by using the domain knowledge enhanced discriminant model are as follows:
[0038] S41, map the evidence classification result to a basic score ;
[0039] S42, generate a corresponding adjustment factor according to the claimed classification result Adjust the basic score to obtain an adjusted score ;
[0040] S43, based on the adjusted score , introduce an evidence strength integral term , to obtain the final logical consistency score ;
[0041] S44, determine a second support determination threshold and a second contradiction determination threshold Compare the logical consistency score with the second support determination threshold and the second contradiction determination threshold :
[0042] If , it is determined that the claim is true; if If yes, then the claim is determined as doubtful; otherwise, the claim is determined as indeterminable.
[0043] As a further improvement of the technical solution, the explainability report includes the accusation and focus statement summary, evidence discovery and evaluation details, result determination logic and score traceability, and final determination result and uncertainty explanation.
[0044] Compared with the prior art, the present application has the following advantages:
[0045] 1. In the automatic discrimination method of pre-packaged food label based on large language model, the fuzzy product claim is converted into a verifiable specific proposition by introducing the focus statement generation mechanism and the domain knowledge enhanced discrimination model, and deep semantic reasoning and multi-dimensional evidence fusion are performed using the pre-constructed food ingredient knowledge graph, thereby realizing accurate discrimination of implicit misleading and numerical claim compliance in label information, effectively solving the defects of lack of context logical reasoning ability and inability to identify deep semantic contradictions in the prior art, and significantly improving the accuracy, efficiency and explainability of food label review.
[0046] 2. The first layer threshold is used to micro-evaluate each piece of evidence, converting it into a standardized evidence classification result, ensuring the preliminary reliability of data processing; then the second layer threshold is used for macro-decision, comprehensively considering the strength of all evidence, the strictness of the claim type, and the possible evidence conflict or deficiency, etc., for weighted fusion and final determination, thereby effectively solving the evidence conflict or evidence deficiency that cannot be handled by a single threshold, and significantly improving the accuracy of the discrimination result. BRIEF DESCRIPTION OF DRAWINGS
[0047] Figure 1 The overall method flowchart of the present application. DETAILED DESCRIPTION
[0048] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0049] Embodiment:
[0050] Please refer to Figure 1 The present embodiment provides an automatic discrimination method of pre-packaged food label based on large language model, which includes the following steps:
[0051] S1, obtaining structured food label data, the food label data at least containing separated product claim text and ingredient list text; specifically, the full text of the label is extracted by optical character recognition technology, and then the claim paragraph and the ingredient list paragraph are recognized and separated based on natural language processing rules or a sequence labeling model (BiLSTM-CRF), and the separated text is stored in a structured format (such as JSON) to ensure that the subsequent processing steps can be accurately accessed.
[0052] S2, constructing a domain knowledge enhanced discriminant model, inputting the product claim text into the domain knowledge enhanced discriminant model, the discriminant model can analyze the semantics of the product claim text and classify it, and generate a final focus statement for verifying the authenticity of the claim, the focus statement is a natural language proposition that converts ambiguous claims into specific verification conditions;
[0053] In S2, the specific steps of constructing the domain knowledge enhanced discriminant model are as follows:
[0054] A preset base model is selected, and a structured domain knowledge base is constructed, the content in the knowledge base includes the application conditions of the functional claims of nutritional ingredients and the functional attribute classification of key ingredients, training data is generated based on the domain knowledge base, and the base model is modified using the training data, wherein the training data is composed of a plurality of paired samples (input food label claim text, output corresponding standard focus statement template), the base model learns the mapping relationship from the claim to the verification logic to generate the domain knowledge enhanced discriminant model. The preset base model is a sequence-to-sequence or classification generation type large language model based on Transformer, using an encoder-decoder architecture. The domain knowledge base is stored in the form of a relational database, including but not limited to:
[0055] Application conditions of functional claims of nutritional ingredients (quantitative standards for claims such as "high calcium" and "low fat");
[0056] Functional attribute classification of key ingredients (such as sweeteners, preservatives, and nutritional enhancers);
[0057] Abstract verification rule templates (such as verification logic corresponding to non-additive type and content claim type);
[0058] Food ingredient knowledge graph, including physical properties, functional categories, detection methods, and regulatory basis of ingredients.
[0059] In S2, the specific steps of generating a final focus statement for verifying the authenticity of the claim are as follows:
[0060] S21, the discriminant model classifies the input product claim text according to the intention, maps it to a predefined number of claim types, and generates a claim classification result; the predefined number of claim types includes no-addition type, source type, content claim type, and comparison claim type; wherein the no-addition type means that a certain or certain type of specific ingredient is not added. For example, "no added sucrose" and "no artificial colorants". The verification core of this type of claim is to check whether the ingredient or its functional substitute exists.
[0061] The source type means that the ingredients or the product itself of the product are derived from a certain specific raw material or process. For example, "derived from nature" and "100% imported milk source". The verification core of this type of claim is to trace whether the original attribute of the ingredient meets the claim.
[0062] The content claim type means that it claims to contain or not contain a certain nutrient ingredient, and the claim usually has a clear content standard, for example, "high calcium" and "low fat". The verification core of this type of claim is to check whether the value in the nutrient ingredient table meets the quantitative requirements of the relevant national standards for the claim.
[0063] The comparison claim type means that the content of a certain nutrient ingredient is increased or decreased compared with the conventional product of the same type. For example, "30% less salt" and "50% more protein content". The verification core of this type of claim is to confirm whether the comparison benchmark is reasonable and clear, and the current content meets the regulatory requirements.
[0064] S22, according to the classification result, the discriminant model retrieves the corresponding abstract verification rule from the preset claim type and abstract verification rule mapping table;
[0065] The claim type and abstract verification rule mapping table is a key data structure stored in the knowledge base, which associates each claim type with a guiding verification logic template.
[0066] The abstract verification rule is a parameterizable verification condition description without specific entities, which is used to generate specific verification conditions by substituting entities and context by the discriminant model. It is usually expressed in the form of a template sentence or a structured condition. Each type of claim should correspond to at least one abstract rule template (preferably multiple to cover different contexts).
[0067] No-addition type template: verify whether the detection result of the product on [ingredient X] under the recommended detection method is within the 'no-addition' definition range allowed by the regulations; the evidence classification result is product ingredient table, detection report, and formula declaration.
[0068] Content type template: verify whether the content of [nutrient Y] meets [quantitative relationship] (for example, ≥ / ≤ value), the unit of measurement is [unit], the measurement method is [method], and the evidence classification result is nutrient ingredient table or detection report.
[0069] Comparative template: verification and comparison of the basis for comparison of the reference [reference item]: reference source, sample ratio, statistical method, and whether the comparison caliber is consistent (such as dry basis / wet basis), and the evidence classification result is the detection report of two samples and the comparison calculation file.
[0070] S23, the discriminant model substitutes the specific entity and context information in the current claim into the retrieved abstract verification rule to generate a preliminary focus statement of the current claim that is verifiable, and introduces a semantic consistency checking loop for optimization to generate a final focus statement.
[0071] For the above-mentioned example of "no added sucrose", the discriminant model fills in "sucrose" in the variable [X], and obtains the "functional substitution category of sucrose" information from the knowledge base, and finally generates the preliminary focus statement: "verify whether sucrose or any ingredient belonging to high-intensity sweeteners and sugar alcohols is not added in the product". In order to ensure that the generated focus statement is highly consistent with the semantics of the original claim, a semantic consistency checking loop is introduced for optimization.
[0072] In S23, the specific steps for generating the final focus statement by introducing the semantic consistency checking loop for optimization are as follows:
[0073] S231, after generating the preliminary focus statement, the discriminant model compares the preliminary focus statement with the product claim text for semantic consistency, and calculates the semantic consistency score; any one or a combination of the following methods can be used to calculate the score: the inclusion probability based on natural language inference (NLI), the normalized value of sentence vector cosine similarity, or the similarity score obtained by using a question and answer model;
[0074] S232, if the semantic consistency score is lower than the semantic consistency threshold, the discriminant model reclassifies and verifies the preliminary focus statement, until the semantic consistency score is not lower than the semantic consistency threshold or the maximum number of iterations is reached, then the loop ends and outputs the current optimal focus statement as the final focus statement; the semantic consistency threshold is preferably in the range [0.70, 0.90], and the preferred value is 0.80;
[0075] S233, when outputting the final focus statement, the discriminant model simultaneously generates the generation reason of the focus statement, and transmits the generation reason to the explainability report, and the generation reason needs to quote the regulatory provisions or knowledge base entries relied on;
[0076] S3, input the final focus statement and the ingredient list text into the discriminant model enhanced by domain knowledge, the discriminant model retrieves the ingredients related to the focus statement in the ingredient list text, and obtains the evidence classification result by using the pre-constructed food ingredient knowledge graph;
[0077] The food ingredient knowledge graph is a pre-constructed semantic network, with nodes representing food ingredients or nutrients and edges representing relationships between ingredients (such as substitution relationships, functional similarity, detection method association, etc.). The graph data is derived from public databases, industry standards, and scientific literature, and the graph construction uses entity linking and relationship extraction techniques, and is updated regularly to ensure timeliness.
[0078] In S3, the evidence classification result includes supporting evidence, neutral evidence, and contradictory evidence;
[0079] In S3, the discriminant model retrieves ingredients related to the focus statement in the ingredient list text and uses the pre-constructed food ingredient knowledge graph to assist in obtaining the specific steps of the evidence classification result as follows:
[0080] S31, taking the final focus statement and ingredient list text as input, using named entity recognition to extract initial candidate ingredient entities from the ingredient list text and map them to candidate ingredient entities in the food ingredient knowledge graph;
[0081] S32, based on the candidate ingredient entities, retrieve a number of evidence items related to the final focus statement in the domain knowledge enhanced discriminant model; the number of evidence items include but are not limited to: labeled ingredient items, nutrient ingredient table records, formula record segments, third-party detection report metadata, external regulations / knowledge base entries.
[0082] S33, for each evidence item, construct an evidence feature vector, and for each evidence item, calculate the local support degree according to the feature vector ;
[0083] The evidence feature vector includes a semantic implication component , a graph relationship support component , a measurement consistency component , a source credibility component and a time trace component ;
[0084] Wherein, the semantic implication component is generated by at least one natural language reasoning model, and the natural language reasoning model is fine-tuned on the field annotated corpus by contrastive learning to improve the discrimination ability of "verifiability" semantics, and the model output is subjected to confidence calibration for threshold determination;
[0085] The graph relationship support component is calculated by a graph embedding or graph neural network running on the food ingredient knowledge graph, representing the relationship strength or support degree of the evidence entity and the focus statement entity in the knowledge graph;
[0086] The measurement consistency component includes a unit normalization sub-component and a statistical consistency sub-component. The unit normalization sub-component is responsible for converting the physical quantities involved in the evidence into a unified unit of measurement. The statistical consistency sub-component evaluates the numerical consistency by comparing the numerical distribution between several detection reports (for example, using test or robust statistics) and incorporates the results into the measurement consistency component after normalization;
[0087] The source credibility component is calculated by combining the following indicators: detection agency qualification score (value range 0-1), detection method compliance score (value range 0-1), and document verifiability score (value range 0-1). These indicators are fused using a weighted average or multiplicative confidence model to obtain the source credibility component.
[0088] The time traceability component considers the time decay factor of the evidence and the supply chain traceability depth. The time decay factor is implemented as an exponential decay function, for example, where is the time difference from the evidence sampling to the present, is the decay rate), and the traceability depth is calculated based on the reachable path length or the number of verification nodes from the final product node to the raw material node in the knowledge graph.
[0089] Local support The components are combined linearly or nonlinearly according to the weights to obtain the final result. Specifically,
[0090]
[0091] where is the local support of the ith evidence item; is the normalization operation, which uses the Min-Max linear normalization method to map the linearly weighted results to the interval [-1, 1]; is the weight coefficient of the semantic implication component; is the weight coefficient of the graph relationship support component; is the weight coefficient of the measurement consistency component; is the weight coefficient of the source credibility component; is the weight coefficient of the time traceability component;
[0092] S34, generate a local support set based on the local support of all evidence items, and calculate the global consistency score of the focus statement using a hierarchical aggregation strategy ;
[0093] In S34, the global consistency score of the focus statement is calculated using a hierarchical aggregation strategy The specific implementation steps are as follows:
[0094] S341, group all evidence items by their evidence source credibility level, form several evidence groups; credibility level is pre-set based on the authority and objectivity of evidence source, credibility level includes but not limited to:
[0095] High credibility group: contains numerical evidence with clear measurement unit from official nutrient composition table data;
[0096] Medium credibility group: contains evidence from standardized ingredient list description and can be identified by entity normalization through food ingredient knowledge graph;
[0097] Low credibility group: contains evidence from product marketing text and needs complex semantic reasoning to associate with focus statement.
[0098] S342, aggregate the local support of all evidence items in each evidence group, calculate the group-internal aggregated support of the evidence group ;
[0099] To avoid score inflation caused by high correlation of evidence in a single group, group-internal aggregation uses weighted mean deviation method, its calculation formula is:
[0100]
[0101] Where, is the weight of the th evidence (can be set based on its source credibility subdivision); is the weight of the th evidence; is the semantic correlation or source dependency between evidence and evidence , is an adjustment parameter for controlling the strength of correlation penalty;
[0102] S343, take the group-internal aggregated support of each evidence group as input, use the model based on Bayesian opinion update for group-internal aggregation, calculate the global consistency score;
[0103] The model based on Bayesian opinion update regards evidence from high credibility group as information with high prior weight, its update process is as follows:
[0104] Initialization: set a prior global opinion (usually set to neutral, such as 0.5);
[0105] Sequential update: according to the order from high to low of credibility level, use the aggregated support of each evidence group to update the current global opinion by Bayesian method;
[0106] Final score: The posterior probability obtained after updating all evidence sets is the global consistency score. ;
[0107] S35. Determine the first support decision threshold. The first contradiction threshold Global consistency score With the first support threshold The first contradiction threshold Comparison:
[0108] like If so, it is considered supporting evidence; if If the evidence is contradictory, it is considered contradictory; otherwise, it is considered neutral evidence. The first support threshold is... The first contradiction threshold Used for evidence classification, usually set , It can be dynamically adjusted according to the type of claim.
[0109] S4. Based on the results of evidence classification and claim classification, generate a logical consistency score using a domain knowledge-enhanced discriminant model, output the judgment result on the truthfulness of the claim based on the logical consistency score, and generate an interpretability report.
[0110] In S4, the specific steps for generating a logical consistency score using a domain-knowledge-enhanced discriminative model based on the evidence classification results and the claim classification results are as follows:
[0111] S41. Map the evidence classification results to basic scores. ;
[0112] The mapping rule is: if the evidence is classified as supporting evidence, then Initialize to a positive value (e.g., +1.0); if the evidence is contradictory, initialize it to a negative value. (e.g., -1.0); if it is neutral evidence, initialize it to a small random value near zero or zero;
[0113] S42. Based on the claimed classification results, generate the corresponding adjustment factors. Adjust the base score to obtain the adjusted score. ;
[0114] The moderating factor is used to reflect the difference in stringency between different types of claims:
[0115] For absolute claims (such as "additive-free" or "source-based"), due to their stringent requirements, contradictory evidence has a strong veto power; therefore, a [specific requirement] is set. , to amplify the negative impact of contradictory evidence.
[0116] For descriptive or comparative claims (e.g. "content claims", "comparative claims"), set , to keep the fractional linear change.
[0117] The adjusted score is ;
[0118] S43, based on the adjusted score , introduce an evidence strength integration term , to get the final logical consistency score ;
[0119]
[0120] where is a preset integration strength coefficient to balance the contribution ratio between the basic classification result and the overall evidence strength. The score is normalized to the interval [-1, +1], where -1 represents complete contradiction and +1 represents complete consistency.
[0121] S44, determine the second support decision threshold and the second contradiction decision threshold , compare the logical consistency score with the second support decision threshold and the second contradiction decision threshold :
[0122] If , it is determined that the claim is true; if , it is determined that the claim is doubtful; otherwise, it is determined that it cannot be determined; the second support decision threshold and the second contradiction decision threshold are used for final decision, usually set , , which can be automatically relaxed for complex claims.
[0123] The values of the above two thresholds are dynamically adjusted according to the complexity of the current decision focus statement and the total amount of available evidence: when the focus statement is complex (such as involving multiple logical relationships) or the evidence is scarce, the decision threshold is automatically relaxed (i.e. the second support decision threshold is lowered and the second contradiction decision threshold is raised) to avoid making arbitrary conclusions when information is insufficient, outputting "insufficient evidence, cannot be determined" or "neutral" results
[0124] The explainability report includes the charge and focus statement summary, the evidence discovery and evaluation details, the result determination logic and score trace, and the final determination result and uncertainty explanation.
[0125] The charge and focus statement summary includes:
[0126] (1) Product claim text: Directly quoting the original claim to be verified;
[0127] (2) Generated final focus statement: Show the specific proposition generated by the model for verification;
[0128] (3) Claim type classification result: Indicates what type the claim is classified as (such as no-add), and attaches the classification confidence.
[0129] The evidence discovery and evaluation details include:
[0130] (1) Evidence list: Show all evidence items retrieved and involved in the determination in list form. For each evidence item, list the evidence content (such as ingredient name in ingredient list), its evidence classification result (supportive / contradictory / neutral), its local support degree, and the key components of its evidence feature vector;
[0131] (2) Key evidence analysis: Specifically point out the top K evidence items that contribute most to the final determination (positive or negative), and explain their importance.
[0132] The result determination logic and score trace include:
[0133] (1) Composition of global consistency score: Explain how the score is calculated from the evidence support scores of each evidence item through hierarchical aggregation strategy, including but not limited to evidence grouping conditions, intra-group aggregation support and inter-group aggregation method (such as Bayesian update);
[0134] (2) Decomposition of logical consistency score: Show the calculation process of the score in a formula or structured way, and explicitly list: base score , applied claim type adjustment factor and its value reason, evidence strength integral value and its calculation basis, and final score ;
[0135] (3) Threshold determination process: Explicitly list the second support determination threshold and the second contradiction determination threshold used for final determination, and show the comparison result with the threshold.
[0136] The final determination result and uncertainty explanation includes:
[0137] (1) Final determination conclusion: clearly state the conclusion of "claim true", "claim doubtful" or "undetermined";
[0138] (2) Uncertainty or limitation explanation: if the determination is "undetermined", the report needs to explain the reasons, such as insufficient evidence, conflicting evidence or too low classification credibility, etc.
[0139] Example 1:
[0140] For the automatic identification of the claim of no added sucrose, the input data is:
[0141] Product claim text: "This product does not contain sucrose";
[0142] Ingredient list text: "Ingredients: water, fructose syrup, sucrose, food additives";
[0143] Structured data source: extracted from pre-packaged food label images through OCR technology, and separated into claim text and ingredient list.
[0144] Process execution steps:
[0145] The system obtains the above structured claim text and ingredient list text as input.
[0146] The discrimination model classifies the claim text by intent, and the output probability distribution is:
[0147] P={no added type: 0.45, source type: 0.38, content claim type: 0.10, comparison claim type: 0.07}, the classification result is no added type.
[0148] According to the "no added type" classification result, the model retrieves the corresponding abstract verification rule from the pre-set mapping table, for example: "verify whether the product does not add [X] or any ingredient belonging to the functional substitute category of [X]".
[0149] The model substitutes the entity "sucrose" into the rule to generate the initial focus statement: "verify whether the product does not add sucrose or any ingredient belonging to the high-intensity sweetener and sugar alcohol category";
[0150] The discrimination model calculates the semantic consistency score of the initial focus statement with the original claim "this product does not contain sucrose", the score is , and the set semantic consistency threshold is Since , the model triggers the optimization loop and fine-tunes the initial focus statement to generate a new focus statement: "verify whether the sucrose content is less than , and no functional substitute sweetener is used";
[0151] The new claim is calculated for semantic consistency with the original claim, and the score is Since The threshold condition is met, and the loop ends. The claim is output as the final focus claim, and the reason is generated: "According to the verification rules of the additive-free claim, it is necessary to check sucrose and its functional substitutes."
[0152] Use NER technology to extract candidate entities from the ingredient list, such as "sucrose" and "fructose syrup", and map them to nodes in the knowledge graph. Retrieve evidence items (such as "sucrose" in the ingredient list), and construct evidence feature vectors:
[0153] (low semantic implication, directly contradictory to "sucrose"), (strong association between "sucrose" in the graph and the focus claim entity), (inconsistent numerical values), (trustworthy source of ingredient list), (high timeliness).
[0154] Calculate local support:
[0155]
[0156] where the weight coefficient takes the default value ( , , , , ), and the score (negative value indicates contradiction).
[0157] The evidence is classified into the "high credibility group", and the aggregated support within the group is (weighted and unbiased average calculation). The global consistency score (after Bayesian update), is lower than the first contradiction judgment threshold , and is judged as contradictory evidence.
[0158] The evidence is classified as contradictory, and the basic score is mapped .
[0159] The claim type is "additive-free", and the adjustment factor is applied, resulting in .
[0160] Evidence strength integration (based on the number and relevance of evidence), and logical consistency score (after normalization);
[0161] , the claim is determined to be doubtful.
[0162] Output an interpretability report, including a focus statement, a list of evidence (highlighting "sucrose" as contradictory evidence), and score tracing (displaying...). The calculation process and knowledge graph path (showing the association between "sucrose" and sweetener categories) are presented, and manual review of the test report is recommended.
[0163] Example 2:
[0164] For automatic identification of protein content claims, input the following data:
[0165] Product claim text: "Protein" ”;
[0166] Nutrition Facts label text: "Protein: ”;
[0167] Third-party testing report: includes the test number and test value. .
[0168] The system receives the claim text and nutrition facts table text as structured input;
[0169] The discriminant model classifies the claim text and outputs a probability distribution: P={content claim type:0.93,...}, with the classification result being "content claim type".
[0170] Based on the classification results, the corresponding abstract verification rules are retrieved, such as: "Verify whether the content of [nutrient Y] satisfies [quantitative relationship], with the unit of measurement being [unit]".
[0171] The discriminant model will use "protein", " Substituting entities and information into the rules, a preliminary focus statement is generated: "Verify whether the protein content is..." ,unit Calculate the semantic consistency score between the initial focus statement and the original claim, and the score is... ,because If the condition is met directly, there is no need to enter the optimization loop. The declaration is directly output as the final focus declaration, and a reason is generated.
[0172] Retrieve evidence items (nutrition facts records and test reports) and construct a feature vector:
[0173] Nutrition Facts Evidence: , , (Value 12.5 ≥ 10) , ; .
[0174] Test report evidence: , , ( value 12.3 ≥ 10 ), ( third party organization ), ; .
[0175] evidence is divided into "high credibility group", the aggregation within the group , global score , determined as supporting evidence.
[0176] evidence is classified as supporting, ;
[0177] claimed as "content claim type", , get ;
[0178] evidence strength integral , ( after normalization ≈ 0.95 ) ;
[0179] , determined as the truth of the claim.
[0180] output explainability report, list focus statement, evidence details (nutrient table and test report), score decomposition (show calculation), regulatory basis (protein content claim standard), and mark test report number and method basis.
[0181] The above shows and describes the basic principles, main features and advantages of the present application. Those skilled in the art should understand that the present application is not limited to the above examples, and the above examples and descriptions in the specification are only preferred examples of the present application, and are not intended to limit the present application. Without departing from the spirit and scope of the present application, various changes and improvements can be made to the present application, and these changes and improvements all fall within the scope of the present application.
Claims
1. An automatic identification method for prepackaged food labels based on a large language model, characterized in that, Includes the following steps: S1. Obtain structured food label data, which must contain at least the separated product claim text and ingredient list text; S2. Construct a domain knowledge-enhanced discriminant model. Input the product claim text into the domain knowledge-enhanced discriminant model. The discriminant model can parse the semantics of the product claim text and classify it, and generate the final focus statement used to verify the authenticity of the claim. In S2, the specific steps for generating the final focus statement used to verify the authenticity of the claim are as follows: S21. The discriminant model performs intent classification on the input product claim text, maps it to several predefined claim types, and generates claim classification results. S22. Based on the classification results, the discrimination model retrieves the corresponding abstract verification rule from the preset claim type and abstract verification rule mapping table; S23. The discriminative model substitutes the specific entities and contextual information in the current claim into the retrieved abstract verification rules to generate a preliminary focus claim that is currently verifiable. It then introduces a semantic consistency verification loop for optimization to generate the final focus claim. S3. Input the final focus statement and the ingredient list text together into the domain knowledge-enhanced discriminant model. The discriminant model retrieves the ingredients related to the focus statement from the ingredient list text and uses a pre-built food ingredient knowledge graph to assist in obtaining the evidence classification result. S4. Based on the results of evidence classification and claim classification, generate a logical consistency score using a domain knowledge-enhanced discriminant model. Based on the logical consistency score, output the judgment result on the authenticity of the claim and generate an interpretability report.
2. The automatic identification method for prepackaged food labels based on a large language model according to claim 1, characterized in that: In step S2, the specific steps for constructing the domain knowledge-enhanced discriminative model are as follows: A preset base model is selected, and a structured domain knowledge base is constructed. The content of the knowledge base includes the applicable conditions for functional claims of nutritional components and the functional attribute classification of key ingredients. Training data is generated based on the domain knowledge base, and the base model is corrected using the training data, thereby generating a discriminative model enhanced with domain knowledge.
3. The automatic identification method for prepackaged food labels based on a large language model according to claim 1, characterized in that: In step S23, a semantic consistency check loop is introduced for optimization. The specific steps for generating the final focus declaration are as follows: S231. After generating the preliminary focus statement, the discriminant model compares the preliminary focus statement with the product claim text for semantic consistency and calculates the semantic consistency score. S232. If the semantic consistency score is lower than the semantic consistency threshold, the discriminant model will reclassify and validate the initial focus statement until the semantic consistency score is not lower than the semantic consistency threshold or the maximum number of iterations is reached. Then the loop ends and the current optimal focus statement is output as the final focus statement. S233. When outputting the final focus statement, determine the reason for generating the focus statement by the model.
4. The automatic identification method for prepackaged food labels based on a large language model according to claim 1, characterized in that: In S3, the evidence classification results include supporting evidence, neutral evidence, and contradictory evidence.
5. The automatic identification method for prepackaged food labels based on a large language model according to claim 4, characterized in that: In step S3, the specific steps of the discriminative model retrieving components related to the focus statement from the ingredient list text and using a pre-constructed food ingredient knowledge graph to assist in obtaining the evidence classification result are as follows: S31. Take the final focus statement and ingredient list text as input, use named entity recognition to extract initial candidate ingredient entities from the ingredient list text, and map them to candidate ingredient entities in the food ingredient knowledge graph; S32. Based on candidate component entities, retrieve several evidence items related to the final focus statement in a domain knowledge-enhanced discriminative model; S33. Construct an evidence feature vector for each evidence item, and calculate the local support for each evidence item based on the feature vector. ; S34. Generate a local support set based on the local support of all evidence items, and calculate the global consistency score of the focus claims using a hierarchical aggregation strategy. ; S35. Determine the first support decision threshold. The first contradiction threshold Global consistency score With the first support threshold The first contradiction threshold Comparison: like If so, it is considered supporting evidence; if If the evidence is contradictory, it is considered contradictory; otherwise, it is considered neutral.
6. The automatic identification method for prepackaged food labels based on a large language model according to claim 5, characterized in that: The evidence feature vector includes a semantic entailment component. Graph relation support components Measurement of consistency components Source credibility component and time traceability components .
7. The automatic identification method for prepackaged food labels based on a large language model according to claim 6, characterized in that: In step S34, a hierarchical aggregation strategy is used to calculate the global consistency score of the focus declaration. The specific implementation steps are as follows: S341. Group all evidence items according to the credibility level of their evidence sources to form several evidence groups; S342. Aggregate the local support of all evidence items within each evidence group and calculate the intra-group aggregated support for that evidence group. ; S343, Aggregate the support within each evidence group. As input, a model based on Bayesian view updates is used for inter-group aggregation to calculate the global consistency score. .
8. The automatic identification method for prepackaged food labels based on a large language model according to claim 7, characterized in that: In step S4, the specific steps for generating a logical consistency score using a domain-knowledge-enhanced discriminant model based on the evidence classification results and the claim classification results are as follows: S41. Map the evidence classification results to basic scores. ; S42. Based on the claimed classification results, generate the corresponding adjustment factors. Adjust the base score to obtain the adjusted score. ; S43, Based on Adjusted Score Introducing an integral term for the strength of evidence The final logical consistency score is obtained. ; S44. Determine the second support threshold. Second contradiction judgment threshold Logical consistency score With the second support threshold Second contradiction judgment threshold Comparison: like If, then it is determined to be true; if If the claim is true, it is deemed questionable; otherwise, it is deemed uncertain.
9. The automatic identification method for prepackaged food labels based on a large language model according to claim 8, characterized in that: The interpretability report includes a summary of the allegations and key statements, a detailed list of evidence findings and assessments, the logic behind the outcome determination and the source of the scores, and an explanation of the final determination and uncertainties.
Citation Information
Patent Citations
Food product creative concept generation and verification method based on knowledge graph
CN116992959A
Drug knowledge graph clustering construction method based on artificial intelligence
CN117540226A