Method and device for processing commodity packaging material, and electronic device

By performing text content recognition and large language model analysis on images of product packaging materials to be reviewed, the accuracy and efficiency issues of reviewing packaging materials for specific industries in existing technologies have been solved, achieving more efficient text error recognition and location.

CN122200660APending Publication Date: 2026-06-12HANGZHOU NETEASE ZAIGU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
HANGZHOU NETEASE ZAIGU TECH CO LTD
Filing Date
2026-02-26
Publication Date
2026-06-12

Smart Images

  • Figure CN122200660A_ABST
    Figure CN122200660A_ABST
Patent Text Reader

Abstract

The application provides a commodity packaging material processing method and device and electronic equipment, acquires a to-be-audited image corresponding to commodity packaging, determines text content corresponding to each packaging element in the to-be-audited image; processes the text content corresponding to each packaging element based on a preset database, determines error information of target text content corresponding to at least part of the packaging elements; generates to-be-analyzed content corresponding to at least part of the packaging elements; inputs the to-be-analyzed content into a target model, outputs analysis results corresponding to at least part of the packaging elements through the target model, and generates a target image based on the to-be-audited image and the analysis results. This way, the target model based on a large language model analyzes the text content and error information of each packaging element, obtains more accurate analysis results, and generates corresponding icons on the image corresponding to the commodity packaging, which is convenient for users to locate text errors on the commodity packaging and improves the auditing efficiency of the commodity packaging.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of large-scale model technology, and more specifically, to a method, apparatus, and electronic device for processing commodity packaging materials. Background Technology

[0002] In practical applications, it is often necessary to review product packaging materials, such as marking errors in the materials. Related technologies can extract text from the materials using character recognition technology, and then identify typos based on a universal misspelling database and common grammatical error rules across the industry. However, this method is difficult to apply to specific industries and packaging elements, and is prone to misjudging technical terms.

[0003] Another approach is to review product packaging materials using a holistic recognition scheme based on a large model. This method concatenates all the text in the packaging materials into a long text, inputs it into a large language model, and then relies on the model's language understanding capabilities to review the materials. However, in this method, the large language model struggles to comprehensively and accurately review various packaging elements using a single long text, resulting in low efficiency. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a method, apparatus and electronic device for processing product packaging materials, so as to facilitate users in locating textual errors on product packaging and improve the efficiency of product packaging review.

[0005] In a first aspect, embodiments of the present invention provide a method for processing product packaging materials. The method includes: acquiring an image to be reviewed corresponding to the product packaging; determining text content in the image to be reviewed corresponding to each preset packaging element; processing the text content corresponding to each packaging element based on a preset database; determining error information of target text content corresponding to at least some packaging elements; generating content to be analyzed corresponding to at least some packaging elements; the content to be analyzed includes target text content, error information of the target text content, and position information of the target text content in the image to be reviewed; inputting the content to be analyzed into a target model; outputting analysis results corresponding to at least some packaging elements through the target model; and generating a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, the at least one icon being used to indicate error information of the target text content, and / or, the analysis results.

[0006] Secondly, embodiments of the present invention provide a processing apparatus for commodity packaging materials. The apparatus includes: a packaging element text correspondence module, used to acquire an image to be reviewed corresponding to the commodity packaging, and determine the text content corresponding to each preset packaging element in the image to be reviewed; an error information determination module, used to process the text content corresponding to each packaging element based on a preset database, and determine error information for the target text content corresponding to at least some of the packaging elements; a content to be analyzed generation module, used to generate content to be analyzed corresponding to at least some of the packaging elements; the content to be analyzed includes target text content, error information of the target text content, and position information of the target text content in the image to be reviewed; and a target image generation module, used to input the content to be analyzed into a target model, output analysis results corresponding to at least some of the packaging elements through the target model, and generate a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, the at least one icon being used to indicate the error information of the target text content, and / or the analysis results.

[0007] Thirdly, embodiments of the present invention provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor executes the machine-executable instructions to implement the above-described method for processing commodity packaging materials.

[0008] Fourthly, embodiments of the present invention provide a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-described method for processing commodity packaging materials.

[0009] The embodiments of the present invention bring the following beneficial effects: The aforementioned method, apparatus, and electronic device for processing product packaging materials involve: acquiring an image of the product packaging to be reviewed; determining the text content corresponding to each preset packaging element in the image to be reviewed; processing the text content corresponding to each packaging element based on a preset database to determine error information of the target text content corresponding to at least some packaging elements; generating content to be analyzed corresponding to at least some packaging elements; the content to be analyzed includes the target text content, error information of the target text content, and position information of the target text content in the image to be reviewed; inputting the content to be analyzed into a target model; outputting analysis results corresponding to at least some packaging elements through the target model; and generating a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, at least one icon used to indicate error information of the target text content, and / or, the analysis results. This method, after determining the error information of the text content corresponding to the packaging elements in the image to be reviewed based on a preset database, continues to analyze the text content and error information through a target model based on a large language model, obtaining more accurate analysis results of the text content of the packaging elements, and generating icons corresponding to the error information and analysis results on the image to be reviewed, facilitating users to locate text errors on product packaging and improving the efficiency of product packaging review.

[0010] Other features and advantages of the invention will be set forth in the description which follows, and will be apparent in part from the description, or may be learned by practicing the invention. The objects and other advantages of the invention are realized and obtained in accordance with the structures particularly pointed out in the description, claims and drawings.

