Language model pre-training methods, product information processing methods and related devices

By recognizing, segmenting, and filtering the text on product images, and using successfully paired text combinations to pre-train the language model, the problem of limited improvement of generative pre-trained language models in generative text summarization is solved, and the accuracy of the model in processing product information is improved.

CN115935579BActive Publication Date: 2026-11-17BEIJING JINGDONG SHANGKE INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210005974.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-04
Publication Date
2026-11-17
Estimated Expiration
2042-01-04

AI Technical Summary

Technical Problem

Existing generative pre-trained language models offer limited improvement in generative text summarization tasks, resulting in low accuracy of the final trained model when processing product information.

Method used

By acquiring product images, using an optical character recognition model to identify text and determine location information, the text is divided into image titles and description text. Statements that do not meet quality requirements are filtered out, and after pairing, a pre-built language model is pre-trained for generative text summarization to obtain a pre-trained language model.

Benefits of technology

This improves the accuracy of generative text summarization, making subsequent models output more accurate results when processing product information.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115935579B_ABST
    Figure CN115935579B_ABST
Patent Text Reader

Abstract

This application discloses a pre-training method for a language model, a product information processing method, and related apparatus. The pre-training method for the language model includes: acquiring multiple product images; identifying the text on each product image and determining the positional information of the text on each product image; based on the positional information of the text on each product image, dividing the text on each product image into an image title and descriptive text; filtering out sentences in each group of text combinations that do not meet preset quality requirements; a group of text combinations includes an image title and descriptive text on a product image; for each group of text combinations, pairing the image title with the descriptive text to determine whether the image title is a summary of the descriptive text; and using the successfully paired groups of text combinations to pre-train the pre-trained language model using generative text summarization to obtain the pre-trained language model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of model pre-training technology, and in particular to a language model pre-training method, a product information processing method, and related apparatus. Background Technology

[0002] Pre-training of language models is a hot topic in the field of natural speech processing technology. It significantly improves the performance of downstream tasks obtained through subsequent training, especially generative pre-trained language models, which greatly enhance downstream tasks such as generative text summarization and generative question answering.

[0003] Existing generative pre-trained language models mask a portion of the input text and feed it into a pre-training model for pre-training. The goal is to have the encoder of the pre-trained model encode the masked text, and then the decoder decodes it to generate the masked text.

[0004] However, since the pre-training task in this approach is a general text generation task, the difference between the two is significant when the downstream task is generative text summarization. Therefore, this approach offers limited improvement for generative text summarization. Consequently, the model subsequently trained using the pre-trained model to perform the downstream task has lower accuracy when processing product information. Summary of the Invention

[0005] In view of the shortcomings of the prior art, this application provides a pre-training method for language models, a product information processing method and related apparatus to solve the problem that the existing methods have limited improvement on generative text summarization models, resulting in low accuracy of the output results of the finally trained models.

[0006] To achieve the above objectives, this application provides the following technical solution:

[0007] The first aspect of this application provides a pre-training method for a language model, comprising:

[0008] Get multiple product images;

[0009] The text on each product image is identified using an optical character recognition model, and the location information of the text on each product image is determined.

[0010] Based on the positional information of the text on each product image, the text on each product image is divided into image title and description text;

[0011] Each text combination that does not meet the preset quality requirements is filtered out; wherein, each text combination includes the image title and the description text on a product image;

[0012] For each group of texts obtained after filtering, the image title in the text group is paired with the introductory text to determine whether the image title is a summary of the introductory text;

[0013] The pre-built language model is pre-trained using generative text summarization of the successfully paired text combinations to obtain the pre-trained language model.

[0014] Optionally, in the above-described pre-training method for the language model, the step of dividing the text on each product image into image title and descriptive text based on the positional information of the text on each product image includes:

[0015] For each of the product images, based on the position information of the text on the product image, determine the text on the product image that meets preset conditions; wherein, the preset conditions are that the corresponding paragraph in the product image is centered and has the largest font size among all the texts on the product image;

[0016] The text that meets the preset conditions will be determined as the image title corresponding to the product image, and the remaining text on the product image will be determined as the description text corresponding to the product image.

[0017] Optionally, in the above-described pre-training method for the language model, the step of filtering out sentences that do not meet the preset quality requirements in each group of text combinations includes:

[0018] Based on the text height in the recognition results of the optical character recognition model corresponding to each group of text combinations, sentences with a font height less than a preset height in each group of text combinations are filtered out;

[0019] Based on the confidence level in the recognition results of the optical character recognition model corresponding to each group of text combinations, sentences with a confidence level lower than a preset confidence level in each group of text combinations are filtered out.

