Content tag prediction method, apparatus, and electronic device

CN117743660BActive Publication Date: 2026-10-23BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211107307.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-09-09
Publication Date
2026-10-23
Estimated Expiration
2042-09-09

AI Technical Summary

Technical Problem

[0005]本公开提供了一种内容标签预测方法、装置及电子设备,以解决现有技术中部分或全部技术问题

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117743660B_ABST
    Figure CN117743660B_ABST
Patent Text Reader

Abstract

Embodiments of the present disclosure relate to a content label prediction method and device, and an electronic device. The method comprises: obtaining a plurality of data sets; inputting each piece of data in the plurality of data sets into a pre-constructed hierarchical single-label prediction model respectively, and obtaining a label prediction result of each piece of data in each data set of the plurality of data sets; constructing a label system according to all data in all data sets and the label prediction result of each piece of data in each data set of the plurality of data sets; and predicting a final label corresponding to first data according to the label system and the label prediction result of the first data in each data set of the plurality of data sets. In the method, the relationship between labels in the label prediction result of the first data in each data set of the plurality of data sets can be determined according to the label system. Furthermore, the most reasonable and accurate label is selected from the relationship between the labels to form the final label.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a content tag prediction method, apparatus, and electronic device. Background Technology

[0002] With the development of deep learning technology, more and more data classification tasks have been proposed to improve people's understanding of data distribution.

[0003] Application software products often employ data classification tasks to categorize content, such as media content. Existing methods for predicting tags at different levels typically use the prediction results of neural network models directly. While predictions for single-level tags are generally quite accurate, current prediction results are not ideal for multi-level tags.

[0004] Therefore, how to make the prediction results of the multi-level labels obtained more accurate and reasonable is the technical problem to be solved by this disclosure. Summary of the Invention

[0005] This disclosure provides a content tag prediction method, apparatus, and electronic device to solve some or all of the technical problems in the prior art.

[0006] Firstly, this disclosure provides a content tag prediction method, including:

[0007] Obtain multiple datasets;

[0008] Each data point from multiple datasets is input into a pre-built hierarchical single-label prediction model to obtain the label prediction result for each data point in each of the multiple datasets.

[0009] A label system is constructed based on all data in all datasets and the label prediction results of each data point in each of the multiple datasets.

[0010] Based on the labeling system and the label prediction results of the first data in each of the multiple datasets, predict the final label corresponding to the first data, where the first data is any data in any of the multiple datasets.

[0011] The method provided in this disclosure involves acquiring multiple datasets and then obtaining the label prediction results for each piece of data in each of the multiple datasets. A label system is constructed based on all data in all datasets and the label prediction results for each piece of data in each of the multiple datasets. Then, based on the label system and the label prediction results for the first data in each of the multiple datasets, a first label corresponding to the first data is predicted. In this method, the labels in the label system may include inclusion or being included relationships, or mutually exclusive relationships at the same level. Finally, based on the label system, the relationships between the labels in the label prediction results for the first data in each of the multiple datasets can be determined. Then, based on the relationships between the labels, the most reasonable and accurate labels (groups) are selected to constitute the final labels.

[0012] Optionally, the hierarchical single-label prediction model includes a feature extraction layer, a preset number of hidden layers, a confusion layer, and a mapping layer, with one hidden layer corresponding to one dataset;

[0013] Each data point from multiple datasets is input into a pre-built hierarchical single-label prediction model to obtain the label prediction result for each data point in each of the multiple datasets. Specifically, this includes:

[0014] The feature vector of the first data in multiple datasets is extracted using a feature extraction layer;

[0015] The feature vectors are input into a preset number of hidden layers, and the first output vector corresponding to each hidden layer is obtained.

[0016] Concatenate all the first output vectors to obtain the concatenated vector;

[0017] Based on the concatenated vector and the first output vector corresponding to the first hidden layer, obtain the second output vector, where the first hidden layer is any one of the preset number of hidden layers;

[0018] Based on the second output vector, predict the label prediction result of the first data in the first dataset, where the first dataset is the dataset corresponding to the first hidden layer among multiple datasets.

[0019] The hierarchical single-label prediction model extracts feature vectors from the first data set through a feature extraction layer. These feature vectors are then input into different hidden layers, resulting in a first output vector corresponding to each hidden layer. Each hidden layer corresponds to a dataset, so each first output vector corresponds to a dataset. All first output vectors are concatenated to obtain a concatenated vector. Based on this concatenated vector and the first output vectors from each hidden layer, a second output vector is obtained. This second output vector is then used to predict the label of the first data set in each dataset. It can be seen that regardless of which dataset the label prediction is for, the concatenated vector is incorporated. This means that when predicting the label in each dataset, the influence of feature vectors from other datasets is considered, thus taking into account the relationships between labels in different datasets and fusing other label information to improve the model's prediction performance.

[0020] Optionally, based on all data in all datasets, and the label prediction results for each data point in each of the multiple datasets, a label system is constructed, specifically including:

[0021] Group the second dataset from all datasets together with other datasets from multiple datasets to create multiple groups;

[0022] Based on the data in each group and the label prediction results of the data in each of the multiple datasets, a confusion matrix is ​​constructed. The confusion matrix is ​​used to indicate the association between the label of any data in the second dataset and the label of any data in the third dataset in other datasets. The second dataset is any dataset in all datasets, and the third dataset is any dataset in all datasets except the second dataset.

[0023] A label system is constructed based on the relationships between different labels in all confusion matrices.

[0024] In constructing a labeling system, one dataset can be selected from multiple datasets as a baseline dataset. This baseline dataset is then grouped with the other datasets. A confusion matrix is ​​constructed based on the data from this group and the corresponding label prediction results. The proportion of data belonging to the same label and the same label in the confusion matrix is ​​then statistically analyzed. Based on this proportion, the association between the two labels is determined, such as inclusion, being included, or other relationships. With the associations between different labels established, a labeling system can be constructed. This system allows for the determination of the associations between different labels in the label prediction results for each data point, and ultimately, the selection of reasonable and accurate labels (groups) as the final labels.

