CN113744006A - Category recommendation method and device, electronic equipment and storage medium - Google Patents

Category recommendation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN113744006A
CN113744006A CN202010476089.4A CN202010476089A CN113744006A CN 113744006 A CN113744006 A CN 113744006A CN 202010476089 A CN202010476089 A CN 202010476089A CN 113744006 A CN113744006 A CN 113744006A
Authority
CN
China
Prior art keywords
category
prediction
specified
hierarchy
picture
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010476089.4A
Other languages
Chinese (zh)
Inventor
仇辉
杜川
李志伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202010476089.4A priority Critical patent/CN113744006A/en
Publication of CN113744006A publication Critical patent/CN113744006A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0631Item recommendations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/02Marketing; Price estimation or determination; Fundraising
    • G06Q30/0201Market modelling; Market analysis; Collecting market data
    • G06Q30/0202Market predictions or forecasting for commercial activities

Landscapes

  • Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Finance (AREA)
  • Accounting & Taxation (AREA)
  • Strategic Management (AREA)
  • Development Economics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • Marketing (AREA)
  • General Business, Economics & Management (AREA)
  • Entrepreneurship & Innovation (AREA)
  • Economics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Game Theory and Decision Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The disclosure provides a category recommendation method, a category recommendation device, an electronic device and a storage medium, wherein the method comprises the following steps: acquiring text description and/or pictures of a target commodity to be subjected to category recommendation; inputting the text description and/or the picture into a pre-established category recommendation model, and simultaneously performing a plurality of category prediction tasks through the category recommendation model to obtain a plurality of category prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in a specified category system; the category prediction task is used for predicting categories into which the target commodity is divided in one hierarchy; and outputting the category prediction result meeting the preset condition as a recommended category. According to the method and the device, the user does not need to perform complicated manual category selection operation, operation steps of the user are reduced, and the use experience of the user is improved.

Description

