Method, device, server and storage medium for determining tag sequence of object
Through the use of the cascade probability model, category-level correlation is fully considered, the problem of inaccurate item category classification in the existing technology is solved, and the item label sequence is quickly and accurately determined.
Patent Information
- Application Number
- CN202010124575.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-27
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2040-02-27
AI Technical Summary
The existing technology does not fully consider the correlation between category levels when classifying items, resulting in poor classification results. Especially when the hierarchy is deep or contains many categories, the model training is complex and the classification results are inaccurate.
Using the pre-trained cascade probability model, through text feature extraction, label probability output and target random condition tree sub-model, a method for determining the item label sequence is constructed, fully considering the correlation between each category level, and calculating the joint Probability value to determine the target tag sequence.
It improves the matching degree and accuracy of item label sequences, solves the problems of inaccurate classification results and complex model training in the existing technology, and achieves fast and accurate determination of item label sequences.
Smart Images

Figure CN113312430B
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular, to a method, device, server, and storage medium for determining a tag sequence of an object. Background Art
[0002] Currently, items can be divided into three levels of categories. For example, the first-level category label of a book can be book, the second-level category label can be novel, and the third-level category label can be collection of works. The relationship between the three is that book contains novels, and novels contain collections of works, that is, the first-level category inclusion range is larger than the corresponding second-level category inclusion range, and the second-level category inclusion range is larger than the corresponding third-level category inclusion range.
[0003] In order to help users quickly find target items or process items into storage, each item can be divided into categories. However, in actual applications, merchants are unable to accurately determine the category of items, and the category of items is entered arbitrarily, resulting in inaccurate search and inaccurate storage when searching for items based on categories or storing items. To address this problem, machine learning algorithms can be used, or items can be classified through pre-established classifiers corresponding to each category level.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:
[0005] When using machine learning algorithms to determine the categories of items, it is necessary to assume that there is no correlation between categories, that is, the correlation between each category level is not fully considered, resulting in poor final classification results. When classifying items based on classifiers corresponding to each category level, if each level includes more categories and the classification level is deep, a large number of sub-classifiers need to be built, and the correlation between each level is not considered, there are technical problems such as complex model training and inaccurate classification results. Summary of the invention
[0006] The present invention provides a method, device, server and storage medium for determining a label sequence of an object, so as to achieve the technical effect of quickly and accurately determining a label sequence corresponding to an object based on a title text used to describe the object.
[0007] In a first aspect, an embodiment of the present invention provides a method for determining a tag sequence of an object, the method comprising:
[0008] Get the target title text used to describe the target item;
[0009] Determine a joint probability value corresponding to the target title text based on a pre-trained target cascade probability model;
[0010] Determining a target tag sequence corresponding to the target object according to the joint probability value;
[0011] The joint probability value includes the probability value of the target item corresponding to each preset label sequence, and the preset label sequence includes at least two category-level labels.
[0012] In a second aspect, an embodiment of the present invention further provides a method for constructing a cascade probability model, wherein the cascade probability model includes a text feature extraction sub-model, a label probability output sub-model, and a target random conditional tree sub-model, and the method includes:
[0013] The output of the text feature extraction sub-model is used as the input of the label probability output sub-model, and the output of the label probability output sub-model is used as the input of the target random conditional tree sub-model to construct the cascade probability model;
[0014] Wherein, the text feature extraction sub-model is used to output a target feature vector corresponding to the target title text based on the input target title text of the target item;
[0015] The label probability output submodel is used to output a label probability value corresponding to each label in the label probability output submodel based on the target feature vector;
[0016] The target random conditional tree sub-model is used to output a joint probability value based on the label probability value; the joint probability value includes the probability value of each preset label sequence corresponding to the target item, and the preset label sequence includes at least two category-level labels.
[0017] In a third aspect, an embodiment of the present invention further provides a device for determining a tag sequence of an item, the device comprising:
[0018] A target title text determination module, used to obtain a target title text for describing a target item;
[0019] A joint probability value determination module, used to determine a joint probability value corresponding to the target title text based on a pre-trained target cascade probability model;
[0020] A target tag sequence determination module, used to determine a target tag sequence corresponding to the target object according to the joint probability value;
[0021] The joint probability value includes the probability value of the target item corresponding to each preset label sequence, and the preset label sequence includes at least two category-level labels.
[0022] In a fourth aspect, an embodiment of the present invention further provides a device for constructing a cascade probability model, characterized in that the cascade probability model includes a text feature extraction sub-model, a label probability output sub-model and a target random conditional tree sub-model, and the device includes:
[0023] Wherein, the text feature extraction sub-model is used to output a target feature vector corresponding to the target title text based on the input target title text of the target item;
[0024] The label probability output submodel is used to output a label probability value corresponding to each label in the label probability output submodel based on the target feature vector;
[0025] The target random conditional tree sub-model is used to output a joint probability value based on the label probability value; the joint probability value includes the probability value of each preset label sequence corresponding to the target item, and the preset label sequence includes at least two category-level labels.
[0026] In a fifth aspect, an embodiment of the present invention further provides a server, the server comprising:
[0027] one or more processors;
[0028] a storage device for storing one or more programs,
[0029] When the one or more programs are executed by the one or more processors, the one or more processors implement the method for determining the label sequence of an object or the method for constructing a cascade probability model as described in any one of the embodiments of the present invention.
[0030] In a sixth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a method for determining a label sequence of an object or a method for constructing a cascade probability model as described in any one of the embodiments of the present invention.
[0031] The technical solution of the embodiment of the present invention can obtain a target label sequence corresponding to the target item by inputting the target title text value used to describe the target item into a pre-trained target cascade probability model. Since the target cascade probability model fully considers the correlation between the category levels to which each label belongs, the obtained target label sequence has the highest matching degree with the target item, which improves the technical effect of improving the accuracy of determining the target label sequence. It solves the problem that in the prior art, whether a single model or a classifier corresponding to each level is used, when determining the label sequence corresponding to the item, the correlation between the category levels is not taken into account, resulting in the inability to accurately determine the label sequence of the target item. The present technical solution achieves the technical effect of quickly, accurately and conveniently determining the label sequence corresponding to each item. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] In order to more clearly illustrate the technical solutions of the exemplary embodiments of the present invention, the following briefly introduces the drawings required to describe the embodiments. Obviously, the drawings introduced are only drawings of a part of the embodiments to be described in the present invention, rather than all the drawings. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0033] Figure 1 A schematic diagram of a flow chart of a method for determining a tag sequence of an item provided in Embodiment 1 of the present invention;
[0034] Figure 2 Another schematic diagram of a flow chart of a method for determining a tag sequence of an item provided in the second embodiment of the present invention;
[0035] Figure 3 A schematic diagram of determining a label probability value provided by Embodiment 2 of the present invention;
[0036] Figure 4 A schematic diagram of a flow chart of a training target cascade probability model provided in Embodiment 3 of the present invention;
[0037] Figure 5 A schematic diagram of a random conditional tree structure provided in Embodiment 3 of the present invention;
[0038] Figure 6 A schematic diagram of a preferred embodiment of the fourth embodiment of the present invention;
[0039] Figure 7 A schematic diagram of the structure of a device for determining a tag sequence of an item provided in Embodiment 5 of the present invention;
[0040] Figure 8 A schematic diagram of a cascade probability model construction device provided in Embodiment 6 of the present invention,
[0041] Fig. 9 A schematic diagram of a server structure provided in Embodiment 7 of the present invention. DETAILED DESCRIPTION
[0042] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0043] Embodiment 1
[0044] Figure 1 This is a flow chart of a method for determining a label sequence of an item provided in the first embodiment of the present invention. When putting each item on a shelf or into storage, it is necessary to determine the label sequence corresponding to the item, so as to determine the specific shelf category of the item and the specific location of the item according to the label sequence. Therefore, it is necessary to determine the label sequence corresponding to each item. In other words, this embodiment is applicable to the situation where the label sequence of the item is determined based on the text used to describe the item. The method can be executed by an item label sequence determination device, which can be implemented in the form of software and / or hardware, and optionally, can be implemented based on a server.
[0045] like Figure 1 The method of this embodiment includes:
[0046] S110: Obtain a target title text for describing the target object.
[0047] Among them, the object for which the tag sequence needs to be determined is taken as the target object. The target title text can be text information used to describe the target object. For example, if the target object is sunglasses, the text description corresponding to the sunglasses, that is, the target title text can be: Redmond ultra-light sunglasses, men's and women's polarized sunglasses, celebrity style, trendy colorful frog glasses, retro reflective sunglasses, color film sunglasses, polarized glasses.
[0048] That is, when it is necessary to determine a tag sequence corresponding to an item, the target title text for the target item may be obtained first.
[0049] S120: Determine a joint probability value corresponding to the target title text based on a pre-trained target cascade probability model.
[0050] Among them, the joint probability value is the probability value of each preset label sequence corresponding to the target item. The number of preset label sequences is the same as the number of leaf nodes corresponding to the end of the pre-established random conditional tree structure. Optionally, if the number of leaf nodes corresponding to the end of the tree in the random conditional tree structure is 20, then the number of preset label sequences is 20 groups, and accordingly, the number of joint probability values is the same as the number of preset label sequences. The label sequence is composed of labels at multiple category levels, and the labels are in a relationship of inclusion and inclusion. In other words, all labels on the same branch in the random conditional tree structure are taken as a preset label sequence. The number of labels in the sequence is related to the depth of the tree. Each depth represents a category level, and the category level corresponding to the root node is higher than the category level corresponding to the leaf node. The target cascade probability model is a model that processes the target title text and determines the probability values of each preset label sequence corresponding to the target title text. The target cascade probability model is constructed based on the random conditional tree and trained based on sample data. The sample data may include sample title text and sample label sequence corresponding to the sample title text. The target cascade probability model can be trained based on the sample title text and the sample label sequence.
[0051] Specifically, in this embodiment, the target title text may be input into a pre-trained target cascade probability model to obtain a joint probability value of each preset label sequence corresponding to the target title text.
[0052] Exemplarily, by inputting "Redmond ultra-light sunglasses, men's and women's polarized sunglasses, celebrity style, trendy colorful frog-eye glasses, retro reflective sunglasses, color film sunglasses, polarized lenses" into the target cascade probability model, the joint probability value of each preset label sequence corresponding to the text can be obtained. Optionally, if there are 10 groups of preset label sequences, 10 groups of joint probability values can be obtained.
[0053] S130: Determine a target tag sequence corresponding to the target object according to the joint probability value.
[0054] In this embodiment, each preset tag sequence includes at least two category-level tags, and the relationship between tags in different category levels is a relationship of inclusion and inclusion. For example, one preset tag sequence includes three category-level tags, where the tags in the first-level category level are clothes, the tags in the second-level category level are tops, and the tags in the third-level category level are vests. That is, the tags in the first-level category level include the tags in the second-level category level, and the tags in the second-level category level include the tags in the third-level category level. For example, clothes include tops, and tops include vests. The preset tag sequence can be "clothes-tops-vests".
[0055] The target label sequence is the label sequence with the highest correlation with the target title text selected from all preset label sequences.
[0056] Specifically, according to the various joint probability values determined by the target cascade probability model, the probability values of each preset label sequence corresponding to the target title text can be accurately judged. Based on the probability values corresponding to all preset label sequences, the target label sequence corresponding to the target title text can be determined from all preset label sequences.
[0057] In this embodiment, the target label sequence corresponding to the target item is determined according to the joint probability value. This can be: according to the joint probability value, a preset label sequence corresponding to the highest joint probability value is determined, and the preset label sequence corresponding to the highest joint probability value is used as the target label sequence corresponding to the target item.
[0058] The number of joint probability values is the same as the number of preset label sequences. For example, if there are ten preset label sequences, the output joint probability values are also ten. The label sequence corresponding to the highest joint probability value is taken as the label sequence with the highest correlation with the target title text.
[0059] Specifically, from all joint probability values, the preset label sequence corresponding to the highest probability value is obtained and used as the target label sequence.
[0060] Exemplarily, based on 10 groups of joint probability values, a label sequence corresponding to the highest joint probability value can be determined and used as the target label sequence.
[0061] In this embodiment, the benefit of determining the target tag sequence is that when putting items on the shelves, the items can be accurately added to the category, so that users can quickly find the items, which increases user browsing volume and thus improves sales.
[0062] The technical solution of the embodiment of the present invention can obtain a target label sequence corresponding to the target item by inputting the target title text value used to describe the target item into a pre-trained target cascade probability model. Since the target cascade probability model fully considers the correlation between the category levels to which each label belongs, the obtained target label sequence has the highest matching degree with the target item, which improves the technical effect of improving the accuracy of determining the target label sequence. It solves the problem that in the prior art, whether a single model or a classifier corresponding to each level is used, when determining the label sequence corresponding to the item, the correlation between the category levels is not taken into account, resulting in the inability to accurately determine the label sequence of the target item. The present technical solution achieves the technical effect of quickly, accurately and conveniently determining the label sequence corresponding to each item.
[0063] Embodiment 2
[0064] Figure 2This is another flow chart of a method for determining a label sequence of an item provided by the second embodiment of the present invention. In this embodiment, based on the above embodiment, the target cascade probability model may include: a label probability output submodel connected to a text feature extraction submodel, and a target random conditional tree submodel connected to the label probability output submodel. Based on the above submodels, the target title text can be specifically processed. The explanations of terms that are the same or corresponding to the above embodiment are not repeated here.
[0065] like Figure 2 As shown, the method for determining the tag sequence of an item provided in this embodiment includes:
[0066] S210: Obtain a target title text for describing the target object.
[0067] S220: Determine a target feature vector corresponding to the target title text based on the text feature extraction sub-model.
[0068] Among them, the text feature extraction submodel may refer to a network submodel used to extract the title words in each title text, extract the features corresponding to the title words, and obtain the corresponding target feature vector. Before processing the title words, the target title text may be segmented to obtain each title word in the target title text. For example, the text feature extraction submodel may include: a language processing submodel and a neural network submodel. Among them, the preset language processing submodel may process the title words to obtain the title word vector corresponding to each title word. The neural network output submodel may be a neural network model that extracts the feature vector corresponding to the title word based on a deep learning method. For example, the language processing submodel may be but is not limited to a BERT (Bidirectional Encoder Representation from Transformers) bidirectional encoder model; the neural network submodel may be but is not limited to a Bi-LSTM (Bi-directional Long-Short Term Memory) bidirectional long short-term memory network.
[0069] Specifically, this embodiment can perform word segmentation processing on the target title text based on the word segmentation dictionary, determine each title word in the target title text to obtain a title word sequence corresponding to the target item, input the title word sequence into the text feature extraction sub-model, and determine the title word vector corresponding to each title word based on the bidirectional encoder model in the text feature extraction sub-model. The title word vector can be processed based on the neural network sub-model to obtain a target feature vector corresponding to the target title text.
[0070] Optionally, perform word segmentation on the target title text to obtain each title word in the target title text; input each title word into the language processing sub-model to obtain a title word vector corresponding to each title word; input each title word vector into the neural network sub-model to obtain a target feature vector corresponding to the target title text.
[0071] Specifically, when performing word segmentation processing on the target title text, each word in the target title text can be used as a title word, or valid words in the target title text can be filtered out and used as title words. The title words can be first input into the language processing sub-model, and the title word vector corresponding to each title word is obtained according to the output of the language processing sub-model, and each title word vector (i.e., the title word vector) is input into the neural network sub-model to obtain the target feature vector corresponding to each title word, i.e., the target feature vector corresponding to the target title text.
[0072] Based on the above technical solution, it should be noted that the text feature extraction sub-model mainly processes the title text to determine the feature vector corresponding to the title text. If the feature vector corresponding to the title text can be determined in advance, the text feature extraction sub-model may not be included in the target cascade probability model.
[0073] S230. Determine a label probability value corresponding to each label in the label probability output submodel based on the target feature vector and the label probability output submodel.
[0074] It should be noted that the target cascade probability model also includes a label probability output sub-model. The label probability output sub-model can be a model for determining each label in the model, that is, the probability value corresponding to each label in the preset label sequence. In other words, the label probability value of each label in each preset label sequence can be determined based on the label probability output sub-model.
[0075] Among them, the label probability output submodel includes a preset number of output network layers, and the preset number of layers can be the same as the number of pre-established category levels. That is to say, after the random condition tree is constructed, the number of output network layers can be determined according to the depth of the random condition tree, that is, the number of category levels. Based on the output network layer, the feature vector corresponding to each label in the corresponding category level is processed to obtain the label probability value of each label in the category level.
[0076] Before processing the target feature vector based on each output network layer in the label probability output sub-model, the structure of each output network layer in the label probability output sub-model is briefly introduced.
[0077] The label probability output sub-model includes multiple output network layers, each of which includes a fully connected layer and a normalized exponential function layer. The fully connected layer is used to map the target feature vector to a feature vector corresponding to the current output network layer, and the normalized exponential function layer is used to process the feature vector and determine the label probability value of each label in the category level corresponding to the output network layer.
[0078] Specifically, for each output network layer in the preset number of output network layers, the output network layer corresponding to each category level can be determined according to the pre-established mapping relationship table. Assuming that there are K category levels, the label probability output sub-model includes K groups of output network layers, which may be the first category level corresponding to the first output network layer, the second category level corresponding to the second output network layer, and the Kth category level corresponding to the Kth group of output network layers. Taking the processing of the target feature vector by the Kth group of output network layers as an example, it can be: after the target feature vector is input into the label probability output sub-model, according to the pre-established mapping relationship, the category level corresponding to the Kth group of output network layers is determined, and optionally, for the Kth category level, the number of labels M in the Kth category level is determined, and the target feature vector is mapped to a vector corresponding to the number of labels M based on the fully connected layer in the Kth group of output network layers as a feature vector; the feature vector is input into the normalized exponential function layer in the Kth group of output network layers, and the label probability value of each label in the Kth category level can be output. Based on the above method, the label probability value of each label in each category level can be determined, that is, the label probability value of each label in each preset label sequence can be determined.
[0079] For example, assuming that the target input text (name of the product) is X i , the text feature extraction sub-model is f(·). Based on the text feature extraction sub-model f(·), the processed target feature vector can be expressed as H i =f(X i ), where H i ∈R 1 ×d , d represents the number of elements in the target feature vector. i Input into the label probability output sub-model, that is, the K group output network, taking the k-th group output network layer as an example, where the k-th group output network layer can be expressed as g k (·). Target feature vector H i, The target feature vector H can be transformed through the fully connected layer i ∈R 1×d Mapping to vector Where L kIt represents the number of labels in the category level corresponding to the k-th group of output network layers, that is, the number of elements in the vector after mapping is the same as the number of labels in the category level. Corresponding to a label in the kth level Then, the mapped vector is processed based on the normalized exponential function layer to obtain the label probability value of each label in the k-th category level, that is, the softmax operation is performed on the mapped vector to obtain in For each label in the k-th category level The label probability value of .
[0080] In this embodiment, the label table probability value of each label in the preset label sequence is determined, which can be seen in Figure 3 As shown, input data X i , after the feature extraction network layer (after the text feature extraction sub-model), we can get the same i The corresponding target feature vector; input the target feature vector into the K group output network layer, and the feature vector O corresponding to each category level can be obtained first i , after processing the feature vector, we can get the label probability value E of each label in each category level i .
[0081] S240: Based on the label probability value and the target random conditional tree sub-model, determine the joint probability value of a preset label sequence consisting of all labels located on the same branch in the pre-established random conditional tree structure.
[0082] It should be noted that the target random conditional tree sub-model is constructed based on the pre-established random conditional tree structure. In other words, the structure of the target random conditional tree sub-model is the same as that of the random conditional tree.
[0083] Among them, the target random conditional tree sub-model is constructed and trained based on the pre-established random conditional tree structure. The main function of training the target random conditional tree sub-model is to establish the association between the labels in the label sequence, that is, to determine the weight value between the nodes in the random conditional tree structure, that is, the transition probability value at the label associated node. In other words, the target random conditional tree sub-model includes the transition probability value between the nodes in the random conditional tree structure.
[0084] Specifically, all label probability values are input into the target random conditional tree submodel, and the joint probability value of the label sequences at different category levels and on the same branch can be determined according to the transition probability values between the nodes (labels) in the target random conditional tree submodel. For example, the product operation is performed on the label probability values in a preset label sequence and the transition probability values between the labels to obtain the joint probability value corresponding to the preset label sequence.
[0085] Exemplarily, after the sample data is input into the target cascade probability model, for the input data sample X i The corresponding preset label sequences at each level are {l(1) i ,l(2) i ,…,l(K) i}, that is, the joint probability value of each preset label sequence on the same path in the random conditional tree structure can be:
[0086]
[0087] Among them, Z(X i ) is the normalization factor, is the label probability value of the i-th label in the k-th category level, P(l(k+1) i / l(k) i ) is the transition probability value between one of the labels associated with the i-th label in the K+1-th category level.
[0088] S250 , determining a preset tag sequence corresponding to a maximum joint probability value according to the joint probability value, and using the preset tag sequence corresponding to the maximum joint probability value as a target tag sequence corresponding to the target item.
[0089] Specifically, after obtaining the joint probability value corresponding to each preset label sequence, the preset label sequence corresponding to the highest joint probability value may be obtained and used as the target label sequence.
[0090] Exemplarily, after obtaining the joint probability value P(l(1) corresponding to each preset tag sequence i ,l(2) i ,…,l(K) i |X i ), the preset label sequence corresponding to the maximum probability value is selected, that is, The label sequence corresponding to the maximum probability value is taken as the target label sequence.
[0091] The technical solution of the embodiment of the present invention can obtain the label probability values of each preset label corresponding to the target item after processing the data through the label probability output sub-model in the target cascade probability model. When processing each label probability value based on the random condition tree, since the random condition tree sub-model includes the transition probability values between each label, that is, the association relationship between each level, it is possible to accurately determine the joint probability value of each preset label sequence associated with the target item, thereby screening out the label sequence with the highest association with the target item from all joint probability values, which solves the problem of using a single model or corresponding to each category level in the prior art. When the classifier classifies items, it does not take into account the correlation between labels when processing data, resulting in certain differences between the determined label sequence and the items, that is, there is a problem of low accuracy; further, when the classifier classifies items, if each level includes more labels and the classification level is deep, it is necessary to build a huge sub-classifier, which has the problems of complex model training and certain errors between the classification results and the actual results. This achieves the technical effect that when processing data based on the target cascade probability model, the model fully takes into account the correlation between the labels, so the processed results have a high degree of match with the target item.
[0092] Embodiment 3
[0093] Before processing the target title text based on the target cascade probability model, it is necessary to train the target cascade probability model. The flowchart of training the target cascade probability model is as follows: Figure 4 As shown, the method includes:
[0094] In order to improve the accuracy of the target cascade probability model, the constructed initial cascade probability model can be trained based on as many training sample data as possible. The initial cascade probability model is a model constructed based on a random conditional tree structure. The random conditional tree structure can be constructed based on multiple training sample data, or a pre-constructed random conditional tree structure can be directly applied.
[0095] In this embodiment, the random condition tree structure may be constructed as follows:
[0096] A plurality of training sample data are obtained, and a label sequence corresponding to each training sample data is obtained, and the category level to which each label in the label sequence belongs is determined; a tree structure established based on the category level and each label in the label sequence is used as a random conditional tree structure.
[0097] The training sample data includes training title texts for describing sample items and training label sequences corresponding to the training title texts. Items with determined label sequences can be used as training samples. A random conditional tree is established based on the label sequence corresponding to each training sample data. For example, the label corresponding to the first-level category in the training sample data can be used as the root node, the label corresponding to the second-level category can be the child node of the first-level category label, and the label corresponding to the third-level category can be the child node of the second-level category label. Based on the above method, a tree structure corresponding to all training sample data is established. The label sequence on any path from the root node to the leaf node in the random conditional tree structure is a preset label sequence.
[0098] To clearly introduce the random conditional tree structure, please refer to Figure 5 To understand. When constructing a random conditional tree structure based on training sample data, you can first obtain the number of labels in the training label sequence, and establish the depth of the tree according to the number of labels. Optionally, assuming that the number of labels in the training label sequence is 3, the depth of the random conditional tree can be 4. The root node in the random conditional tree is used as the starting symbol. The nodes in the second layer of the random conditional tree represent the labels in the first category level, the nodes in the third layer identify the labels in the second category level, and the nodes in the fourth layer represent the labels in the third category level. The connection between labels of different levels represents the inclusion relationship. For the labels in the first category level The set of labels in the second category level is Label Contains three second-category-level labels. Based on the above relationship, the labels in the training label sequence are constructed together in a tree diagram. It should be noted that Figure 5 This is just a simple diagram of the random conditional tree structure. The number of category levels and the number of labels are not limited to Figure 5 As indicated in.
[0099] S410: Acquire multiple training sample data, and input the training sample data into a pre-built initial cascade probability model to obtain an initial joint probability value corresponding to each training sample data.
[0100] The initial cascade probability model is constructed based on the random conditional tree structure. The training of the initial cascade probability model mainly involves training the label probability output sub-model and the target random conditional tree sub-model.
[0101] According to the random conditional tree structure, each output network layer in the label probability output sub-model and the target random conditional tree sub-model can be constructed, and the label probability output sub-model and the target random conditional tree sub-model constructed at this time are used as part of the initial cascade probability model.
[0102] In order to train the target random conditional tree sub-model, when establishing the random conditional tree structure, the weight value of the node without connection relationship can be set to 0. The weight value between the labels with connection relationship is marked as in, represents a label at the kth level, Representation and Labeling When training a model, the weight value of the node can be used as the training parameter of the model, that is, the weight value between the labels with connection relationship can be used as the training parameter of the initial cascade probability model.
[0103] Specifically, a label probability output submodel and a random conditional tree submodel can be constructed based on a pre-established random conditional tree structure. After obtaining the training sample data, the sample title text corresponding to the sample data and the label sequence corresponding to the sample data can be used as inputs of the initial cascade probability model, and the initial cascade probability model can output an initial joint probability value corresponding to each training sample data.
[0104] S420: Based on the back propagation algorithm and the initial joint probability value, the preset loss function in the initial cascade probability model is modified.
[0105] It should be noted that the training parameters can be set to default values before training the initial cascade probability model. When training the initial cascade probability model, the training parameters in the model can be corrected based on the output results of the initial cascade probability model, that is, the target cascade probability model can be obtained by correcting the loss function in the initial cascade probability model.
[0106] Among them, the loss function is pre-set and is used to measure whether the determined initial joint probability value is accurate.
[0107] The loss function can be set as follows:
[0108]
[0109] Among them, P(l(1) i ,l(2) i ,…,l(K) i |X i ) represents the initial joint probability value of each preset label sequence relative to the training label sequence.
[0110] Specifically, after the initial joint probability value is obtained, the loss parameter in the initial cascade probability model can be determined based on the back propagation algorithm and the initial joint probability value, and the loss function can be corrected based on the loss parameter.
[0111] S430, taking the convergence of the preset loss function as the training goal, training the initial cascade probability model to obtain the target cascade probability model.
[0112] Specifically, the training error of the loss function, that is, the loss parameter, can be used as a condition for detecting whether the loss function has reached convergence, such as whether the training error is less than the preset error or whether the error change trend tends to be stable, or whether the current number of iterations is equal to the preset number. If the detection reaches the convergence condition, such as the training error of the loss function is less than the preset error or the error change tends to be stable, it indicates that the training of the initial cascade probability model is completed, and the iterative training can be stopped at this time. If it is detected that the convergence condition is not met at present, sample data can be further obtained to train the initial cascade probability model until the training error of the loss function is within the preset range. When the training error of the loss function reaches convergence, the initial cascade probability model can be used as the target cascade probability model, that is, the transfer probability between each node in the initial cascade probability model can be determined at this time.
[0113] The technical solution of the embodiment of the present invention establishes a random conditional tree structure based on the multi-level classification relationship of each label in the training sample data. The random conditional tree structure includes the connection information between each node. By training the target random conditional tree sub-model and the label probability output sub-model constructed based on the random conditional tree, the transition probability between each node can be determined, that is, the association relationship between each level is fully considered. Therefore, the target cascade probability model obtained by training fully considers the association relationship between each level, so that the target label sequence corresponding to the target object can be accurately determined.
[0114] Embodiment 4
[0115] Based on the above technical solution, before training the cascade probability model, it is necessary to first construct the cascade probability model, so as to obtain the target cascade probability model based on training the constructed cascade probability model. The cascade probability model includes a text feature extraction sub-model, a label probability output sub-model and a target random conditional tree sub-model.
[0116] The specific method for constructing the target cascade probability model can be: first construct a random conditional tree structure. For example, if the data sample is the name of a product, the product has three levels of labels, namely, the first-level category label, the second-level category label, and the first-level and third-level category label. That is to say, for a product, the category level K = 3. Assume that the set of all labels in the k∈{1,2,…,K} level is L k , for a label in the kth class The next level of label set contained in this label is expressed as For a K-level classification problem, the corresponding random conditional tree is a tree with a depth of K+1. The root node has a start symbol. The second layer of nodes represents the classification labels in the first category level, and the k+1th layer represents the labels on the kth level. The connection relationship between different hierarchical labels represents the inclusion relationship. The connection between two nodes has a weight, which represents the transition probability between the two labels. For example, the label on the kth level To the label at the k+1th level The transition probability is Then the weight value of the connection between the corresponding nodes is also If there is no inclusion relationship between nodes, the transition probability is 0. Any path from the root node to the leaf node in the random conditional tree structure represents a possible sequence classified by level. Taking the classification of goods as an example, this path may be "books-novels-collections". The random conditional tree structure is constructed in the above manner, and the weight values of each node that does not have a connection relationship in the random conditional tree are marked, so that after the model is built, the weight values of each node can be used as training parameters to train the cascade probability model.
[0117] After the random conditional tree structure is established, a label probability output sub-model and a target random conditional tree sub-model can be established based on the random conditional tree structure.
[0118] Optionally, constructing a label probability output submodel based on a random conditional tree structure may be by determining the number of output network layers in the label probability output submodel based on the number of category levels in the random conditional tree structure, determining the output network layer structure corresponding to the category level with respect to the number of labels contained in each category level, and constructing the label probability output submodel based on the number of output network layers and the output network layer structure.
[0119] Specifically, after determining the depth of the random conditional tree, the number of layers of the output network layer in the label probability output submodel can be determined according to the depth of the tree. According to the category level corresponding to each output network layer and the number of labels corresponding to the category level, the structure of the fully connected layer in the output network layer can be determined. While constructing the label probability submodel, the target random conditional tree submodel can also be constructed.
[0120] The functions of each constructed model are as follows: the text feature extraction sub-model is used to output a target feature vector corresponding to the target title text based on the input target title text of the target item; the label probability output sub-model is used to output a label probability value corresponding to each label in the label probability output sub-model based on the target feature vector; the target random conditional tree sub-model is used to output a joint probability value based on the label probability value; the joint probability value includes the probability value of each preset label sequence corresponding to the target item, and the preset label sequence includes at least two category-level labels.
[0121] Correspondingly, in the process of specific application, the output of the text feature extraction sub-model can be used as the input of the label probability output sub-model, and the output of the label probability output sub-model can be used as the input of the target random conditional tree sub-model to construct the cascade probability model.
[0122] The technical solution of the embodiment of the present invention can obtain the label probability values of each preset label corresponding to the target item after processing the data through the constructed text feature extraction sub-model and label probability output sub-model. When processing each label probability value based on the random condition tree, since the random condition tree sub-model includes the transition probability values between each label, that is, the association relationship between each level, it is possible to accurately determine the joint probability value of each preset label sequence associated with the target item, thereby screening out the label sequence with the highest association with the target item from all joint probability values, which solves the problem of using a single model or corresponding to each category level in the prior art. When the corresponding classifier processes data to classify items, it does not take into account the correlation between labels, resulting in certain differences between the determined label sequence and the items, that is, there is a problem of low accuracy; further, when the classifier classifies items, if each level includes more labels and the classification level is deep, it is necessary to build a huge sub-classifier, which leads to complex model training and certain errors between the classification results and the actual results. This achieves the technical effect of achieving a high degree of match between the processed results and the target items when processing data based on the target cascade probability model, because the model fully takes into account the correlation between the labels.
[0123] Embodiment 4
[0124] As a preferred embodiment of the above embodiment, the technical solution can be divided into a target cascade probability model construction process, a training process and an application process. Figure 6 As shown, the method includes:
[0125] S610: Construct a random conditional tree structure.
[0126] After the random conditional tree is constructed, an initial cascade probability model can be constructed based on the random conditional tree structure, that is, a target random conditional tree sub-model and a label probability output sub-model in the initial cascade probability model are constructed.
[0127] S620: Input the name and label sequence of the training sample into the constructed initial cascade probability model.
[0128] Among them, the initial cascade probability model includes a text feature extraction sub-model, a label probability output sub-model and a target random conditional tree sub-model.
[0129] The name of the training sample data and the corresponding label sequence are input into the initial cascade probability model to obtain the initial joint probability value corresponding to the training sample data.
[0130] S630: Based on the initial joint probability value, a back propagation algorithm is used to correct the loss function in the initial cascade probability model to obtain a target cascade probability model.
[0131] The back propagation algorithm is combined with the initial joint probability value to correct the loss function in the initial cascade probability model. When the loss function converges, the initial cascade probability model at this time is used as the target cascade probability model.
[0132] S640: Input the name of the target object into the target cascade probability model.
[0133] The text used to describe the target item, i.e., the name of the target item, is input into the target cascade probability model.
[0134] S650: Based on the target cascade probability model, the name of the target object is processed to obtain a joint probability value corresponding to each preset tag sequence.
[0135] The preset label sequence is a combination of all labels located on the same branch in the random conditional tree structure.
[0136] Specifically, based on the label probability output submodel in the target cascade probability model, the label probability value of each label in the preset label sequence can be determined. After each label probability value is input into the target random conditional tree submodel, the joint probability value corresponding to the preset label sequence can be obtained.
[0137] S660, obtaining the category label sequence corresponding to the maximum joint probability value as the target label sequence corresponding to the target item, and outputting the target label sequence.
[0138] Specifically, the label sequence corresponding to the maximum joint probability value is selected from all joint probability values and used as the target label sequence, and the determined target label sequence is output.
[0139] The technical solution of the embodiment of the present invention can obtain the label probability values of each preset label corresponding to the target item after processing the data through the label probability output sub-model in the target cascade probability model. When processing each label probability value based on the random condition tree, since the random condition tree sub-model includes the transition probability values between each label, that is, the association relationship between each level, it is possible to accurately determine the joint probability value of each preset label sequence associated with the target item, thereby screening out the label sequence with the highest association with the target item from all joint probability values, which solves the problem of using a single model or corresponding to each category level in the prior art. When the classifier classifies items, it does not take into account the correlation between labels when processing data, resulting in certain differences between the determined label sequence and the items, that is, there is a problem of low accuracy; further, when the classifier classifies items, if each level includes more labels and the classification level is deep, it is necessary to build a huge sub-classifier, which has the problems of complex model training and certain errors between the classification results and the actual results. This achieves the technical effect that when processing data based on the target cascade probability model, the model fully takes into account the correlation between the labels, so the processed results have a high degree of match with the target item.
[0140] Embodiment 5
[0141] Figure 7 This is a schematic diagram of the structure of a device for determining a label sequence of an item provided in Embodiment 4 of the present invention. The device includes: a target title text determination module 710, a joint probability value determination module 720 and a target label sequence determination module 730.
[0142] Among them, the target title text determination module 710 is used to obtain the target title text used to describe the target item; the joint probability value determination module 720 is used to determine the joint probability value corresponding to the target title text based on a pre-trained target cascade probability model; the target label sequence determination module 730 is used to determine the target label sequence corresponding to the target item according to the joint probability value; wherein the joint probability value includes the probability value of the target item corresponding to each preset label sequence, and the preset label sequence includes at least two category-level labels.
[0143] The technical solution of the embodiment of the present invention can obtain a target label sequence corresponding to the target item by inputting the target title text value used to describe the target item into a pre-trained target cascade probability model. Since the target cascade probability model fully considers the correlation between the category levels to which each label belongs, the obtained target label sequence has the highest matching degree with the target item, which improves the technical effect of improving the accuracy of determining the target label sequence. It solves the problem that in the prior art, whether a single model or a classifier corresponding to each level is used, when determining the label sequence corresponding to the item, the correlation between the category levels is not taken into account, resulting in the inability to accurately determine the label sequence of the target item. The present technical solution achieves the technical effect of quickly, accurately and conveniently determining the label sequence corresponding to each item.
[0144] On the basis of the above technical solution, the target cascade probability model includes a label probability output sub-model connected to the text feature extraction sub-model, and a target random conditional tree sub-model connected to the label probability output sub-model; the joint probability value determination module also includes:
[0145] A feature vector determination unit, used to determine a target feature vector corresponding to the target title text based on the text feature extraction sub-model;
[0146] a label probability value determining unit, configured to determine a label probability value corresponding to each label in the label probability output submodel based on the target feature vector and the label probability output submodel;
[0147] The joint probability value determining unit is used to determine the joint probability value of a preset label sequence consisting of all labels on the same branch in a pre-established random conditional tree structure based on the label probability value and the target random conditional tree sub-model.
[0148] On the basis of the above technical solutions, the text feature extraction sub-model includes a language processing sub-model and a neural network sub-model;
[0149] Correspondingly, the feature vector determination unit further includes:
[0150] A word segmentation subunit is used to perform word segmentation processing on the target title text to obtain each title word in the target title text;
[0151] A title word vector determination subunit, used for inputting each title word into the language processing submodel to obtain a title word vector corresponding to each title word;
[0152] The target feature vector determination subunit is used to input each title word vector into the neural network submodel to obtain a target feature vector corresponding to the target title text.
[0153] Based on the above technical solutions, the language processing sub-model is a BERT bidirectional encoder model, and the neural network sub-model is a long short-term memory network.
[0154] Based on the above technical solutions, the label probability output submodel includes a preset number of output network layers; the preset number is the same as the number of pre-established category levels; each category level includes at least one label; the number of category levels is the same as the depth of the tree in the pre-established random conditional tree structure;
[0155] Correspondingly, the label probability value output module is used to process the target feature vector based on a preset number of output network layers to obtain a label probability value for each label in each category level.
[0156] Based on the above technical solutions, each output network layer includes a fully connected layer and a normalized exponential function layer;
[0157] Correspondingly, the label probability value output module is also used to determine, for each output network layer in a preset number of output network layers, the target category level corresponding to the output network layer based on a pre-established mapping relationship; based on the fully connected layer in the output network layer and the number of labels in the target category level, map the target feature vector to a first feature vector corresponding to the target category level; based on the first feature vector and the normalized exponential function layer, determine the label probability value of each label in the target category level.
[0158] On the basis of the above technical solutions, the target random conditional tree sub-model is obtained based on the training of the pre-established random conditional tree structure, and the target random conditional tree sub-model includes a root node, leaf nodes connected to the root node, and transition probability values between the leaf nodes;
[0159] Correspondingly, the joint probability value determination unit is also used to: input all label probability values into the target random conditional tree sub-model, process the label probability value of each label according to the predetermined mapping relationship between the label and the transition probability value, and determine the joint probability value of the label sequence at different category levels and on the same branch.
[0160] On the basis of the above technical solutions, the target label sequence determination module is also used to determine the preset label sequence corresponding to the highest joint probability value according to the at least one joint probability value, and use the preset label sequence corresponding to the highest joint probability value as the target label sequence corresponding to the target item.
[0161] On the basis of the above technical solutions, the device further comprises: a cascade probability model determination module, used for training the target cascade probability model;
[0162] The cascade probability model determination module is specifically used for:
[0163] Acquire multiple training sample data, and input the training sample data into a pre-built initial cascade probability model to obtain an original joint probability value corresponding to each training sample data; wherein the training sample data includes a training title text for describing a sample item, and a training label sequence corresponding to the training title text;
[0164] Based on the back propagation algorithm and the original joint probability value, modifying the preset loss function in the initial cascade probability model;
[0165] The preset loss function reaching convergence is taken as a training goal, and the initial cascade probability model is trained to obtain the target cascade probability model.
[0166] Based on the above technical solutions, the target label sequence includes a primary category label, a secondary category label and a tertiary category label. The level of the primary category label is higher than that of the secondary category label, and the level of the secondary category label is higher than that of the tertiary category label.
[0167] The device for determining the tag sequence of an object provided in the embodiment of the present invention can execute the method for determining the tag sequence of an object provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0168] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.
[0169] Embodiment 6
[0170] Figure 8 A schematic diagram of the structure of a device for constructing a cascade probability model provided in Embodiment 6 of the present invention, the device comprising: a text feature extraction sub-model 810, a label probability output sub-module 820 and a target random conditional sub-tree module 830.
[0171] Wherein, the text feature extraction sub-model is used to output a target feature vector corresponding to the target title text based on the input target title text of the target item;
[0172] The label probability output submodel is used to output a label probability value corresponding to each label in the label probability output submodel based on the target feature vector;
[0173] The target random conditional tree sub-model is used to output a joint probability value based on the label probability value; the joint probability value includes the probability value of each preset label sequence corresponding to the target item, and the preset label sequence includes at least two category-level labels.
[0174] The technical solution of the embodiment of the present invention can obtain the label probability values of each preset label corresponding to the target item after processing the data through the constructed text feature extraction sub-model and label probability output sub-model. When processing each label probability value based on the random condition tree, since the random condition tree sub-model includes the transition probability values between each label, that is, the association relationship between each level, it is possible to accurately determine the joint probability value of each preset label sequence associated with the target item, thereby screening out the label sequence with the highest association with the target item from all joint probability values, which solves the problem of using a single model or corresponding to each category level in the prior art. When the corresponding classifier processes data to classify items, it does not take into account the correlation between labels, resulting in certain differences between the determined label sequence and the items, that is, there is a problem of low accuracy; further, when the classifier classifies items, if each level includes more labels and the classification level is deep, it is necessary to build a huge sub-classifier, which leads to complex model training and certain errors between the classification results and the actual results. This achieves the technical effect of achieving a high degree of match between the processed results and the target items when processing data based on the target cascade probability model, because the model fully takes into account the correlation between the labels.
[0175] On the basis of the above technical solution: before constructing the cascade probability model, it also includes: constructing a random conditional tree structure;
[0176] Among them, constructing a random conditional tree structure includes:
[0177] For each training sample data in a plurality of training sample data, obtaining a label sequence of the training sample data, and determining a category level to which each label in the label sequence belongs;
[0178] A tree structure is established based on the category level and the label sequence as the random conditional tree structure, so as to construct the label probability output sub-model and the target random conditional tree sub-model based on the random conditional tree structure.
[0179] On the basis of the above technical solution, the device further comprises:
[0180] Based on the number of category levels in the random conditional tree structure, determine the number of output network layers in the label probability output submodel, based on the number of labels contained in each category level, determine the output network layer structure corresponding to the category level, and construct the label probability output submodel according to the number of output network layers and the output network layer structure;
[0181] Based on each label in each category level in the random conditional tree structure, the target random conditional tree sub-model is constructed.
[0182] The apparatus for constructing a cascade probability model provided in the embodiment of the present invention can execute the method for constructing a cascade probability model provided in any embodiment of the present invention, and has the functional modules and beneficial effects corresponding to the execution method.
[0183] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the protection scope of the embodiments of the present invention.
[0184] Embodiment 7
[0185] Fig. 9 A schematic diagram of the structure of a server provided in Embodiment 7 of the present invention. Fig. 9 A block diagram of an exemplary server 90 suitable for use in implementing exemplary embodiments of the present invention is shown. Fig. 9 The server 90 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0186] like Fig. 9 As shown, the server 90 is in the form of a general computing server. The components of the server 90 may include, but are not limited to: one or more processors or processing units 901, a system memory 902, and a bus 903 connecting different system components (including the system memory 902 and the processing unit 901).
[0187] Bus 903 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor or a local bus using any of a variety of bus structures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0188] The server 90 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the server 90, including volatile and non-volatile media, removable and non-removable media.
[0189] System memory 902 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 904 and / or cache memory 905. Server 90 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 906 may be used to read and write non-removable, non-volatile magnetic media ( Fig. 9 not shown, usually called a "hard drive"). Although Fig. 9 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 903 via one or more data medium interfaces. Memory 902 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of various embodiments of the present invention.
[0190] A program / utility 908 having a set (at least one) of program modules 907 may be stored, for example, in the memory 902, such program modules 907 including but not limited to an operating system, one or more application programs, other program modules, and program data, each of which or some combination thereof may include an implementation of a network environment. The program modules 907 generally perform the functions and / or methods of the embodiments described herein.
[0191] The server 90 may also communicate with one or more external devices 909 (e.g., keyboards, pointing servers, displays 910, etc.), one or more servers that enable users to interact with the server 90, and / or any server that enables the server 90 to communicate with one or more other computing servers (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 911. Furthermore, the server 90 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 912. As shown, the network adapter 912 communicates with other modules of the server 90 via a bus 903. It should be understood that although Fig. 9Not shown, other hardware and / or software modules may be used in conjunction with server 90, including but not limited to microcode, server drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0192] The processing unit 901 executes various functional applications and data processing by running the programs stored in the system memory 902, such as implementing the method for determining the tag sequence of an object or the method for determining the cascade probability model provided in the embodiments of the present invention.
[0193] Embodiment 6
[0194] Embodiment 6 of the present invention further provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute a method for determining a tag sequence of an object or a method for determining a cascade probability model.
[0195] The method includes:
[0196] Get the target title text used to describe the target item;
[0197] Determine a joint probability value corresponding to the target title text based on a pre-trained target cascade probability model;
[0198] Determining a target tag sequence corresponding to the target object according to the joint probability value;
[0199] The joint probability value includes the probability value of each preset tag sequence corresponding to the target item, and the preset tag sequence includes at least two category-level tags. Or,
[0200] The cascade probability model includes a text feature extraction sub-model, a label probability output sub-model and a target random conditional tree sub-model, and the method includes:
[0201] The output of the text feature extraction sub-model is used as the input of the label probability output sub-model, and the output of the label probability output sub-model is used as the input of the target random conditional tree sub-model to construct the cascade probability model;
[0202] Wherein, the text feature extraction sub-model is used to output a target feature vector corresponding to the target title text based on the input target title text of the target item;
[0203] The label probability output submodel is used to output a label probability value corresponding to each label in the label probability output submodel based on the target feature vector;
[0204] The target random conditional tree sub-model is used to output a joint probability value based on the label probability value; the joint probability value includes the probability value of each preset label sequence corresponding to the target item, and the preset label sequence includes at least two category-level labels.
[0205] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0206] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0207] Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0208] Computer program code for performing the operation of embodiments of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on a user's computer, partially on a user's computer, as an independent software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0209] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.
Claims
1. A method for determining a tag sequence of an object, characterized in that: include: Get the target title text used to describe the target item; Determine a joint probability value corresponding to the target title text based on a pre-trained target cascade probability model; Determining a target tag sequence corresponding to the target object according to the joint probability value; The joint probability value includes the probability value of the target item corresponding to each preset label sequence, and the preset label sequence includes at least two category-level labels; The target cascade probability model includes a label probability output sub-model connected to the text feature extraction sub-model, and a target random conditional tree sub-model connected to the label probability output sub-model; the method of determining the joint probability value corresponding to the target title text based on the pre-trained target cascade probability model includes: Based on the text feature extraction sub-model, determining a target feature vector corresponding to the target title text; Determine a label probability value corresponding to each label in the label probability output submodel based on the target feature vector and the label probability output submodel; Based on the label probability value and the target random conditional tree sub-model, determine a joint probability value of a preset label sequence consisting of all labels located on the same branch in a pre-established random conditional tree structure; The number of the preset tag sequences is the same as the number of corresponding leaf nodes at the end of the pre-established random conditional tree structure; The target random condition tree sub-model is constructed based on a pre-established random condition tree structure, and the target random condition tree sub-model includes transition probability values between nodes in the random condition tree structure; Accordingly, based on the label probability value and the target random conditional tree sub-model, a joint probability value of a label sequence consisting of all labels on the same branch in a pre-established random conditional tree structure is determined, including: Input all label probability values into the target random conditional tree sub-model, process the label probability value of each label according to the predetermined mapping relationship between each label and the transition probability value, and determine the joint probability value of the label sequence at different category levels and on the same branch; The processing of the label probability value of each label according to the predetermined mapping relationship between each label and the transition probability value to determine the joint probability value of the label sequences at different category levels and on the same branch includes: The probability value of each label in a preset label sequence is multiplied by the transition probability value between each label to obtain a joint probability value corresponding to the preset label sequence.
2. The method according to claim 1, characterized in that The text feature extraction sub-model includes a language processing sub-model and a neural network sub-model; Accordingly, determining the target feature vector corresponding to the target title text based on the text feature extraction sub-model includes: Performing word segmentation processing on the target title text to obtain each title word in the target title text; Input each title word into the language processing sub-model to obtain a title word vector corresponding to each title word; Each title word vector is input into the neural network sub-model to obtain the target feature vector corresponding to the target title text.
3. The method according to claim 2, characterized in that The language processing sub-model is a BERT bidirectional encoder model, and the neural network sub-model is a long short-term memory network.
4. The method according to claim 1, characterized in that: The label probability output submodel includes a preset number of output network layers; the preset number is the same as the number of pre-established category levels; each category level includes at least one label; the number of category levels is the same as the depth of the tree in the pre-established random conditional tree structure; Accordingly, determining the label probability value corresponding to each label in the label probability output submodel based on the target feature vector and the label probability output submodel includes: The target feature vector is processed based on a preset number of output network layers to obtain a label probability value for each label in each category level.
5. The method according to claim 4, characterized in that Each output network layer includes a fully connected layer and a normalized exponential function layer; Accordingly, the target feature vector is processed based on a preset number of output network layers to obtain a label probability value of each label in each category level, including: For each output network layer in the preset number of output network layers, determining a target category level corresponding to the output network layer based on a pre-established mapping relationship; Based on the fully connected layer in the output network layer and the number of labels in the target category level, mapping the target feature vector to a first feature vector corresponding to the target category level; Based on the first feature vector and the normalized exponential function layer, a label probability value of each label in the target category level is determined.
6. The method according to claim 1, characterized in that The step of determining a target tag sequence corresponding to the target object according to the joint probability value includes: According to the joint probability value, a preset label sequence corresponding to the highest joint probability value is determined, and the preset label sequence corresponding to the highest joint probability value is used as a target label sequence corresponding to the target object.
7. The method according to claim 1, characterized in that Also includes: Training the target cascade probability model; Wherein, training the target cascade probability model includes: Acquire multiple training sample data, and input the training sample data into a pre-built initial cascade probability model to obtain an initial joint probability value corresponding to each training sample data; wherein the training sample data includes a training title text for describing a sample item, and a training label sequence corresponding to the training title text; Based on the back propagation algorithm and the initial joint probability value, modifying the preset loss function in the initial cascade probability model; The preset loss function reaching convergence is taken as a training goal, and the initial cascade probability model is trained to obtain the target cascade probability model.
8. The method according to claim 1, characterized in that The target label sequence includes a primary category label, a secondary category label and a tertiary category label. The level of the primary category label is higher than that of the secondary category label, and the level of the secondary category label is higher than that of the tertiary category label.
9. A method for constructing a cascade probability model, characterized in that: The cascade probability model includes a text feature extraction sub-model, a label probability output sub-model and a target random conditional tree sub-model, and the method includes: The output of the text feature extraction sub-model is used as the input of the label probability output sub-model, and the output of the label probability output sub-model is used as the input of the target random conditional tree sub-model to construct the cascade probability model; Wherein, the text feature extraction sub-model is used to output a target feature vector corresponding to the target title text based on the input target title text of the target item; The label probability output submodel is used to output a label probability value corresponding to each label in the label probability output submodel based on the target feature vector; The target random conditional tree sub-model is used to determine, based on the label probability value, a joint probability value of a preset label sequence composed of all labels located on the same branch in a pre-established random conditional tree structure; wherein the number of the preset label sequences is the same as the number of corresponding leaf nodes at the end of the pre-established random conditional tree structure, and the preset label sequence includes at least two category-level labels; Wherein, the target random condition tree sub-model is constructed based on a pre-established random condition tree structure, and the target random condition tree sub-model includes transition probability values between nodes in the random condition tree structure; The target random conditional tree sub-model is used to determine the joint probability value of a preset label sequence composed of all labels on the same branch in the pre-established random conditional tree structure based on the label probability value, including: Input all label probability values into the target random conditional tree sub-model, process the label probability value of each label according to the predetermined mapping relationship between each label and the transition probability value, and determine the joint probability value of the label sequence at different category levels and on the same branch; The processing of the label probability value of each label according to the predetermined mapping relationship between each label and the transition probability value to determine the joint probability value of the label sequences at different category levels and on the same branch includes: The probability value of each label in a preset label sequence is multiplied by the transition probability value between each label to obtain a joint probability value corresponding to the preset label sequence.
10. A device for determining a tag sequence of an object, characterized in that: include: A target title text determination module, used to obtain a target title text for describing a target item; A joint probability value determination module, used to determine a joint probability value corresponding to the target title text based on a pre-trained target cascade probability model; A target tag sequence determination module, used to determine a target tag sequence corresponding to the target object according to the joint probability value; The joint probability value includes the probability value of the target item corresponding to each preset label sequence, and the preset label sequence includes at least two category-level labels; A feature vector determination unit, used to determine a target feature vector corresponding to the target title text based on a text feature extraction sub-model; a label probability value determining unit, configured to determine a label probability value corresponding to each label in the label probability output submodel based on the target feature vector and the label probability output submodel; A joint probability value determination unit, configured to determine a joint probability value of a preset label sequence consisting of all labels on the same branch of a pre-established random conditional tree structure based on the label probability value and the target random conditional tree sub-model; The number of the preset tag sequences is the same as the number of corresponding leaf nodes at the end of the pre-established random conditional tree structure; The target random conditional tree sub-model is obtained by training based on a pre-established random conditional tree structure, and the target random conditional tree sub-model includes a root node, leaf nodes connected to the root node, and transition probability values between the leaf nodes; Correspondingly, the joint probability value determination unit is further used to: input all label probability values into the target random conditional tree sub-model, process the label probability value of each label according to the predetermined mapping relationship between the label and the transition probability value, and determine the joint probability value of the label sequence at different category levels and on the same branch; The processing of the label probability value of each label according to the predetermined mapping relationship between each label and the transition probability value to determine the joint probability value of the label sequences at different category levels and on the same branch includes: The probability value of each label in a preset label sequence is multiplied by the transition probability value between each label to obtain a joint probability value corresponding to the preset label sequence.
11. A device for constructing a cascade probability model, characterized in that: The cascade probability model includes a text feature extraction sub-model, a label probability output sub-model and a target random condition tree sub-model. include: Wherein, the text feature extraction sub-model is used to output a target feature vector corresponding to the target title text based on the input target title text of the target item; The label probability output submodel is used to output a label probability value corresponding to each label in the label probability output submodel based on the target feature vector; The target random conditional tree sub-model is used to determine, based on the label probability value, a joint probability value of a preset label sequence composed of all labels located on the same branch in a pre-established random conditional tree structure; wherein the number of the preset label sequences is the same as the number of corresponding leaf nodes at the end of the pre-established random conditional tree structure, and the preset label sequence includes at least two category-level labels; Wherein, the target random condition tree sub-model is constructed based on a pre-established random condition tree structure, and the target random condition tree sub-model includes transition probability values between nodes in the random condition tree structure; The target random conditional tree sub-model is used to determine the joint probability value of a preset label sequence composed of all labels on the same branch in the pre-established random conditional tree structure based on the label probability value, including: Input all label probability values into the target random conditional tree sub-model, process the label probability value of each label according to the predetermined mapping relationship between each label and the transition probability value, and determine the joint probability value of the label sequence at different category levels and on the same branch; The processing of the label probability value of each label according to the predetermined mapping relationship between each label and the transition probability value to determine the joint probability value of the label sequences at different category levels and on the same branch includes: The probability value of each label in a preset label sequence is multiplied by the transition probability value between each label to obtain a joint probability value corresponding to the preset label sequence.
12. A server, characterized in that: The server comprises: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the object tag sequence determination method as described in any one of claims 1 to 8 or the cascade probability model construction method as described in claim 9.
13. A storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the method for determining an object tag sequence as described in any one of claims 1 to 8 or the method for constructing a cascade probability model as described in claim 9.