[0011] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0012] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0013] Figure 1 A flowchart illustrating a method for processing product packaging materials according to an embodiment of the present invention; Figure 2 A schematic diagram of a device for processing commodity packaging materials provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0015] Packaging materials typically refer to product packaging design drafts, including but not limited to design files in formats such as PDF, AI (Adobe Illustrator), JPG, and PNG, containing all text, images, labels, and other information on the product packaging. Packaging materials usually include multiple types of packaging elements. Packaging elements refer to structured information units in the packaging design draft, mainly including: ingredient lists, nutrition facts, promotional text, label elements, and regulatory terminology.

[0016] During the packaging review process, the following issues are typically encountered: 1. For the numerous industry-specific technical terms used in packaging materials (such as ingredient names and nutritional terms in the pet food industry), it is impossible for humans to accurately identify and verify the correctness of these technical terms.

[0017] 2. Does the copywriting on the packaging comply with the Advertising Law, national standards for the corresponding category, and other relevant laws and regulations? 3. Some logical errors on the packaging are easily overlooked during review, such as the recommended feeding amount for pet food, which should increase as the pet's weight increases. 4. During the continuous revision of the design draft, it is necessary to constantly compare it with previous versions. Currently, it is not possible to quickly identify all the differences. Among related technologies, text-based misspelling recognition schemes can be used for error recognition. This technology first extracts text using Optical Character Recognition (OCR), and then recognizes misspellings in the text based on a universal misspelling library, a homophone replacement library, and common grammatical error rules across the industry.

[0018] Error identification can also be performed using a holistic recognition scheme based on a large model. All the text in the packaging design draft is concatenated into a long text and input into a large language model. Relying on the language understanding capabilities of the large model, it is possible to simultaneously complete multiple checks such as "spelling errors, inappropriate semantic use of words, advertising compliance risks, and issues with numerical units".

[0019] Text-based spelling recognition schemes have the following main drawbacks: 1. Lack of industry specificity: General terminology databases are difficult to cover professional terms such as pet food ingredients / nutrition terms, and are prone to misjudging professional terms.

[0020] 2. Unable to identify packaging element types: It is impossible to distinguish structured areas such as ingredient lists, nutrition facts, and promotional slogans, resulting in a lack of differentiation in audit strategies.

[0021] 3. High false alarm rate: Version comparison is sensitive to changes in layout such as line breaks and splits, and cannot effectively filter out "differences caused by text segmentation".

[0022] 4. Incomplete knowledge base: Lacks industry knowledge base (English-Chinese translation of terminology, system of easily confused words, etc.), and has weak verification capabilities.

[0023] The overall recognition scheme based on a large model has the following main drawbacks: 1. Lack of explicit and maintainable industry knowledge base: Industry knowledge is only implied in the model parameters by the text in the prompt words, which is uncontrollable, untraceable and cannot be incrementally maintained.

[0024] 2. Lack of structured understanding and strategic routing at the "packaging element level": LLM receives flat, long texts, which typically cannot reliably distinguish which paragraphs belong to the ingredient list, which are nutrition facts, which are promotional materials, and which are legal information sections. Due to the lack of explicit "packaging element identification and labeling," it is impossible to select different review strategies for different elements.

[0025] Based on this, embodiments of the present invention provide a method, apparatus, and electronic device for processing commodity packaging materials, which can be applied to the review of commodity packaging materials.

[0026] See Figure 1 First, a method for processing commodity packaging materials provided by an embodiment of the present invention will be introduced. This method includes the following steps: Step S102: Obtain the image to be reviewed corresponding to the product packaging, and determine the text content in the image to be reviewed that corresponds to each preset packaging element.

[0027] The aforementioned product packaging can be of any type, such as food, toys, clothing, electronic products, etc., without any restrictions. The image to be reviewed can be one or multiple. When the product packaging is in the form of a bag, the image to be reviewed can include two images corresponding to the front and back of the bag, respectively. When the product packaging is in the form of a cube, the image to be reviewed can include images corresponding to each face of the box. Multiple images can also be combined into a single image for review. Specific settings can be configured according to requirements, without any restrictions.

[0028] The packaging elements for different types of goods are usually different. For example, the packaging elements for food products typically include an ingredient list, nutrition facts, promotional text, label elements, and regulatory terms; while the packaging elements for electronic devices typically include the name, model number, accessories list, promotional text, and regulatory terms.

[0029] The product type corresponding to the product packaging can be pre-labeled, thereby determining the packaging elements corresponding to the image to be reviewed. Furthermore, the text content in the image to be reviewed can be extracted and analyzed to determine the product type of the packaging corresponding to the image, and thus, the corresponding packaging elements.

[0030] Text content corresponding to different wrapper elements is usually displayed in the same area. Text content corresponding to the same wrapper element can be enclosed in a line element to indicate that this text content belongs to the same wrapper element. Text content corresponding to the same wrapper element is usually on the same line, or it may have a line break effect with the text content corresponding to other wrapper elements. Based on the above layout characteristics, the text content in the image to be reviewed can be divided into text content parts belonging to different wrapper elements. Then, the wrapper element corresponding to each text content part can be determined.

[0031] Typically, the text content corresponding to each wrapper element usually includes text content representing the element name of that wrapper element. The wrapper element corresponding to each piece of text content can be determined by reading the text content corresponding to the element name of the wrapper element from the divided text content.

[0032] Step S104: Process the text content corresponding to each packaging element based on a preset database to determine error information for the target text content corresponding to at least some packaging elements.

[0033] The aforementioned database can include data content for different product types and packaging elements. For example, for food products, it can include standardized ingredient names and common spelling errors, standard names of nutritional components, and legally mandated or recommended content ranges. It can also include common homophones / near-homophones, common incorrect abbreviations, and a bilingual (Chinese-English) dictionary, where the dictionary is used to detect translation errors or inconsistencies between the Chinese and English versions.