[0020] For each group of text combinations, the perplexity of each statement in the text combination is calculated using the GPT model, and statements with perplexity greater than a preset perplexity are filtered out.

[0021] Optionally, in the above-described pre-training method for the language model, the step of pairing the image title with the descriptive text in each filtered text combination includes:

[0022] For each of the text combinations obtained after filtering, the text combination is input into a pre-trained pairing model to obtain the pairing result corresponding to the text combination; wherein, the pairing model is pre-trained using multiple sets of positive samples and multiple sets of negative samples; one set of positive samples includes an input text and its corresponding summary summary; one set of negative samples includes an input text and its corresponding random sample summary.

[0023] A second aspect of this application provides a method for processing product information, including:

[0024] Obtain target product information for the target product; the target product information is product information belonging to a specified type.

[0025] The target product information of the target product is input into a pre-trained target language model. The target language model processes the target product information of the target product to obtain the concise text information corresponding to the target product information. The target language model is pre-trained using the target product information of multiple products. The pre-trained language model is pre-trained using multiple successfully paired text combinations to pre-train the pre-constructed language model. Each text combination consists of an image title and descriptive text obtained from a product image.

[0026] Optionally, in the above-described product information processing method, the training method for the target language model includes:

[0027] Obtain target product information for multiple products and the expected simplified text information corresponding to the target product information of each product;

[0028] The target product information of each of the aforementioned products is input into the pre-trained language model to obtain the predicted simplified text information corresponding to the target product information of each of the aforementioned products;

[0029] Determine whether the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold;

[0030] If it is determined that the error between the currently obtained predicted simplified text information and the expected simplified text information is not less than a preset threshold, then the pre-trained language model is tuned based on the error between the currently obtained predicted simplified text information and the expected simplified text information, and for the tuned pre-trained language model, the process of inputting the target product information of each product into the pre-trained language model is returned.

[0031] If the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold, then the current pre-trained language model is determined as the target language model.

[0032] A third aspect of this application provides a pre-training device for a language model, comprising:

[0033] The acquisition unit is used to acquire multiple product images;

[0034] The recognition unit is used to recognize the text on each of the product images using an optical character recognition model, and to determine the position information of the text on each of the product images;

[0035] The segmentation unit is used to divide the text on each product image into image title and description text based on the position information of the text on each product image;

[0036] A filtering unit is used to filter out statements in each group of text combinations that do not meet the preset quality requirements; wherein, a group of text combinations includes the image title and the description text on a product image;

[0037] A pairing unit is used to pair the image title in each of the filtered text combinations with the introductory text to determine whether the image title is a summary of the introductory text.

[0038] The training unit is used to pre-train the pre-built language model with generative text summarization using the successfully paired text combinations, thereby obtaining a pre-trained language model.

[0039] Optionally, in the pre-training device for the language model described above, the partitioning unit includes:

[0040] The first determining unit is used to determine, for each of the product images, the text on the product image that meets preset conditions based on the position information of the text on the product image; wherein, the preset conditions are that the corresponding paragraph in the product image is centered and has the largest font size among all the texts on the product image;

[0041] The second determining unit is used to determine the text that meets the preset conditions as the image title corresponding to the product image, and to determine the remaining text on the product image as the description text corresponding to the product image.

[0042] Optionally, in the pre-training device for the language model described above, the filtering unit includes:

[0043] The first filtering unit is used to filter out sentences in each group of text combinations whose font height is less than a preset height based on the text height in the recognition result of the optical character recognition model corresponding to each group of text combinations.

[0044] The second filtering unit is used to filter out statements in each group of text combinations whose confidence level is less than a preset confidence level, based on the confidence level in the recognition result of the optical character recognition model corresponding to each group of text combinations.

[0045] The third filtering unit is used to calculate the perplexity of each statement in each text combination using the GPT model for each group of text combinations, and to filter out statements with perplexity greater than a preset perplexity.

[0046] Optionally, in the pre-training device for the language model described above, the pairing unit includes:

[0047] A pairing subunit is used to input each of the filtered text combinations into a pre-trained pairing model to obtain the pairing result corresponding to the text combination; wherein, the pairing model is pre-trained using multiple sets of positive samples and multiple sets of negative samples; one set of positive samples includes an input text and its corresponding summary summary; one set of negative samples includes an input text and its corresponding random sample summary.

[0048] The fourth aspect of this application provides a commodity information processing apparatus, comprising:

[0049] The first acquisition unit is used to acquire target product information of the target product; the target product information is product information belonging to a specified type.