Category recommendation method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of computer software technologies, and in particular, to a category recommendation method and apparatus, an electronic device, and a storage medium.
Background
With the vigorous development of the e-commerce platform, the number of commodities of the e-commerce platform is hundreds of millions, the classification scale is tens of thousands, the user demands are various, and the covered market range is extremely large.
In the process of uploading the commodities by the merchant, category information corresponding to the commodities, such as clothes, food and the like, needs to be filled in, so that the process of classifying the commodities is realized, and the commodities are conveniently recommended to the user or other services are carried out according to the commodity classification. However, when the number of categories is very large, it takes time for a merchant to select categories of goods, and even when the merchant is not familiar with the e-commerce platform, the merchant does not know which categories the goods belong to, which may cause wrong classification, and is not favorable for the user experience.
Disclosure of Invention
To overcome the problems in the related art, the present disclosure provides a category recommendation method, apparatus, electronic device, and storage medium.
According to a first aspect of the embodiments of the present disclosure, there is provided a category recommendation method, including:
acquiring text description and/or pictures of a target commodity to be subjected to category recommendation;
inputting the text description and/or the picture into a pre-established category recommendation model, and simultaneously performing a plurality of category prediction tasks through the category recommendation model to obtain a plurality of category prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in a specified category system; the category prediction task is used for predicting categories into which the target commodity is divided in one hierarchy;
and outputting the category prediction result meeting the preset condition as a recommended category.
Optionally, the category recommendation model is obtained by training through the following steps:
obtaining a training sample; the training sample at least comprises text descriptions or pictures of a plurality of commodities, each commodity corresponds to a plurality of labels, and each label represents a category into which the commodity is divided in one level of a specified category system; different labels correspond to different levels in the specified category hierarchy;
inputting the training sample into a specified model, and simultaneously performing a plurality of category prediction tasks through the specified model to obtain a plurality of prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in the specified category system; the category prediction task is used for predicting categories into which the commodity is divided in one hierarchy;
and comparing the prediction results belonging to the same level with the labels, and reversely adjusting parameters for constructing the specified model according to the comparison results to obtain the category recommendation model.
Optionally, the specified category hierarchy comprises a root hierarchy, a non-leaf hierarchy and a leaf hierarchy, and the relationship between the hierarchies is represented by a tree relationship;
the comparing the prediction result belonging to the same level with the label, and reversely adjusting the parameters for constructing the designated model according to the comparison result, includes:
sequentially comparing the prediction results belonging to the same level with the labels according to the sequence from the leaf level to the root level, and determining whether the prediction of the level is correct or not according to the comparison result;
if the prediction of the current level is wrong, continuing the comparison step of the next level;
if the prediction of the hierarchy is correct or all the hierarchies are wrong, finishing the comparison step among the hierarchies and executing the following steps: calculating loss values between the prediction results corresponding to the prediction error levels and the labels respectively based on a preset loss function; accumulating the loss values corresponding to the levels with wrong prediction to obtain the loss value of the specified model; and adjusting parameters for constructing the specified model according to the loss value of the specified model to obtain the category recommendation model.
Optionally, the specified category hierarchy comprises a root hierarchy, a non-leaf hierarchy and a leaf hierarchy, and the relationship between the hierarchies is represented by a tree relationship;
the plurality of category prediction results correspond to each hierarchy in the specified category system one to one;
the step of outputting the category prediction result meeting the preset condition as a recommended category comprises the following steps:
and outputting the category prediction result corresponding to the leaf level as a recommended category.
Optionally, the method further comprises:
and obtaining and outputting the categories of the root level corresponding to the recommended categories according to the recommended categories and the tree-like relation among the levels of the specified category system.
Optionally, the outputting the category prediction result meeting the preset condition as a recommended category includes:
converting the category prediction result meeting the preset condition into the category of a third-party platform according to a pre-stored category system mapping relation; the category system mapping relation represents a corresponding relation between the categories in the specified category system and the categories in the category system of the third-party platform;
and outputting the category of the third-party platform as a recommended category of the target commodity.
Optionally, the category recommendation model at least includes a text feature extraction network and/or a picture feature extraction network;
the character extraction network is used for extracting the character description of the target commodity to obtain character features; the character features are used for predicting categories into which the target commodity is divided in each hierarchy;
the picture feature extraction network is used for extracting features of the picture of the target commodity to obtain picture features; the picture features are used for predicting categories into which the target commodity is divided in various levels.
Optionally, the text feature extraction network includes a preprocessing layer, an embedding layer, and a first splicing layer;
the preprocessing layer is used for preprocessing the character description of the target commodity to obtain a plurality of words;
the embedding layer is used for respectively converting the words into embedding vectors;
the first splicing layer is used for splicing the embedded vectors to obtain the character features; the textual features are used to predict categories into which the target good is divided in various tiers.
Optionally, the text feature extraction network further includes a text recognition layer;
the character recognition layer is used for recognizing characters in the picture of the target commodity and acquiring a character recognition result;
the preprocessing layer is specifically used for preprocessing the character description of the target commodity and/or the character recognition result to obtain a plurality of words; the words are used to predict the categories into which the target good is divided in the various tiers.
Optionally, the text feature extraction network further includes a picture classifier;
the picture classifier is used for identifying the picture of the target commodity and acquiring a commodity label; the commodity label represents an identification result of the picture of the target commodity;
the preprocessing layer is specifically used for preprocessing the text description of the target commodity and/or the commodity label to obtain a plurality of words; the words are used to predict the categories into which the target good is divided in the various tiers.
Optionally, the preprocessing process includes at least one of the following operations:
and filtering the operation of the specified characters, the character splicing operation and the word segmentation operation.
Optionally, the category recommendation model further includes a second splice layer;
the second splicing layer is used for splicing the character features and the picture features to obtain splicing features; the stitching features are used to predict categories into which the target good is divided in various tiers.
Optionally, the category recommendation model further includes a plurality of prediction networks respectively corresponding to the category prediction tasks;
and the prediction network is used for processing the splicing characteristics to obtain a category prediction result corresponding to the target commodity in a corresponding level.
Optionally, each of the prediction networks is formed by sequentially connecting a plurality of fully-connected layers.
According to a second aspect of the embodiments of the present disclosure, there is provided a category recommendation apparatus including:
the target commodity information acquisition module is used for acquiring the text description and/or the picture of the target commodity to be subjected to category recommendation;
the category prediction result acquisition module is used for inputting the text description and/or the picture into a pre-established category recommendation model, and simultaneously performing a plurality of category prediction tasks through the category recommendation model to acquire a plurality of category prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in a specified category system; the category prediction task is used for predicting categories into which the target commodity is divided in one hierarchy;
and the recommendation category output module is used for outputting the category prediction result meeting the preset conditions as a recommendation category.
Optionally, the category recommendation model is obtained by:
the training sample acquisition module is used for acquiring a training sample; the training sample at least comprises text descriptions or pictures of a plurality of commodities, each commodity corresponds to a plurality of labels, and each label represents a category into which the commodity is divided in one level of a specified category system; different labels correspond to different levels in the specified category hierarchy;
the prediction result acquisition module is used for inputting the training samples into a specified model, and simultaneously performing a plurality of category prediction tasks through the specified model to obtain a plurality of prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in the specified category system; the category prediction task is used for predicting categories into which the commodity is divided in one hierarchy;
and the category recommendation model acquisition module is used for comparing the prediction result belonging to the same level with the label, and reversely adjusting parameters for constructing the specified model according to the comparison result to acquire the category recommendation model.
Optionally, the specified category hierarchy comprises a root hierarchy, a non-leaf hierarchy and a leaf hierarchy, and the relationship between the hierarchies is represented by a tree relationship;
the category recommendation model obtaining module comprises:
the comparison module is used for sequentially comparing the prediction results belonging to the same level with the labels according to the sequence from the leaf level to the root level and determining whether the prediction of the level is correct or not according to the comparison results;
the first execution module is used for continuing the comparison step of the next level if the prediction of the current level is wrong;
a second execution module, configured to, if the prediction of the current level is correct or all levels are wrong, end the comparison step between the levels and execute the following steps: calculating loss values between the prediction results corresponding to the prediction error levels and the labels respectively based on a preset loss function; accumulating the loss values corresponding to the levels with wrong prediction to obtain the loss value of the specified model; and adjusting parameters for constructing the specified model according to the loss value of the specified model to obtain the category recommendation model.
Optionally, the specified category hierarchy comprises a root hierarchy, a non-leaf hierarchy and a leaf hierarchy, and the relationship between the hierarchies is represented by a tree relationship;
the plurality of category prediction results correspond to each hierarchy in the specified category system one to one;
the recommendation category output module comprises:
and outputting the category prediction result corresponding to the leaf level as a recommended category.
Optionally, the method further comprises:
and the category output module is used for acquiring and outputting the categories of the root level corresponding to the recommended categories according to the recommended categories and the tree-like relation among the levels of the specified category system.
Optionally, the recommendation category output module includes: converting the category prediction result meeting the preset condition into the category of a third-party platform according to a pre-stored category system mapping relation; the category system mapping relation represents a corresponding relation between the categories in the specified category system and the categories in the category system of the third-party platform; and outputting the category of the third-party platform as a recommended category of the target commodity.
Optionally, the category recommendation model at least includes a text feature extraction network and/or a picture feature extraction network;
the character extraction network is used for extracting the character description of the target commodity to obtain character features; the character features are used for predicting categories into which the target commodity is divided in each hierarchy;
the picture feature extraction network is used for extracting features of the picture of the target commodity to obtain picture features; the picture features are used for predicting categories into which the target commodity is divided in various levels.
Optionally, the text feature extraction network includes a preprocessing layer, an embedding layer, and a first splicing layer;
the preprocessing layer is used for preprocessing the character description of the target commodity to obtain a plurality of words;
the embedding layer is used for respectively converting the words into embedding vectors;
the first splicing layer is used for splicing the embedded vectors to obtain the character features; the textual features are used to predict categories into which the target good is divided in various tiers.
Optionally, the text feature extraction network further includes a text recognition layer;
the character recognition layer is used for recognizing characters in the picture of the target commodity and acquiring a character recognition result;
the preprocessing layer is specifically used for preprocessing the character description of the target commodity and/or the character recognition result to obtain a plurality of words; the words are used to predict the categories into which the target good is divided in the various tiers.
Optionally, the text feature extraction network further includes a picture classifier;
the picture classifier is used for identifying the picture of the target commodity and acquiring a commodity label; the commodity label represents an identification result of the picture of the target commodity;
the preprocessing layer is specifically used for preprocessing the text description of the target commodity and/or the commodity label to obtain a plurality of words; the words are used to predict the categories into which the target good is divided in the various tiers.
Optionally, the preprocessing process includes at least one of the following operations:
and filtering the operation of the specified characters, the character splicing operation and the word segmentation operation.
Optionally, the category recommendation model further includes a second splice layer;
the second splicing layer is used for splicing the character features and the picture features to obtain splicing features; the stitching features are used to predict categories into which the target good is divided in various tiers.
Optionally, the category recommendation model further includes a plurality of prediction networks respectively corresponding to the category prediction tasks;
and the prediction network is used for processing the splicing characteristics to obtain a category prediction result corresponding to the target commodity in a corresponding level.
Optionally, each of the prediction networks is formed by sequentially connecting a plurality of fully-connected layers.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of any of the first aspect.
According to a fourth aspect of embodiments of the present disclosure, there is provided a storage medium having instructions that, when executed by a processor of an electronic device, enable the electronic device to perform the method of any one of the first aspects
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising the computer program of the method of any one of the first or second aspects.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
in the embodiment of the disclosure, after acquiring the text description and the picture of the target commodity or one of the text description and the picture, the electronic device inputs the text description and/or the picture into a pre-established category recommendation model, performs a plurality of category prediction tasks through the category recommendation model at the same time to acquire a plurality of category prediction results, and then outputs the category prediction results meeting preset conditions as recommended categories, so that in the process of uploading commodities by a merchant, complicated manual category selection operation is not required, the category to which the commodity belongs can be effectively identified through the category recommendation model and then recommended to the merchant, the operation steps of a user are reduced, the commodity uploading efficiency of the merchant is further improved, the user experience is improved, and on the other hand, the merchant can upload the commodities correctly according to the categories identified by the category recommendation model, the safety problem of commodity is guaranteed, the operation risk of an e-commerce platform and the purchase risk of a consumer are reduced, and the property safety of the consumer is guaranteed.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this disclosure, illustrate embodiments consistent with the disclosure and together with the description, serve to explain the principles of the disclosure.
FIG. 1 is a flow chart illustrating a method of training a category recommendation model according to an exemplary embodiment of the present disclosure.
FIG. 2 is a schematic diagram of a category hierarchy shown in the present disclosure in accordance with an exemplary embodiment.
FIG. 3 is a schematic diagram of loss calculation logic shown in accordance with an exemplary embodiment of the present disclosure.
FIG. 4 is a flowchart illustrating a category recommendation method according to an exemplary embodiment of the present disclosure.
FIG. 5 is a block diagram of a first category recommendation model shown in accordance with an exemplary embodiment of the present disclosure.
FIG. 6 is a block diagram of a second category recommendation model shown in accordance with an exemplary embodiment of the present disclosure.
FIG. 7 is a block diagram illustrating a third category recommendation model according to an exemplary embodiment of the present disclosure.
FIG. 8 is a block diagram illustrating a fourth category recommendation model according to an exemplary embodiment of the present disclosure.
Fig. 9 is a block diagram of a fifth category recommendation model shown in accordance with an exemplary embodiment of the present disclosure.
FIG. 10 is a block diagram of an electronic device shown in accordance with an exemplary embodiment of the present disclosure.
Fig. 11 is a block diagram of a category recommendation device provided by the present disclosure according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
The terminology used in the present disclosure is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. As used in this disclosure and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present disclosure. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In order to solve the problems in the related art, the embodiment of the disclosure provides a category recommendation method, which can predict categories of target commodities by using a pre-established category recommendation model to obtain category prediction results, and then output recommended categories according to the category prediction results, so that a user does not need to manually select the categories of the target commodities, a complicated operation process of the user is reduced, and the use experience of the user is improved.
Next, a training process of the category recommendation model will be described: referring to fig. 1, a flowchart illustrating a method for training a category recommendation model according to an exemplary embodiment of the present disclosure is shown, where the method is performed by an electronic device, and the electronic device may be a device with computing capability, such as a server, a cloud, a computer, a Personal Digital Assistant (PDA), or a mobile phone terminal, and the method includes:
in step S101, a training sample is obtained; the training sample at least comprises text descriptions or pictures of a plurality of commodities, each commodity corresponds to a plurality of labels, and each label represents a category into which the commodity is divided in one level of a specified category system; different ones of the labels correspond to different levels in the specified taxonomy.
In step S102, inputting the training sample into a designated model, and performing multiple category prediction tasks simultaneously through the designated model to obtain multiple prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in the specified category system; the category prediction task is used for predicting categories into which the commodity is divided in one hierarchy.
In step S103, the prediction results belonging to the same hierarchy are compared with the labels, and parameters for constructing the specified model are reversely adjusted according to the comparison results, so as to obtain the category recommendation model.
Firstly, before training of the category recommendation model is started, the electronic device needs to obtain a training sample, in the embodiment of the present disclosure, a supervised learning manner is used for performing a model training process, the training sample at least includes text descriptions or pictures of a plurality of commodities, each commodity corresponds to a plurality of tags, each tag represents a category into which the commodity is divided in one level of a specified category system, that is, the plurality of tags correspond to a plurality of levels of the specified category system one to one, and different tags correspond to different levels of the specified category system.
It can be understood that, in the embodiment of the present disclosure, no limitation is imposed on the acquisition source of the training sample, the division of the specified category system, and the text description of the commodity, and specific settings may be performed according to actual application scenarios. By way of example, the textual description of the item may include a title of the item and a detailed description, such as a textual description of a food product as "date of freshness 6 months for a savory spicy snack made from a soy product of the old source 148g by 5.
The specified category system comprises a root level, a non-leaf level and a leaf level, and the relationship among the levels is represented by a tree relationship. In an example, for example, the specified category hierarchy includes 3 hierarchies, the relationship between the hierarchies may be represented by a tree relationship, the parent hierarchy may have a plurality of child hierarchies, and the child hierarchy only has one parent hierarchy, please refer to fig. 2, which is a schematic diagram of the category hierarchy shown in the present disclosure according to an exemplary embodiment, and is illustrated in fig. 2: level 1 is a root level and comprises clothes and food; the 2 nd level is a non-leaf level, wherein the clothing node comprises { men's clothing, women's clothing }, and the food node comprises { fresh and snack }; the 3 rd level is a leaf level, the node of the ' men ' comprises { jacket, men trousers }, the node of the ' women ' comprises { jacket, women trousers, women ' skirt }, the node of the ' fresh ' comprises { aquatic products, fruits }, the node of the ' snacks ' comprises { candy, biscuit and nuts }, and in a category system comprising 3 levels, the commodity of one ' one-piece dress ' corresponds to 3 labels, wherein the label corresponding to the first level is ' clothing ', the label corresponding to the second level is ' women ' dress ', and the label corresponding to the third level is ' women ' skirt '.
In an embodiment, after obtaining the training sample and the label related to the commodity, the electronic device may perform model training according to the training sample and the label, the electronic device inputs the training sample into a specified model, and simultaneously performs a plurality of category prediction tasks through the specified model, the category prediction tasks being used for predicting the category into which the commodity is divided in one hierarchy, the plurality of category prediction tasks respectively corresponding to the plurality of hierarchies included in the specified category system one to one, so that the electronic device may obtain a plurality of prediction results through the specified model, the plurality of prediction results respectively corresponding to the plurality of hierarchies included in the specified category system one to one, then compare the prediction results belonging to the same hierarchy with the label, and reversely adjust parameters for constructing the specified model according to the comparison results, and obtaining the category recommendation model.
It is understood that the number of the hierarchies included in the specified category system is not limited in the embodiment of the present disclosure, and the embodiment illustrated in fig. 2 is only an example, where the number of the non-leaf hierarchies may be one or more, and may be specifically set according to an actual application scenario.
In an example, for example, the specified category system includes 3 hierarchies, relationships among the hierarchies may be represented by a tree relationship, and are a root hierarchy, a non-leaf hierarchy and a leaf hierarchy, correspondingly, the training sample includes text descriptions or pictures of a plurality of commodities, the commodities correspond to 3 tags, the specified model includes 3 category prediction tasks, each category prediction task corresponds to one of the hierarchies, the electronic device performs 3 category prediction tasks simultaneously in the process of training the specified model to obtain 3 prediction results, then compares the prediction results belonging to the same hierarchy with the tags, and reversely adjusts parameters used for constructing the specified model according to the comparison results to obtain the category recommendation model.
In this embodiment, after a training sample is obtained, the training sample is input into a designated model, and a plurality of category prediction tasks are performed simultaneously through the designated model, the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in a designated category system, the category prediction tasks are used for predicting categories into which the commodity is divided in one hierarchy, so as to obtain a plurality of prediction results, then the prediction results belonging to the same hierarchy are compared with the labels, and parameters for constructing the designated model are reversely adjusted according to the comparison results, so as to obtain the category recommendation model; according to the method and the device, the multi-task learning process is realized, the multiple category prediction tasks are mutually assisted in the training process, the sharing of partial parameters is realized, and the accurate prediction of the commodity categories is realized, so that a user does not need to perform complicated manual category selection operation, the prediction result obtained through the category recommendation model is used as the recommendation categories of the commodity, the operation steps of the user are favorably reduced, the commodity uploading efficiency of a merchant is further improved, and the use experience of the user is improved.
The reverse tuning of the parameters used to construct the specified model is specifically described here: the appointed category system comprises a root level, a non-leaf level and a leaf level, the relation among the levels is expressed by a tree relation, in the process of reversely adjusting parameters for constructing the appointed model according to a comparison result, the electronic equipment compares the prediction result belonging to the same level with the label in sequence from the leaf level to the root level, and determines whether the level is predicted correctly or not according to the comparison result; if the prediction of the current level is wrong, continuing the comparison step of the next level; if the prediction of the hierarchy is correct or all the hierarchies are wrong, finishing the comparison step among the hierarchies and executing the following steps: calculating loss values between the prediction results corresponding to the prediction error levels and the labels respectively based on a preset loss function; accumulating the loss values corresponding to the levels with wrong prediction to obtain the loss value of the specified model; and adjusting parameters for constructing the specified model according to the loss value of the specified model to obtain the category recommendation model.
Based on the above description, the comparison process is performed in the order from the leaf level to the root level, so that the loss can be adaptively increased or decreased, when a certain level predicts correctly, the remaining other levels are not required to be compared, the loss values corresponding to the levels which have been compared before are calculated, and the loss values of the levels which have not been compared are not required to be calculated, so that the loss is reduced, when a certain level predicts incorrectly, the remaining other levels are continuously compared, and if all levels predict incorrectly, the loss values corresponding to all levels are calculated, so that the loss is amplified, and the prediction accuracy of the designated model can be effectively improved in the process of back propagation and optimization of the designated model parameters.
The specified category hierarchy here includes 3 levels as an example for illustration: the specified category system comprises a root level, a non-leaf level and a leaf level, the relationship among the levels is represented by a tree relationship, please refer to fig. 3, the electronic device firstly compares the prediction result of the leaf level with the label, and determines whether the prediction of the level is correct according to the comparison result; if yes, the total loss (set as loss) of the specified model is 0; if not, comparing the prediction result of the non-leaf level with the label, and determining whether the level is predicted correctly according to the comparison result; if yes, the total loss (set as loss) of the specified model is a loss value (set as loss3) corresponding to the leaf level; if not, comparing the prediction result of the root level with the label, and determining whether the prediction of the current level is correct or not according to the comparison result; if so, the total loss (set as loss) of the specified model is the result of the accumulation of the loss value (set as loss3) corresponding to the leaf level and the loss value (set as loss2) corresponding to the non-leaf level; if not, the total loss (set as loss) of the specified model is the result of accumulation of a loss value (set as loss3) corresponding to a leaf level, a loss value (set as loss2) corresponding to a non-leaf level and a loss value (set as loss1) corresponding to a root level; in this embodiment, under the condition that a certain layer is predicted incorrectly, the remaining other layers are continuously compared until the compared layer is determined to be predicted correctly, and loss values corresponding to the layers with the wrong prediction are accumulated, so that the purpose of amplifying the loss is achieved, and the prediction accuracy of the specified model can be effectively improved in the process of back propagation and optimization of the parameters of the specified model.
After the category recommendation model is obtained, a procedure of performing category recommendation by using the category recommendation model is described as follows: referring to fig. 4, a category recommendation method provided in an embodiment of the present disclosure is applicable to an electronic device, and the method includes:
in step S201, a text description and/or a picture of a target product to be subjected to category recommendation is acquired.
In step S202, inputting the text description and/or the picture into a pre-established category recommendation model, and performing multiple category prediction tasks simultaneously through the category recommendation model to obtain multiple category prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in a specified category system; the category prediction task is used for predicting categories into which the target commodity is divided in one hierarchy.
In step S203, the category prediction result that meets the preset condition is output as a recommended category.
In one embodiment, after acquiring the text description and the picture of the target commodity or one of the text description and the picture, the electronic device inputs the text description and/or the picture into a pre-established category recommendation model, performs a plurality of category prediction tasks simultaneously through the category recommendation model to acquire a plurality of category prediction results, and outputs the category prediction results meeting preset conditions as recommended categories, so that in the process of uploading commodities by a merchant, complicated manual category selection operation is not required, the category to which the commodity belongs can be effectively identified through the category recommendation model and then recommended to the merchant, the operation steps of a user are reduced, the commodity uploading efficiency of the merchant is further improved, the user experience is improved, and on the other hand, the merchant can upload the commodities correctly according to the categories identified by the category recommendation model, the safety problem of commodity is guaranteed, the operation risk of an e-commerce platform and the purchase risk of a consumer are reduced, and the property safety of the consumer is guaranteed.
It can be understood that, the preset condition is not limited in any way in the embodiment, and can be specifically set according to the actual application scenario. In an example, considering that the specified category system includes a root level, a non-leaf level and a leaf level, the relationship between the levels is represented by a tree-like relationship, that is, the specified category system is a tree structure, and generally, in the commodity classification, the merchant focuses most on the category corresponding to the leaf level, so that the preset condition may be a category prediction result corresponding to the leaf level, that is, a category prediction result corresponding to the leaf level in the multiple category recommendation results is output as a recommended category, thereby facilitating the use of the user. In another example, the preset condition may also be a hierarchy selected by the user according to actual needs of the user, and the corresponding category prediction result may be output based on the hierarchy selected by the user, which is not limited in this embodiment.
Further, after the category prediction result corresponding to the leaf level is output as the recommended category, the electronic device may further obtain and output the category of the root level corresponding to the recommended category according to the recommended category and the tree relationship between the levels of the specified category system, so that for a merchant who wants to know the category of the root level corresponding to the recommended category, the category may also be quickly, simply and conveniently obtained based on the structural characteristics of the category system, thereby facilitating the use of the user.
In an exemplary application scenario, on the e-commerce platform, based on security considerations, some categories need to have corresponding licenses, and some categories have lower qualification requirements on merchants, and thus do not need corresponding licenses, for example, a high-risk category "food" needs a "food operation license", and a low-risk category "clothes" does not need, because requirements of different industries are different, in the process of manually filling in or manually selecting the categories of goods by merchants, a certain merchant has a leak required by the industry, for example, a certain food merchant is checked for avoiding the license, and in the process of uploading food goods, the category is selected as "clothes", and such behavior seriously infringes the benefits of the e-commerce platform and consumer users, based on this, the prediction result of the goods is obtained through the category recommendation model of the embodiment of the present disclosure, and is used as the recommendation category of the goods, therefore, the merchant can upload the commodities correctly according to the recommendation categories, the safety problem of the commodities is guaranteed, the operation risk of the e-commerce platform and the purchase risk of the consumer are reduced, and the property safety of the consumer is guaranteed.
Furthermore, the commodity category manually filled or selected by the merchant for the commodity and the recommended category obtained by the commodity through the category recommendation model can be compared, if the difference between the commodity category and the recommended category is too large, the commodity category automatically filled by the merchant and the recommended category can be sent to a terminal corresponding to an auditor, and the auditor audits the commodity correctly or not, so that the safety problem of the commodity is further ensured, the operation risk of a power provider platform and the purchase risk of consumers are reduced, the workload of the auditor is reduced, the classification of all commodities uploaded by the merchant does not need to be audited, and the working efficiency is improved.
In another exemplary application scenario, considering that the hierarchy of categories may differ between different platforms, the electronic device may predetermine a category hierarchy mapping relationship between the category hierarchy pointed to by the category recommendation model and other category hierarchies (such as those of a third-party platform), namely establishing a corresponding relation between the categories in the category system and the categories in the category system of the third-party platform, when the target commodity is a commodity on a third-party platform, the electronic equipment acquires a plurality of category prediction results and then acquires the category prediction results meeting preset conditions from the plurality of category prediction results, then, according to a preset category system mapping relation, converting the category prediction result meeting the preset condition into a category of a third-party platform, and outputting the category of the third-party platform as a recommended category of the target commodity; the method and the device for recommending the categories can effectively solve the problem that the categories in different category systems of the platform are different in division, further improve the accuracy of the category division, and are beneficial to improving the compatibility of the category recommendation model, so that the method and the device have wide applicability.
The following describes a structure of the category recommendation model in this embodiment, so as to further clarify a process in which the category recommendation model obtains multiple category recommendation results of the target product. Referring to fig. 5, a block diagram of a first category recommendation model according to an exemplary embodiment of the present disclosure is shown, where the category recommendation model at least includes a text feature extraction network 11 or a picture feature extraction network 12; the character extraction network is used for extracting the character description of the target commodity to obtain character features; the character features are used for predicting categories into which the target commodity is divided in each hierarchy; the picture feature extraction network 12 is configured to perform feature extraction on the picture of the target commodity to obtain picture features; the picture features are used for predicting categories into which the target commodity is divided in various levels. In the embodiment, the text features and the picture features of the target commodity or one of the text features and the picture features are acquired, and the text description and the picture are closely related to the target commodity and are fused, so that the accuracy of model prediction is improved.
In an embodiment, in a case that the category recommendation model includes a text feature extraction network 11 and a picture feature extraction network 12, the category recommendation model further includes a second splicing layer 13 and a plurality of prediction networks 14 respectively corresponding to the category prediction tasks, where the second splicing layer 13 is configured to splice the text features and the picture features to obtain splicing features; the splicing characteristics are used for predicting categories into which the target commodity is divided in each hierarchy, and then the prediction network 14 is used for processing the splicing characteristics to obtain prediction results corresponding to the target commodity in corresponding hierarchies; in this embodiment, the second stitching layer 13 is used for stitching, which is beneficial to facilitating other subsequent processing procedures and improving processing efficiency, and the multi-task learning process is realized through the plurality of prediction networks 14, and the plurality of category prediction tasks assist each other in the training process, so that sharing of partial parameters (parameters related to the text feature extraction network 11, the picture feature extraction network 12 and the second stitching layer 13) is realized, and accurate prediction of the category to which the target commodity belongs is realized.
In another embodiment, in a case that the category recommendation model includes a text feature extraction network or a picture feature extraction network, the category recommendation model further includes a plurality of prediction networks respectively corresponding to the category prediction tasks, and the prediction networks are configured to process the text features or the picture features and obtain prediction results corresponding to the target product at corresponding levels; the embodiment realizes mutual assistance of a plurality of category prediction tasks in the training process, realizes sharing of partial parameters (parameters related to a character feature extraction network or a picture feature extraction network), and is beneficial to improving the model prediction accuracy.
The specific structure of the prediction network is not limited in this embodiment of the present disclosure, and may be specifically set according to an actual application scenario. In one example, the prediction network may be formed by a plurality of fully-connected layers connected in sequence.
Referring to fig. 6, which is a structural diagram of a second category recommendation model according to an exemplary embodiment of the present disclosure, the text feature extraction network 11 includes a preprocessing layer 111, an embedding layer 112, and a first splicing layer 113; the preprocessing layer 111 is used for preprocessing the text description of the target commodity to obtain a plurality of words; the embedding layer 112 is used for respectively converting a plurality of words into embedding vectors; the first splicing layer 113 is configured to splice the plurality of embedded vectors to obtain the text features; the textual features are used to predict categories into which the target good is divided in various tiers. The embodiment realizes the primary processing of the word description of the target commodity through the preprocessing process, is favorable for improving the accuracy of model prediction, and then converts a plurality of acquired words into dense vectors through the embedding layer 112, thereby avoiding excessive occupation of a large amount of sparse vectors on resources, and finally, the embedded vectors are spliced through the first splicing layer 113, so that the subsequent processing process can improve the processing efficiency.
Please refer to fig. 7, which is a structural diagram of a third category recommendation model according to an exemplary embodiment of the present disclosure, where the text feature extraction network 11 includes a text recognition layer 114, a preprocessing layer 111, an embedding layer 112, and a first splicing layer 113, where the text recognition layer 114 is configured to recognize text in a picture of the target product, and obtain a text recognition result; the preprocessing layer 111 is specifically configured to preprocess the text description of the target product and the text recognition result to obtain a plurality of words; the embedding layer 112 is used for respectively converting a plurality of words into embedding vectors; the first splicing layer 113 is configured to splice the plurality of embedded vectors to obtain the text features; in this embodiment, the text recognition result of the picture is obtained, so that the text recognition result and the text description of the target commodity are fused, and the prediction accuracy of the model is improved.
Referring to fig. 8, which is a structural diagram of a fourth category recommendation model according to an exemplary embodiment of the present disclosure, the text feature extraction network 11 includes a picture classifier 115, a preprocessing layer 111, an embedding layer 112, and a first splicing layer 113; the picture classifier 115 is configured to identify a picture of the target product and obtain a product tag; the commodity label represents the recognition result of the picture; the preprocessing layer 111 is specifically configured to preprocess the textual description of the target product and the product label to obtain a plurality of words; the embedding layer 112 is used for respectively converting a plurality of words into embedding vectors; the first splicing layer 113 is configured to splice the plurality of embedded vectors to obtain the text features; the textual features are used to predict categories into which the target good is divided in various tiers. In the embodiment, the recognition result of the picture is obtained, so that the recognition result of the picture and the text description of the target commodity are fused, and the prediction accuracy of the model is improved.
It is understood that the embodiment of the present disclosure does not set any limitation to the preprocessing process, and may be specifically configured according to an actual application scenario. In one example, the pre-processing comprises at least one of: filtering the operation of appointed characters, character splicing operation and word segmentation operation; the operation of filtering the specified characters can be filtering to numbers, punctuations or other common words without distinguishing ability, such as me, you, he, coming, going and the like, so that interference factors are removed, and the model prediction accuracy is improved; the character splicing operation can be that the character description, the character recognition result and the label of the target commodity are spliced into a sentence; the word segmentation operation is a process of segmenting one sentence into a plurality of words.
In an exemplary embodiment, please refer to fig. 9, which is a block diagram illustrating a fifth category recommendation model according to an exemplary embodiment of the present disclosure, where the category recommendation model includes a text feature extraction network 11, a picture feature extraction network 12, a second concatenation layer 13, and a plurality of prediction networks 14 respectively corresponding to the category prediction tasks.
The character extraction network is used for extracting the character description of the target commodity to obtain character features; the character features are used for predicting categories into which the target commodity is divided in each hierarchy; the character features are used for predicting categories into which the target commodity is divided in each hierarchy; the text extraction network includes a text recognition layer 114, a picture classifier 115, a pre-processing layer 111, an embedding layer 112, and a first stitching layer 113.
The character recognition layer 114 is configured to recognize characters in the picture of the target product, and obtain a character recognition result; it can be understood that, the embodiment of the present disclosure does not set any limitation to a specific algorithm for character recognition, and may perform specific setting according to an actual application scenario, for example, characters in a picture of the target product may be recognized through an OCR algorithm.
The picture classifier 115 is configured to identify a picture of the target product and obtain a product tag; the commodity label represents the recognition result of the picture; it can be understood that, the image classifier 115 is not limited in any way in the embodiments of the present disclosure, and may be specifically set according to an actual application scenario, for example, the image classifier 115 may be obtained based on deep learning algorithm training; in one example, the picture classifier 115 may train a residual network (ResNet) to converge through a picture sample set, where the picture sample set includes pictures of several commodities with labels, for example, a picture of a "dress" is labeled as a "dress". The trained picture classifier 115 can more accurately recognize the picture.
The preprocessing layer 111 is specifically configured to preprocess the text description of the target product, the product label, and the text recognition result to obtain a plurality of words; in one example, the electronic device performs a specified character filtering operation on the character description of the target product, the product label and the character recognition result through the preprocessing layer 111, and may filter to numbers, punctuations or other common words without distinguishing ability, such as me, you, he, come, go, and the like, so as to remove interference factors, thereby facilitating improvement of model prediction accuracy, and then concatenates the remaining 3 parts together with spaces as separators to form an integral sentence, and performs a word segmentation operation on the sentence, thereby obtaining a plurality of words; the embodiment realizes the fusion of various data sources, and is beneficial to improving the accuracy of model prediction.
The embedding layer 112 is used for respectively converting a plurality of words into embedding vectors; the first splicing layer 113 is configured to splice the plurality of embedded vectors to obtain the text features; the character features are used for predicting categories into which the target commodity is divided in each hierarchy; in this embodiment, the obtained words are converted into dense vectors by the embedding layer 112, so that excessive occupation of resources by a large number of sparse vectors is avoided, and finally, the embedding vectors are spliced by the first splicing layer 113, so that the subsequent processing process is facilitated, and the processing efficiency is improved. It can be understood that, in this embodiment, the representation form of the embedded vector and the splicing manner of the first splicing layer 113 are not limited at all, and may be specifically set according to an actual application scenario. In one example, the embedded vector may be represented as an integer vector or a floating-point vector, such as a 64-bit floating-point vector (64 is for illustration only and does not include other meanings). In an example, the first stitching layer 113 may add the embedded vectors in a sum posing manner to obtain the text feature, for example, the embedded vector is represented as a 64-bit floating-point type vector, and the electronic device may add corresponding positions of a plurality of embedded vectors through the first stitching layer 113 to obtain the text feature represented as a 64-bit floating-point type vector.
The picture feature extraction network 12 is configured to perform feature extraction on the picture of the target commodity to obtain picture features; the picture features are used for predicting categories into which the target commodity is divided in various levels. It can be understood that, the picture extraction network according to the embodiments of the present disclosure is not limited in any way, and may be specifically configured according to an actual application scenario. In one example, the extraction of the picture features can be realized through a neural network structure (such as a residual error network), the extracted picture features include the detail information of the picture, and the picture features are taken as one of the inputs, which is beneficial to improving the prediction accuracy of the model. The present embodiment does not set any limitation on the representation form of the picture features, for example, the picture features may be represented as 128-dimensional feature vectors (128 is merely an example, and does not include other meanings).
The second splicing layer 13 is used for splicing the character features and the picture features to obtain splicing features; the stitching features are used to predict categories into which the target good is divided in various tiers. The embodiment realizes the fusion of various data sources, and is beneficial to improving the accuracy of model prediction. It can be understood that, in this embodiment, no limitation is imposed on the splicing manner of the second splicing layer 13, and specific setting may be performed according to an actual application scenario. In one example, the second stitching layer 13 is configured to add the text feature and the picture feature to obtain a stitching feature, for example, the picture feature is represented as a 128-dimensional feature vector, the text feature is represented as a 64-dimensional feature vector, and the obtained stitching feature is a 192(128+64) -dimensional feature vector.
The prediction network 14 is configured to process the splicing features, and obtain a prediction result corresponding to the target commodity at a corresponding level. Each of the prediction networks 14 is configured to perform one of category prediction tasks, where the category prediction tasks are used to predict categories into which the target product is divided in one of the hierarchies, and the category prediction tasks are respectively in one-to-one correspondence with the hierarchies included in the specified category hierarchy. In the embodiment, the multi-task learning process is realized, a plurality of category prediction tasks are mutually assisted in the training process, and the accurate prediction of the target commodity category is realized; meanwhile, the category prediction model disclosed by the embodiment of the disclosure can be used for learning based on a deep neural network, and can adaptively learn the mode in the data under the condition of huge data volume, so that the category prediction model can still accurately predict under the condition of new commodities.
Corresponding to the embodiment of the method, the disclosure also provides an embodiment of the category recommendation device and the applied equipment thereof.
The embodiment of the category recommendation device in the disclosure can be applied to computer equipment, such as terminal equipment. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and as a logical device, the device is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor in which the file processing is located. From a hardware aspect, as shown in fig. 10, which is a hardware structure diagram of an electronic device where a recommendation device is located in the category recommendation apparatus in the embodiment of the present disclosure, except for the processor 310, the memory 330, the network interface 320, and the nonvolatile memory 340 shown in fig. 10, the electronic device where the recommendation device 331 is located in the embodiment may also include other hardware according to an actual function of the computer device, which is not described again.
Accordingly, the embodiments of the present disclosure also provide a computer storage medium, in which a program is stored, and when the program is executed by a processor, the method in any of the above embodiments is implemented.
The present disclosure may take the form of a computer program product embodied on one or more storage media including, but not limited to, disk storage, CD-ROM, optical storage, and the like, having program code embodied therein. Computer-usable storage media include permanent and non-permanent, removable and non-removable media, and information storage may be implemented by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of the storage medium of the computer 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, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic tape storage or other magnetic storage devices, or any other non-transmission medium, may be used to store information that may be accessed by a computing device.
Referring to fig. 11, a block diagram of an apparatus for recommending categories according to an exemplary embodiment of the present disclosure is shown, the apparatus including:
the target product information obtaining module 401 is configured to obtain text descriptions and/or pictures of a target product to be subjected to category recommendation.
A category prediction result obtaining module 402, configured to input the text description and/or the picture into a pre-established category recommendation model, and perform multiple category prediction tasks simultaneously through the category recommendation model to obtain multiple category prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in a specified category system; the category prediction task is used for predicting categories into which the target commodity is divided in one hierarchy.
And a recommended category output module 403, configured to output a category prediction result meeting a preset condition as a recommended category.
Optionally, the category recommendation model is obtained by:
the training sample acquisition module is used for acquiring a training sample; the training sample at least comprises text descriptions or pictures of a plurality of commodities, each commodity corresponds to a plurality of labels, and each label represents a category into which the commodity is divided in one level of a specified category system; different ones of the labels correspond to different levels in the specified taxonomy.
The prediction result acquisition module is used for inputting the training samples into a specified model, and simultaneously performing a plurality of category prediction tasks through the specified model to obtain a plurality of prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in the specified category system; the category prediction task is used for predicting categories into which the commodity is divided in one hierarchy.
And the category recommendation model acquisition module is used for comparing the prediction result belonging to the same level with the label, and reversely adjusting parameters for constructing the specified model according to the comparison result to acquire the category recommendation model.
Optionally, the specified category hierarchy includes a root hierarchy, a non-leaf hierarchy and a leaf hierarchy, and the relationship between the respective hierarchies is represented by a tree relationship.
The category recommendation model obtaining module comprises:
and the comparison module is used for sequentially comparing the prediction results belonging to the same level with the labels according to the sequence from the leaf level to the root level and determining whether the prediction of the level is correct or not according to the comparison results.
And the first execution module is used for continuing the comparison step of the next level if the prediction of the current level is wrong.
A second execution module, configured to, if the prediction of the current level is correct or all levels are wrong, end the comparison step between the levels and execute the following steps: calculating loss values between the prediction results corresponding to the prediction error levels and the labels respectively based on a preset loss function; accumulating the loss values corresponding to the levels with wrong prediction to obtain the loss value of the specified model; and adjusting parameters for constructing the specified model according to the loss value of the specified model to obtain the category recommendation model.
Optionally, the specified category hierarchy includes a root hierarchy, a non-leaf hierarchy and a leaf hierarchy, and the relationship between the respective hierarchies is represented by a tree relationship.
The plurality of category prediction results correspond to each level in the specified category system one to one.
The recommendation category output module comprises: and outputting the category prediction result corresponding to the leaf level as a recommended category.
Optionally, the method further comprises: and the category output module is used for acquiring and outputting the categories of the root level corresponding to the recommended categories according to the recommended categories and the tree-like relation among the levels of the specified category system.
Optionally, the recommendation category output module includes: converting the category prediction result meeting the preset condition into the category of a third-party platform according to a pre-stored category system mapping relation; the category system mapping relation represents a corresponding relation between the categories in the specified category system and the categories in the category system of the third-party platform; and outputting the category of the third-party platform as a recommended category of the target commodity.
Optionally, the category recommendation model at least includes a text feature extraction network and/or a picture feature extraction network;
the character extraction network is used for extracting the character description of the target commodity to obtain character features; the textual features are used to predict categories into which the target good is divided in various tiers.
The picture feature extraction network is used for extracting features of the picture of the target commodity to obtain picture features; the picture features are used for predicting categories into which the target commodity is divided in various levels.
Optionally, the text feature extraction network includes a preprocessing layer, an embedding layer, and a first splicing layer.
The preprocessing layer is used for preprocessing the character description of the target commodity and obtaining a plurality of words.
The embedding layer is used for respectively converting a plurality of words into embedding vectors.
The first splicing layer is used for splicing the embedded vectors to obtain the character features. The textual features are used to predict categories into which the target good is divided in various tiers.
Optionally, the text feature extraction network further includes a text recognition layer.
The character recognition layer is used for recognizing characters in the picture of the target commodity and obtaining a character recognition result.
The preprocessing layer is specifically used for preprocessing the character description of the target commodity and/or the character recognition result to obtain a plurality of words; the words are used to predict the categories into which the target good is divided in the various tiers.
Optionally, the text feature extraction network further includes a picture classifier.
The picture classifier is used for identifying the picture of the target commodity and acquiring a commodity label; the commodity label represents an identification result of the picture of the target commodity;
the preprocessing layer is specifically used for preprocessing the text description of the target commodity and/or the commodity label to obtain a plurality of words; the words are used to predict the categories into which the target good is divided in the various tiers.
Optionally, the preprocessing process includes at least one of the following operations: and filtering the operation of the specified characters, the character splicing operation and the word segmentation operation.
Optionally, the category recommendation model further includes a second splice layer; the second splicing layer is used for splicing the character features and the picture features to obtain splicing features; the stitching features are used to predict categories into which the target good is divided in various tiers.
Optionally, the category recommendation model further includes a plurality of prediction networks respectively corresponding to the category prediction tasks; and the prediction network is used for processing the splicing characteristics to obtain a category prediction result corresponding to the target commodity in a corresponding level.
Optionally, each of the prediction networks is formed by sequentially connecting a plurality of fully-connected layers.
The implementation process of the functions and actions of each module in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the disclosed solution. One of ordinary skill in the art can understand and implement it without inventive effort.
Correspondingly, the present disclosure also provides an electronic device, which includes a processor; a memory for storing processor-executable instructions; wherein the processor is configured to: the instructions, when executed, perform the method of any of the method embodiments of the present disclosure.
The Processor may be a Central Processing Unit (CPU), other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
The memory may include at least one type of storage medium including a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. Also, the apparatus may cooperate with a network storage device that performs a storage function of the memory through a network connection. The storage may be an internal storage unit of the device, such as a hard disk or a memory of the device. The memory may also be an external storage device of the device, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) Card, Flash memory Card (Flash Card), etc. provided on the device. Further, the memory may also include both internal storage units of the device and external storage devices. The memory is used for storing computer programs and other programs and data required by the device. The memory may also be used to temporarily store data that has been output or is to be output.
The various embodiments described herein may be implemented using a computer-readable medium such as computer software, hardware, or any combination thereof. For a hardware implementation, the embodiments described herein may be implemented using at least one of an Application Specific Integrated Circuit (ASIC), a Digital Signal Processor (DSP), a Digital Signal Processing Device (DSPD), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a processor, a controller, a microcontroller, a microprocessor, and an electronic unit designed to perform the functions described herein. For a software implementation, the implementation such as a process or a function may be implemented with a separate software module that allows performing at least one function or operation. The software codes may be implemented by software applications (or programs) written in any suitable programming language, which may be stored in memory and executed by the controller.
Electronic devices include, but are not limited to, the following forms of presence: (1) a mobile terminal: such devices are characterized by mobile communications capabilities and are primarily targeted at providing voice, data communications. Such terminals include: smart phones (e.g., iphones), multimedia phones, functional phones, and low-end phones, etc.; (2) ultra mobile personal computer device: the equipment belongs to the category of personal computers, has calculation and processing functions and generally has the characteristic of mobile internet access. Such terminals include: PDA, MID, and UMPC devices, etc., such as iPad; (3) other electronic devices with computing capabilities. The device may include, but is not limited to, a processor, a memory. Those skilled in the art will appreciate that more or fewer components than those described above may be included, or certain components may be combined, or different components, e.g., the device may also include input-output devices, network access devices, buses, camera devices, etc.
In an exemplary embodiment, a storage medium comprising instructions, such as a memory comprising instructions, executable by a processor of an electronic device to perform the above method is also provided. Alternatively, the storage medium may be a non-transitory computer readable storage medium, which may be, for example, a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium, instructions in the storage medium, when executed by a processor of a terminal, enable the terminal to perform the above-described method.
In an exemplary embodiment, a computer program product is also provided, comprising executable program code, wherein the program code, when executed by the above-described apparatus, implements a method embodiment of any of the above.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This disclosure is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. A category recommendation method, comprising:
acquiring text description and/or pictures of a target commodity to be subjected to category recommendation;
inputting the text description and/or the picture into a pre-established category recommendation model, and simultaneously performing a plurality of category prediction tasks through the category recommendation model to obtain a plurality of category prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in a specified category system; the category prediction task is used for predicting categories into which the target commodity is divided in one hierarchy;
and outputting the category prediction result meeting the preset condition as a recommended category.
2. The method of claim 1, wherein the category recommendation model is trained by:
obtaining a training sample; the training sample at least comprises text descriptions or pictures of a plurality of commodities, each commodity corresponds to a plurality of labels, and each label represents a category into which the commodity is divided in one level of a specified category system; different labels correspond to different levels in the specified category hierarchy;
inputting the training sample into a specified model, and simultaneously performing a plurality of category prediction tasks through the specified model to obtain a plurality of prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in the specified category system; the category prediction task is used for predicting categories into which the commodity is divided in one hierarchy;
and comparing the prediction results belonging to the same level with the labels, and reversely adjusting parameters for constructing the specified model according to the comparison results to obtain the category recommendation model.
3. The method of claim 2, wherein the specified hierarchy of categories comprises a root hierarchy, a non-leaf hierarchy and a leaf hierarchy, and wherein the relationship between the respective hierarchies is represented by a tree relationship;
the comparing the prediction result belonging to the same level with the label, and reversely adjusting the parameters for constructing the designated model according to the comparison result, includes:
sequentially comparing the prediction results belonging to the same level with the labels according to the sequence from the leaf level to the root level, and determining whether the prediction of the level is correct or not according to the comparison result;
if the prediction of the current level is wrong, continuing the comparison step of the next level;
if the prediction of the hierarchy is correct or all the hierarchies are wrong, finishing the comparison step among the hierarchies and executing the following steps: calculating loss values between the prediction results corresponding to the prediction error levels and the labels respectively based on a preset loss function; accumulating the loss values corresponding to the levels with wrong prediction to obtain the loss value of the specified model; and adjusting parameters for constructing the specified model according to the loss value of the specified model to obtain the category recommendation model.
4. The method of claim 1, wherein the specified hierarchy of categories comprises a root level, a non-leaf level and a leaf level, and wherein the relationship between the levels is represented by a tree relationship;
the plurality of category prediction results correspond to each hierarchy in the specified category system one to one;
the step of outputting the category prediction result meeting the preset condition as a recommended category comprises the following steps:
and outputting the category prediction result corresponding to the leaf level as a recommended category.
5. The method according to claim 1, wherein the category recommendation model comprises at least a text feature extraction network and/or a picture feature extraction network;
the character extraction network is used for extracting the character description of the target commodity to obtain character features; the character features are used for predicting categories into which the target commodity is divided in each hierarchy;
the picture feature extraction network is used for extracting features of the picture of the target commodity to obtain picture features; the picture features are used for predicting categories into which the target commodity is divided in various levels.
6. The method of claim 5, wherein the category recommendation model further comprises a second splice layer;
the second splicing layer is used for splicing the character features and the picture features to obtain splicing features; the stitching features are used to predict categories into which the target good is divided in various tiers.
7. The method of claim 6, wherein the category recommendation model further comprises a plurality of prediction networks respectively corresponding to the category prediction tasks;
and the prediction network is used for processing the splicing characteristics to obtain a category prediction result corresponding to the target commodity in a corresponding level.
8. A category recommendation device, comprising:
the target commodity information acquisition module is used for acquiring the text description and/or the picture of the target commodity to be subjected to category recommendation;
the category prediction result acquisition module is used for inputting the text description and/or the picture into a pre-established category recommendation model, and simultaneously performing a plurality of category prediction tasks through the category recommendation model to acquire a plurality of category prediction results; the plurality of category prediction tasks are respectively in one-to-one correspondence with a plurality of hierarchies included in a specified category system; the category prediction task is used for predicting categories into which the target commodity is divided in one hierarchy;
and the recommendation category output module is used for outputting the category prediction result meeting the preset conditions as a recommendation category.
9. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the method of any one of claims 1 to 7.
10. A storage medium, wherein instructions in the storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the method of any of claims 1-7.
CN202010476089.4A 2020-05-29 2020-05-29 Category recommendation method and device, electronic equipment and storage medium Pending CN113744006A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010476089.4A CN113744006A (en) 2020-05-29 2020-05-29 Category recommendation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010476089.4A CN113744006A (en) 2020-05-29 2020-05-29 Category recommendation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN113744006A true CN113744006A (en) 2021-12-03