[0034] For each wrapper element's corresponding text content, the system can retrieve the data content of that wrapper element and general data content from the database. Then, based on the retrieved data content, it can determine whether an error has occurred in the text content of that wrapper element, and if so, what kind of error it is, thereby generating the corresponding error message.

[0035] The text content corresponding to each packaging element may contain error messages, or only some of the packaging content may contain error messages, or no packaging element may contain error messages. If no packaging element contains error messages, the image to be reviewed can be discontinued.

[0036] Step S106: Generate content to be analyzed corresponding to at least some of the packaging elements; the content to be analyzed includes the target text content, error information of the target text content, and the position information of the target text content in the image to be reviewed.

[0037] The aforementioned location information is typically the coordinates of the target text content within the image to be reviewed, which can be determined through image recognition of the image. Specifically, it can be obtained during the process of determining the text content corresponding to each preset packaging element in the image to be reviewed, or it can be obtained through other methods, which are not limited here.

[0038] When there are multiple wrapper elements, it is usually necessary to generate corresponding content to be analyzed for each wrapper element. The format of the content to be analyzed can be preset, and then the target text content, error messages, and location information can be concatenated according to this format to form the content to be analyzed.

[0039] The target model is typically implemented using artificial intelligence techniques. In practical applications, it can be implemented using large language models. Large language models (LLMs) are deep learning models trained on large amounts of text data, enabling them to generate natural language text or understand the meaning of language text. These models can provide in-depth knowledge and language production on various topics by training on massive datasets. Common large language models include ChatGPT, Wenxin Yiyan, Tongyi Qianwen, Newbing, and Bard. The specific large language model selected for weather analysis can be chosen based on the requirements; no restrictions are imposed here.

[0040] To clarify the analysis to be performed on the target model, the content to be analyzed can also include descriptive information, giving the target model a "professional" "identity," such as a nutritionist or an electronics expert. It also specifies what kind of analysis the target model should perform on error information, such as analyzing the causes of errors and the risks associated with them. Furthermore, it can limit the content and format of the analysis results output by the target model. These can be set according to specific needs and are not restricted here.

[0041] Step S108: Input the content to be analyzed into the target model, output the analysis results corresponding to at least some of the packaging elements through the target model, and generate a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, at least one icon is used to indicate error information of the target text content, and / or, the analysis results.

[0042] When at least some packaging elements include multiple packaging elements, the content to be analyzed for each packaging element is typically input into the target model separately. The target model can then analyze and process this content to generate the corresponding analysis results.

[0043] After the target model generates analysis results, icons corresponding to the analysis results or error messages can be generated and added to the image to be reviewed, thus generating the target image. Specifically, the icon can be added to the corresponding position based on the location of the target text content corresponding to the wrapping element in the image to be reviewed. In the implementation, the correspondence between the icon and the error type can be set. For example, highlighting can indicate homophone errors, and a red box can indicate non-compliance with national standards.

[0044] The above-described method for processing product packaging materials involves: acquiring an image of the product packaging to be reviewed; determining the text content corresponding to each preset packaging element in the image to be reviewed; processing the text content corresponding to each packaging element based on a preset database to determine error information of the target text content corresponding to at least some packaging elements; generating content to be analyzed corresponding to at least some packaging elements; the content to be analyzed includes the target text content, error information of the target text content, and position information of the target text content in the image to be reviewed; inputting the content to be analyzed into a target model, outputting analysis results corresponding to at least some packaging elements through the target model, and generating a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, at least one icon used to indicate error information of the target text content, and / or, the analysis results. This method, after determining the error information of the text content corresponding to the packaging elements in the image to be reviewed based on a preset database, continues to analyze the text content and error information through a target model based on a large language model, obtaining more accurate analysis results of the text content of the packaging elements, and generating icons corresponding to the error information and analysis results on the image to be reviewed, making it easier for users to locate text errors on the product packaging and improving the efficiency of product packaging review.

[0045] The following embodiments provide a method for determining the text content in an image to be reviewed that corresponds to each preset packaging element.

[0046] In practical applications, layout analysis can be performed on the image to be reviewed to determine its typesetting features. Typesetting features include one or more of the following: the display position of text content, line spacing, alignment, and display format. Display format can refer to whether the text content is displayed within a border, in a table, or in bold or larger font sizes. This can be achieved using text position and geometric feature extraction techniques. For example, PaddleOCR can be used to extract the coordinates (x0, y0, x1, y1) of each text unit, calculate the font size (through bounding box height) and line spacing (through the difference in y-coordinates between adjacent lines), and determine left, center, and right alignment by statistically analyzing the x-coordinates (standard deviation, mean) of the same line of text. For line and table detection, PaddleOCR's PP-Structure function can be used.

[0047] Based on layout features, the image to be reviewed can be divided into multiple image regions. Each image region can be considered to correspond to a specific packaging element. Next, it is necessary to determine which packaging element each image region corresponds to. This can be done based on the element features of multiple pre-defined packaging elements to determine the corresponding packaging element for each image region.

[0048] The aforementioned element characteristics can include element name, element keywords, and formatting rules. The element name can be one type of element keyword. Element keywords can also include general keywords for this product type, such as national standards (GBXXXX). Formatting rules can include text content corresponding to the same packaging element being within the same border, on the same line, or without explicit line breaks between text content.

[0049] For each of the multiple image regions, the first step is to determine the keywords and text format of the text content within that region. Keywords can be words with specific formats, such as highlighted or bolded words, the most frequently occurring words in the text, or the text can be semantically segmented, with each segmented word serving as a keyword. Further, the keywords and text format of the text content can be matched against the keywords and formatting rules corresponding to each wrapping element to obtain the matching results.

