Commodity price identification method and related device
By identifying the numerical values and their adjacent words in the product image and using the price keyword clustering model for detection, the problem of product prices inconsistent with the actual price is solved, and the recognition accuracy is improved.
Patent Information
- Application Number
- CN202411919129.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-24
- Publication Date
- 2025-04-18
AI Technical Summary
In e-commerce platforms, the problem that the product price in the product image does not match the actual sales price has led to misleading consumers.
By identifying the numerical values in the product image and their adjacent words, and performing price keyword detection based on the price keyword clustering model, we determine whether the numerical value is the commodity price.
Improve the accuracy of product price identification and avoid misleading caused by wrong prices.
Smart Images

Figure CN119851298A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and more particularly to a commodity price identification method and related devices. Background Art
[0002] E-commerce has brought convenience to people's lives. Consumers can easily purchase the products they need by visiting e-commerce platforms. In e-commerce platforms, in order to facilitate consumers to understand the products on sale, product images can be displayed in the provided access interface. Furthermore, in addition to the physical image of the product, the product image may also contain information such as the product price. In some cases, there may be a problem that the product price in the product image does not match the actual product price purchased by the consumer. In order to avoid these product images with incorrect product prices from misleading consumers, it is necessary to identify the prices in the product images from the e-commerce platform to facilitate the discovery of incorrect product images. Summary of the invention
[0003] In view of this, multiple embodiments of the present application are dedicated to providing a commodity price recognition method and related devices, which can improve the recognition accuracy of commodity prices in commodity images.
[0004] One embodiment of the present application provides a method for identifying commodity prices, including: identifying a numerical value in a commodity image and neighboring words of the numerical value; performing price keyword detection on the neighboring words based on a price keyword clustering model to obtain a detection result; wherein the price keyword clustering model includes at least one price keyword set, and each word in the price keyword set is similar to each other; the detection result is used to characterize the relationship between the neighboring words and the at least one price keyword set; when the detection result meets a preset condition, the numerical value is determined to be the commodity price.
[0005] One embodiment of the present application provides a model generation method, including: extracting neighboring words related to price representation in training data as sample neighboring words to obtain a sample neighboring word set; identifying sample neighboring word pairs that meet a preset similarity from the sample neighboring word set; constructing a vocabulary graph based on each sample neighboring word pair; wherein the vocabulary graph includes sample neighboring word pairs connected by edges; using each connected component in the vocabulary graph as a price keyword set to generate a price keyword clustering model containing at least one price keyword set; wherein the price keyword clustering model is used to perform price keyword detection on neighboring words of numerical values in a product image, and when the detection result meets a preset condition, the numerical value is the product price.
[0006] One embodiment of the present application provides a commodity price identification device, including: an identification module, used to identify a numerical value in a commodity image and adjacent words of the numerical value; a price keyword detection module, used to perform price keyword detection on the adjacent words based on a price keyword clustering model to obtain a detection result; wherein the price keyword clustering model includes at least one price keyword set, and each word in the price keyword set is similar to each other; the detection result is used to characterize the relationship between the adjacent words and the at least one price keyword set; a commodity price identification module, used to identify the numerical value as a commodity price when the detection result meets a preset condition.
[0007] One embodiment of the present application provides a model generation device, including: a sample extraction module, used to extract neighboring words related to price representation in training data as sample neighboring words, and obtain a sample neighboring word set; a neighboring word pair identification module, used to identify sample neighboring word pairs that meet a preset similarity from the sample neighboring word set; a vocabulary graph construction module, used to construct a vocabulary graph based on each sample neighboring word pair; wherein the vocabulary graph includes sample neighboring word pairs connected by edges; a model generation module, used for neighboring word pairs to use each connected component in the vocabulary graph as a price keyword set to generate a price keyword clustering model containing at least one price keyword set; wherein the price keyword clustering model is used to perform price keyword detection on neighboring words of numerical values in a product image, and when the detection result meets a preset condition, the numerical value is the product price.
[0008] One embodiment of the present application provides a computer device, which includes a memory and a processor, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the model generation method as described above.
[0009] One embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores at least one computer program, and when the at least one computer program is executed by a processor, the model generation method as described above can be implemented.
[0010] One embodiment of the present application provides a computer program product, which is used to implement the model generation method as described above.
[0011] In multiple implementations provided in the present application, the numerical value and its neighboring words in the product image can be first identified, and then the neighboring words can be subjected to price keyword detection based on a price keyword clustering model including at least one price keyword set to obtain a detection result, wherein the words in the price keyword set are similar words to each other, and the detection result can characterize the relationship between the neighboring words and at least one price keyword set. Based on this, when the detection result meets the preset conditions, the numerical value can be determined as the product price. Compared with directly determining the numerical value in the product image as the product price, using the numerical value and its neighboring words as the basis for product price recognition can improve the recognition accuracy of the product price in the product image. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] Figure 1 A schematic diagram of a system architecture for implementing a commodity price identification method provided in accordance with one embodiment of the present application.
[0013] Figure 2 A schematic diagram of an application scenario of a commodity price identification method provided for one embodiment of the present application.
[0014] Figure 3 A schematic diagram of a commodity image provided for one embodiment of the present application.
[0015] Figure 4 A flowchart of a commodity price identification method provided for one embodiment of the present application.
[0016] Figure 5 A flowchart of a model generation method provided for one embodiment of the present application.
[0017] Figure 6 A schematic diagram of a module of a commodity price identification device provided for one embodiment of the present application.
[0018] Figure 7 A schematic diagram of a module of a model generation device provided for one embodiment of the present application.
[0019] Figure 8 A schematic diagram of a computer device provided for one embodiment of the present application. DETAILED DESCRIPTION
[0020] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.
[0021] In the description of the embodiments of the present application, it should be understood that the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, the meaning of "multiple" is two or more, unless otherwise clearly and specifically defined.
[0022] The product images displayed to users by the e-commerce platform include product entity images, product feature descriptions, product prices, product discount information, discount duration, etc. When users browse product images that meet their needs in the streaming interface of the e-commerce platform, the touchable area corresponding to the product image will be triggered, and then they will jump to the main interface corresponding to the product. The main interface is used to display the full amount of information corresponding to the product, such as product name, product price, product category, product details description, product model, product specifications, etc.
[0023] In some cases, for example, during a product promotion, the product price may be relatively low. In order to make it easier for consumers to understand the product price and improve the competitiveness of the product, the merchant may synthesize the lower product price into the product image. However, after the product promotion ends, due to negligence or insufficient maintenance capabilities of the merchant, the actual product price may return to the normal price, but the product image with the promotional product price is still displayed. In this way, there is a situation where the price in the product image does not match the actual sales price.
[0024] In the related art, optical character recognition technology (OCR) can be used to recognize text information in product images, and the numerical value in the text information can be determined as the product price, or a deep learning model can be trained and deployed to recognize the product price. However, the product images designed by merchants usually do not only contain product prices, but may also contain discount duration, discount information, etc. Directly using the numerical value in the OCR recognition result as the product price can easily determine that the numerical value is not the product price as the product price. Deep learning models can also be used to identify product prices. However, the internal layout of product images often changes, resulting in the problem of unsatisfactory recognition accuracy of deep learning models.
[0025] Therefore, it is necessary to provide a technical solution that can accurately identify product prices in product images on e-commerce platforms.
[0026] See also Figure 1In the multiple embodiments provided in the present application, the commodity price identification method can be applied to an electronic device with certain computing power and network access capability. The electronic device can be a desktop computer, a laptop computer, a tablet computer, or a server. The electronic device can be connected to the merchant end through the network to receive the commodity image uploaded by the merchant end and identify the commodity price in the commodity image.
[0027] Specifically, the electronic device includes a processor, a memory, a display module, and a network access module for network communication. The network access module is used to receive product images uploaded by the merchant. The processor is used to identify the numerical value in the product image and the neighboring words of the numerical value; based on the price keyword clustering model, the neighboring words are subjected to price keyword detection to obtain a detection result; wherein the price keyword clustering model includes at least one price keyword set, and each word in the price keyword set is similar to each other; the detection result is used to characterize the relationship between the neighboring words and the at least one price keyword set; when the detection result meets the preset conditions, the numerical value is determined to be the product price. The memory is used to store the product image and the product price in correspondence for other services to call. The display module is used to display the product price in the product image for manual review.
[0028] See also Figure 2 One embodiment of the present application provides an example of an application scenario of a method for identifying commodity prices. In an e-commerce platform, there are a large number of commodity images containing commodity prices. Identifying commodity prices in commodity images is necessary for image compliance review, personalized commodity recommendation, and other needs.
[0029] Since there may be a large number of numerical values in a product image, if the recognized numerical value is directly used as the product price, there may be a problem of misjudgment. For example, if the product image includes "First 1,000 will receive a gift", and the recognized numerical value 1,000 is directly identified as the product price, there will be a problem of misjudgment of the product price. Generally speaking, there is a certain degree of correlation between the neighboring words near the numerical value in the product image and the numerical value. Combining the numerical value and its neighboring words to identify which numerical value in the product image indicates the product price can obtain a more accurate result.
[0030] Based on this, before executing commodity price recognition, the present application first generates a price keyword clustering model used as a basis for neighboring word detection and a logistic regression model used to perform logistic regression calculation on the detection results to clarify the commodity.
[0031] Specifically, the present application may collect a batch of training data, and the training data may include multiple neighboring word data, each of which includes a numerical value and the first 3 neighboring words and the last 3 neighboring words of the numerical value. Then, the neighboring words related to price expression in the training data may be extracted as sample neighboring words, and a sample neighboring word set may be obtained, for example, the sample neighboring word set = {……, ¥, $, price, promotion price, price for 10 boxes, discount price, …}.
[0032] Then, similarity recognition can be performed on every two sample neighboring words in the sample neighboring word set to identify sample neighboring word pairs that meet the preset similarity (such as 0.3) from the sample neighboring word set. For example, sample neighboring word pair 1 = {¥, $}, sample neighboring word pair 2 = {received price, promotional price}, sample neighboring word pair 3 = {promotional price, 10 boxes received price}, sample neighboring word pair 4 = {received price, 10 boxes received price}... Then, a vocabulary graph can be constructed based on the relationship between each sample neighboring word pair. The vocabulary graph contains each sample neighboring word pair, and the sample neighboring word pairs are connected by edges. For the construction of the vocabulary graph, please refer to the example as an example. Figure 3 .
[0033] On this basis, each connected component in the vocabulary graph can be used as a price keyword set to generate a price keyword clustering model containing at least one price keyword set. For details, please refer to Figure 3 , the vocabulary graph includes: connected component 1 = {hand-in price, promotional price, hand-in price for 10 boxes}, connected component 2 = {¥, $}, and each connected component can be used as a price keyword set. Each price keyword set can constitute a price keyword clustering model used as a basis for neighbor word detection. For example, the price keyword clustering model includes: a price keyword set identified as a price description, a price keyword set identified as a price symbol, and a price keyword set identified as a price unit.
[0034] Furthermore, price keyword detection can be performed on the sample neighboring word set based on the price keyword clustering model. Since the sample neighboring word set contains multiple neighboring word data, and one neighboring word data includes numerical values and numerical neighboring words, price keyword detection can be performed on each sample neighboring word based on the price keyword clustering model to obtain a detection result containing the following fields: the first neighboring word contains price description, the first neighboring word contains price symbol, the first neighboring word contains price unit, the second neighboring word contains price description, the second neighboring word contains price symbol, and the second neighboring word contains price unit.
[0035] Taking the neighboring word data = {free while supplies last, foreign, XXX pharmaceutical, 10, patch, breathable non-woven fabric, event price} as an example, the front neighboring word = {free while supplies last, foreign, XXX pharmaceutical}, the rear neighboring word = {patch, breathable non-woven fabric, event price}, none of the words in the front neighboring words hit the price keyword clustering model, the event price in the rear neighboring words hits the price keyword set marked as price description in the price keyword clustering model, and the words in the rear neighboring words except the event price do not hit the price keyword clustering model. Therefore, the value of the field corresponding to the previous adjacent word containing price description is generated as 0, the value of the field corresponding to the previous adjacent word containing price symbol is generated as 0, the value of the field corresponding to the previous adjacent word containing price unit is generated as 0, the value of the field corresponding to the next adjacent word containing price description is generated as 1, the value of the field corresponding to the next adjacent word containing price symbol is generated as 0, and the value of the field corresponding to the next adjacent word containing price unit is generated as 0. Based on this, the sample detection result corresponding to the sample adjacent word = {while supplies last, outside, XXX Pharmaceutical, 10, mounting, breathable non-woven fabric, event price} can be obtained = {0, 0, 0, 1, 0, 0}.
[0036] Based on the above method, each neighboring word data can be processed in turn to obtain a sample detection result corresponding to each neighboring word data, and based on each sample detection result and the commodity price identification result corresponding to each neighboring word data, the weights corresponding to each field in the sample detection result in the logistic regression model can be iterated to obtain a logistic regression model for performing a logistic regression calculation on the actual detection result to clarify the commodity price. The logistic regression model is used to characterize the relationship between the neighboring words and the numerical values in the neighboring word data. Among them, the commodity price identification result characterizes whether the numerical value in each neighboring word data is a commodity price. Optionally, if the numerical value in the neighboring word data is a commodity price, the commodity price identification result is represented as 1, and if the numerical value in the neighboring word data is not a commodity price, the commodity price identification result is represented as 0.
[0037] When detecting Figure 2 When a product image is shown, text recognition can be performed on the product image based on a text recognition model (such as OCR) to obtain a text recognition result. The text recognition result includes all text information contained in the product image. The text recognition is performed on the product image based on the text recognition model to obtain the text recognition result, including: preprocessing the product image based on the text recognition model (such as denoising, binarization, etc.), segmenting the product image to obtain areas containing text in the product image, and performing character recognition on these areas to obtain text recognition results.
[0038] Among them, the text recognition result can be stored as word-granularity segmentation or as non-word-granularity data. For example, the text recognition result stored as word-granularity segmentation = {..., place an order and get it free, xxx, while supplies last, outside, XXX Pharmaceutical, 10, patch, breathable non-woven fabric, event price, ...}, each segmentation is arranged in the order of text recognition, and the text recognition result stored as non-word-granularity data = {... place an order xxx, while supplies last, outside XXX Pharmaceutical 10 patch breathable non-woven fabric event price ...}. If the text recognition result is stored as non-word-granularity data, it is necessary to further split the text recognition result into word-granularity to obtain word-granularity segmentation. In addition, the text recognition result can also be cleaned according to the data cleaning rules to reduce the impact of redundant data in the text recognition result on the accuracy of the commodity price recognition result.
[0039] Further, according to the preset regular expression for limiting the numerical range and the number of neighboring words, the numerical value and the neighboring words distributed before and after the numerical value are determined from multiple participles, assuming that the numerical range defined by the preset regular expression is 0-100000, and the number of neighboring words is 3 front neighboring words and 3 back neighboring words. On this basis, based on the text recognition result = {……, place an order to send, xxx, while supplies last, outside, XXX Pharmaceutical, 10, mounting, breathable non-woven fabric, activity price, …}, it is recognized that the numerical value that meets the preset regular expression is 10, and the neighboring words distributed before and after the numerical value are divided into 3 front neighboring words = {while supplies last, outside, XXX Pharmaceutical} and 3 back neighboring words = {mounting, breathable non-woven fabric, activity price}.
[0040] Further, price keyword detection is performed on each neighboring word based on a pre-generated price keyword clustering model to obtain a detection result, wherein the price keyword clustering model includes at least one price keyword set, for example, the price keyword set A in the at least one price keyword set = {activity price, 6-box price, 3-box price, single-box price, each box price, ...}. Since the words in the price keyword set are similar to each other, and the similarity between similar words meets the preset similarity, each neighboring word can be compared with at least one price keyword set to obtain a keyword detection result. The keyword detection result specifically includes values corresponding to the following fields: the front neighboring word contains a price description, the front neighboring word contains a price symbol, the front neighboring word contains a price unit, the rear neighboring word contains a price description, the rear neighboring word contains a price symbol, and the rear neighboring word contains a price unit.
[0041] For example, the three front neighboring words = {gift only, foreign, XXX pharmaceutical industry} do not have a price keyword set with a hit mark as price description / price symbol / price unit, and the three rear neighboring words = {mounting, breathable non-woven fabric, event price} have a price keyword set with a hit mark as price description but do not hit a price keyword set with a hit mark as price symbol / price unit. Based on this, a keyword detection result for characterizing the above hit situation can be generated.
[0042] Furthermore, the values of each field in the keyword detection result can be substituted into the logistic regression model to generate a logistic regression result (eg, 0.7) through the logistic regression model. If the logistic regression result is greater than a preset value (eg, 0.5), the value 10 is determined as the product price.
[0043] It can be seen that the commodity price recognition method provided by the above embodiment can first identify the numerical value and its neighboring words in the commodity image, and then perform price keyword detection on the neighboring words based on the price keyword clustering model containing at least one price keyword set to obtain a detection result. Based on this, when the detection result meets the preset conditions, the numerical value can be determined as the commodity price. Compared with directly determining the numerical value in the commodity image as the commodity price, using the numerical value and its neighboring words as the basis for commodity price recognition can improve the recognition accuracy of the commodity price in the commodity image.
[0044] See also Figure 4 . The embodiment of the present application provides a commodity price identification method. The commodity price identification method can be applied to a commodity price identification device. The commodity price identification device can be an electronic device with certain computing power and network access capabilities. Of course, the commodity price identification device can also refer to a software program running in an electronic device. In this embodiment, the commodity price identification method can include the following steps.
[0045] Step S110: Identify the numerical value and the adjacent words of the numerical value in the product image.
[0046] Step S120: Perform price keyword detection on the neighboring words based on the price keyword clustering model to obtain a detection result; wherein the price keyword clustering model includes at least one price keyword set, and each word in the price keyword set is similar to each other; the detection result is used to characterize the relationship between the neighboring words and the at least one price keyword set.
[0047] Step S130: when the detection result meets the preset conditions, the value is determined to be the commodity price.
[0048] In this embodiment, in order to improve the recognition accuracy of the commodity price in the commodity image, the commodity price recognition device can recognize the numerical value (such as 10) and the adjacent words of the numerical value (such as, while supplies last, foreign, XXX Pharmaceutical, mounting, breathable non-woven fabric, event price) in the commodity image, wherein the commodity image can be an image uploaded by the merchant to the e-commerce platform for user reference to assist in selling commodities. In order to improve the intuitiveness of the commodity price or highlight the price advantage of the commodity, the merchant usually designs the commodity price, commodity discount information, commodity entity image and other information in the commodity image. The commodity price to be recognized usually exists in the text recognition result of the commodity image in the form of a numerical value. In order to recognize the numerical value representing the commodity price, the numerical value and its adjacent words in the commodity image can be extracted to combine the numerical value and its adjacent words to identify whether the numerical value is the commodity price. Among them, the adjacent words are one or more ordered participles adjacent to the numerical value in the text recognition result.
[0049] In this embodiment, the commodity price identification device can perform price keyword detection on neighboring words based on the price keyword clustering model to obtain a detection result. The price keyword clustering model is composed of a set of price keywords corresponding to different identifiers (such as price description, price symbol, price unit), and the detection result includes sub-results corresponding to multiple fields (such as a non-inclusion relationship represented by 0 and an inclusion relationship represented by 1), and each field is used to represent the relationship between neighboring words and different price keyword sets, which can be an inclusion relationship or a non-inclusion relationship. Optionally, multiple fields are represented as: the first neighboring word contains the price description, the first neighboring word contains the price symbol, the first neighboring word contains the price unit, the second neighboring word contains the price description, the second neighboring word contains the price symbol, and the second neighboring word contains the price unit.
[0050] In this embodiment, since the detection result can indicate the relationship between the neighboring words and at least one price keyword set, the value can be identified as the commodity price when the detection result meets the preset conditions. The preset conditions are used to limit the commodity price identification conditions, such as the sub-result of at least one field in the detection result is represented as an inclusion relationship, or the logistic regression calculation result of the detection result is represented as a preset value / preset interval.
[0051] The commodity price identification method provided in the embodiment of the present application can first identify the numerical value and its neighboring words in the commodity image, and then perform price keyword detection on the neighboring words based on the price keyword clustering model containing at least one price keyword set to obtain a detection result, wherein the words in the price keyword set are similar words to each other, and the detection result can characterize the relationship between the neighboring words and at least one price keyword set. Based on this, when the detection result meets the preset conditions, the numerical value can be determined as the commodity price. Compared with directly determining the numerical value in the commodity image as the commodity price, using the numerical value and its neighboring words as the basis for commodity price identification can improve the recognition accuracy of the commodity price in the commodity image.
[0052] In some embodiments, the step of a commodity price recognition device identifying a numerical value in a commodity image and adjacent words of the numerical value includes: performing text recognition on the commodity image to obtain a text recognition result; wherein the text recognition result includes a plurality of segmented words arranged in a text recognition order; determining the numerical value and adjacent words distributed before and after the numerical value from the plurality of segmented words according to a preset regular expression; wherein the preset regular expression is used to limit the numerical range and the number of adjacent words.
[0053] In this embodiment, in order to more accurately identify the commodity price in the commodity image, the commodity price recognition device can perform text recognition on the commodity image to obtain a text recognition result. The text recognition result includes all text information in the commodity image. The information in the text recognition result is arranged in sequence in the form of word granularity. The text information can be text, symbols, numbers, etc.
[0054] In this embodiment, the commodity price recognition device can also perform data cleaning on multiple word segments in the text recognition result according to data cleaning rules, and the data cleaning rules are used to define the characteristics of the data to be retained or the characteristics of the data to be filtered out. For example, the data cleaning rules include: filtering out the marker "#" without specific meaning.
[0055] In this embodiment, the commodity price identification device can also determine the numerical value and the neighboring words distributed before and after the numerical value from multiple participles according to a preset regular expression. The numerical value and the neighboring words distributed before and after the numerical value can form a data set to participate in the subsequent commodity price identification process. If the commodity image includes multiple numerical values, for each numerical value, the following is executed: determine the numerical value and the neighboring words distributed before and after the numerical value from the multiple participles according to a preset regular expression.
[0056] In this embodiment, the preset regular expression can be expressed in any form such as a sentence, text information, or a character string. The numerical range in the preset regular expression can be limited by an upper limit value and a lower limit value, such as (1 to 100000). The data range is used to limit the range in which the data to be processed by the embodiment of the present application should be located. The number of neighboring words is used to limit the number of neighboring words adjacent to the numerical value. Further, the number of neighboring words includes the number of front neighboring words arranged before the numerical value and the number of rear neighboring words arranged after the numerical value. By limiting the number of neighboring words, the amount of data processing can be adjusted. The number of neighboring words can be set to 4 front neighboring words and 4 rear neighboring words, or the number of neighboring words can be set to 2 front neighboring words and 2 rear neighboring words.
[0057] In some embodiments, the neighboring words include a first preset number of front neighboring words and a second preset number of rear neighboring words; the at least one price keyword set includes a price keyword set identified as price descriptions, a price keyword set identified as price symbols, and a price keyword set identified as price units; the detection result includes sub-results corresponding to the following fields: the front neighboring word contains the price description, the front neighboring word contains the price symbol, the front neighboring word contains the price unit, the rear neighboring word contains the price description, the rear neighboring word contains the price symbol, and the rear neighboring word contains the price unit.
[0058] In this embodiment, in order to improve the efficiency of commodity identification, the neighboring words are set to include a first preset number (such as 3) of front neighboring words and a second preset number (such as 3) of rear neighboring words, the first preset number and the second preset number may be the same or different, and the detection result is set to include sub-results of the following fields: the front neighboring word includes a price description (desc_prev_flag), the front neighboring word includes a price symbol (money_prev_flag), the front neighboring word includes a price unit (unit_prev_flag), the rear neighboring word includes a price description (desc_next_flag), the rear neighboring word includes a price symbol (money_next_flag), and the rear neighboring word includes a price unit (unit_next_flag). The sub-results can be represented by symbols, characters, numbers, etc.
[0059] In some embodiments, if there is a price keyword set whose vocabulary hits are marked as price description in the previous neighboring word, the vocabulary of the price keyword set whose vocabulary hits are marked as price description in the previous neighboring word is replaced with price description, and based on the replaced previous neighboring word, 1 can be generated as a sub-result of the field that the previous neighboring word contains price description, and if there is no price keyword set whose vocabulary hits are marked as price description in the previous neighboring word, 0 is generated as a sub-result of the field that the previous neighboring word contains price description. If there is a price keyword set whose vocabulary hits are marked as price symbol in the previous neighboring word, the vocabulary of the price keyword set whose vocabulary hits are marked as price symbol in the previous neighboring word is replaced with price symbol, and based on the replaced previous neighboring word, 1 can be generated as a sub-result of the field that the previous neighboring word contains price symbol. If there is a price keyword set whose vocabulary hits are marked as price unit in the previous neighboring word, the vocabulary of the price keyword set whose vocabulary hits are marked as price unit in the previous neighboring word is replaced with price unit, and based on the replaced previous neighboring word, 1 can be generated as a sub-result of the field that the previous neighboring word contains price unit.
[0060] In some embodiments, if there is a price keyword set whose vocabulary hits are marked as price description in the rear adjacent word, the vocabulary of the price keyword set whose vocabulary hits are marked as price description in the rear adjacent word is replaced with price description, and based on the replaced rear adjacent word, 1 can be generated as a sub-result of the field that the rear adjacent word contains price description, and if there is no price keyword set whose vocabulary hits are marked as price description in the rear adjacent word, 0 is generated as a sub-result of the field that the rear adjacent word contains price description. If there is a price keyword set whose vocabulary hits are marked as price symbol in the rear adjacent word, the vocabulary of the price keyword set whose vocabulary hits are marked as price symbol in the rear adjacent word is replaced with price symbol, and based on the replaced rear adjacent word, 1 can be generated as a sub-result of the field that the rear adjacent word contains price symbol. If there is a price keyword set whose vocabulary hits are marked as price unit in the rear adjacent word, the vocabulary of the price keyword set whose vocabulary hits are marked as price unit in the rear adjacent word is replaced with price unit, and based on the replaced rear adjacent word, 1 can be generated as a sub-result of the field that the rear adjacent word contains price unit.
[0061] In this embodiment, each price keyword in the price keyword set marked as price description belongs to the category of price description, each price keyword in the price keyword set marked as price symbol belongs to the category of price symbol, and each price keyword in the price keyword set marked as price unit belongs to the category of price unit.
[0062] In some embodiments, the commodity price identification device can calculate the logistic regression results of each sub-result based on a logistic regression model; wherein the logistic regression model includes weights corresponding to each of the fields respectively; the logistic regression result is used to indirectly characterize whether the numerical value is a commodity price; when the logistic regression result is greater than a preset value, it is determined that the detection result meets the preset condition.
[0063] In this embodiment, in order to more accurately identify the commodity price in the commodity image by combining each neighboring word, the commodity price identification device can calculate the logistic regression result of each sub-result based on the logistic regression model. The logistic regression model can be expressed as p in, The value of is the linear combination result of the sub-results, after By processing the linear combination results, a logistic regression result can be obtained to represent the probability that the value is the commodity price (such as 0.7). The logistic regression result can indirectly represent whether the value is the commodity price. The value range of the logistic regression result can be (0, 1). Specifically, β0 is the intercept, β i is the weight of the field corresponding to each of the i sub-results, x i There are i sub-results. Optionally, the fields are: first neighbor word contains price description, first neighbor word contains price symbol, first neighbor word contains price unit, second neighbor word contains price description, second neighbor word contains price symbol, second neighbor word contains price unit, so i=6, sub-results include {x1,x2,x3,x4,x5,x6}, and correspondingly, the weights corresponding to each field include {β1,β2,β3,β4,β5,β6}.
[0064] In this embodiment, the commodity price identification device can compare the logistic regression result with the preset value. When the logistic regression result is greater than the preset value, the detection result is determined to meet the preset condition. When the logistic regression result is less than or equal to the preset value, the detection result is determined not to meet the preset condition. The preset value is a pre-set value for comparison with the logistic regression result. The value of the preset value depends on actual needs, and this application does not limit this.
[0065] See also Figure 5 . An embodiment of the present application provides a model generation method, which is used to generate a price keyword clustering model in a commodity price identification method. The model generation method can be applied to a model generation device. The model generation device can be an electronic device with certain computing power and network access capabilities. Of course, the model generation device can also refer to a software program running in an electronic device. In this embodiment, the model generation method can include the following steps.
[0066] Step S210: extracting neighboring words related to price representation in the training data as sample neighboring words to obtain a sample neighboring word set.
[0067] Step S220: identifying sample adjacent word pairs that meet a preset similarity from the sample adjacent word set.
[0068] Step S230: constructing a vocabulary graph based on each sample neighboring word pair; wherein the vocabulary graph includes sample neighboring word pairs connected by edges.
[0069] Step S240: taking each connected component in the vocabulary graph as a price keyword set to generate a price keyword clustering model including at least one price keyword set; wherein the price keyword clustering model is used to perform price keyword detection on neighboring words of numerical values in the product image, and when the detection result meets preset conditions, the numerical value is the product price.
[0070] In this embodiment, in order to accurately identify the words that can represent the price in the neighboring words and improve the efficiency of commodity price recognition, the model generation device can generate a price keyword clustering model that consumes less computing power and storage than the language model. The specific method is: extract the neighboring words related to the price expression in the training data as sample neighboring words, and obtain a sample neighboring word set, wherein the training data is data with pre-labeled commodity price recognition results, and the neighboring words related to the price expression in the training data can be extracted as sample neighboring words based on semantic recognition to form a sample neighboring word set. Then, the similarity can be calculated for every two sample neighboring words in the sample neighboring word set, and the two sample neighboring words corresponding to the similarity greater than or equal to the preset similarity (such as 0.5) are determined as sample neighboring word pairs, and the sample neighboring word pairs obtained thereby can be used to construct a vocabulary graph, in which the sample neighboring word pairs are connected by edges. Furthermore, the connected components in the vocabulary graph can be determined by the Hash-To-Min algorithm or other graph theory clustering algorithms, and each connected component can be used as a price keyword set to generate a price keyword clustering model containing at least one price keyword set, wherein a connected component refers to the maximum set of sample neighboring words connected by edges in the vocabulary graph, and there is a connected path between any two sample neighboring words in the connected component, and the connected component can be a clustering result of similar words.
[0071] The model generation method provided in the embodiment of the present application can generate at least one price keyword set, and each word in the price keyword set is similar to each other. The price keyword clustering model composed of at least one price keyword set can be used to perform price keyword detection on neighboring words of numerical values in product images. The obtained detection result can characterize the relationship between the neighboring words and at least one price keyword set. Therefore, when the detection result meets the preset conditions, the numerical value can be determined as the product price. Compared with directly determining the numerical value in the product image as the product price, using the numerical value and its neighboring words as the basis for product price recognition can improve the recognition accuracy of the product price in the product image.
[0072] In some embodiments, the model generation device can perform price keyword detection on the training data based on the price keyword clustering model to obtain sample detection results corresponding to each neighboring word data in the training data; wherein the sample detection results are used to characterize the relationship between the corresponding neighboring word data and the at least one price keyword set; through the sample detection results and the commodity price identification results corresponding to the each neighboring word data, the weights corresponding to each field in the sample detection results in the iterative logistic regression model are obtained; wherein the iterated logistic regression model is used to calculate the logistic regression results of the detection results, and when the logistic regression results are greater than a preset value, the detection results meet the preset conditions.
[0073] In this embodiment, in order to achieve more accurate commodity price identification and more efficient processing speed, the model generation device can train a logistic regression model that consumes less computing power than the model that requires inference. Specifically, the training data can be subjected to price keyword detection based on the price keyword clustering model to obtain sample detection results corresponding to each neighboring word data in the training data. Among them, the neighboring word data includes a numerical value and its neighboring words, and each neighboring word data includes a positive sample and a negative sample. The commodity price identification result corresponding to the positive sample indicates that the numerical value in the positive sample is the commodity price, and the commodity price identification result corresponding to the negative sample indicates that the numerical value in the negative sample is not the commodity price. The sample detection result includes sub-results corresponding to the following fields: the first neighboring word contains a price description, the first neighboring word contains a price symbol, the first neighboring word contains a price unit, the second neighboring word contains a price description, the second neighboring word contains a price symbol, and the second neighboring word contains a price unit. Then, the sample test results and the commodity price identification results corresponding to the corresponding neighboring word data can be substituted into the logistic regression model to calculate the weights of each field in the sample test results in the logistic regression model. Based on this method, each neighboring word data is processed in turn until multiple iterations of the weights are completed. As an example, the weights corresponding to each field in the iterative logistic regression model are: 0.33, 5.58, -0.72, -0.52, -3.04, 3.54. The iterative logistic regression model can be used to calculate the logistic regression results of the actual test results, so as to identify the commodity price based on the logistic regression results.
[0074] See also Figure 6 . One embodiment of the present application also provides a commodity price identification device. The commodity price identification device may include: an identification module, used to identify a numerical value in a commodity image and neighboring words of the numerical value; a price keyword detection module, used to perform price keyword detection on the neighboring words based on a price keyword clustering model to obtain a detection result; wherein the price keyword clustering model includes at least one price keyword set, and each word in the price keyword set is similar to each other; the detection result is used to characterize the relationship between the neighboring words and the at least one price keyword set; a commodity price identification module, used to identify the numerical value as a commodity price when the detection result meets a preset condition.
[0075] In this embodiment, the specific functions and effects achieved by the commodity price identification device can be explained with reference to other embodiments of the present application and will not be repeated here.
[0076] See also Figure 7. One embodiment of the present application also provides a model generation device. The model generation device may include: a sample extraction module, used to extract neighboring words related to price representation in training data as sample neighboring words to obtain a sample neighboring word set; a neighboring word pair identification module, used to identify sample neighboring word pairs that meet a preset similarity from the sample neighboring word set; a vocabulary graph construction module, used to construct a vocabulary graph based on each sample neighboring word pair; wherein the vocabulary graph includes sample neighboring word pairs connected by edges; a model generation module, used for neighboring word pairs to use each connected component in the vocabulary graph as a price keyword set to generate a price keyword clustering model containing at least one price keyword set; wherein the price keyword clustering model is used to perform price keyword detection on neighboring words of numerical values in product images, and when the detection result meets preset conditions, the numerical value is the product price.
[0077] In this embodiment, the specific functions and effects achieved by the model generation device can be explained with reference to other embodiments of the present application and will not be repeated here.
[0078] The embodiment of the present application also provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the processor implements the commodity price identification method or model generation method as described above.
[0079] The embodiment of the present application also provides a computer program product including instructions, and when the computer program product is executed by a processor, the commodity price identification method or model generation method as described above is implemented.
[0080] See also Figure 8 The present description embodiment may provide a computer device, the computer device comprising: a memory, and one or more processors communicatively connected to the memory; the memory stores instructions executable by the one or more processors, the instructions are executed by the one or more processors, so that the one or more processors implement the commodity price identification method or model generation method as described above.
[0081] In some embodiments, the computer device may include a processor, a non-volatile storage medium, an internal memory, a communication interface, a display device, and an input device connected by a system bus. The non-volatile storage medium may store an operating system and related computer programs.
[0082] The user information or user account information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, etc.) involved in multiple implementation methods of the present application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0083] It should be understood that the specific examples in this article are only intended to help those skilled in the art to better understand the embodiments of the present application, rather than to limit the scope of the present invention.
[0084] It can be understood that in the various implementations of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the implementation methods of the present application.
[0085] It can be understood that the various embodiments described in this application can be implemented individually or in combination, and the embodiments of this application are not limited to this.
[0086] Unless otherwise stated, all technical and scientific terms used in the embodiments of the present application have the same meaning as those generally understood by those skilled in the art of the technical field of the present application. The terms used in the present application are only for the purpose of describing specific embodiments and are not intended to limit the scope of the present application. The term "and / or" used in the present application includes any and all combinations of one or more related listed items. The singular forms of "a kind of", "above" and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings.
[0087] It can be understood that the processor of the embodiment of the present application can be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method implementation can be completed by the hardware integrated logic circuit or software instructions in the processor. The above processor can be a general processor, a digital signal processor (DigitalSignal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components. The methods, steps and logic block diagrams disclosed in the embodiment of the present application can be implemented or executed. The general processor can be a microprocessor or the processor can also be any conventional processor, etc. The steps of the method disclosed in the embodiment of the present application can be directly embodied as a hardware decoding processor to perform, or the hardware and software modules in the decoding processor are combined and executed. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware.
[0088] It is understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (programmable ROM, PROM), an erasable programmable read-only memory (erasable PROM, EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0089] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0090] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.
[0091] In the several embodiments provided in the present application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device implementation described above is only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0092] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0093] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0094] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0095] The above is only a specific implementation of the present application, but the protection scope of the present invention is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A commodity price identification method, characterized in that: include: Identify numerical values and adjacent words of the numerical values in product images; Performing price keyword detection on the neighboring words based on the price keyword clustering model to obtain a detection result; wherein the price keyword clustering model includes at least one price keyword set, and each word in the price keyword set is similar to each other; the detection result is used to characterize the relationship between the neighboring words and the at least one price keyword set; When the detection result meets the preset conditions, the value is determined to be the commodity price.
2. The method according to claim 1, characterized in that The step of identifying a numerical value and adjacent words of the numerical value in a product image includes: Performing text recognition on the product image to obtain a text recognition result; wherein the text recognition result includes a plurality of segmented words arranged in a text recognition order; A numerical value and adjacent words before and after the numerical value are determined from the multiple participles according to a preset regular expression; wherein the preset regular expression is used to limit the numerical range and the number of adjacent words.
3. The method according to claim 1, characterized in that The adjacent words include a first preset number of front adjacent words and a second preset number of rear adjacent words; the at least one price keyword set includes a price keyword set identified as price descriptions, a price keyword set identified as price symbols, and a price keyword set identified as price units; the detection result includes sub-results corresponding to the following fields: the front adjacent word contains the price description, the front adjacent word contains the price symbol, the front adjacent word contains the price unit, the rear adjacent word contains the price description, the rear adjacent word contains the price symbol, and the rear adjacent word contains the price unit.
4. The method according to claim 3, characterized in that The method further comprises: Calculating a logistic regression result of each sub-result based on a logistic regression model; wherein the logistic regression model includes weights corresponding to each of the fields; and the logistic regression result is used to indirectly indicate whether the value is a commodity price; When the logistic regression result is greater than a preset value, it is determined that the detection result meets the preset condition.
5. A model generation method, characterized in that: The model generation method is used to generate the price keyword clustering model as claimed in claim 1, and the method comprises: Extracting neighboring words related to price representation in the training data as sample neighboring words, and obtaining a sample neighboring word set; Identifying sample adjacent word pairs that meet a preset similarity from the sample adjacent word set; Constructing a vocabulary graph based on each sample neighboring word pair; wherein the vocabulary graph includes sample neighboring word pairs connected by edges; Each connected component in the vocabulary graph is used as a price keyword set to generate a price keyword clustering model containing at least one price keyword set; wherein the price keyword clustering model is used to perform price keyword detection on neighboring words of numerical values in commodity images, and when the detection result meets preset conditions, the numerical value is the commodity price.
6. The method according to claim 5, characterized in that The method further comprises: Performing price keyword detection on the training data based on the price keyword clustering model to obtain sample detection results corresponding to each neighboring word data in the training data; wherein the sample detection results are used to characterize the relationship between the corresponding neighboring word data and the at least one price keyword set; Through the sample detection results and the commodity price identification results corresponding to the neighboring word data, the weights corresponding to each field in the sample detection results are iterated in the logistic regression model; wherein the iterated logistic regression model is used to calculate the logistic regression results of the detection results, and when the logistic regression results are greater than a preset value, the detection results meet the preset conditions.
7. A commodity price identification device, characterized in that: include: A recognition module, used to recognize a numerical value and adjacent words of the numerical value in a product image; a price keyword detection module, configured to perform price keyword detection on the neighboring words based on a price keyword clustering model to obtain a detection result; wherein the price keyword clustering model includes at least one price keyword set, and each word in the price keyword set is similar to each other; and the detection result is used to characterize the relationship between the neighboring words and the at least one price keyword set; The commodity price identification module is used to identify the numerical value as the commodity price when the detection result meets the preset conditions.
8. A model generation device, characterized in that: include: A sample extraction module is used to extract neighboring words related to price representation in the training data as sample neighboring words to obtain a sample neighboring word set; A neighboring word pair identification module, used to identify sample neighboring word pairs that meet a preset similarity from the sample neighboring word set; A vocabulary graph construction module, used to construct a vocabulary graph based on each sample neighboring word pair; wherein the vocabulary graph includes sample neighboring word pairs connected by edges; A model generation module is used for neighboring word pairs to use each connected component in the vocabulary graph as a price keyword set to generate a price keyword clustering model containing at least one price keyword set; wherein the price keyword clustering model is used to perform price keyword detection on neighboring words of numerical values in a product image, and when the detection result meets a preset condition, the numerical value is the product price.
9. A computer device, characterized in that: The computer device includes a memory and a processor, wherein the memory stores at least one computer program, and the at least one computer program is loaded and executed by the processor to implement the commodity price identification method as described in any one of claims 1 to 4, or the model generation method as described in any one of claims 5 to 6.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores at least one computer program, and when the at least one computer program is executed by a processor, it can implement the commodity price identification method according to any one of claims 1 to 4, or the model generation method according to any one of claims 5 to 6.
11. A computer program product, characterized in that The computer program product is used to implement the commodity price identification method according to any one of claims 1 to 4, or the model generation method according to any one of claims 5 to 6.