[0050] The input unit is used to input the target product information of the target product into a pre-trained target language model, and to process the target product information of the target product through the target language model to obtain the concise text information corresponding to the target product information of the target product; wherein, the target language model is pre-trained using the target product information of multiple products to train a pre-trained language model; the pre-trained language model is pre-trained using multiple successfully paired text combinations to pre-train a pre-constructed language model; a text combination includes an image title and descriptive text obtained from a product image.

[0051] Optionally, the above-mentioned commodity information processing device further includes:

[0052] The second acquisition unit is used to acquire target product information of multiple products and expected simplified text information corresponding to the target product information of each product.

[0053] The input unit is used to input the target product information of each of the products into the pre-trained language model to obtain the predicted simplified text information corresponding to the target product information of each of the products.

[0054] The judgment unit is used to determine whether the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold.

[0055] The parameter tuning unit is used to tune the pre-trained language model based on the error between the currently obtained predicted simplified text information and the expected simplified text information if the error is not less than a preset threshold, and to return to the pre-trained language model after parameter tuning, to input the target product information of each product into the pre-trained language model respectively.

[0056] The determining unit is configured to determine the current pre-trained language model as the target language model if the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold.

[0057] The fifth aspect of this application provides an electronic device, comprising:

[0058] Memory and processor;

[0059] The memory is used to store programs;

[0060] The processor is used to execute the program, which, when executed, is specifically used to implement the pre-training method of the language model as described in any of the above, or to implement the product information processing method as described in any of the above.

[0061] The sixth aspect of this application provides a computer storage medium for storing a computer program, which, when executed, is used to implement a pre-training method for a language model as described in any one of the preceding claims, or to implement a product information processing method as described in any one of the preceding claims.

[0062] This application provides a pre-training method for a language model. Multiple product images are acquired, and then the text on each product image is recognized using an optical character recognition (OCR) model. The positional information of the text on each product image is determined, and based on this positional information, the text on each product image is divided into an image title and descriptive text. Statements in each text combination that do not meet preset quality requirements are filtered out, thus ensuring the quality of the obtained data is suitable for pre-training. Each text combination includes an image title and descriptive text from one of the product images. Then, for each filtered text combination, the image title and descriptive text are paired to determine if the image title is a summary of the descriptive text, thereby obtaining a large amount of input text and its corresponding summaries. Finally, the successfully paired text combinations are used to pre-train the pre-trained language model for generative text summarization, resulting in a pre-trained model. Since the pre-training process of the language model involves generating titles from the descriptive text, it is similar to the task of generative text summarization, thus significantly improving the performance. This also ensures the accuracy of the output results of the model further trained using the pre-trained model to perform downstream tasks. Attached Figure Description

[0063] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.

[0064] Figure 1 A flowchart illustrating a language model pre-training method provided in this application embodiment;

[0065] Figure 2 A flowchart illustrating a method for dividing image titles and descriptive text, as provided in another embodiment of this application;

[0066] Figure 3 A schematic diagram of a product image provided in an example for another embodiment of this application;

[0067] Figure 4 A flowchart illustrating a method for filtering statements in a text combination, as provided in another embodiment of this application;

[0068] Figure 5 A flowchart illustrating a product information processing method provided in another embodiment of this application;

[0069] Figure 6A flowchart illustrating a training method for a target language model, provided as another embodiment of this application;

[0070] Figure 7 A schematic diagram of the structure of a language model pre-training device provided in another embodiment of this application;

[0071] Figure 8 This is a schematic diagram of a partitioning unit provided in another embodiment of this application;

[0072] Figure 9 This is a schematic diagram of the structure of a filtering unit provided in another embodiment of this application;

[0073] Figure 10 A schematic diagram of the structure of a commodity information processing device provided in another embodiment of this application;

[0074] Figure 11 This is a schematic diagram of the structure of an electronic device provided in another embodiment of this application. Detailed Implementation

[0075] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0076] In this application, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0077] This application provides a method for pre-training a language model, such as... Figure 1 As shown, it includes the following steps:

[0078] S101. Obtain multiple product images.

[0079] It should be noted that, in this embodiment, "product image" can refer to images promoting products, such as product posters or product images on e-commerce platforms. These types of images typically include a title for the product and a detailed description of that title. Therefore, the product title serves as a summary of its detailed description, perfectly matching the data requirements of input text and its corresponding output summary. Thus, in this embodiment, product images are used to obtain the "input text - output summary" data.

[0080] Alternatively, images can be obtained from a database or scraped from a large number of product detail pages on e-commerce platforms.