[0050] For each wrapper element, keywords for that wrapper element can be extracted from the keywords in the text content. If they are extracted, the two can be considered to match. Furthermore, the semantic relevance between the keywords in the text content and the keywords in the wrapper element can be compared. This relevance can be used as the degree of matching between the keywords in the text content and the keywords in the wrapper element.

[0051] In practical implementation, a keyword library can be established for each packaging element. Taking the ingredient list as an example, the keyword library for the ingredient list can include the following keywords: ['Ingredients', 'Composition', 'Raw Materials', 'Ingredients', 'Raw Material Composition']; the keyword library for the nutrition facts can include the following keywords: ['Nutritional Components', 'Nutrition', 'Per 100g', 'Energy', 'Protein', 'Nutrition Facts']; the keyword library for the feeding guide can include the following keywords: ['Feeding', 'Feeding', 'Recommended', 'Dosage', 'Weight', 'Feeding Guide']; the keyword library for product selling points can include the following keywords: ['Contains', 'Promotes', 'Improves', 'Nourishes', 'Beautifies Coat']; the keyword library for warnings can include the following keywords: ['Caution', 'Warning', 'Prohibited', 'Applicable', 'Target Audience']. For the text content in each candidate region, perform keyword matching and calculate the matching score: score = number of matched keywords / total number of texts in the region.

[0052] It is also necessary to compare the text format and formatting rules of the text content to determine the degree of matching between the two. Finally, based on preset weights, the matching degree corresponding to keywords, and the matching degree corresponding to formatting rules, the degree of matching between the text content and the wrapping element can be calculated. The above matching results typically include the degree of matching between image regions and each wrapping element.

[0053] After determining the matching results, it is necessary to determine the wrapping element corresponding to the image region based on the matching results. We can first identify the target wrapping element among all the wrapping elements that has the highest degree of matching with the image region, and then directly determine the target wrapping element as the wrapping element corresponding to the image region.

[0054] A matching threshold, referred to as the first threshold, can be preset. If the matching degree between the target packaging element and the image region is greater than or equal to the preset first threshold, the target packaging element can be identified as the packaging element corresponding to the image region. If the matching degree between the target packaging element and the image region is less than the first threshold, it is necessary to combine the statistical characteristics or layout characteristics of the packaging element, or both, to determine the packaging element corresponding to the image region.

[0055] The statistical characteristics of packaging elements typically include font size distribution, text density, number ratio, line count characteristics, table characteristics, and alignment consistency. Font size distribution can include the mean, standard deviation, maximum, and minimum font sizes; text density can be expressed as the ratio of the number of characters to the area; line count characteristics can include the number of lines, average line spacing, and standard deviation of line spacing.

[0056] The statistical characteristics of different packaging elements are usually different. For example, the statistical characteristics of a nutrition facts table are: table lines + percentage of numbers > 0.15 + number of rows >= 5 + alignment consistency 0.8; the statistical characteristics of an ingredient list are: number of rows >= 3 + text density > 0.1; and the statistical characteristics of a feeding guide are: table lines + percentage of numbers > 0.2 + number of numbers >= 10.

[0057] The first threshold mentioned above can be set to 70%. That is, when the matching degree between the target packaging element and the image region is less than 70%, it is necessary to determine the statistical characteristics of the text content in the image region and compare the statistical characteristics of the text content in the image region with the statistical characteristics of the target packaging element. If they are similar, the target packaging element can be determined as the packaging element corresponding to the image region.

[0058] A smaller threshold than the first threshold can also be set. For example, when the first threshold is 70%, another threshold can be set to 40%. When the matching degree between the target packaging element and the image area is less than 40%, a heuristic algorithm based on the layout characteristics of the packaging elements can be used to determine the packaging element corresponding to the image area. According to common layout patterns in packaging design drafts, the layout characteristics of the nutrition facts table are: usually located at the bottom of the page (y>70% of the page height); the layout characteristics of the product selling points are: usually located at the top of the page (y<30% of the page height); the layout characteristics of the warning label are: usually located at the bottom edge (y>85% of the page height); and the layout characteristics of the ingredient list are: usually located near the nutrition facts table (lower middle). Combining the position of the image area in the image to be reviewed and the layout patterns of each packaging element, the packaging element corresponding to the image area can be determined.

[0059] After identifying the wrapper elements corresponding to each image region, the text content within the corresponding image region can be defined as the text content for that wrapper element. There can be one or more image regions corresponding to a wrapper element; this is not limited here.

[0060] The following embodiments provide a method for generating content to be analyzed corresponding to at least some of the packaging elements.

[0061] Typically, cue word templates can be set for each packaging element of the target model. Specifically, refined cue word design techniques targeting specific elements can be used to construct differentiated cue word templates for different packaging elements. The cue word template is used to define at least one of the following: the analysis method for the text content and error messages of the packaging element, the content included in the analysis results output by the target model, and the data format of the analysis results output by the target model. In practical implementation, the cue word template can define the analysis method, such as performing cause analysis, risk classification, and modification suggestions. The cue word template can also require the large model to use a structured format such as JSON as the target data format, and define the content included in the analysis results, such as "a list of typos, a list of potential errors, formatting issues, compliance risk points, and a summary explanation."

[0062] For each target packaging element within at least some of the packaging elements, it is typically necessary to obtain the location information of the target text content corresponding to that packaging element. This location information can be obtained by extracting text from the image to be reviewed. In one specific embodiment, the user may generate a standardized preview image based on the original designed text file; for example, packaging materials generated using an artificial intelligence model can serve as the standardized preview image, i.e., the image to be reviewed. During this process, the "correspondence between text coordinates and the preview image coordinate system" can be recorded in the intermediate representation. This correspondence constitutes the location information, providing a basis for subsequent annotation on the image.