[0025] Optionally, based on the data in each group and the label prediction results of the data in each of the multiple datasets, a confusion matrix is ​​constructed, specifically including:

[0026] Within the grouping, extract the first total data volume of the first label belonging to the second dataset, and extract the second total data volume of the second label belonging to the third dataset;

[0027] Determine the ratio between the first total data volume and the second total data volume;

[0028] Construct a confusion matrix corresponding to each group based on all the first labels, all the second labels, and the ratio between the total first data volume and the total second data volume.

[0029] Within each group, we can obtain the total first data volume of the first label belonging to the second dataset and the total second data volume of the second label belonging to the third dataset. Determining the ratio between the total first and second data volumes allows us to construct a confusion matrix corresponding to each group based on all first labels, all second labels, and the ratio between the total first and second data volumes. From the confusion matrix, we can infer the inclusion / containing relationship between two labels. This facilitates the subsequent construction of a label system based on the inclusion relationships between labels of different data in all confusion matrices.

[0030] Optionally, based on the labeling system and the label prediction results of the first data in all datasets, predict the final label corresponding to the first data, specifically including:

[0031] Based on the labeling system, determine the correlation between labels in the label prediction results of the first data across all datasets;

[0032] Based on the correlation, predict the final label corresponding to the first data.

[0033] As described above, the labeling system contains the hierarchical relationships between different labels. Within the same hierarchy, there are corresponding inclusion relationships. Therefore, based on the labeling system, we can determine the correlation between the labels in the label prediction results of the first data across all datasets. Then, based on the correlation between the labels, we can select a more reasonable and accurate final label from multiple labels.

[0034] Optionally, before inputting each data point from multiple datasets into a pre-built hierarchical single-label prediction model to obtain the label prediction result for each data point in each of the multiple datasets, the method further includes:

[0035] Obtain multiple sample datasets, each of which contains multiple sample data points, and each sample data point is labeled according to a preset annotation method;

[0036] Each sample data point is input into the hierarchical single-label initial model, which is the original model of the hierarchical single-label prediction model.

[0037] The hierarchical single-label initial model is trained using sample data from multiple sample datasets to obtain the label of the sample data in each of the multiple sample datasets.

[0038] The loss function is determined based on the total amount of sample data in multiple sample datasets, the number of sample datasets, each sample data, and the hit label of each sample data in each of the multiple sample datasets.

[0039] When the loss function meets the preset conditions, training of the hierarchical single-label initial model is stopped, and the currently trained model is determined to be the hierarchical single-label prediction model. In this model, the hit label of each sample data in each of the multiple sample datasets is the label of the sample data in the sample dataset that is not empty.

[0040] Secondly, this disclosure provides a content tag prediction device, comprising:

[0041] The acquisition module is used to acquire multiple datasets;

[0042] The processing module is used to input each data point from multiple datasets into a pre-built hierarchical single-label prediction model to obtain the label prediction result of each data point in each of the multiple datasets.

[0043] The building module is used to construct a label system based on all data in all datasets, as well as the label prediction results of each data point in each of the multiple datasets;

[0044] The prediction module is used to predict the final label corresponding to the first data based on the label system and the label prediction results of the first data in each of the multiple datasets. The first data is any data in any of the multiple datasets.

[0045] This disclosure provides a content tag prediction device that acquires multiple datasets and then obtains the tag prediction results for each piece of data in each of the multiple datasets. Based on all data in all datasets and the tag prediction results for each piece of data in each of the multiple datasets, a tag system is constructed. Then, based on the tag system and the tag prediction results for the first piece of data in each of the multiple datasets, a first tag corresponding to the first piece of data is predicted. In this method, the tags in the tag system can include inclusion or being included relationships, or mutually exclusive relationships at the same level. Finally, based on the tag system, the relationships between the tags in the tag prediction results for the first piece of data in each of the multiple datasets can be determined. Then, based on the relationships between the tags, the most reasonable and accurate tags are selected to form the final tags.

[0046] Optionally, the hierarchical single-label prediction model includes a feature extraction layer, a preset number of hidden layers, a confusion layer, and a mapping layer, with one hidden layer corresponding to one dataset;

[0047] The processing module is specifically used to extract the feature vector of the first data from multiple datasets through the feature extraction layer;

[0048] The feature vectors are input into a preset number of hidden layers, and the first output vector corresponding to each hidden layer is obtained.

[0049] Concatenate all the first output vectors to obtain the concatenated vector;

[0050] Based on the concatenated vector and the first output vector corresponding to the first hidden layer, obtain the second output vector, where the first hidden layer is any one of the preset number of hidden layers;

[0051] Based on the second output vector, predict the label prediction result of the first data in the first dataset, where the first dataset is the dataset corresponding to the first hidden layer among multiple datasets.

[0052] The hierarchical single-label prediction model extracts feature vectors from the first data set through a feature extraction layer. These feature vectors are then input into different hidden layers, resulting in a first output vector corresponding to each hidden layer. Each hidden layer corresponds to a dataset, so each first output vector corresponds to a dataset. All first output vectors are concatenated to obtain a concatenated vector. Based on this concatenated vector and the first output vectors from each hidden layer, a second output vector is obtained. This second output vector is then used to predict the label of the first data set in each dataset. It can be seen that regardless of which dataset the label prediction is for, the concatenated vector is incorporated. This means that when predicting the label in each dataset, the influence of feature vectors from other datasets is considered, thus taking into account the relationships between labels in different datasets and fusing other label information to improve the model's prediction performance.

[0053] Optionally, a building module is used to group the second dataset in all datasets with other datasets in multiple datasets, creating multiple groups;

[0054] Based on the data in each group and the label prediction results of the data in each of the multiple datasets, a confusion matrix is ​​constructed. The confusion matrix is ​​used to indicate the association between the label of any data in the second dataset and the label of any data in the third dataset in other datasets. The second dataset is any dataset in all datasets, and the third dataset is any dataset in all datasets except the second dataset.

[0055] A label system is constructed based on the relationships between different labels in all confusion matrices.