[0081] S102. Identify the text on each product image using an optical character recognition model, and determine the position information of the text on each product image.

[0082] In this embodiment, an existing Optical Character Recognition (OCR) model is used to recognize the text on each product image, and the position information of each character in the recognized text is determined. The position information of the text can be information about the text's position relative to the edge of the product image, such as centered, right-aligned, or left-aligned; it can also be specific coordinate information; or both; or other information that can represent the text's position on the product image.

[0083] S103. Based on the position information of the text on each product image, divide the text on each product image into image title and description text.

[0084] It's worth noting that product image titles are typically centered within the product image, and are usually short and separated from other text. Therefore, based on the positional information of the text on each product image, text meeting these characteristics can be designated as image titles, while the remaining text can be designated as descriptive text. Of course, image titles often also have attributes such as larger font size and artistic font. Therefore, to make the segmentation more specific, it's possible to further divide the text on each product image into image titles and descriptive text based on the positional information and other attributes.

[0085] Optionally, in another embodiment of this application, a specific implementation of step S103 is as follows: Figure 2 As shown, it includes the following steps:

[0086] S201. For each product image, determine the text that meets the preset conditions on the product image based on the position information of the text on the product image.

[0087] The preset conditions are that the corresponding paragraph in the product image is centered and has the largest font size among all texts in the product image.

[0088] S202. Text that meets the preset conditions will be identified as the image title corresponding to the product image, and the remaining text on the product image will be identified as the description text corresponding to the product image.

[0089] In this embodiment, based on the positional information and font of the text on the product image, the text is divided into image title and descriptive text. Specifically, the text centered on the product image and with the largest font size is determined as the image title, and the remaining text on the product image is determined as the descriptive text. For example, as... Figure 3 The image of the air conditioner shows the text centered and in the largest font size on the picture, which reads "No need for manual defrosting, food is cooled evenly." Therefore, this text is determined as the image title. The text "The frost-free air-cooling system distributes cold air evenly throughout the refrigerator, preventing food from spoiling and eliminating frost, making cleaning easier from the start" is a description of the image title. It is not the centered and largest font size text on the picture, so it is determined as the description text.

[0090] S104. Filter out sentences in each text combination that do not meet the preset quality requirements.

[0091] One set of text includes the image title on a product image and the descriptive text.

[0092] It should be noted that since a large number of text combinations are obtained through steps S101 to S103, a large amount of data can be acquired without manual annotation. However, because the text is obtained from product images using OCR technology, inaccuracies may occur during the recognition process. Furthermore, unsuitable data from product images may also be recognized. Therefore, not all text combinations obtained are necessarily suitable for subsequent pre-training. Thus, it is necessary to filter the text according to preset quality requirements.

[0093] Optionally, in another embodiment of this application, one specific implementation of step S104 is as follows: Figure 4 As shown, the specific steps include:

[0094] S401. Based on the text height in the recognition results of the optical character recognition model corresponding to each text combination, filter out sentences in each text combination whose font height is less than the preset height.

[0095] Because product images may contain small text, which is usually non-critical information and therefore not part of the image title, it will still be detected during image recognition and needs to be filtered out.

[0096] It should be noted that when recognizing the text on each product image using the OCR model, a recognition result will be obtained. The recognition result will include the recognized text and the text height of each text. Therefore, based on the text height in the OCR recognition result corresponding to each text combination, sentences with a font height smaller than the preset height in each text combination can be filtered out.

[0097] S402. Based on the confidence level in the recognition results of the optical character recognition model corresponding to each text combination, filter out statements in each text combination whose confidence level is less than the preset confidence level.

[0098] Here, confidence level refers to the statistical confidence level. Also called confidence degree, it refers to the degree to which a specific individual believes in the truth of a particular proposition. In the embodiments of this application, the confidence level of the recognition result can be understood as the degree of credibility of the recognition result obtained by the optical character recognition model in recognizing text on an image.

[0099] It should be noted that when recognizing text on each product image using an OCR model, the recognition result also includes the confidence score of the recognized text. Text with low confidence scores often indicates recognition errors, so the confidence score can be used to identify and correct these errors. Therefore, to ensure the quality of the text combination, in this embodiment, statements with confidence scores lower than a preset confidence score are directly filtered out. Optionally, the confidence score of a statement can be the average confidence score of each character that makes up the statement.

[0100] S403. For each text combination, use the GPT model to calculate the perplexity of each statement in the text combination, and filter out statements with perplexity greater than the preset perplexity.

[0101] In language processing, perplexity is a parameter used to measure the quality of a language probability model. In the embodiments of this application, the perplexity of a statement can be understood as the probability of the statement appearing in its current position.