[0063] Furthermore, it is necessary to generate the content to be analyzed corresponding to the target packaging element based on the prompt word template corresponding to the target packaging element, the target text content, the error information corresponding to the target text content, and the position information of the target text content in the image to be reviewed.

[0064] Specifically, error results detected by traditional rule engines and knowledge bases (such as identified discrepancy lists, suspected error words, and logical anomalies) can be combined with pre-set prompt word templates to form a structured context (i.e., "content to be analyzed") which is then input into the error analysis module (usually achieved through a "large model").

[0065] In one specific embodiment, taking the nutrition facts table area as an example, the following content to be analyzed is generated: You are a professional pet food packaging reviewer, specializing in reviewing nutrition facts labels. Please conduct an in-depth analysis of the following nutrition facts label.

[0066] ## Element Type Nutrition Facts ## Text Content {element_text} ## Location Information {position_info} ## Review Task Based on the detection results from the rule engine, please perform the following high-level analysis: 1. Cause Analysis : - For suspected erroneous words identified by the rule engine, analyze the reasons for the error (e.g., whether it is a misjudgment of technical terms, whether it is a common spelling error, etc.). - Regarding formatting issues, analyze their potential impact and compliance risks. 2. Risk Classification : - Categorize the identified issues according to their risk level: High risk: May lead to compliance issues or misleading consumer claims. Medium risk: Formatting issues or potentially ambiguous wording Low risk: Minor formatting issues or suggested improvements 3. Suggested modifications : - Provide specific modification suggestions for each problem. - Explain the correct way to express the revised statement. 4. Cross-validation : - Check if the rule engine's detection results are accurate. - Identify issues that the rule engine may miss. - Verify the accuracy of technical terms ## Output Requirements Please return the results in JSON format, as follows: {{ "typos": [ {{ "word": "incorrect word", "correct": "correct word", "position": location, "reason": "Error cause analysis", "risk_level": "high|medium|low", "source": "rule_engine|llm_discovered", "confidence": 0.0-1.0 }} ], "potential_errors": [ {{ "word": "commonly misspelled words", "suggestion": "suggestion", "reason": "causal analysis", "risk_level": "high|medium|low", "confidence": 0.0-1.0 }} ], "format_issues": [ {{ "issue": "Problem Description", "suggestion": "Recommendation", "risk_level": "high|medium|low", "confidence": 0.0-1.0 }} ], "compliance_risks": [ {{ "risk_type": "risk type", "description": "Risk Description", "risk_level": "high|medium|low", "suggestion": "recommended measures", "confidence": 0.0-1.0 }} ], "summary": Overall audit summary }}""" The following embodiments provide a method for generating the content of the target image by outputting analysis results corresponding to at least some of the packaging elements through the target model and based on the image to be reviewed and the analysis results.

[0067] The aforementioned target model typically includes an error analysis module and an image generation module. For each target wrapping element in at least some of the wrapping elements, the error analysis module first outputs the analysis results of the target text content and error information corresponding to the target wrapping element. Then, the image generation module adds an icon to the image to be reviewed based on the location information of the target text content in the image to be reviewed, the error information, and the analysis results, thereby generating the target image.

[0068] During the process of outputting the analysis results corresponding to the content to be analyzed through the error analysis module, the error analysis module can merge, deduplicate, and cross-validate its own processing results of the text content with the results of the rule engine / knowledge base, retaining the source, confidence level, and evidence fragments of each problem, which is convenient for subsequent auditing and interpretation.

[0069] During the generation of the target image, a corresponding number can be assigned to the text content of each error message. The icons mentioned above can include highlights, arrows, and numbered markers. In some scenarios, the text content of two versions of the image to be reviewed can be input into the target model, causing the model to output a set of differences between the two versions. In this case, a globally unique number can be assigned to each difference based on the set of differences, ensuring a one-to-one correspondence with the entries in the subsequently generated report. The corresponding number can also be marked in the image to be reviewed to generate the target image.

[0070] For the above method embodiments, see Figure 2 The apparatus shown is a processing device for commodity packaging materials, the apparatus comprising: The packaging element text correspondence module 202 is used to obtain the image to be reviewed corresponding to the product packaging and determine the text content in the image to be reviewed that corresponds to each preset packaging element. Error message determination module 204 is used to process the text content corresponding to each packaging element based on a preset database to determine the error message of the target text content corresponding to at least some of the packaging elements. The content to be analyzed generation module 204 is used to generate content to be analyzed corresponding to at least some of the packaging elements; the content to be analyzed includes target text content, error information of the target text content, and position information of the target text content in the image to be reviewed. The target image generation module 206 is used to input the content to be analyzed into the target model, output the analysis results corresponding to at least some of the packaging elements through the target model, and generate a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, the at least one icon is used to indicate the error information of the target text content, and / or the analysis results.

[0071] The aforementioned processing device for product packaging materials acquires an image of the product packaging to be reviewed, determines the text content corresponding to each preset packaging element in the image to be reviewed; processes the text content corresponding to each packaging element based on a preset database, determines error information of the target text content corresponding to at least some packaging elements; generates content to be analyzed corresponding to at least some packaging elements; the content to be analyzed includes the target text content, error information of the target text content, and position information of the target text content in the image to be reviewed; inputs the content to be analyzed into a target model, outputs the analysis results corresponding to at least some packaging elements through the target model, and generates a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, at least one icon used to indicate the error information of the target text content, and / or, the analysis results. This method, after determining the error information of the text content corresponding to the packaging elements in the image to be reviewed based on a preset database, continues to analyze the text content and error information through a target model based on a large language model, obtaining more accurate analysis results of the text content of the packaging elements, and generating icons corresponding to the error information and analysis results on the image to be reviewed, facilitating users to locate text errors on the product packaging and improving the review efficiency of product packaging.