[0056] In constructing a labeling system, one dataset can be selected from multiple datasets as a baseline dataset. This baseline dataset is then grouped with the other datasets. A confusion matrix is ​​constructed based on the data from this group and the corresponding label prediction results. The proportion of data belonging to the same label and the same label in the confusion matrix is ​​then statistically analyzed. Based on this proportion, the association between the two labels is determined, such as inclusion, being included, or other relationships. With the associations between different labels established, a labeling system can be constructed. This system allows for the determination of the associations between different labels in the label prediction results for each data point, and ultimately, the selection of reasonable and accurate labels (groups) as the final labels.

[0057] Optional, building modules, specifically used for:

[0058] Within the grouping, extract the first total data volume of the first label belonging to the second dataset, and extract the second total data volume of the second label belonging to the third dataset;

[0059] Determine the ratio between the first total data volume and the second total data volume;

[0060] Construct a confusion matrix corresponding to each group based on all the first labels, all the second labels, and the ratio between the total first data volume and the total second data volume.

[0061] Within each group, we can obtain the total first data volume of the first label belonging to the second dataset and the total second data volume of the second label belonging to the third dataset. Determining the ratio between the total first and second data volumes allows us to construct a confusion matrix corresponding to each group based on all first labels, all second labels, and the ratio between the total first and second data volumes. From the confusion matrix, we can infer the inclusion / containing relationship between two labels. This facilitates the subsequent construction of a label system based on the inclusion relationships between labels of different data in all confusion matrices.

[0062] Optional, the prediction module is specifically used to determine the association between labels in the label prediction results of the first data in all datasets based on the label system;

[0063] Based on the correlation, predict the final label corresponding to the first data.

[0064] As described above, the labeling system contains the hierarchical relationships between different labels. Within the same hierarchy, there are corresponding inclusion relationships. Therefore, based on the labeling system, we can determine the correlation between the labels in the label prediction results of the first data across all datasets. Then, based on the correlation between the labels, we can select a more reasonable and accurate final label from multiple labels.

[0065] Optionally, the device may also include: a model training module;

[0066] The acquisition module is also used to acquire multiple sample datasets. Each sample dataset includes multiple sample data, and each sample data is configured with a data label according to a preset annotation method.

[0067] The model training module is used to input each sample data into the hierarchical single-label initial model, which is the original model of the hierarchical single-label prediction model. The module trains the hierarchical single-label initial model using sample data from multiple sample datasets, obtaining the label of each sample data in each of the multiple sample datasets. A loss function is determined based on the total amount of sample data in the multiple sample datasets, the number of sample datasets, each sample data, and the matched label of each sample data in each of the multiple sample datasets. When the loss function meets preset conditions, training of the hierarchical single-label initial model stops, and the currently trained model is determined as the hierarchical single-label prediction model. Here, the matched label of each sample data in each of the multiple sample datasets is the label of the sample data in the sample dataset that is not empty.

[0068] Thirdly, an electronic device is provided, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0069] Memory, used to store computer programs;

[0070] When a processor executes a program stored in memory, it implements the steps of the content tag prediction method of any embodiment of the first aspect.

[0071] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by an electronic device, implements the steps of the content tag prediction method, apparatus, and electronic device method as described in any embodiment of the first aspect. Attached Figure Description

[0072] Figure 1 This is a schematic diagram of a content tag prediction method provided in an embodiment of this disclosure;

[0073] Figure 2 A schematic diagram of the architecture of the different datasets provided in this disclosure;

[0074] Figure 3 This is a hierarchical architecture diagram of a hierarchical single-label prediction model provided in this disclosure;

[0075] Figure 4 This is a schematic diagram illustrating the specific method and flowchart provided in this disclosure for inputting each data point from multiple datasets into a pre-built hierarchical single-label prediction model to obtain the label prediction result of each data point in each of the multiple datasets.

[0076] Figure 5This disclosure provides a flowchart illustrating a method for constructing a label system based on all data in all datasets and the label prediction results of each data point in each of the multiple datasets.

[0077] Figure 6 This is a schematic flowchart of a method for constructing a confusion matrix provided in an embodiment of the present disclosure;

[0078] Figure 7 A schematic diagram illustrating different labeling systems provided in embodiments of this disclosure;

[0079] Figure 8 This is a flowchart illustrating the specific method for predicting the final label corresponding to the first data based on the label system and the label prediction results of the first data in all datasets provided in this disclosure.

[0080] Figure 9 This is a schematic diagram of a method for training a hierarchical single-label prediction model provided in this disclosure;

[0081] Figure 10 This is a schematic diagram of the structure of a content tag prediction device provided in an embodiment of the present disclosure;

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

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

[0084] To facilitate understanding of the embodiments of this disclosure, further explanations and descriptions will be provided below with reference to the accompanying drawings and specific embodiments. These embodiments do not constitute a limitation on the embodiments of this disclosure.

[0085] In view of the technical problems mentioned in the background art, this disclosure provides a content tag prediction method.

[0086] The specific methods and steps for label prediction will be described in detail below. Please refer to the accompanying drawings provided in the embodiments of this disclosure. Figure 1 This is a schematic flowchart of a content tag prediction method provided in an embodiment of this disclosure. The method includes the following steps:

[0087] Step 110: Obtain multiple datasets.

[0088] Specifically, data within the same dataset can be considered to belong to the same level. For example, data within the same dataset might include task-related, question-and-answer, and casual conversation data.

[0089] Considering different categories of data at the same level, multiple sets of data can also be included. For example, task-based data can include categories such as music, weather, and video. Furthermore, different categories can have multiple sub-tasks; for example, the music category could include playing music, switching music, searching for music, etc.

[0090] Multiple sets of data under a task-based dataset, such as music and weather as mentioned above, can be further divided into multiple sub-data sets. Different sub-data sets can also be divided into multiple datasets depending on the situation.