[0102] In language models, the perplexity of a given text is used to evaluate the quality of the trained language model. Therefore, given a fixed language model, the perplexity of the text can also reflect the quality of the text. Thus, by calculating the perplexity of each sentence in a text combination using a trained GPT model, sentences with perplexity greater than a preset perplexity are filtered out, thereby filtering out texts of lower quality.

[0103] Among them, the GPT model (GereratePre-TrainingModel) is a deep language model, mainly used to prove the effectiveness of large models and datasets.

[0104] S105. For each text combination obtained after filtering, pair the image title in the text combination with the introductory text to determine whether the image title is a summary of the introductory text.

[0105] It should be noted that while dividing the text on each product image into image title and description text based on the positional information of the text on each image is a high-probability event and can completely guarantee the accurate acquisition of the image title, the description text may not necessarily be the content described in the image title. Therefore, the image title is not necessarily a summary of the description text. Thus, it is necessary to pair the image title with the description text to determine whether the image title is a summary of the description text, and text combinations that do not match need to be discarded.

[0106] It should be noted that the two match successfully when the image title is a summary of the introductory text.

[0107] For example, see also Figure 3 As shown, a set of text extracted from the image contains the following text: The image title is "No manual defrosting required, food is cooled evenly," and the description text is "The frost-free system distributes cold air evenly throughout the refrigerator, preventing food spoilage and eliminating frost, making cleaning easier." Clearly, the image title is a summary of the description text, so the two match. However, if the extracted image title is not "No manual defrosting required, food is cooled evenly," but rather "Latest Generation Smart Refrigerator," then while the image title is related to the description text, it is not a summary of the description text, and therefore the match fails.

[0108] Optionally, the matching degree between the image title and the description text can be used to determine whether the image title and the description text are successfully matched, or other matching methods can be used.

[0109] Optionally, in another embodiment of this application, a specific implementation of step S105 includes:

[0110] For each of the filtered text combinations, the text combination is input into a pre-trained pairing model to obtain the pairing result corresponding to the text combination.

[0111] The pairing model is pre-trained using multiple sets of positive and negative samples. A set of positive samples includes an input text and its corresponding summary. A set of negative samples includes an input text and its corresponding randomly sampled summary, i.e., a portion of the input text is randomly selected as its summary.

[0112] S106. Using the successfully paired text combinations, pre-train the pre-built language model to generate text summarization, and obtain the pre-trained language model.

[0113] The pre-training process involves the encoder of a pre-trained language model encoding the introductory text, and the decoder decoding it to generate the image title.

[0114] It's important to note that the decoder ultimately outputs the probabilities of each character in the image title, i.e., the probabilities of each character indicating the image title. Therefore, when the output probability values ​​are sufficiently high, it's equivalent to generating the image title. So, the pre-training process involves taking an input text combination as an introductory text and ensuring that the output probabilities of each character in the image title within that text combination are as high as possible.

[0115] Specifically, during the pre-training process, the introductory texts from each successfully paired text combination are input into the pre-trained language model. The encoder of the pre-trained language model encodes each character of the introductory text to obtain a latent feature vector. Then, the decoder decodes the latent feature vector to obtain the probability of each character in the image title of the text combination, and adjusts the model according to the output structure.

[0116] This application provides a pre-training method for a language model. Multiple product images are acquired, and then the text on each product image is identified using an optical character recognition (OCR) model. The positional information of the text on each product image is determined. Based on the positional information, the text on each product image is divided into an image title and descriptive text. Statements in each text combination that do not meet preset quality requirements are filtered out, thus ensuring the quality of the obtained data is suitable for pre-training. Each text combination includes an image title and descriptive text from one of the product images. Then, for each filtered text combination, the image title and descriptive text are paired to determine if the image title is a summary of the descriptive text, thereby obtaining a large amount of input text and its corresponding summaries. Finally, the successfully paired text combinations are used to pre-train the pre-trained language model using generative text summarization, resulting in a pre-trained language model. Since the pre-training process of the language model involves generating titles from descriptive text, it is similar to the task of generative text summarization, thus significantly improving its performance. Finally, it should be noted that the pre-training method for the language model provided in this application embodiment can also be applied to all generative language models.

[0117] Based on the trained language model obtained above, embodiments of this application provide a product information processing method, such as... Figure 5 As shown, it includes:

[0118] S501. Obtain the target product information.

[0119] Among them, the target product information is product information belonging to a specified type. That is, the target product information is a certain type of information related to the product specified according to the needs, such as product introduction information, questions about the product, etc.