[0072] The aforementioned packaging element text correspondence module is used to: perform layout analysis on the image to be reviewed, and determine the layout features of the image to be reviewed; the layout features include one or more of the following: the display position of the text content, line spacing, alignment, and display format; based on the layout features, divide the image to be reviewed into multiple image regions; based on the element features of multiple preset packaging elements, determine the packaging elements corresponding to each image region in the multiple image regions; for each packaging element, determine the text content in the image region corresponding to the packaging element as the text content corresponding to the packaging element.

[0073] The aforementioned element features include the keywords and formatting rules corresponding to the packaging elements; the aforementioned packaging element text correspondence module is used to: determine the keywords and text format of the text content in each of the multiple image regions; match the keywords and text format with the keywords and formatting rules corresponding to each packaging element to obtain the matching results; and determine the packaging element corresponding to the image region based on the matching results.

[0074] The matching results are used to indicate the degree of matching between the image region and each packaging element; the packaging element text correspondence module is used to: determine the target packaging element with the highest degree of matching with the image region among all packaging elements; and determine the target packaging element as the packaging element corresponding to the image region.

[0075] The above-mentioned packaging element text correspondence module is used to: if the matching degree between the target packaging element and the image region is greater than or equal to a preset first threshold, determine the target packaging element as the packaging element corresponding to the image region; if the matching degree between the target packaging element and the image region is less than the first threshold, determine the packaging element corresponding to the image region based on the statistical characteristics and / or layout characteristics of the packaging element.

[0076] The aforementioned target model includes prompt word templates corresponding to each packaging element; the prompt word templates are used to limit at least one of the following: the analysis method for the text content and error information of the packaging element, the content included in the analysis results output by the target model, and the data format of the analysis results output by the target model. The content to be analyzed generation module is also used to: for each target packaging element among at least some packaging elements, based on the prompt word template corresponding to the target packaging element, the target text content, the error information corresponding to the target text content, and the position information of the target text content in the image to be reviewed, generate the content to be analyzed corresponding to the target packaging element.

[0077] The aforementioned target model includes an error analysis module and an image generation module. The target image generation module is also used to: for each target packaging element in at least some of the packaging elements, output the analysis results of the target text content and error information corresponding to the target packaging element through the error analysis module; and add an icon to the image to be reviewed and generate a target image through the image generation module based on the position information of the target text content in the image to be reviewed, the error information, and the analysis results.

[0078] This embodiment also provides an electronic device, including a processor and a memory. The memory stores machine-executable instructions that can be executed by the processor. The processor executes the machine-executable instructions to implement the above-mentioned method for processing commodity packaging materials, for example: The process involves: acquiring an image of the product packaging to be reviewed; determining the text content corresponding to each pre-defined packaging element in the image to be reviewed; processing the text content corresponding to each packaging element based on a pre-defined database to determine error information for the target text content corresponding to at least some of the packaging elements; generating content to be analyzed corresponding to at least some of the packaging elements; the content to be analyzed includes the target text content, error information of the target text content, and the position information of the target text content in the image to be reviewed; inputting the content to be analyzed into a target model, outputting analysis results corresponding to at least some of the packaging elements through the target model, and generating a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, at least one icon used to indicate error information of the target text content, and / or, the analysis results.

[0079] The above method, after determining the error information of the text content corresponding to the packaging elements in the image to be reviewed based on a preset database, continues to analyze the text content and error information through a target model based on a large language model, to obtain more accurate analysis results of the text content of the packaging elements, and generates icons corresponding to the error information and analysis results on the image to be reviewed, making it easier for users to locate text errors on product packaging and improving the efficiency of product packaging review.

[0080] Optionally, the above steps for determining the text content corresponding to each preset packaging element in the image to be reviewed include: performing layout analysis on the image to be reviewed to determine the layout features of the image to be reviewed; the layout features include one or more of the following: the display position, line spacing, alignment, and display format of the text content; dividing the image to be reviewed into multiple image regions based on the layout features; determining the packaging element corresponding to each image region in the multiple image regions based on the element features of the preset multiple packaging elements; and determining the text content in the image region corresponding to each packaging element as the text content corresponding to the packaging element for each packaging element.

[0081] Optionally, the aforementioned element features include keywords and formatting rules corresponding to the packaging elements; the step of determining the packaging elements corresponding to each image region in multiple image regions based on the preset element features of multiple packaging elements includes: for each image region in multiple image regions, determining the keywords and text format of the text content in the image region; matching the keywords and text format with the keywords and formatting rules corresponding to each packaging element to obtain the matching result; and determining the packaging elements corresponding to the image regions based on the matching result.

[0082] Optionally, the matching results are used to indicate the degree of matching between the image region and each packaging element; the step of determining the packaging element corresponding to the image region based on the matching results includes: determining the target packaging element with the highest degree of matching with the image region among all packaging elements; and determining the target packaging element as the packaging element corresponding to the image region.

[0083] Optionally, the step of determining the target packaging element as the packaging element corresponding to the image region includes: if the matching degree between the target packaging element and the image region is greater than or equal to a preset first threshold, determining the target packaging element as the packaging element corresponding to the image region; if the matching degree between the target packaging element and the image region is less than the first threshold, determining the packaging element corresponding to the image region based on the statistical characteristics and / or layout characteristics of the packaging element.

[0084] Optionally, the target model mentioned above includes prompt word templates corresponding to each packaging element; the prompt word templates are used to limit at least one of the following: the step of generating content to be analyzed corresponding to at least some packaging elements based on the analysis method of the text content and error information of the packaging elements, the content included in the analysis results output by the target model, and the data format of the analysis results output by the target model, including: for each target packaging element among the at least some packaging elements, generating content to be analyzed corresponding to the target packaging element based on the prompt word template corresponding to the target packaging element, the target text content, the error information corresponding to the target text content, and the position information of the target text content in the image to be reviewed.