[0091] Figure 2 The abstract diagram illustrates the relationships between multiple datasets, where U represents the entire dataset, and datasets at different levels are denoted as D1, D2, and D3. D1 includes A, B, and C, representing data at the same level, such as the task, question-and-answer, and casual conversation categories mentioned above. D2 includes D, E, and F, where D and E are subsets of A. D3 includes G, H, and I. F and G are subsets of B, and H and I are subsets of C. Specifically, D through I belong to the same level of data. For example, if A is a task category, then D and E could represent the music domain and the time domain, respectively. If B is a question-and-answer category, then F and G could represent inquiries about music and interests, respectively. If C is a casual conversation domain, then H and I could represent casual conversations about basketball and running, respectively.

[0092] Therefore, when partitioning the different datasets in the second level, D, E, and F are grouped into the same dataset (the data in this dataset all involve music and time). G, H, and I are grouped into the same dataset (the data in this dataset all involve hobbies and interests). That is, although the data are from different fields, there is actually some overlap in the categories involved, so they can be grouped into the same dataset in the next level.

[0093] Step 120: Input each data point from multiple datasets into the pre-built hierarchical single-label prediction model to obtain the label prediction result of each data point in each of the multiple datasets.

[0094] Specifically, like Figure 2 The introduction includes multiple ( Figure 2There are three datasets, each containing multiple data points. By inputting each data point into a pre-built hierarchical single-label prediction model, we can obtain the label prediction result for each data point in each of the multiple datasets.

[0095] It is understandable that a hierarchical single-label prediction model includes a separate data label prediction system for each dataset, used to predict the label prediction result of the first data point in each dataset. Here, the first data point can be any data point from multiple datasets.

[0096] To illustrate with a specific example, when a hierarchical single-label prediction model predicts the label of the first data, it obtains the data label as C in D1, E in D2, and I in D3.

[0097] Step 130: Construct a label system based on all data in all datasets and the label prediction results of each data point in each of the multiple datasets.

[0098] Specifically, as described above, by using a hierarchical single-label prediction model, we can obtain the label prediction results for each data point in each of multiple datasets. Based on the label prediction results for all data points, we can determine the association between different labels, and then construct a label system based on the association between different labels.

[0099] In a specific example, the relationship can include inclusion and being included. For example, U includes A and B, A includes C and D, and B includes E and F. Then, a tag system containing U to F can be constructed. In a specific example, the tag system can be represented in the form of a "tag tree".

[0100] Furthermore, when determining the relationships between different labels, we can include a well-known principle: if A contains B, and A and B belong to different levels of datasets, then data belonging to label B must also belong to label A.

[0101] Therefore, we can analyze two datasets at different levels. For example, if the tag results include data containing tag A, then among the data containing tag A, which data also includes tag B? If the ratio between the total number of data containing tag B and the total number of data containing tag A is greater than a certain preset threshold, then it means that tag A contains tag B. Similarly, we can determine the inclusion relationships between other tags, and thus establish the associations between different tags.

[0102] Step 140: Based on the labeling system and the label prediction results of the first data in each of the multiple datasets, predict the final label corresponding to the first data.

[0103] Specifically, as mentioned above, if the relationships between different labels can be known, that is, if the label system can be known, then the relationships between the label prediction results of the first data in each of the multiple datasets can be deduced. By predicting the relationships between different labels in the label prediction results, the final label corresponding to the first data can be reasonably inferred.

[0104] The label prediction method provided in this disclosure involves acquiring multiple datasets and then obtaining the label prediction result for each piece of data in each of the multiple datasets. A label system is constructed based on all data in all datasets and the label prediction results for each piece of data in each of the multiple datasets. Then, based on the label system and the label prediction results for the first data in each of the multiple datasets, a first label corresponding to the first data is predicted. In this method, the labels in the label system can include inclusion or being included relationships, or mutually exclusive relationships at the same level. Finally, based on the label system, the relationships between the labels in the label prediction results for the first data in each of the multiple datasets can be determined. Then, based on the relationships between the labels, the most reasonable and accurate labels (groups) are selected to constitute the final labels.

[0105] In an optional embodiment, based on the above embodiments, this disclosure provides another embodiment of the content tag prediction method. Content that is the same as or similar to that described above will not be repeated here. In the embodiments of this disclosure, the focus will be on introducing the composition of the hierarchical single-tag prediction model, and the functional description of each part of the hierarchical single-tag prediction model, etc.

[0106] Specifically, the hierarchical single-label prediction model includes a feature extraction layer, a preset number of hidden layers, a confusion layer, and a mapping layer, with one hidden layer corresponding to one dataset.

[0107] See details Figure 3 As shown, Figure 3 The diagram illustrates the hierarchical architecture of a hierarchical single-label prediction model.

[0108] The first layer is the feature extraction layer, also known as the backbone network. It is used to extract feature vectors from the data.

[0109] Multiple hidden layers, each configured with a different transformation space, perform different dimensionality reduction operations. However, the feature vectors after dimensionality reduction have the same dimension. Each hidden layer corresponds to a dataset; that is, each hidden layer and other structures in the hierarchical single-label prediction model constitute a label prediction output system for a specific dataset, used to predict the label of a data point in that dataset.

[0110] A confusion layer is a process that concatenates the first output vectors from multiple hidden layers and then mixes them with the first output vectors from different hidden layers to obtain a second output vector.

[0111] The mapping layer is used to predict the label results for each dataset based on each second output vector.

[0112] For details on the implementation process, please refer to Figure 4 As shown, Figure 4 The following diagram illustrates the specific process of inputting each data point from multiple datasets into a pre-built hierarchical single-label prediction model to obtain the label prediction result for each data point in each of the multiple datasets.

[0113] Step 410: Extract the feature vector of the first data from multiple datasets through the feature extraction layer.

[0114] Step 420: Input the feature vectors into a preset number of hidden layers respectively, and obtain the first output vector corresponding to each hidden layer.

[0115] Step 430: Concatenate all the first output vectors to obtain the concatenated vector.

[0116] Step 440: Obtain the second output vector based on the concatenated vector and the first output vector corresponding to the first hidden layer.

[0117] The first hidden layer is any one of the preset number of hidden layers.

[0118] Step 450: Based on the second output vector, predict the label prediction result of the first data in the first dataset.

[0119] The first dataset is the dataset corresponding to the first hidden layer among multiple datasets.

[0120] For details on the specific working principle of the above model in predicting the label prediction results of the first data in the first dataset, please refer to the working principle of existing neural network models, which will not be explained in detail here.

[0121] In the above embodiment, the hierarchical single-label prediction model extracts feature vectors from the first data through a feature extraction layer. These feature vectors are then input into different hidden layers to obtain a first output vector corresponding to each hidden layer. Each hidden layer corresponds to a dataset, so each first output vector corresponds to a dataset. All first output vectors are concatenated to obtain a concatenated vector. Based on the concatenated vector and the first output vectors from each hidden layer, a second output vector is obtained. Then, based on the second output vector, the label prediction result for the first data in each dataset is predicted. It can be seen that regardless of which dataset the label prediction result for the first data is in, the concatenated vector is included. This means that when predicting the label in each prediction dataset, the influence of feature vectors obtained from other datasets is considered, i.e., the relationship between labels in different datasets is taken into account, and other label information is fused to improve the model's prediction performance.

[0122] Further optionally, based on any of the above embodiments, this disclosure also provides another embodiment of the content tag prediction method, the content of which is the same as or similar to any of the above embodiments, and will not be described in detail here. In this embodiment, a feasible process for constructing a tag system based on all data in all datasets, and the tag prediction results of each data point in each of the multiple datasets, will be described in detail. See details... Figure 5 As shown, the method includes the following steps:

[0123] Step 510: Group the second dataset in all datasets with other datasets in multiple datasets to create multiple groups.

[0124] Specifically, as in the example above, the dataset includes D1, D2, and D3. Suppose that when the second dataset is D1, the third dataset is any dataset other than D1, such as D2. That is, D1 and D2 are grouped together. Similarly, D1 and D3 need to be grouped together. If the second dataset is D2, it also needs to be grouped with both D1 and D3. Similarly, if the second dataset is D3, it also needs to be grouped with both D1 and D2. In this embodiment, the dataset can be divided into 6 groups, although some groups may contain the same data.

[0125] Step 520: Based on the data in each group and the label prediction results of the data in each of the multiple datasets, construct a confusion matrix.

[0126] In a specific example, a confusion matrix can be constructed using the following steps; see [link to documentation]. Figure 6 As shown, the method includes the following steps:

[0127] Step 610: In the grouping, extract the first total amount of data belonging to the first label in the second dataset, and extract the second total amount of data belonging to the second label in the third dataset.

[0128] Step 620: Determine the ratio between the first total data volume and the second total data volume.

[0129] The specific calculation process involves dividing the total amount of the second data by the total amount of the first data to obtain the ratio.

[0130] Step 630: Construct a confusion matrix corresponding to the group based on all the first labels, all the second labels, and the ratio between the total first data volume and the total second data volume in the group.

[0131] In a specific example of this disclosure, if the ratio between the first total data and the second total data exceeds a preset ratio threshold, it can be determined that the first label contains the second label.

[0132] In a specific example, taking D1 and D2 from the above text as examples, D1 and D2 can form a confusion matrix. See Table 1 for details.

[0133] D 95% 2% 3% E 95% 3% 2% F 2% 95% 3%

[0134] Table 1

[0135] Table 1 shows the predicted label results for each data point in the group consisting of D1 and D2. It was found that, assuming 100 data points are predicted to be labeled D, 95 of these 100 data points are also predicted to be labeled A (95 / 100), representing 95%. Two data points are also predicted to be labeled B (2%), and three data points are predicted to be labeled C (3%). Since 95% of the 100 data points predicted to be labeled D belong to the same label (A), exceeding the preset threshold of 90%, it can be determined that label D is a subset of label A.

[0136] Similarly, as can be seen from Table 1, label E is contained within label A, and label F is contained within label B.

[0137] By using a similar method, it is also possible to infer from other data groups that B contains G, and C contains H and I.

[0138] Step 530: Construct a tag system based on the relationships between different tags in all confusion matrices.

[0139] Specifically, as described in step 520, a relationship between different tags can be inferred from the confusion matrix. Therefore, a tag system can be constructed based on the relationship between all tags in all confusion matrices.

[0140] For details, please refer to Figure 7 As shown, Figure 7 This illustrates a labeling system where A includes D and E, B includes F and G, and C includes H and I, etc.

[0141] In constructing a labeling system, one dataset can be selected from multiple datasets as a baseline dataset. This baseline dataset is then grouped with the other datasets. A confusion matrix is ​​constructed based on the data from this group and the corresponding label prediction results. The proportion of data belonging to the same label and the same label in the confusion matrix is ​​then statistically analyzed. Based on this proportion, the association between the two labels is determined, such as inclusion, being included, or other relationships. With the associations between different labels established, a labeling system can be constructed. This system allows for the determination of the associations between different labels in the label prediction results for each data point, and ultimately, the selection of reasonable and accurate labels (groups) as the final labels.

[0142] Further optionally, based on any of the above embodiments, this disclosure also provides another embodiment of the content tag prediction method, which is the same as or similar to any of the above embodiments, and will not be described in detail here. In this embodiment, the specific method flow for predicting the final tag corresponding to the first data based on the tag system and the tag prediction results of the first data in all datasets will be described in detail. See [link to documentation] for details. Figure 8 As shown, the method includes the following steps:

[0143] Step 810: Based on the labeling system, determine the association between labels in the label prediction results of the first data across all datasets.

[0144] Step 820: Based on the association relationship, predict the final label corresponding to the first data.

[0145] Specifically, now that a labeling system is in place, the relationships between labels will be immediately apparent. After obtaining the label prediction results of the first data across all datasets, the relationships between different labels in the prediction results can be determined based on the labeling system, such as inclusion relationships, mutual exclusion relationships, or included relationships.

[0146] For example, if a dataset contains three data points, and the label prediction results show two labels with an inclusion relationship, and a third label has a mutually exclusive relationship with one of the other two labels, then it is reasonable to infer that the final labels of the first dataset are the two labels with inclusion relationships.

[0147] For example, the predicted labels for the first data point might include (A, D, G).

[0148] Therefore, the final label can be determined through either of the following two methods.

[0149] The first method determines that A is a non-last-level tag based on the tag body, while the D tag is contained within A, and the G tag is a last-level tag. Other tags do not have a parent tag B, so the final output is the AD tag.

[0150] The second method is to refer to the model score. For example, if the scores of the predicted labels (A,D,G) are (0.9,0.9,0.5), then according to the label system, D and G are both last-level labels, and the score of D is greater than that of G. Therefore, the label AD is output.

[0151] As described above, the labeling system contains the hierarchical relationships between different labels. Within the same hierarchy, there are corresponding inclusion relationships. Therefore, based on the labeling system, we can determine the correlation between the labels in the label prediction results of the first data across all datasets. Then, based on the correlation between the labels, we can select a more reasonable and accurate final label from multiple labels.

[0152] Further optionally, based on any of the above embodiments, this disclosure also provides another embodiment of the content tag prediction method, the content of which is the same as or similar to any of the above embodiments, and will not be described in detail here. In this embodiment, before inputting each data point from multiple datasets into a pre-built hierarchical single-label prediction model to obtain the label prediction result of each data point in each of the multiple datasets, the method further includes the following method steps, which can be found in detail below. Figure 9 As shown, it includes:

[0153] Step 910: Obtain multiple sample datasets.

[0154] Each sample dataset contains multiple sample data points, and each sample data point is labeled according to a preset annotation method.

[0155] Specifically, during the training process, data labels can be configured for each data point according to a unified labeling rule.

[0156] For example, if the data corresponds to a specific label in a dataset, then that label is configured directly; otherwise, it is configured as NULL. Figure 2 The following example uses a virtual dataset. If a data point appears only in dataset D1 and its label is A, then the unified label for that data point is (A, NULL, NULL). Alternatively, if a data point appears in both D1 and D3 and its labels are C and H respectively, then the unified label is (C, NULL, H).

[0157] Step 920: Input each sample data into the hierarchical single-label initial model.

[0158] Among them, the hierarchical single-label initial model is the original model of the hierarchical single-label prediction model.

[0159] Step 930: Train the hierarchical single-label initial model using sample data from multiple sample datasets to obtain the label of the sample data in each of the multiple sample datasets.

[0160] For details on the prediction process, please refer to [link / reference]. Figure 3 and Figure 4 The corresponding attached diagrams are not described here.

[0161] Step 940: Determine the loss function based on the total amount of sample data in multiple sample datasets, the number of sample datasets, each sample data, and the hit label of each sample data in each of the multiple sample datasets.

[0162] In this context, the label of each sample data point in each of the multiple sample datasets is the label of the sample data in the sample dataset that is not empty.

[0163] Specifically, the calculation process of the loss function is shown in the following formula:

[0164]

[0165] Where n is the size of the dataset and m is the number of samples. Let be the number of non-NULL labels in the j-th sample data. This represents the predicted label of the j-th sample data in the i-th dataset. L represents the probability of the predicted label of the j-th sample data in the i-th dataset, and L represents the cross-entropy function.

[0166] Step 950: When the loss function meets the preset conditions, stop training the hierarchical single-label initial model and determine that the currently trained model is a hierarchical single-label prediction model.

[0167] The above process can be found in the training principles of neural network models in existing technologies, and will not be elaborated further here.

[0168] The above are the method embodiments for label prediction provided in this disclosure. Other embodiments for label prediction provided in this disclosure will be described below. Please refer to the following for details.

[0169] Figure 10 This is a schematic diagram of a content tag prediction device provided in an embodiment of the present disclosure. The device includes: an acquisition module 1001, a processing module 1002, a construction module 1003, and a prediction module 1004.

[0170] Module 1001 is used to acquire multiple datasets;

[0171] The processing module 1002 is used to input each data point from multiple datasets into a pre-built hierarchical single-label prediction model to obtain the label prediction result of each data point in each of the multiple datasets.

[0172] Module 1003 is used to build a label system based on all data in all datasets and the label prediction results of each data point in each of the multiple datasets.

[0173] The prediction module 1004 is used to predict the final label corresponding to the first data based on the label system and the label prediction results of the first data in each of the multiple datasets, wherein the first data is any data in any of the multiple datasets.

[0174] Optionally, the hierarchical single-label prediction model includes a feature extraction layer, a preset number of hidden layers, a confusion layer, and a mapping layer, with one hidden layer corresponding to one dataset;

[0175] Processing module 1002 is specifically used to input each data point from multiple datasets into a pre-built hierarchical single-label prediction model, and obtain the label prediction result for each data point in each of the multiple datasets, specifically including:

[0176] The feature vector of the first data in multiple datasets is extracted using a feature extraction layer;

[0177] The feature vectors are input into a preset number of hidden layers, and the first output vector corresponding to each hidden layer is obtained.

[0178] Concatenate all the first output vectors to obtain the concatenated vector;

[0179] Based on the concatenated vector and the first output vector corresponding to the first hidden layer, obtain the second output vector, where the first hidden layer is any one of the preset number of hidden layers;

[0180] Based on the second output vector, predict the label prediction result of the first data in the first dataset, where the first dataset is the dataset corresponding to the first hidden layer among multiple datasets.

[0181] Optionally, module 1003 is used to group the second dataset in all datasets with other datasets in multiple datasets, and to build multiple groups.

[0182] Based on the data in each group and the label prediction results of the data in each of the multiple datasets, a confusion matrix is ​​constructed. The confusion matrix is ​​used to indicate the association between the label of any data in the second dataset and the label of any data in the third dataset in other datasets. The second dataset is any dataset in all datasets, and the third dataset is any dataset in all datasets except the second dataset.

[0183] A label system is constructed based on the relationships between different labels in all confusion matrices.

[0184] Optionally, module 1003 is specifically used to extract, in the grouping, the first total amount of data belonging to the first label in the second dataset, and the second total amount of data belonging to the second label in the third dataset;

[0185] Determine the ratio between the first total data volume and the second total data volume;

[0186] Construct a confusion matrix corresponding to each group based on all the first labels, all the second labels, and the ratio between the total first data volume and the total second data volume.

[0187] Optionally, the prediction module 1004 is specifically used to determine the correlation between each label in the label prediction results of the first data in all datasets based on the label system;

[0188] Based on the correlation, predict the final label corresponding to the first data.

[0189] Optionally, the device may also include: a model training module;

[0190] The acquisition module 1001 is also used to acquire multiple sample datasets, each sample dataset includes multiple sample data, and each sample data is configured with data labels according to a preset annotation method;

[0191] The model training module is used to input each sample data into the hierarchical single-label initial model, which is the original model of the hierarchical single-label prediction model. The module trains the hierarchical single-label initial model using sample data from multiple sample datasets, obtaining the label of each sample data in each of the multiple sample datasets. A loss function is determined based on the total amount of sample data in the multiple sample datasets, the number of sample datasets, each sample data, and the matched label of each sample data in each of the multiple sample datasets. When the loss function meets preset conditions, training of the hierarchical single-label initial model stops, and the currently trained model is determined as the hierarchical single-label prediction model. Here, the matched label of each sample data in each of the multiple sample datasets is the label of the sample data in the sample dataset that is not empty.

[0192] The functions performed by each component in the content tag prediction device provided in this disclosure have been described in detail in the above embodiments, and therefore will not be repeated here.

[0193] This disclosure provides a content tag prediction device that acquires multiple datasets and then obtains the tag prediction results for each piece of data in each of the multiple datasets. Based on all data in all datasets and the tag prediction results for each piece of data in each of the multiple datasets, a tag system is constructed. Then, based on the tag system and the tag prediction results for the first data in each of the multiple datasets, a first tag corresponding to the first data is predicted. In this method, the tags in the tag system can include inclusion or being included relationships, or mutually exclusive relationships at the same level. Finally, based on the tag system, the relationships between the tags in the tag prediction results for the first data in each of the multiple datasets can be determined. Then, based on the relationships between the tags, the most reasonable and accurate tags (groups) are selected to constitute the final tags.

[0194] like Figure 11 As shown, this embodiment of the present disclosure provides an electronic device, including a processor 111, a communication interface 112, a memory 113, and a communication bus 114, wherein the processor 111, the communication interface 112, and the memory 113 communicate with each other through the communication bus 114.

[0195] Memory 113 is used to store computer programs;

[0196] In one embodiment of this disclosure, when the processor 111 executes a program stored in the memory 113, it implements the tag prediction method provided in any of the foregoing method embodiments, the method comprising:

[0197] Obtain multiple datasets;

[0198] Each data point from multiple datasets is input into a pre-built hierarchical single-label prediction model to obtain the label prediction result for each data point in each of the multiple datasets.

[0199] A label system is constructed based on all data in all datasets and the label prediction results of each data point in each of the multiple datasets.

[0200] Based on the labeling system and the label prediction results of the first data in each of the multiple datasets, predict the final label corresponding to the first data, where the first data is any data in any of the multiple datasets.

[0201] Optionally, the hierarchical single-label prediction model includes a feature extraction layer, a preset number of hidden layers, a confusion layer, and a mapping layer, with one hidden layer corresponding to one dataset;

[0202] Each data point from multiple datasets is input into a pre-built hierarchical single-label prediction model to obtain the label prediction result for each data point in each of the multiple datasets. Specifically, this includes:

[0203] The feature vector of the first data in multiple datasets is extracted using a feature extraction layer;

[0204] The feature vectors are input into a preset number of hidden layers, and the first output vector corresponding to each hidden layer is obtained.

[0205] Concatenate all the first output vectors to obtain the concatenated vector;

[0206] Based on the concatenated vector and the first output vector corresponding to the first hidden layer, obtain the second output vector, where the first hidden layer is any one of the preset number of hidden layers;

[0207] Based on the second output vector, predict the label prediction result of the first data in the first dataset, where the first dataset is the dataset corresponding to the first hidden layer among multiple datasets.

[0208] Optionally, based on all data in all datasets, and the label prediction results for each data point in each of the multiple datasets, a label system is constructed, specifically including:

[0209] Group the second dataset from all datasets together with other datasets from multiple datasets to create multiple groups;

[0210] Based on the data in each group and the label prediction results of the data in each of the multiple datasets, a confusion matrix is ​​constructed. The confusion matrix is ​​used to indicate the association between the label of any data in the second dataset and the label of any data in the third dataset in other datasets. The second dataset is any dataset in all datasets, and the third dataset is any dataset in all datasets except the second dataset.

[0211] A label system is constructed based on the relationships between different labels in all confusion matrices.

[0212] Optionally, based on the data in each group and the label prediction results of the data in each of the multiple datasets, a confusion matrix is ​​constructed, specifically including:

[0213] Within the grouping, extract the first total data volume of the first label belonging to the second dataset, and extract the second total data volume of the second label belonging to the third dataset;

[0214] Determine the ratio between the first total data volume and the second total data volume;

[0215] Construct a confusion matrix corresponding to each group based on all the first labels, all the second labels, and the ratio between the total first data volume and the total second data volume.

[0216] Optionally, based on the labeling system and the label prediction results of the first data in all datasets, predict the final label corresponding to the first data, specifically including:

[0217] Based on the labeling system, determine the correlation between labels in the label prediction results of the first data across all datasets;

[0218] Based on the correlation, predict the final label corresponding to the first data.

[0219] Optionally, before inputting each data point from multiple datasets into a pre-built hierarchical single-label prediction model to obtain the label prediction result for each data point in each of the multiple datasets, the method further includes:

[0220] Obtain multiple sample datasets, each of which contains multiple sample data points, and each sample data point is labeled according to a preset annotation method;

[0221] Each sample data point is input into the hierarchical single-label initial model, which is the original model of the hierarchical single-label prediction model.

[0222] The hierarchical single-label initial model is trained using sample data from multiple sample datasets to obtain the label of the sample data in each of the multiple sample datasets.

[0223] The loss function is determined based on the total amount of sample data in multiple sample datasets, the number of sample datasets, each sample data, and the hit label of each sample data in each of the multiple sample datasets.

[0224] When the loss function meets the preset conditions, training of the hierarchical single-label initial model is stopped, and the currently trained model is determined to be the hierarchical single-label prediction model. In this model, the hit label of each sample data in each of the multiple sample datasets is the label of the sample data in the sample dataset that is not empty.

[0225] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a cloud server, implements the aforementioned functionality. Figures 6 to 10 The steps of the content tag prediction method provided in one or more method embodiments.

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

[0227] The above are merely specific embodiments of this disclosure, enabling those skilled in the art to understand or implement this disclosure. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this disclosure. Therefore, this disclosure is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A content tag prediction method, characterized in that, The method includes: Obtain multiple datasets; Each data point from the multiple datasets is input into a pre-built hierarchical single-label prediction model to obtain the label prediction result for each data point in each of the multiple datasets. A label system is constructed based on all the data in all the datasets, and the label prediction results of each data point in each of the multiple datasets; Based on the labeling system, determine the association between the labels in the label prediction results of the first data across all the datasets; Based on the association, predict the final label corresponding to the first data, wherein the first data is any one of the data in any one of the multiple datasets; The hierarchical single-label prediction model includes a feature extraction layer, a preset number of hidden layers, a confusion layer, and a mapping layer, wherein one hidden layer corresponds to one dataset. The step of inputting each data point from the multiple datasets into the pre-built hierarchical single-label prediction model, and obtaining the label prediction result for each data point in each of the multiple datasets, specifically includes: The feature extraction layer extracts the feature vector of the first data from the multiple datasets; The feature vectors are input into a preset number of hidden layers respectively, and a first output vector corresponding to each hidden layer is obtained; Concatenate all the first output vectors to obtain the concatenated vector; Based on the spliced ​​vector and the first output vector corresponding to the first hidden layer, a second output vector is obtained, wherein the first hidden layer is any one of the preset number of hidden layers; Based on the second output vector, predict the label prediction result of the first data in the first dataset, wherein the first dataset is the dataset corresponding to the first hidden layer among the plurality of datasets.

2. The method according to claim 1, characterized in that, The step of constructing a label system based on all the data in all the datasets, and the label prediction result of each data point in each of the multiple datasets, specifically includes: Each of the second datasets in the datasets is grouped with the other datasets in the datasets to create multiple groups; Based on the data in each group and the label prediction results of the data in each of the plurality of datasets, a confusion matrix is ​​constructed. The confusion matrix is ​​used to indicate the association between the label of any data in the second dataset and the label of any data in the third dataset of other datasets. The second dataset is any dataset in all the datasets, and the third dataset is any dataset in all the datasets except the second dataset. The label system is constructed based on the relationships between different labels in all the confusion matrices.

3. The method according to claim 2, characterized in that, Based on the data in each group and the label prediction results of the data in each of the plurality of datasets, a confusion matrix is ​​constructed, specifically including: In the grouping, the first total amount of data belonging to the first label in the second dataset is extracted, and the second total amount of data belonging to the second label in the third dataset is extracted; Determine the ratio between the first total data volume and the second total data volume; Based on all the first tags, all the second tags in the group, and the ratio between the total first data volume and the total second data volume, construct a confusion matrix corresponding to the group.

4. The method according to any one of claims 1-3, characterized in that, Before inputting each data point from the plurality of datasets into a pre-built hierarchical single-label prediction model to obtain the label prediction result for each data point in each of the plurality of datasets, the method further includes: Multiple sample datasets are obtained, each sample dataset includes multiple sample data, and each sample data is configured with data labels according to a preset annotation method; Each of the sample data is input into the hierarchical single-label initial model, which is the original model of the hierarchical single-label prediction model. The hierarchical single-label initial model is trained using the sample data from multiple sample datasets to obtain the label of the sample data in each of the multiple sample datasets; The loss function is determined based on the total amount of sample data in the multiple sample datasets, the number of sample datasets, each of the sample data, and the hit label of each of the sample data in each of the multiple sample datasets; When the loss function meets the preset conditions, training of the hierarchical single-label initial model is stopped, and the currently trained model is determined to be the hierarchical single-label prediction model. In this case, the hit label of each sample data in each of the multiple sample datasets is the label of the sample data in the sample dataset where the label is not empty.

5. A content tag prediction device, characterized in that, The device includes: The acquisition module is used to acquire multiple datasets; The processing module is used to input each piece of data from the multiple datasets into a pre-built hierarchical single-label prediction model to obtain the label prediction result of each piece of data in each of the multiple datasets. A construction module is used to construct a label system based on all the data in all the datasets and the label prediction results of each data in each of the multiple datasets; The prediction module is used to determine the association relationship between each label in the label prediction results of the first data in all the datasets according to the label system; and to predict the final label corresponding to the first data according to the association relationship, wherein the first data is any one of the data in any one of the multiple datasets; The hierarchical single-label prediction model includes a feature extraction layer, a preset number of hidden layers, a confusion layer, and a mapping layer, wherein one hidden layer corresponds to one dataset. The processing module is specifically used to extract the feature vector of the first data from the plurality of datasets through the feature extraction layer; The feature vectors are input into a preset number of hidden layers respectively, and a first output vector corresponding to each hidden layer is obtained; Concatenate all the first output vectors to obtain the concatenated vector; Based on the spliced ​​vector and the first output vector corresponding to the first hidden layer, a second output vector is obtained, wherein the first hidden layer is any one of the preset number of hidden layers; Based on the second output vector, predict the label prediction result of the first data in the first dataset, wherein the first dataset is the dataset corresponding to the first hidden layer among the plurality of datasets.

6. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the content tag prediction method according to any one of claims 1-4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by an electronic device, it implements the steps of the content tag prediction method as described in any one of claims 1-4.

Citation Information

Patent Citations

  • Label prediction method and device, equipment and storage medium

    CN113010705A

  • Entity label prediction method and device, equipment and storage medium

    CN114462390A