[0120] It should be noted that after specifying the target product information, the corresponding settings for obtaining the target product information are required.

[0121] S502. Input the target product information of the target product into the pre-trained target language model, and process the target product information of the target product through the target language model to obtain the simplified text information corresponding to the target product information.

[0122] It should be noted that the concise text information corresponding to the target product information refers to the shorter text information obtained from the target product information compared to the target product information itself. For example, the concise text information corresponding to the product description text could be a summary of the description text, a title derived from other product information, or a simple answer generated based on a user's online question about the product. For instance, if a user inputs the question, "What is the power of model B of brand A air conditioner?", the concise text information obtained through the target language model could be a power value.

[0123] The target language model is pre-trained using target product information from multiple products. The pre-trained language model is further pre-trained using multiple successfully paired text combinations. Each text combination consists of an image title and descriptive text obtained from a single product image. The specific methods for obtaining these text combinations and the specific training methods for the pre-trained language model can be found in the language model pre-training methods provided in the above embodiments, and will not be elaborated upon here.

[0124] It should also be noted that, in the embodiments of this application, after the language model is pre-trained by combining text to obtain the pre-trained language model, the pre-trained language model already has the ability to perform preliminary text processing. Therefore, the pre-trained language model can be trained with corresponding data according to different specified downstream tasks to obtain a language model that can achieve the specified downstream tasks.

[0125] Optionally, embodiments of this application provide a method for training a target language model, such as... Figure 6 As shown, it includes:

[0126] S601. Obtain target product information for multiple products and the expected simplified text information corresponding to the target product information for each product.

[0127] It should be noted that the target product information obtained in step S601 is the same type of information as the target product information obtained in step S501.

[0128] The expected simplified text information corresponding to the target product information is the label corresponding to the training sample, which can be determined manually or by other means.

[0129] S602. Input the target product information of each product into the pre-trained language model to obtain the predicted simplified text information corresponding to the target product information of each product.

[0130] S603. Determine whether the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold.

[0131] If the error between the currently obtained predicted simplified text information and the expected simplified text information is not less than a preset threshold, then step S604 is executed. If the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold, then step S605 is executed.

[0132] S604. Adjust the parameters of the pre-trained language model based on the error between the currently obtained predicted simplified text information and the expected simplified text information.

[0133] Specifically, a loss function can be constructed, and the parameters in the pre-trained language model can be adjusted based on the loss function and gradient descent.

[0134] It should be noted that after executing step S604, for the pre-trained language model with adjusted parameters, step S602 is executed again to achieve iterative training of the model, thereby obtaining a language model that meets the requirements.

[0135] S605. Determine the current pre-trained language model as the target language model.

[0136] Specifically, when the error between the model input and the actual result meets the requirements, it means that the model has been trained. Therefore, the pre-trained language model at this time is determined as the target language model for subsequent processing of product information.

[0137] Another embodiment of this application provides a pre-training device for a language model, such as... Figure 7 As shown, it includes the following units:

[0138] Acquisition unit 701 is used to acquire multiple product images.

[0139] The recognition unit 702 is used to recognize the text on each product image through an optical character recognition model and determine the position information of the text on each product image.

[0140] The segmentation unit 703 is used to divide the text on each product image into image title and description text based on the position information of the text on each product image.

[0141] The filtering unit 704 is used to filter out sentences in each group of text that do not meet the preset quality requirements.

[0142] One set of text includes the image title on a product image and the descriptive text.

[0143] The pairing unit 705 is used to pair the image title with the descriptive text in each text combination obtained after filtering, so as to determine whether the image title is a summary of the descriptive text.

[0144] Training unit 706 is used to pre-train the pre-trained language model for generative text summarization using successfully paired text combinations, so that the encoder of the pre-trained language model encodes the introductory text and the decoder decodes it to generate image titles.

[0145] Optionally, in the pre-training apparatus for the language model provided in another embodiment of this application, the units are divided, such as... Figure 8 As shown, it includes:

[0146] The first determining unit 801 is used to determine, based on the position information of the text on each of the product images, the text on the product image that meets the preset conditions.

[0147] The preset conditions are that the paragraphs in the product image are centered and have the largest font size among all the text in the product image.

[0148] The second determining unit 802 is used to determine the text that meets the preset conditions as the image title corresponding to the product image, and to determine the remaining text on the product image as the description text corresponding to the product image.

[0149] Optionally, in another embodiment of the language model pre-training apparatus provided in this application, a filtering unit, such as... Figure 9 As shown, it includes:

[0150] The first filtering unit 901 is used to filter out sentences in each text combination whose font height is less than a preset height based on the text height in the recognition result of the optical character recognition model corresponding to each text combination.

[0151] The second filtering unit 902 is used to filter out sentences in each text combination whose confidence level is less than a preset confidence level, based on the confidence level in the recognition results of the optical character recognition model corresponding to each text combination.

[0152] The third filtering unit 903 is used to calculate the perplexity of each statement in each text combination using the GPT model, and filter out statements with perplexity greater than the preset perplexity.

[0153] Optionally, in another embodiment of the language model pre-training apparatus provided in this application, the pairing unit includes:

[0154] The pairing subunit is used to input the text combination into the pre-trained pairing model for each text combination obtained after filtering, so as to obtain the pairing result corresponding to the text combination.

[0155] The pairing model is pre-trained using multiple sets of positive and negative samples. A set of positive samples includes an input text and its corresponding summary; a set of negative samples includes an input text and its corresponding randomly sampled summary.

[0156] It should be noted that the specific working process of each unit provided in the above embodiments of this application can be referred to the corresponding steps in the above method embodiments, and will not be repeated here.

[0157] Another embodiment of this application provides a product information processing device, such as... Figure 10 As shown, it includes:

[0158] The first acquisition unit 1001 is used to acquire target product information of the target product.

[0159] The target product information refers to product information belonging to a specified type.

[0160] The input unit 1002 is used to input the target product information of the target product into a pre-trained target language model, and process the target product information of the target product through the target language model to obtain the simplified text information corresponding to the target product information of the target product.

[0161] The target language model is pre-trained using target product information from multiple products. The pre-trained language model is further pre-trained using multiple successfully paired text combinations. Each text combination comprises an image title and descriptive text obtained from a single product image.

[0162] Optionally, in another embodiment of the commodity information processing apparatus provided in this application, the apparatus further includes:

[0163] The second acquisition unit is used to acquire target product information of multiple products and expected simplified text information corresponding to the target product information of each product.

[0164] The input unit is used to input the target product information of each of the products into the pre-trained language model to obtain the predicted simplified text information corresponding to the target product information of each product.

[0165] The judgment unit is used to determine whether the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold.

[0166] The parameter tuning unit is used to tune the pre-trained language model based on the error between the currently obtained predicted simplified text information and the expected simplified text information if the error is not less than a preset threshold, and then return to the pre-trained language model to input the target product information of each product into the pre-trained language model for the tuned pre-trained language model.

[0167] The determining unit is configured to determine the current pre-trained language model as the target language model if the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold.

[0168] Another embodiment of this application provides an electronic device, such as... Figure 11 As shown, it includes:

[0169] Memory 1101 and processor 1102.

[0170] The memory 1101 is used to store a program, and the processor 1102 is used to execute the program stored in the memory 1101. When the program is executed, it is specifically used to implement the language model pre-training method provided in any of the above embodiments, or to implement the commodity information processing method provided in any of the above embodiments.

[0171] Another embodiment of this application provides a computer storage medium for storing a computer program, which, when executed, is used to implement the language model pre-training method provided in any of the above embodiments, or to implement the commodity information processing method provided in any of the above embodiments.

[0172] Computer storage media, including both permanent and non-permanent, removable and non-removable media, can store information using any method or technology. Information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0173] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0174] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A method for pre-training a language model, characterized in that, include: Get multiple product images; The text on each product image is identified using an optical character recognition model, and the location information of the text on each product image is determined. Based on the positional information of the text on each product image, the text on each product image is divided into image title and description text; Each text combination is filtered out for statements that do not meet the preset quality requirements; wherein, a text combination includes the image title and the description text on a product image; statements that do not meet the preset quality requirements include statements with a font height less than the preset height, statements with a confidence level less than the preset confidence level, and statements with a perplexity level greater than the preset perplexity level. For each group of texts obtained after filtering, the image title in the text group is paired with the introductory text to determine whether the image title is a summary of the introductory text; The pre-built language model is pre-trained using the successfully paired text combinations to generate text summarization, thus obtaining a pre-trained language model. Specifically, for each group of text combinations obtained after filtering, pairing the image title with the descriptive text in the text combination includes: For each of the text combinations obtained after filtering, the text combination is input into a pre-trained pairing model to obtain the pairing result corresponding to the text combination; wherein, the pairing model is pre-trained using multiple sets of positive samples and multiple sets of negative samples; one set of positive samples includes an input text and its corresponding summary summary; one set of negative samples includes an input text and its corresponding random sample summary.