[0085] Optionally, the target model mentioned above includes an error analysis module and an image generation module; the step of outputting analysis results corresponding to at least some of the packaging elements through the target model, and generating a target image based on the image to be reviewed and the analysis results, includes: for each target packaging element among the at least some packaging elements, outputting analysis results of the target text content and error information corresponding to the target packaging element through the error analysis module; and adding an icon to the image to be reviewed through the image generation module based on the position information of the target text content in the image to be reviewed, the error information, and the analysis results, thereby generating the target image. See also Figure 3 As shown, the electronic device includes a processor 100 and a memory 101. The memory 101 stores machine-executable instructions that can be executed by the processor 100. The processor 100 executes the machine-executable instructions to implement the above-mentioned method for processing commodity packaging materials.

[0086] Furthermore, Figure 3 The electronic device shown also includes a bus 102 and a communication interface 103, with the processor 100, the communication interface 103 and the memory 101 connected via the bus 102.

[0087] The memory 101 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device. Communication between this system network element and at least one other network element is achieved through at least one communication interface 103 (which can be wired or wireless), such as the Internet, wide area network, local area network, metropolitan area network, etc. The bus 102 may be an ISA bus, PCI bus, or EISA bus, etc. The bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 3 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0088] Processor 100 may be an integrated circuit chip with signal processing capabilities. In implementation, each step of the above method can be completed by the integrated logic circuitry in the hardware of processor 100 or by instructions in software form. The processor 100 may be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams of the invention in the embodiments of this invention. The general-purpose processor may be a microprocessor or any conventional processor. The steps of the method invented in conjunction with the embodiments of this invention can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a readily available storage medium in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory 101, and the processor 100 reads the information from memory 101 and, in conjunction with its hardware, completes the steps of the method described in the foregoing embodiments.

[0089] This embodiment also provides a machine-readable storage medium storing machine-executable instructions. When the machine-executable instructions are invoked and executed by a processor, the machine-executable instructions cause the processor to implement the above-mentioned method for processing commodity packaging materials.

[0090] The present invention provides a method, apparatus, and electronic device for processing product packaging materials, including a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the methods described in the preceding method embodiments, for example: The process involves: acquiring an image of the product packaging to be reviewed; determining the text content corresponding to each pre-defined packaging element in the image to be reviewed; processing the text content corresponding to each packaging element based on a pre-defined database to determine error information for the target text content corresponding to at least some of the packaging elements; generating content to be analyzed corresponding to at least some of the packaging elements; the content to be analyzed includes the target text content, error information of the target text content, and the position information of the target text content in the image to be reviewed; inputting the content to be analyzed into a target model, outputting analysis results corresponding to at least some of the packaging elements through the target model, and generating a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, at least one icon used to indicate error information of the target text content, and / or, the analysis results.

[0091] The above method, after determining the error information of the text content corresponding to the packaging elements in the image to be reviewed based on a preset database, continues to analyze the text content and error information through a target model based on a large language model, to obtain more accurate analysis results of the text content of the packaging elements, and generates icons corresponding to the error information and analysis results on the image to be reviewed, making it easier for users to locate text errors on product packaging and improving the efficiency of product packaging review.

[0092] Optionally, the above steps for determining the text content corresponding to each preset packaging element in the image to be reviewed include: performing layout analysis on the image to be reviewed to determine the layout features of the image to be reviewed; the layout features include one or more of the following: the display position, line spacing, alignment, and display format of the text content; dividing the image to be reviewed into multiple image regions based on the layout features; determining the packaging element corresponding to each image region in the multiple image regions based on the element features of the preset multiple packaging elements; and determining the text content in the image region corresponding to each packaging element as the text content corresponding to the packaging element for each packaging element.

[0093] Optionally, the aforementioned element features include keywords and formatting rules corresponding to the packaging elements; the step of determining the packaging elements corresponding to each image region in multiple image regions based on the preset element features of multiple packaging elements includes: for each image region in multiple image regions, determining the keywords and text format of the text content in the image region; matching the keywords and text format with the keywords and formatting rules corresponding to each packaging element to obtain the matching result; and determining the packaging elements corresponding to the image regions based on the matching result.

[0094] Optionally, the matching results are used to indicate the degree of matching between the image region and each packaging element; the step of determining the packaging element corresponding to the image region based on the matching results includes: determining the target packaging element with the highest degree of matching with the image region among all packaging elements; and determining the target packaging element as the packaging element corresponding to the image region.

[0095] Optionally, the step of determining the target packaging element as the packaging element corresponding to the image region includes: if the matching degree between the target packaging element and the image region is greater than or equal to a preset first threshold, determining the target packaging element as the packaging element corresponding to the image region; if the matching degree between the target packaging element and the image region is less than the first threshold, determining the packaging element corresponding to the image region based on the statistical characteristics and / or layout characteristics of the packaging element.

[0096] Optionally, the target model mentioned above includes prompt word templates corresponding to each packaging element; the prompt word templates are used to limit at least one of the following: the step of generating content to be analyzed corresponding to at least some packaging elements based on the analysis method of the text content and error information of the packaging elements, the content included in the analysis results output by the target model, and the data format of the analysis results output by the target model, including: for each target packaging element among the at least some packaging elements, generating content to be analyzed corresponding to the target packaging element based on the prompt word template corresponding to the target packaging element, the target text content, the error information corresponding to the target text content, and the position information of the target text content in the image to be reviewed.

