Target label screening method and device
By combining historical data and label correlation, combining and sorting label pairs, the problem of inaccurate target labels in the multi-label classification method is solved, which improves classification accuracy and adapts to different application needs.
Patent Information
- Application Number
- CN202411080055.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-03
AI Technical Summary
The existing multi-label classification method is not accurate enough when sieving target labels, especially ignoring the relationship between labels and the inability to effectively deal with the problem of tag imbalance when the number of tag categories is too large.
By combining historical data, considering the correlation between labels, multiple labels are combined into label pairs, and using calibration label pairs are divided and sorted, the target label is determined based on the preset proportion, using K-nearest neighbor algorithm and local sensitive hashing Algorithms or approximate nearest neighbor algorithms to improve classification accuracy.
Improve the accuracy of classification, enable more precise screening of labels that are most relevant to the instances to be predicted, and adapt to different application needs through flexible preset proportions.
Smart Images

Figure CN119066420A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a method and device for screening target tags. Background Art
[0002] With the development of the information society and the rapid increase in the amount of data, how to find the target data in the massive data is a hot topic of current research. In the related art, a solution using multi-label learning is disclosed. Among them, for example, Binary Relevance, this method transforms the multi-label learning problem into a "binary classification" problem for solution, and decomposes a multi-label problem into q binary classification problems (Binary Relevance uses the "one-vs-rest" method to construct a binary base classifier), and each category label corresponds to a sub-problem. In each sub-problem, if a sample has the category label corresponding to the sub-problem, then the sample is determined to be a positive sample, otherwise it is a negative sample. Another example is ML-kNN, which transforms the K-nearest neighbor algorithm with the "lazy learning" algorithm to adapt to multi-label data. It is a lazy algorithm used to solve multi-label classification problems. It uses the maximum a posteriori rule to determine whether an example is associated with each label.
[0003] However, when the ML-kNN algorithm is used to classify unknown samples, for all samples to be classified, as long as the number of samples of a certain category among their k nearest neighbors is equal, they will be classified as this category label with the same probability. This method ignores the position differences of different samples in the feature space. It cannot effectively utilize the relationship between multiple labels, and it cannot handle the serious label imbalance problem when the number of label categories is too large. Binary Relevance fails to consider the connection between labels, resulting in a certain degree of information loss.
[0004] Therefore, the classification method using related technologies has the problem that the screened target labels are not accurate enough. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for screening target labels, so as to at least solve the problem that the screened target labels in the classification method in the related art are not accurate enough.
[0006] According to an embodiment of the present invention, a method for screening target tags is provided, comprising:
[0007] Obtain one or more historical instances based on the instance to be predicted;
[0008] Obtaining a corresponding label based on the historical instance, wherein a mapping relationship is set between the historical instance and the label;
[0009] In the case where there are multiple tags, combining the multiple tags into a tag pair;
[0010] Using the calibration labels to divide the label pairs, obtaining a relevant label set and an irrelevant label set;
[0011] Sorting the tag pairs in the related tag set based on the tag classifier to obtain a sorting result;
[0012] The label corresponding to the sorting result is determined as the target label of the instance to be predicted according to a preset ratio.
[0013] Optionally, one or more historical instances are obtained based on the instance to be predicted, including:
[0014] One or more historical instances are obtained based on the instance to be predicted using at least one of the following algorithms: K-nearest neighbor algorithm, locality sensitive hashing algorithm LSH, approximate nearest neighbor algorithm ANN.
[0015] Optionally, in the case where there are multiple tags, combining the multiple tags into a tag pair includes:
[0016] Every two of the multiple tags are freely combined to obtain the tag pair.
[0017] Optionally, the label pairs are divided using the calibration labels to obtain a relevant label set and an irrelevant label set, including:
[0018] Each of the labels in the label pair is compared with the calibration label to obtain the relevant label set and the irrelevant label set.
[0019] Optionally, sorting the tag pairs in the related tag set based on the tag classifier to obtain a sorting result includes:
[0020] Obtaining the number of the tag pairs in the relevant tag set;
[0021] Determining the number of the label classifiers based on the number of the label pairs;
[0022] Using the label classifier to sort the labels in the label pair to obtain a sorting of the labels in the label pair;
[0023] The rankings of the tags within the tag pairs are summarized to obtain the ranking result.
[0024] Optionally, before obtaining the number of the tag pairs in the relevant tag set, the method includes:
[0025] Every two of the multiple tags in the related tag set are freely combined to obtain a new tag pair.
[0026] According to another embodiment of the present invention, there is also provided a target label screening device, comprising: a preprocessing module, configured to obtain one or more historical instances based on the instance to be predicted; and
[0027] Obtaining a corresponding label based on the historical instance, wherein a mapping relationship is set between the historical instance and the label; and
[0028] In the case where there are multiple tags, combining the multiple tags into a tag pair;
[0029] a sorting module, used to divide the tag pairs using the calibration tags to obtain a related tag set and an irrelevant tag set; and
[0030] Sorting the tag pairs in the related tag set based on the tag classifier to obtain a sorting result;
[0031] The determination module is used to determine, according to a preset ratio, that the label corresponding to the sorting result is the target label of the instance to be predicted.
[0032] Optionally, the device is also used to: use at least one of the following algorithms to obtain one or more historical instances based on the instance to be predicted: K-nearest neighbor algorithm, local sensitive hashing algorithm LSH, approximate nearest neighbor algorithm ANN.
[0033] Optionally, the device is further used to: freely combine every two of the multiple tags to obtain the tag pair.
[0034] Optionally, the device is further used to: compare each of the labels in the label pair with the calibration label respectively to obtain the relevant label set and the irrelevant label set.
[0035] Optionally, the device is further used to: obtain the number of the tag pairs in the relevant tag set;
[0036] Determining the number of the label classifiers based on the number of the label pairs;
[0037] Using the label classifier to sort the labels in the label pair to obtain a sorting of the labels in the label pair;
[0038] The rankings of the tags within the tag pairs are summarized to obtain the ranking result.
[0039] Optionally, the device is further used to: freely combine every two of the multiple tags in the related tag set to obtain a new tag pair.
[0040] According to yet another embodiment of the present invention, a computer-readable storage medium is provided, wherein a computer program is stored in the storage medium, wherein the computer program executes the steps in any of the above method embodiments when executed by a processor.
[0041] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0042] According to yet another embodiment of the present invention, a computer program product is provided, comprising computer instructions, which implement the steps in any of the above method embodiments when executed by a processor.
[0043] Through the embodiments of the present invention, by combining historical data, considering the correlation between labels, effectively dividing and sorting label pairs, and introducing a preset ratio to determine the target label, the problem of insufficient precision in screening target labels by multi-label classification methods in related technologies is effectively solved. This method not only improves the accuracy of classification, but also can adapt to different application requirements through flexible preset ratios. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0045] Figure 1 is a structural schematic diagram of a computer terminal for executing a method for screening target tags according to an embodiment of the present invention;
[0046] Figure 2 is a flow chart of a method for screening target tags according to an embodiment of the present invention;
[0047] Figure 3 is a flowchart of a method for obtaining a sorting result based on the sorting of tags within a tag pair according to an embodiment of the present invention;
[0048] Figure 4 is a schematic structural diagram of a target tag screening device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The present invention will be described in detail below with reference to the accompanying drawings and in combination with embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0050] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.
[0051] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a computer terminal as an example, Figure 1 is a schematic diagram of the structure of a computer terminal for executing a method for screening target tags according to an embodiment of the present invention. Figure 1 As shown, the computer terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data. Optionally, the computer terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is only for illustration and does not limit the structure of the above-mentioned computer terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.
[0052] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for screening target tags in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the computer terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0053] The transmission device 106 is used to receive or send data via a network. The specific example of the above network may include a wireless network provided by a communication provider of a computer terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a gateway so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.
[0054] In this embodiment, a method for screening target tags is provided. Figure 2 is a flow chart of a method for screening target tags according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0055] Step S201, obtaining one or more historical instances based on the instance to be predicted;
[0056] In an exemplary implementation, first, an embodiment of the present invention obtains one or more historical instances based on the instance to be predicted. This is different from the Binary Relevance method, which only focuses on the relationship between the current sample and the label without using historical data. The embodiment of the present invention can increase the accuracy of classification by using historical data, because historical data may contain useful information about the relationship between labels. Secondly, the instance to be predicted is real-time data, and data similar to the instance to be predicted can be found in the historical data, thereby converting the data processing of the instance to be predicted into the processing of historical data, which is conducive to obtaining results.
[0057] Step S202, obtaining corresponding labels based on historical instances, wherein a mapping relationship is set between historical instances and labels;
[0058] In an exemplary embodiment, there is a mapping relationship between historical instances and labels, which means that the algorithm can obtain the corresponding historical instances based on the instance to be predicted, and obtain the corresponding labels based on the historical instances, and then the processing object can be converted from the instance to be predicted to the label, which is beneficial to data processing.
[0059] Step S203, when there are multiple tags, combine the multiple tags into a tag pair;
[0060] Step S204, using the calibration labels to divide the label pairs to obtain a relevant label set and an irrelevant label set;
[0061] In an exemplary implementation, first, the embodiment of the present invention combines multiple labels into label pairs, which can fully and better understand the correlation between labels. This is compared with the ML-kNN method. The ML-kNN method may not be effective enough when dealing with label imbalance problems because it does not consider the correlation between labels. Secondly, these label pairs are divided into relevant label sets and irrelevant label sets using calibration labels. This method allows the algorithm to identify which label pairs are valid labels and which are invalid labels. For example, the labels in the relevant label set are valid labels and can be further screened. The irrelevant label set is an invalid label and can be directly ignored. Therefore, the accuracy of classification can be improved.
[0062] Step S205, sorting the tag pairs in the relevant tag set based on the tag classifier to obtain a sorting result;
[0063] In an exemplary implementation, based on a label classifier, the embodiment of the present invention sorts the label pairs in the relevant label set, and then determines the label corresponding to the sorting result as the target label of the instance to be predicted according to a preset ratio. This sorting mechanism can more accurately screen out the label most relevant to the instance to be predicted, rather than simply based on binary classification or K-nearest neighbor algorithm.
[0064] Step S206: Determine the label corresponding to the sorting result as the target label of the instance to be predicted according to a preset ratio.
[0065] In an exemplary embodiment, the target label is determined by a preset ratio, which can flexibly adjust the strictness of the classification result to adapt to different application scenarios and requirements.
[0066] Through the above steps S201 to S206, the embodiment of the present invention effectively solves the problem of inaccurate target label screening in the prior art multi-label classification method by combining historical data, considering the correlation between labels, effectively dividing and sorting label pairs, and introducing a preset ratio to determine the target label. This method not only improves the accuracy of classification, but also can adapt to different application requirements through flexible preset ratios.
[0067] In one implementation, obtaining one or more historical instances based on the instance to be predicted includes:
[0068] One or more historical instances are obtained based on the instance to be predicted using at least one of the following algorithms: K-nearest neighbor algorithm, locality sensitive hashing algorithm LSH, approximate nearest neighbor algorithm ANN.
[0069] In an exemplary implementation, for example, the K-nearest neighbor algorithm may be used in the following manner:
[0070] Data preprocessing:
[0071] Clean the data to remove noise and outliers.
[0072] Standardize or normalize features to eliminate the effects of different dimensions.
[0073] Select K value:
[0074] Determine the K value in the K-nearest neighbor algorithm, that is, consider the K historical instances closest to the instance to be predicted.
[0075] Calculate distance:
[0076] For each historical instance in the data set, the distance between it and the instance to be predicted is calculated. For example, the distance measurement methods that can be used include: Euclidean distance, Manhattan distance, etc.
[0077] Select nearest neighbor:
[0078] According to the calculated distance, the K historical instances with the closest distance are selected as neighbors of the instance to be predicted.
[0079] Weight distribution (optional):
[0080] Different weights can be assigned to the K neighbors, usually the closer the neighbors are, the larger the weights are. The weights can be the inverse of the distance or other functions.
[0081] Label allocation:
[0082] Predict the label of the instance to be predicted based on the labels of its K neighbors. This can be done by majority voting, weighted voting, or using other more complex methods.
[0083] Handling multi-label situations:
[0084] If it is a multi-label classification problem, each neighbor may correspond to multiple labels. Therefore, the vote or weight of the neighbor can be calculated separately for each label.
[0085] Iterative Optimization:
[0086] Adjust the K value or other parameters based on the model's performance on the validation set to optimize model performance.
[0087] Apply to new instances:
[0088] Apply the trained model to the new instance to be predicted, obtain its K nearest neighbors, and make label predictions based on them.
[0089] The following is a code example of an exemplary K-nearest neighbor algorithm:
[0090]
[0091]
[0092] For example, the local sensitive hashing algorithm LSH can be used in the following way:
[0093] Choose a hash function:
[0094] Select or design a set of locality-sensitive hash functions that have a higher probability of producing the same hash value for points that are close to each other.
[0095] Determine the bucket size:
[0096] Determine the bucket size, that is, the capacity of each hash table. The bucket size affects the accuracy and efficiency of the search.
[0097] Data preprocessing:
[0098] Preprocess historical instances, including cleaning data and standardizing or normalizing features.
[0099] Build the hash table:
[0100] The historical instances are mapped into a hash table using the selected hash function. Each instance is assigned to a bucket based on the hash value.
[0101] The hash of the instance to be predicted:
[0102] Apply the same hash function to the instance to be predicted to obtain its hash value.
[0103] Search for candidate neighbors:
[0104] According to the hash value of the instance to be predicted, the bucket where it is located and possible neighboring buckets are retrieved. This step can increase the probability of finding the approximate nearest neighbor by adding a way to retrieve multiple buckets.
[0105] Calculate distance:
[0106] For the retrieved candidate neighbor instances, calculate the actual distance between them and the instance to be predicted.
[0107] Select nearest neighbor:
[0108] According to the calculated distance, the K instances with the closest distance are selected as the approximate nearest neighbors of the instance to be predicted.
[0109] Iterative Optimization:
[0110] Adjust parameters such as bucket size, number and type of hash functions based on the model's performance on the validation set to optimize model performance.
[0111] Apply to new instances:
[0112] Apply the trained LSH model to the new instance to be predicted, obtain its approximate nearest neighbor, and perform further processing or analysis based on it.
[0113] The following is a code example of an exemplary LSH algorithm:
[0114]
[0115]
[0116] For another example, the approximate nearest neighbor algorithm ANN can be used in the following way:
[0117] Choose a suitable ANN algorithm:
[0118] Select a suitable approximate nearest neighbor algorithm, such as quantization, KD tree (K-DimensionalTree), etc.
[0119] Data preprocessing:
[0120] Preprocess historical examples, including cleaning data and standardizing or normalizing features, to ensure the effectiveness of the algorithm.
[0121] Build index:
[0122] The index is built using the selected ANN algorithm, which may involve partitioning the dataset into multiple clusters or using a hash function to map the data into a low-dimensional space.
[0123] Determine the search parameters:
[0124] Determine the parameters used when searching, such as search depth, number of iterations, or accuracy threshold.
[0125] Preprocessing of the instance to be predicted:
[0126] The same preprocessing steps are performed on the predicted instances as on the historical instances.
[0127] Perform an ANN search:
[0128] Using the constructed index and the determined search parameters, perform ANN search on the instances to be predicted.
[0129] Get candidate neighbors:
[0130] The ANN search will return a set of candidate neighbors that are the approximate nearest neighbors of the instance to be predicted.
[0131] Verify and select:
[0132] If necessary, these candidate neighbors can be further verified to select the most relevant instances. For example, the best approximate nearest neighbor can be selected by calculating the exact distance.
[0133] Iterative Optimization:
[0134] Adjust search parameters or index building methods based on the model's performance on the validation set to optimize model performance.
[0135] Apply to new instances:
[0136] Apply the optimized ANN model to the new instance to be predicted, obtain its approximate nearest neighbors, and perform further processing or analysis based on it.
[0137] The following is a code example of an exemplary ANN algorithm:
[0138]
[0139]
[0140]
[0141] In one implementation, when there are multiple tags, the multiple tags are combined into a tag pair, including:
[0142] Each two labels among the multiple labels are freely combined to obtain a label pair.
[0143] In an exemplary embodiment, for example, multiple labels include: A, B, C, D, then A, B, C, D can be freely combined to obtain label pair 1: AB, label pair 2: AC, label pair 3: AD, label pair 4: BC, label pair 5: BD, label pair 6: CD.
[0144] In one implementation, using the calibration labels to divide the label pairs to obtain a relevant label set and an irrelevant label set includes:
[0145] Each label in a label pair is compared with the calibration label to obtain a set of relevant labels and a set of irrelevant labels.
[0146] In an exemplary embodiment, the calibration label λ is used as a reference, and A in label pair 1: AB is compared with the calibration label λ. When it is determined that the similarity between A and the calibration label λ is greater than or equal to the first threshold, A is determined as an element of the relevant label set. When it is determined that the similarity between A and the calibration label λ is less than the first threshold, A is determined as an element of the irrelevant label set. Similarly, B in label pair 1: AB is compared with the calibration label λ. When it is determined that the similarity between B and the calibration label λ is greater than or equal to the first threshold, B is determined as an element of the relevant label set. When it is determined that the similarity between B and the calibration label λ is less than the first threshold, B is determined as an element of the irrelevant label set. Similarly, the labels in label pair 2: AC, label pair 3: AD, label pair 4: BC, label pair 5: BD, and label pair 6: CD are respectively compared with the calibration label λ to obtain the relevant label set and the irrelevant label set. Among them, the first threshold can be set based on the actual situation, and the embodiment of the present invention does not limit it.
[0147] Figure 3 is a flow chart of a method for obtaining a sorting result based on the sorting of tags within a tag pair according to an embodiment of the present invention. In one implementation, Figure 3 As shown, based on the label classifier, the label pairs in the relevant label set are sorted to obtain the sorting results, including:
[0148] Step S301, obtaining the number of tag pairs in the relevant tag set;
[0149] In an exemplary implementation, for example, if the labels in the relevant label set are A, B, and C, three label pairs may be formed, namely: label pair 1: AB, label pair 2: AC, and label pair 3: BC.
[0150] Step S302, determining the number of label classifiers based on the number of label pairs;
[0151] In an exemplary implementation, when the label pairs in the relevant label set are obtained as: label pair 1: AB, label pair 2: AC, label pair 3: BC, label classifier 1, label classifier 2, label classifier 3 are determined.
[0152] Step S303, using a label classifier to sort the labels in the label pair to obtain a sorting of the labels in the label pair;
[0153] In an exemplary embodiment, label classifier 1 is used to sort label pair 1: AB, for example, A is before B. Label classifier 2 is used to sort label pair 1: BC, for example, B is before C. Label classifier 3 is used to sort label pair 3: AC, for example, A is before C.
[0154] Step S304: Summarize the order of tags within the tag pair to obtain an order result.
[0155] In an exemplary embodiment, in the obtained related tag set, for example, when the tags in the tag pair are sorted as: A before B, B before C, and A before C, then the sorting result can be determined to be A, B, C. For example, if the target tags that need to be confirmed finally account for 66.67% of the sorting result, then A and B can be confirmed as the target tags.
[0156] In an exemplary embodiment, for example, the historical feature data of customer A from the time of account opening to the present includes but is not limited to: customer transaction records, risk preferences, life stages, basic customer information, etc. After the above method, the ranking result obtained is: customer A may purchase general financial products (for example, label A: fund, label B: financial management, label C: Anyi deposit, label D: Ancunbao) in the next 3 months. Therefore, the account manager can recommend to customer A related products such as label A: fund, label B: financial management, label C: Anyi deposit, label D: Ancunbao, etc. Of course, the above are only examples, and the embodiments of the present application are not limited to achieving the above purpose.
[0157] In one implementation, before obtaining the number of tag pairs in the relevant tag set, the method includes:
[0158] Every two labels in the multiple labels in the related label set are freely combined to obtain a new label pair.
[0159] In an exemplary implementation, for example, the labels divided into the relevant label set are: label A, label C, label H, then label A, label C, label H can be recombined to obtain label pair AC, label pair AH, label pair CH, then label classifier 4 can be used to sort label pair AC, label classifier 5 can be used to sort label pair AH, and label classifier 6 can be used to sort label pair CH to obtain the sorting result.
[0160] In one embodiment, the method further comprises:
[0161] Responsive to parameter input of the calibration tag to obtain the calibration tag.
[0162] In an exemplary embodiment, the calibration tag may be determined based on manually input parameters, and the computer terminal generates the calibration tag in response to the manually input parameters, so as to use the calibration tag as a reference.
[0163] According to another embodiment of the present invention, a target tag screening device is provided. Figure 4 is a schematic diagram of the structure of a screening device for target tags according to an embodiment of the present invention. Figure 4As shown, the device comprises:
[0164] A preprocessing module 41 is used to obtain one or more historical instances based on the instance to be predicted; and
[0165] Obtain corresponding labels based on historical instances, wherein a mapping relationship is set between historical instances and labels; and
[0166] In the case of multiple labels, multiple labels are combined into a label pair;
[0167] A sorting module 42 is used to divide the tag pairs using the calibration tags to obtain a related tag set and an irrelevant tag set; and
[0168] Sort the label pairs in the relevant label set based on the label classifier to obtain a sorting result;
[0169] The determination module 43 is used to determine, according to a preset ratio, that the label corresponding to the sorting result is the target label of the instance to be predicted.
[0170] In one embodiment, the device is also used to: use at least one of the following algorithms to obtain one or more historical instances based on the instance to be predicted: K-nearest neighbor algorithm, local sensitive hashing algorithm LSH, approximate nearest neighbor algorithm ANN.
[0171] In one embodiment, the device is further used to: freely combine every two tags among the multiple tags to obtain a tag pair.
[0172] In one embodiment, the device is further used to: compare each label in the label pair with the calibration label to obtain a relevant label set and an irrelevant label set.
[0173] In one embodiment, the apparatus is further used to: obtain the number of tag pairs in the relevant tag set;
[0174] Determining the number of label classifiers based on the number of label pairs;
[0175] Use the label classifier to sort the labels in the label pair to obtain the sorting of the labels in the label pair;
[0176] Sum up the ordering of tags within a tag pair to get a sorted result.
[0177] In one embodiment, the device is further used to: freely combine every two tags among the multiple tags in the related tag set to obtain a new tag pair.
[0178] In one embodiment, the device is further used to: respond to parameter input of the calibration tag to obtain the calibration tag.
[0179] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0180] An embodiment of the present invention further provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above method embodiments are executed.
[0181] In one implementation, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0182] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0183] An embodiment of the present invention further provides a computer program product, including computer instructions, which, when executed by a processor, implement the steps of the method described in each embodiment of the present invention.
[0184] In one implementation manner, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment will not be described in detail herein.
[0185] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, and optionally, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0186] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for screening target tags, It is characterized in that include: Obtain one or more historical instances based on the instance to be predicted; Obtaining a corresponding label based on the historical instance, wherein a mapping relationship is set between the historical instance and the label; In the case where there are multiple tags, combining the multiple tags into a tag pair; Using the calibration labels to divide the label pairs, obtaining a relevant label set and an irrelevant label set; Sorting the tag pairs in the related tag set based on the tag classifier to obtain a sorting result; The label corresponding to the sorting result is determined as the target label of the instance to be predicted according to a preset ratio.
2. The method according to claim 1, It is characterized in that Based on the instance to be predicted, one or more historical instances are obtained, including: One or more historical instances are obtained based on the instance to be predicted using at least one of the following algorithms: K-nearest neighbor algorithm, locality sensitive hashing algorithm LSH, approximate nearest neighbor algorithm ANN.
3. The method according to claim 1, It is characterized in that In the case where there are multiple tags, combining the multiple tags into a tag pair includes: Every two of the multiple tags are freely combined to obtain the tag pair.
4. The method according to claim 1, It is characterized in that The label pairs are divided using the calibration labels to obtain a relevant label set and an irrelevant label set, including: Each of the labels in the label pair is compared with the calibration label to obtain the relevant label set and the irrelevant label set.
5. The method according to claim 1, It is characterized in that Sorting the tag pairs in the related tag set based on the tag classifier to obtain a sorting result includes: Obtaining the number of the tag pairs in the relevant tag set; Determining the number of the label classifiers based on the number of the label pairs; Using the label classifier to sort the labels in the label pair to obtain a sorting of the labels in the label pair; The rankings of the tags within the tag pairs are summarized to obtain the ranking result.
6. The method according to claim 5, It is characterized in that Before obtaining the number of the tag pairs in the relevant tag set, the method includes: Every two of the multiple tags in the related tag set are freely combined to obtain a new tag pair.
7. A screening device for target tags, It is characterized in that include: A preprocessing module, used to obtain one or more historical instances based on the instance to be predicted; as well as, Obtaining a corresponding label based on the historical instance, wherein a mapping relationship is set between the historical instance and the label; and In the case where there are multiple tags, combining the multiple tags into a tag pair; a sorting module, used to divide the tag pairs using the calibration tags to obtain a related tag set and an irrelevant tag set; and Sorting the tag pairs in the related tag set based on the tag classifier to obtain a sorting result; The determination module is used to determine, according to a preset ratio, that the label corresponding to the sorting result is the target label of the instance to be predicted.
8. A computer-readable storage medium, It is characterized in that The storage medium stores a computer program, wherein the computer program executes the steps of the method described in any one of claims 1 to 6 when executed by a processor.
9. An electronic device comprising a memory and a processor, It is characterized in that A computer program is stored in the memory, and the processor is configured to run the computer program to perform the steps of the method according to any one of claims 1 to 6.
10. A computer program product comprising computer instructions, It is characterized in that When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