Family

ID=78724690

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010476089.4A Pending CN113744006A (en) 2020-05-29 2020-05-29 Category recommendation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN113744006A (en)

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810208A (en) * 2012-11-14 2014-05-21 腾讯科技(深圳)有限公司 Class mapping method and device
CN104978328A (en) * 2014-04-03 2015-10-14 北京奇虎科技有限公司 Hierarchical classifier obtaining method, text classification method, hierarchical classifier obtaining device and text classification device
CN105740389A (en) * 2016-01-27 2016-07-06 上海晶赞科技发展有限公司 Classification method and device
CN106469182A (en) * 2015-08-21 2017-03-01 阿里巴巴集团控股有限公司 A kind of information recommendation method based on mapping relations and device
CN107679121A (en) * 2017-09-20 2018-02-09 晶赞广告(上海)有限公司 Mapping method and device, storage medium, the computing device of taxonomic hierarchies
CN108171254A (en) * 2017-11-22 2018-06-15 北京达佳互联信息技术有限公司 Image tag determines method, apparatus and terminal
CN109598517A (en) * 2017-09-29 2019-04-09 阿里巴巴集团控股有限公司 Commodity clearance processing, the processing of object and its class prediction method and apparatus
CN109858558A (en) * 2019-02-13 2019-06-07 北京达佳互联信息技术有限公司 Training method, device, electronic equipment and the storage medium of disaggregated model
CN110287329A (en) * 2019-07-04 2019-09-27 刘凡 A kind of electric business classification attribute excavation method based on commodity text classification
CN111046170A (en) * 2018-10-15 2020-04-21 北京京东尚科信息技术有限公司 Method and apparatus for outputting information
CN111191741A (en) * 2020-01-15 2020-05-22 中国地质调查局发展研究中心 Rock classification constraint inheritance loss method of rock recognition deep learning model

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103810208A (en) * 2012-11-14 2014-05-21 腾讯科技(深圳)有限公司 Class mapping method and device
CN104978328A (en) * 2014-04-03 2015-10-14 北京奇虎科技有限公司 Hierarchical classifier obtaining method, text classification method, hierarchical classifier obtaining device and text classification device
CN106469182A (en) * 2015-08-21 2017-03-01 阿里巴巴集团控股有限公司 A kind of information recommendation method based on mapping relations and device
CN105740389A (en) * 2016-01-27 2016-07-06 上海晶赞科技发展有限公司 Classification method and device
CN107679121A (en) * 2017-09-20 2018-02-09 晶赞广告(上海)有限公司 Mapping method and device, storage medium, the computing device of taxonomic hierarchies
CN109598517A (en) * 2017-09-29 2019-04-09 阿里巴巴集团控股有限公司 Commodity clearance processing, the processing of object and its class prediction method and apparatus
CN108171254A (en) * 2017-11-22 2018-06-15 北京达佳互联信息技术有限公司 Image tag determines method, apparatus and terminal
CN111046170A (en) * 2018-10-15 2020-04-21 北京京东尚科信息技术有限公司 Method and apparatus for outputting information
CN109858558A (en) * 2019-02-13 2019-06-07 北京达佳互联信息技术有限公司 Training method, device, electronic equipment and the storage medium of disaggregated model
CN110287329A (en) * 2019-07-04 2019-09-27 刘凡 A kind of electric business classification attribute excavation method based on commodity text classification
CN111191741A (en) * 2020-01-15 2020-05-22 中国地质调查局发展研究中心 Rock classification constraint inheritance loss method of rock recognition deep learning model