[0097] Optionally, the target model mentioned above includes an error analysis module and an image generation module. The step of outputting analysis results corresponding to at least some packaging elements through the target model and generating a target image based on the image to be reviewed and the analysis results includes: for each target packaging element among the at least some packaging elements, outputting the analysis results of the target text content and error information corresponding to the target packaging element through the error analysis module; and adding an icon to the image to be reviewed based on the position information of the target text content in the image to be reviewed, the error information, and the analysis results through the image generation module to generate the target image. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system and device described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0098] Furthermore, in the description of the embodiments of the present invention, unless otherwise explicitly specified and limited, the terms "installation," "connection," and "linking" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in the present invention based on the specific circumstances.

[0099] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0100] In the description of this invention, it should be noted that the terms "center," "upper," "lower," "left," "right," "vertical," "horizontal," "inner," and "outer," etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are used only for the convenience of describing the invention and for simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on the invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and should not be construed as indicating or implying relative importance.

[0101] Finally, it should be noted that the above embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the technical scope disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A method for processing commodity packaging materials, characterized in that, The method includes: Obtain the image to be reviewed corresponding to the product packaging, and determine the text content in the image to be reviewed that corresponds to each preset packaging element; Based on a preset database, the text content corresponding to each of the packaging elements is processed to determine error information of the target text content corresponding to at least some of the packaging elements. Generate content to be analyzed corresponding to at least some of the packaging elements; the content to be analyzed includes the target text content, error information of the target text content, and position information of the target text content in the image to be reviewed. The content to be analyzed is input into the target model, and the target model outputs the analysis results corresponding to at least some of the packaging elements. Based on the image to be reviewed and the analysis results, a target image is generated. The target image includes at least one icon, which is used to indicate error information of the target text content and / or the analysis results.

2. The method according to claim 1, characterized in that, The step of determining the text content corresponding to each preset packaging element in the image to be reviewed includes: The layout of the image to be reviewed is analyzed to determine its layout features; the layout features include one or more of the following: the display position, line spacing, alignment, and display format of the text content; Based on the layout features, the image to be reviewed is divided into multiple image regions; Based on the element features of multiple preset packaging elements, the packaging elements corresponding to each image region in the multiple image regions are determined; For each of the packaging elements, the text content in the image area corresponding to the packaging element is determined as the text content corresponding to the packaging element.

3. The method according to claim 2, characterized in that, The element features include the keywords and formatting rules corresponding to the packaging elements; The step of determining the packaging element corresponding to each image region in the multiple image regions based on the element features of multiple preset packaging elements includes: For each of the plurality of image regions, determine the keywords and text format of the text content in that image region; The keywords and text format are matched with the keywords and format rules corresponding to each of the packaging elements to obtain the matching results; Based on the matching results, the packaging element corresponding to the image region is determined.

4. The method according to claim 3, characterized in that, The matching result is used to indicate the degree of matching between the image region and each of the packaging elements; The step of determining the wrapper element corresponding to the image region based on the matching result includes: Identify the target packaging element among all the packaging elements that has the highest degree of matching with the image region; The target packaging element is determined as the packaging element corresponding to the image region.

5. The method according to claim 4, characterized in that, The step of determining the target wrapping element as the wrapping element corresponding to the image region includes: If the matching degree between the target packaging element and the image region is greater than or equal to a preset first threshold, the target packaging element is determined as the packaging element corresponding to the image region. If the matching degree between the target packaging element and the image region is less than the first threshold, the packaging element corresponding to the image region is determined based on the statistical characteristics and / or layout characteristics of the packaging element.

6. The method according to claim 1, characterized in that, The target model includes prompt word templates corresponding to each packaging element; the prompt word templates are used to define at least one of the following: the analysis method for the text content and error information of the packaging element, the content included in the analysis results output by the target model, and the data format of the analysis results output by the target model; The step of generating the content to be analyzed corresponding to at least some of the packaging elements includes: For each target packaging element among the at least some packaging elements, based on the prompt word template corresponding to the target packaging element, the target text content, the error information corresponding to the target text content, and the position information of the target text content in the image to be reviewed, the content to be analyzed corresponding to the target packaging element is generated.

7. The method according to claim 6, characterized in that, The target model includes an error analysis module and an image generation module; The steps of outputting analysis results corresponding to at least some of the packaging elements through the target model, and generating a target image based on the image to be reviewed and the analysis results, include: For each target packaging element among the at least some packaging elements, the error analysis module outputs the analysis results of the target text content and error information corresponding to the target packaging element. The image generation module adds an icon to the image to be reviewed based on the location information of the target text content in the image to be reviewed, the error information, and the analysis results, thereby generating the target image.

8. A processing device for commodity packaging materials, characterized in that, The device includes: The packaging element text correspondence module is used to obtain the image to be reviewed corresponding to the product packaging and determine the text content in the image to be reviewed that corresponds to each preset packaging element; The error information determination module is used to process the text content corresponding to each of the packaging elements based on a preset database, and determine the error information of the target text content corresponding to at least some of the packaging elements. The content to be analyzed module is used to generate content to be analyzed corresponding to at least some of the packaging elements; the content to be analyzed includes the target text content, error information of the target text content, and position information of the target text content in the image to be reviewed. The target image generation module is used to input the content to be analyzed into the target model, output the analysis results corresponding to at least some of the packaging elements through the target model, and generate a target image based on the image to be reviewed and the analysis results; the target image includes at least one icon, the at least one icon is used to indicate the error information of the target text content, and / or the analysis results.

9. An electronic device, characterized in that, The method includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the method for processing commodity packaging materials according to any one of claims 1-7.

10. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores machine-executable instructions, which, when invoked and executed by a processor, cause the processor to implement the method for processing commodity packaging materials as described in any one of claims 1-7.