2. The method of claim 1, wherein, The step of dividing the text on each product image into image title and description text based on the position information of the text on each product image includes: For each of the product images, based on the position information of the text on the product image, determine the text on the product image that meets preset conditions; wherein, the preset conditions are that the corresponding paragraph in the product image is centered and has the largest font size among all the texts on the product image; The text that meets the preset conditions will be determined as the image title corresponding to the product image, and the remaining text on the product image will be determined as the description text corresponding to the product image.

3. The method of claim 1, wherein, The step of filtering out statements in each text combination that do not meet the preset quality requirements includes: Based on the text height in the recognition results of the optical character recognition model corresponding to each group of text combinations, sentences with a font height less than a preset height in each group of text combinations are filtered out; Based on the confidence level in the recognition results of the optical character recognition model corresponding to each group of text combinations, sentences with a confidence level lower than a preset confidence level in each group of text combinations are filtered out. For each group of text combinations, the perplexity of each statement in the text combination is calculated using the GPT model, and statements with perplexity greater than a preset perplexity are filtered out.

4. A commodity information processing method characterized by comprising: include: Obtain target product information for the target product; wherein, the target product information is product information of a specified type; The target product information of the target product is input into a pre-trained target language model, and the target product information of the target product is processed by the target language model to obtain the simplified text information corresponding to the target product information of the target product; wherein, the target language model is pre-trained using the target product information of multiple products to train the pre-trained language model; the pre-trained language model is pre-trained by the pre-training method of the language model according to any one of claims 1-3.

5. The method according to claim 4, characterized in that, The training method for the target language model includes: Obtain target product information for multiple products and the expected simplified text information corresponding to the target product information of each product; The target product information of each of the aforementioned products is input into the pre-trained language model to obtain the predicted simplified text information corresponding to the target product information of each of the aforementioned products; Determine whether the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold; If it is determined that the error between the currently obtained predicted simplified text information and the expected simplified text information is not less than a preset threshold, then the pre-trained language model is tuned based on the error between the currently obtained predicted simplified text information and the expected simplified text information, and for the tuned pre-trained language model, the process of inputting the target product information of each product into the pre-trained language model is returned. If the error between the currently obtained predicted simplified text information and the expected simplified text information is less than a preset threshold, then the current pre-trained language model is determined as the target language model.

6. A pre-training device for a language model, characterized in that, include: The acquisition unit is used to acquire multiple product images; The recognition unit is used to recognize the text on each of the product images using an optical character recognition model, and to determine the position information of the text on each of the product images; The segmentation unit is used to divide the text on each product image into image title and description text based on the position information of the text on each product image; A filtering unit is used to filter out statements in each group of text combinations that do not meet the preset quality requirements; wherein, a group of text combinations includes the image title and the description text on a product image; statements that do not meet the preset quality requirements include statements with a font height less than a preset height, statements with a confidence level less than a preset confidence level, and statements with a perplexity level greater than a preset perplexity level. A pairing unit is used to pair the image title in each of the filtered text combinations with the introductory text to determine whether the image title is a summary of the introductory text. The training unit is used to pre-train the pre-built language model with generative text summarization using the successfully paired groups of text combinations, so as to obtain the pre-trained language model. The pairing unit includes: A pairing subunit is used to input each of the filtered text combinations into a pre-trained pairing model to obtain the pairing result corresponding to the text combination; wherein, the pairing model is pre-trained using multiple sets of positive samples and multiple sets of negative samples; one set of positive samples includes an input text and its corresponding summary summary; one set of negative samples includes an input text and its corresponding random sample summary.

7. A commodity information processing device, characterized in that, include: An acquisition unit is used to acquire target product information of a target product; wherein, the target product information is product information of a specified type; An input unit is used to input the target product information into a pre-trained target language model, and process the target product information through the target language model to obtain simplified information corresponding to the target product information; wherein, the target language model is pre-trained using the target product information of multiple products to train the pre-trained language model; the pre-trained language model is pre-trained using the pre-training device for the language model as described in claim 6.

8. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor is used to execute the program, which, when executed, is specifically used to implement the pre-training method of the language model as described in any one of claims 1 to 3, or to implement the product information processing method as described in any one of claims 4 to 5.

9. A computer storage medium, characterized in that, Used to store computer programs, which, when executed, are used to implement the pre-training method for the language model as described in any one of claims 1 to 3, or to implement the commodity information processing method as described in any one of claims 4 to 5.

Citation Information

Patent Citations

  • Text abstract generation method and device, computer equipment and storage medium

    CN113609287A

  • Text correction method and device based on OCR technology, equipment and storage medium

    CN113850251A