Similar Documents

Publication Publication Date Title
CN110348580B (en) Method and device for constructing GBDT model, and prediction method and device
CN110310114B (en) Object classification method, device, server and storage medium
CN110765774B (en) Training method and device of information extraction model and information extraction method and device
CN108550065B (en) Comment data processing method, device and equipment
CN111931002B (en) Matching method and related equipment
CN111461164B (en) Sample data set capacity expansion method and model training method
CN112529663A (en) Commodity recommendation method and device, terminal equipment and storage medium
CN109934218A (en) A kind of recognition methods and device for logistics single image
CN110033097A (en) The method and device of the incidence relation of user and article is determined based on multiple data fields
CN111582932A (en) Inter-scene information pushing method and device, computer equipment and storage medium
CN110766460A (en) User portrait drawing method and device, storage medium and computer equipment
CN110929764A (en) Picture auditing method and device, electronic equipment and storage medium
CN112819073A (en) Classification network training method, image classification device and electronic equipment
CN110990523A (en) Legal document determining method and system
CN108197660A (en) Multi-model Feature fusion/system, computer readable storage medium and equipment
CN113837836A (en) Model recommendation method, device, equipment and storage medium
CN112307199A (en) Information identification method, data processing method, device and equipment, information interaction method
CN112465012A (en) Machine learning modeling method and device, electronic equipment and readable storage medium
CN116821516A (en) Resource recommendation method, device, equipment and storage medium
CN113744006A (en) Category recommendation method and device, electronic equipment and storage medium
CN112541357B (en) Entity identification method and device and intelligent equipment
CN114529191A (en) Method and apparatus for risk identification
CN114741592A (en) Product recommendation method, device and medium based on multi-model fusion
CN114461900A (en) Method and device for identifying job title, calculation processing device, program, and medium
CN114219084A (en) Unsupervised representation learning method and unsupervised representation learning device based on multi-source heterogeneous characteristics

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination