Classification method and device

By using the fusion technology of network logs and classification models, search request classification is automatically performed, and the problems of high cost and low efficiency of manual labeling in the existing technology are solved, and fast and accurate user demand classification is achieved.

CN115146123BActive Publication Date: 2025-04-11BEIJING BAIDU NETCOM SCI & TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210774777.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-09-29
Publication Date
2025-04-11
Estimated Expiration
2039-09-29

AI Technical Summary

Technical Problem

When classifying user search requests, the prior art requires manual labeling of large numbers of samples, resulting in high cost and low efficiency, making it difficult to quickly adapt to diverse user needs.

Method used

The search request sample is obtained by recording the network logs of search behavior, and the classification model and the results of network log data calculation are fused to automatically obtain the classification of the target content.

Benefits of technology

It realizes that more accurate search request classification results can be obtained without manual annotation, reduces manpower, time and economic costs, and can quickly reflect changes in user needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115146123B_ABST
    Figure CN115146123B_ABST
Patent Text Reader

Abstract

The present application discloses a classification method and device, which relates to the computer field, and in particular to the network search field. The specific implementation scheme is: obtaining a search request sample based on a network log that records search behavior; the search request sample is a request sample for video access to the same target content; the search request sample includes a search request; the search request sample is input into a classification model to obtain a first classification result; a second classification result is obtained based on the number of search requests included in each classification and the total number of search requests in the search request sample; the classification of the target content is obtained based on the first classification result and the second classification result. The embodiment of the present application can realize the classification of the target content corresponding to the search request, and can obtain a classification result that conforms to user habits and actual network access conditions.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the Chinese patent application with the application date of September 29, 2019, application number 201910935860.7, and invention name “Classification method and device”. Technical Field

[0002] The present application relates to the field of computers, and in particular to the field of network searching. Background Art

[0003] In order to better meet the needs of users, commercial search engines need to identify the categories of user queries (requests), such as gourmet cooking, singing and dancing, football, etc. After identifying the user's demand category, in the process of recalling and sorting the search results, the results that better meet the user's needs are prioritized in the sorting by using this classification result.

[0004] Traditional search request classification is based on web page search. In recent years, there are more and more rich media resources on the Internet, and users' search query needs are also increasing and diversified. For example, machine learning algorithms are used to fit the search query requirements (query) categories based on manual annotation using the title, content and site information of web pages. However, using machine learning algorithms to classify search query requirements requires manual annotation of a large number of samples, which consumes a lot of manpower, time and economic costs. Summary of the invention

[0005] In order to solve the problems in the prior art, the present application provides a classification method and device.

[0006] In a first aspect, the present application provides a classification method, comprising:

[0007] Obtaining a search request sample based on a network log recording search behavior; the search request sample is a request sample for accessing videos related to the same target content; the search request sample includes a search request;

[0008] Inputting the search request sample into a classification model to obtain a first classification result;

[0009] Obtaining a second classification result according to the number of search requests included in each classification and the total number of search requests in the search request sample;

[0010] According to the first classification result and the second classification result, a classification of the target content is obtained.

[0011] In an embodiment of the present application, a search request sample is obtained through a network log, and what is obtained is a record of the user's real search behavior, so that the main demand and the secondary demand can be distinguished under multiple demands, and through automatic classification processing, the problem of a huge classification system and difficult classification can be solved. The classification result output by the model and the classification result calculated according to the actual data of the network log have a complementary effect. The second classification result obtained by directly calculating the search request sample obtained from the network log can reflect the changes in the classification corresponding to the target content more quickly. The first classification result obtained using the model has a higher accuracy for low-frequency data. Therefore, through the classification method provided in the embodiment of the present application, a more accurate classification result can be obtained.

[0012] In one implementation, the first classification result is a first score that the target content belongs to the first category, and the second classification result is a second score that the target content belongs to the first category. According to the first classification result and the second classification result, obtaining the classification of the target content includes:

[0013] Linearly weight the first classification result and the second classification result to obtain the classification of the target content.

[0014] The embodiment of the present application can combine the two classification results to obtain the classification of the target content, thereby improving the accuracy of the classification.

[0015] In one implementation, obtaining a search request sample based on a network log recording search behavior includes:

[0016] Obtain search request samples based on user demand information in network logs;

[0017] The target content is classified into categories related to user demand information.

[0018] The embodiment of the present application utilizes user demand information to classify target content, so that the classification result better meets user needs.

[0019] In one embodiment, after obtaining the classification of the target content according to the first classification result and the second classification result, the method further includes:

[0020] According to the classification of the target content and the classification of the search results related to the target content, the order of the search results in the search result list of the target content is determined.

[0021] In an embodiment of the present application, the order of search results in a search result list is determined based on the classification of target content and the classification of search results related to the target content, so that the order of search results can be more in line with the needs of general users.

[0022] In one implementation, obtaining a search request sample based on a network log recording search behavior includes:

[0023] Obtain raw request samples from network logs;

[0024] Filtering the search requests whose confidence rates are lower than a first set threshold in the original request samples to obtain a first request sample;

[0025] If the number of search requests for the target content in the first request sample exceeds a set second threshold, resampling the target content to obtain a supplementary sample of the target content;

[0026] Adding the supplementary sample of the target content to the first request sample to obtain a second request sample;

[0027] According to the second request sample, a sample word number and a named entity recognition number are obtained; the named entity recognition number is obtained by performing entity name recognition on the second request sample;

[0028] A search request sample is obtained according to the sample word number and the named entity recognition number.

[0029] In an embodiment of the present application, the sample of the target content is expanded according to the number or proportion of search requests corresponding to the target content in the network log, so that the classification operation of the popular search content can be performed based on more sample data.

[0030] In one embodiment, the confidence rate is calculated based on at least one of the search frequency, the click frequency, and the click frequency of the main category.

[0031] In the embodiment of the present application, filtering out search requests with relatively low retrieval frequency, click frequency and main category frequency can improve the confidence rate of the sample.

[0032] In one implementation, inputting a search request sample into a classification model to obtain a first classification result includes:

[0033] Perform embedding operation on sample word number and named entity recognition number to obtain vector result;

[0034] Average the vector results to obtain the implicit variable;

[0035] Convert latent variables to first-class outcomes.

[0036] In the embodiment of the present application, through vector calculation, a classification result that is closer to the search user selection trend in actual operation can be obtained.

[0037] In one embodiment, the method further comprises:

[0038] Input one or more sets of training samples into the classification model, and obtain that each set of training samples belongs to the corresponding prediction category;

[0039] Calculate the loss value based on the corresponding prediction category of each group of training samples;

[0040] Optimize the classification model based on the loss value.

[0041] In the embodiment of the present application, the classification model is trained using multiple groups of samples, which can continuously optimize the classification model and improve the classification accuracy of the classification model.

[0042] In a second aspect, an embodiment of the present application provides a classification device, including:

[0043] Search request sample acquisition module: used to obtain search request samples according to the network log recording the search behavior; the search request samples are request samples for accessing videos related to the same target content; the search request samples include search requests;

[0044] A first classification module: used for inputting the search request sample into a classification model to obtain a first classification result;

[0045] A second classification module: used for obtaining a second classification result according to the number of search requests included in each classification and the total number of search requests in the search request sample;

[0046] Fusion module: used to obtain the classification of the target content according to the first classification result and the second classification result.

[0047] In one implementation, the first classification result is a first score that the target content belongs to the first category, the second classification result is a second score that the target content belongs to the first category, and the fusion module is further used to:

[0048] Linearly weighting the first classification result and the second classification result to obtain a classification of the target content.

[0049] In one implementation, the search request sample obtaining module is further used to:

[0050] Obtaining the search request sample according to the user demand information in the network log;

[0051] The target content is classified into categories related to the user demand information.

[0052] In one embodiment, the device further comprises:

[0053] Sorting module: used to determine the order of the search results in the search result list of the target content according to the classification of the target content and the classification of the search results related to the target content.

[0054] In one implementation, the search request sample obtaining module includes:

[0055] Original request sample unit: used to obtain original request samples based on network logs;

[0056] A filtering unit: used to filter the search requests whose confidence rate is lower than a first set threshold in the original request sample to obtain a first request sample;

[0057] A resampling unit: configured to resample the target content to obtain a supplementary sample of the target content if the number of search requests for the target content in the first request sample exceeds a set second threshold;

[0058] Supplementing unit: adding the supplementary sample of the target content to the first request sample to obtain the second request sample;

[0059] An input feature acquisition unit is used to obtain a sample word number and a named entity recognition number according to the second request sample; the named entity recognition number is obtained by performing entity name recognition on the second request sample;

[0060] Number processing unit: used to obtain search request samples according to sample word numbers and named entity recognition numbers.

[0061] In one embodiment, the confidence rate is calculated based on at least one of the search frequency, the click frequency, and the click frequency of the main category.

[0062] In one embodiment, the first classification module includes:

[0063] Embedding unit: used to embed sample word numbers and named entity recognition numbers to obtain vector results;

[0064] Averaging unit: used to average the vector results to obtain implicit variables;

[0065] Conversion unit: used to convert latent variables into the first classification results.

[0066] In one embodiment, the device further comprises:

[0067] Training sample prediction module: used to input one or more training samples into the classification model to obtain the corresponding prediction category of each training sample;

[0068] Loss calculation module: used to calculate the loss value according to the corresponding prediction category of each group of training samples;

[0069] Loss optimization module: used to optimize the classification model according to the loss value.

[0070] In a third aspect, an embodiment of the present application provides a computer program product, including a computer program / instructions, which implement the method as described above when executed by a processor.

[0071] One embodiment of the above application has the following advantages or beneficial effects: it is possible to classify search requests. Because the classification technical means of combining the model output results and the data calculation results to obtain the target content corresponding to the search request is adopted, the technical problem of difficulty in obtaining accurate search request classification is overcome, thereby achieving the technical effect of providing more accurate search results for search users.

[0072] Other effects of the above optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0073] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0074] Figure 1 is a schematic diagram of a classification method according to the first embodiment of the present application;

[0075] Figure 2 is a schematic diagram of a classification method according to a second embodiment of the present application;

[0076] Figure 3 is a schematic diagram of a video classification system according to a third embodiment of the present application;

[0077] Figure 4 is a schematic diagram of data processing according to the fourth embodiment of the present application;

[0078] Figure 5 is a schematic diagram of a classification method according to a fifth embodiment of the present application;

[0079] Figure 6 is a schematic diagram of a classification method according to a sixth embodiment of the present application;

[0080] Figure 7 is a schematic diagram of a classification device according to a seventh embodiment of the present application;

[0081] Figure 8 is a schematic diagram of a classification device according to an eighth embodiment of the present application;

[0082] Fig. 9 is a schematic diagram of a classification device according to a ninth embodiment of the present application;

[0083] Fig.10 It is a block diagram of an electronic device used to implement the classification method of an embodiment of the present application. DETAILED DESCRIPTION

[0084] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0085] The present application embodiment provides a classification method, such as Figure 1 As shown, including:

[0086] Step S11: obtaining a search request sample according to a network log recording search behavior; the search request sample is a request sample for accessing videos related to the same target content; the search request sample includes a search request.

[0087] Step S12: Input the search request sample into the classification model to obtain a first classification result.

[0088] Step S13: Obtain a second classification result according to the number of search requests included in each classification and the total number of search requests in the search request sample.

[0089] Step S14: Obtaining a classification of the target content according to the first classification result and the second classification result.

[0090] In the embodiment of the present application, the search request sample is obtained through the network log, and the user's real search behavior record is obtained, so that the main demand and the secondary demand can be distinguished under multiple demands, thereby solving the problem of huge classification system and difficult classification. The classification result output by the model and the classification result calculated according to the actual data of the network log have a complementary effect. With the development of the network, many contents will have new meanings, and the corresponding classifications will also change accordingly. The second classification result directly calculated according to the search request sample obtained from the network log can reflect the changes in the classification corresponding to the target content more quickly. The first classification result obtained by using the model has higher accuracy for low-frequency data. Therefore, through the classification method provided by the embodiment of the present application, a more accurate classification result can be obtained without manual labeling, which can save a lot of manpower, time and economic costs.

[0091] In the embodiment of the present application, the search request sample is a part of all search requests and may include more than one search request. Considering that the target content may be rarely searched in some cases, the search request sample may also be an empty set, not including any actual search request. For example, the search request sample may include:

[0092] Target content: A’s song; Number of clicks: 56; Click categories: celebrity peripherals 88%, singing 4%.

[0093] In the embodiment of the present application, the network log may include request samples based on multiple target contents. In the search engine, after the search user initiates a search through the search engine, the click behavior on the search result will be recorded in the background network log.

[0094] In this embodiment, the target content may be the searched content, for example, if the user searches for "apple" on a search engine, the target content is "apple". The search request sample may include the target content and the search result corresponding to the click operation on the search result interface of the corresponding target content.

[0095] In the embodiment of the present application, the target content may include a search term for searching for videos. The corresponding search request sample includes the search term, namely the target content, and a video selected in the search results after searching for the target content.

[0096] In the embodiment of the present application, the first classification result and the second classification result may be the proportion or probability that the target content belongs to one or more categories. For example, among 100 search requests with the target content being "apple", according to the records in the network log, the search results selected by 80 search requests are Apple Inc., and the search results selected by 20 search requests are fruits. The classification results may be: 20% for fruits, 80% for brands.

[0097] In the embodiment of the present application, the second classification result may be a result obtained by mathematical calculation based on the search request sample of the network log, the ratio formula may include a simple ratio calculation formula, and the second classification result may include the distribution ratio of each classification. For example, among 100 search requests with the target content being "apple", 80 search requests correspond to the search results selected as Apple, then the calculated second classification result may include: brand 80%.

[0098] In one example, a sample search request may include:

[0099] Target content: A’s song; Number of clicks: 56; Click categories: celebrity peripherals 88%, singing 4%.

[0100] Then input the search request sample into the classification model and obtain the first classification result:

[0101] Category: Celebrity surrounding 92%, singing 8%.

[0102] According to the search request sample and the simple ratio formula, the second classification result is obtained:

[0103] Category: Celebrity surrounding 88%, singing 4%.

[0104] According to the first classification result and the second classification result, the classification of the target content is obtained:

[0105] Category: Celebrity surrounding 90%, singing 7%.

[0106] In one implementation, the first classification result is a first score that the target content belongs to the first category, and the second classification result is a second score that the target content belongs to the first category. According to the first classification result and the second classification result, obtaining the classification of the target content includes:

[0107] Linearly weight the first classification result and the second classification result to obtain the classification of the target content.

[0108] The embodiment of the present application can combine the two classification results to obtain the classification of the target content, thereby improving the accuracy of the classification.

[0109] In one implementation, obtaining a search request sample based on a network log recording search behavior includes:

[0110] Obtain search request samples based on user demand information in network logs;

[0111] The target content is classified into categories related to user demand information.

[0112] The embodiment of the present application utilizes user demand information to classify target content, so that the classification result better meets user needs.

[0113] In one embodiment, Figure 2 As shown, after obtaining the classification of the target content according to the first classification result and the second classification result, the method further includes:

[0114] Step S21: Determine the order of the search results in the search result list of the target content according to the category of the target content and the category of the search results related to the target content.

[0115] In an embodiment of the present application, the order of search results in a search result list is determined based on the classification of target content and the classification of search results related to the target content, so that the order of search results can be more in line with the needs of general users.

[0116] For example, for most search engine users, when searching for the target content "Apple", they hope to search for some relevant information about electronic product brands. Then the classification of this target content may mainly include electronic product brands, electronic product manufacturers, etc. On the search results page, the search results related to "Apple" may be sorted in a manner that the electronic product brands are sorted first.

[0117] In an embodiment of the present application, before sorting the search results, it is also necessary to classify the search results and determine the category of the search results. The search results can be classified by a model, and the output result of the classification of the search results can be the probability that the search results belong to a certain category. For example, the probability that search result A belongs to an electronic product brand is 20%. When sorting, the search results can be sorted in combination with the classification of the search results and the classification of the target content. For example, the classification corresponding to the target content "apple" includes: electronic products 80%, fruits 20%, indicating that in the search requests with the search content "apple", 80% of the search requests are for electronic products and 20% of the search requests are for fruits. For link A corresponding to a certain search result, the probability of 80% belonging to the electronic product category and the probability of 20% belonging to the fruit category, then the ranking of link A on the search results page is determined in combination with the classification of the search content and the classification of the search results.

[0118] In the embodiment of the present application, if the search result is a video, the classification of the video can be obtained using an existing video classification model. Figure 3 The video classification model shown in the figure classifies the video. The video to be classified is divided into an image part (RGB) and an audio part (Audio), and input into the video classification model. In the bidirectional sequence model layer (Bi-directional Sequence Model) 31, the image part and the audio part are converted into vectors. In the first string connection function layer (Concatenate) 32, the vectors converted from the image part and the vectors converted from the audio part are spliced ​​respectively. Then, the vectors are weighted in the attention layer (Attention) 33 to obtain the weighted vector of the image part and the weighted vector of the audio part respectively. The weighted vector of the image part and the weighted vector of the audio part are spliced ​​again in the second string connection function layer (Concatenate) 34. Then, two full-link layers 35 perform full-link operations. Finally, the classification is performed in the logistic regression function layer (Sigmoid) 36 to obtain the video classification. The video is divided into image and audio, and the models are respectively built. Finally, unified training is obtained during classification to make full use of the multimodal information of the video.

[0119] In one implementation, obtaining a search request sample based on a network log recording search behavior includes:

[0120] Obtain raw request samples from network logs;

[0121] Filtering the search requests whose confidence rates are lower than a first set threshold in the original request samples to obtain a first request sample;

[0122] If the number of search requests for the target content in the first request sample exceeds a set second threshold, resampling the target content to obtain a supplementary sample of the target content;

[0123] Adding the supplementary sample of the target content to the first request sample to obtain a second request sample;

[0124] According to the second request sample, a sample word number and a named entity recognition number are obtained; the named entity recognition number is obtained by performing entity name recognition on the second request sample;

[0125] A search request sample is obtained according to the sample word number and the named entity recognition number.

[0126] In an embodiment of the present application, the sample of the target content is expanded according to the number or proportion of search requests corresponding to the target content in the network log, so that the classification operation of the popular search content can be performed based on more sample data.

[0127] In actual network logs, there may be data with no reference value, such as click errors. Therefore, filtering some data with low confidence in the original request samples in the network logs can improve the sample confidence rate.

[0128] In the embodiment of the present application, the sample word number can be obtained by performing word recognition on the search request in the sample, extracting the words, and then looking up the corresponding word number. The named entity recognition number can include the number corresponding to the entity in the target content. For example, if the search content is the name of a person B, B can be recognized as the name of the person, and then the corresponding number can be obtained.

[0129] In one implementation, the confidence rate may be calculated based on at least one of the search frequency, the click frequency, and the click frequency of the main category.

[0130] In the embodiment of the present application, filtering out search requests with relatively low retrieval frequency, click frequency and main category frequency can improve the confidence rate of the sample.

[0131] In the embodiment of the present application, search requests with low retrieval frequency, click frequency and main category frequency are filtered out, which may be search requests generated by erroneous clicks. The main category can be the request with the highest number or proportion of search requests corresponding to a certain content according to the calculation or model output results. For example, among the search requests corresponding to "apple", 80% are search requests for electronic products and 20% are search requests for fruits, so the main category corresponding to "apple" is electronic products.

[0132] In one embodiment, Figure 4 As shown, the search request sample is input into the classification model to obtain the first classification result, including:

[0133] Perform embedding operation on the sample word (Term) number and the named entity recognition number (NER result ID, Named Entity Recognition result ID) to obtain the vector result;

[0134] Average the vector results to obtain the hidden variable;

[0135] Convert the implicit variable to the first classification result (Output).

[0136] In the embodiment of the present application, through vector calculation, a classification result that is closer to the search user selection trend in actual operation can be obtained.

[0137] In the embodiment of the present application, the classification model uses the named entity recognition number as a label together with the term in the search request sample as input, embeds and maps the term and the proper name, and finally averages the mapped vectors as the implicit expression of the search request sample.

[0138] In one implementation, the first classification result is a first score that the target content belongs to the first classification, and converting the implicit variable into the first classification result includes:

[0139] The implicit variables are converted into the first classification results according to the following formula:

[0140] P = log(f(BAx n ));

[0141] Among them, P is the first score, n is the number of the implicit variable; x n is an implicit variable, f is a normalization function, B and A are weight parameter matrices of the classification model. The model input is the word vector number and named entity recognition number obtained based on the search request sample, and the output is the main category.

[0142] In the embodiment of the present application, accurate scoring can be obtained through the above formula, thereby more accurately classifying the target content.

[0143] In one embodiment, Figure 5 As shown, the classification method also includes:

[0144] Step S51: input one or more training samples into the classification model to obtain the result that each training sample belongs to the corresponding prediction category; that is, obtain the result that each training sample belongs to the corresponding prediction category;

[0145] Step S52: Calculate the loss value according to whether each group of training samples belongs to the corresponding prediction category;

[0146] Step S53: Optimize the classification model according to the loss value.

[0147] In one implementation, calculating the loss value according to each group of training samples belonging to a corresponding prediction category includes:

[0148] The loss value is calculated using the following formula:

[0149]

[0150] Among them, L is the loss value, K is the number of sample groups, k is the kth group of samples, y k is the predicted category, f is the normalization function, B and A are the weight parameter matrices of the classification model.

[0151] By using the back-propagation method, K training samples are taken as a batch, the exponential likelihood of the model's prediction value and the label is maximized to obtain the loss value, and the model is optimized according to the loss value to obtain an optimized classification model.

[0152] The classification model in the embodiments of the present application may also adopt known classification models, such as LSTM (Long ShortTerm Memory), GRU (Gate Recurrent Unit), BERT (Bidirectional Encoder Representations from Transformers), etc.

[0153] In one implementation, the first classification result is a first score that the target content belongs to the first category, and the second classification result is a second score that the target content belongs to the first category. According to the first classification result and the second classification result, obtaining the classification of the target content includes:

[0154] According to the following formula, calculate the score of the target content belonging to the first category:

[0155] S c1 =(a*P c1 +b*F c1 ) / (c+log(N click +1));

[0156] Among them, S c1 is the score, a and b are the first and second score results respectively, P c1 and F c1 are the weights of the first and second scoring results respectively; c is a preset parameter, N click is the number of requests in the search request sample. The above formula is the linear weighted calculation formula.

[0157] In an embodiment of the present application, the prediction model based on term and named entity recognition is integrated with the user's click behavior to provide a comprehensive a posteriori demand classification result.

[0158] If there are other categories, the scores can also be calculated according to the above formula to obtain the scores of the target content belonging to more than two categories:

[0159] S c1 =(a*P c1 +b*F c1 ) / (c+log(N click ));

[0160] S c2 =(a*P c2 +b*F c2 ) / (c+log(N click ));

[0161] …

[0162] In one example of this application, Figure 6 As shown, the search request sample 61 is segmented and named entity recognized in the prior classification model, and the sample word number and the named entity recognition number are obtained. Then, the sample word number and the named entity recognition number are classified by NN (Nearest Neighborhoods) and converted into the first classification result. And after a simple ratio calculation or frequency calculation, the second classification result is obtained. The first classification result and the second classification result are then fused to obtain the posterior classification, that is, the classification of the target content.

[0163] The present application also provides a classification device, such as Figure 7 As shown, including:

[0164] Search request sample acquisition module 71: used to obtain search request samples according to the network log recording the search behavior; the search request samples are request samples for accessing videos related to the same target content; the search request samples include search requests;

[0165] The first classification module 72 is used to input the search request sample into the classification model to obtain a first classification result;

[0166] The second classification module 73 is used to obtain a second classification result according to the search request sample and the ratio formula;

[0167] Fusion module 74: used to obtain the classification of the target content according to the first classification result and the second classification result.

[0168] In one embodiment, Figure 8 As shown, the device also includes:

[0169] Sorting module 81: used to determine the order of the search results in the search result list of the target content according to the category of the target content and the category of the search results related to the target content.

[0170] In one implementation, the first classification result is a first score that the target content belongs to the first category, the second classification result is a second score that the target content belongs to the first category, and the fusion module is further used to:

[0171] Linearly weighting the first classification result and the second classification result to obtain a classification of the target content.

[0172] In one implementation, the search request sample obtaining module is further used to:

[0173] Obtaining the search request sample according to the user demand information in the network log;

[0174] The target content is classified into categories related to the user demand information.

[0175] In one implementation, the search request sample obtaining module includes:

[0176] Original request sample unit: used to obtain original request samples based on network logs;

[0177] A filtering unit: used to filter the search requests whose confidence rate is lower than a first set threshold in the original request sample to obtain a first request sample;

[0178] A resampling unit: configured to resample the target content to obtain a supplementary sample of the target content if the number of search requests for the target content in the first request sample exceeds a set second threshold;

[0179] Supplementing unit: adding the supplementary sample of the target content to the first request sample to obtain a second request sample;

[0180] An input feature acquisition unit is used to obtain a sample word number and a named entity recognition number according to the second request sample; the named entity recognition number is obtained by performing entity name recognition on the second request sample;

[0181] Number processing unit: used to obtain search request samples according to sample word numbers and named entity recognition numbers.

[0182] In one embodiment, the confidence rate is calculated based on at least one of the search frequency, the click frequency, and the click frequency of the main category.

[0183] In one embodiment, the first classification module includes:

[0184] Embedding unit: used to embed sample word numbers and named entity recognition numbers to obtain vector results;

[0185] Averaging unit: used to average the vector results to obtain implicit variables;

[0186] Conversion unit: used to convert latent variables into the first classification results.

[0187] In one embodiment, the conversion unit converts the implicit variable into the first classification result according to the following formula:

[0188] P = log(f(BAx n ));

[0189] Among them, P is the first score; x n is an implicit variable, f is a normalization function, and B and A are weight parameter matrices of the classification model.

[0190] In one embodiment, Fig. 9 As shown, the device also includes:

[0191] Training sample prediction module 91: used to input one or more training samples into the classification model to obtain the corresponding prediction category of each training sample group;

[0192] Loss calculation module 92: used to calculate the loss value according to each group of training samples belonging to the corresponding prediction category;

[0193] Loss optimization module 93: used to optimize the classification model according to the loss value.

[0194] In one embodiment, the loss calculation module calculates the loss value using the following formula:

[0195]

[0196] Among them, L is the loss value, K is the number of sample groups, k is the kth group of samples, y k is the predicted category, f is the normalization function, B and A are the weight parameter matrices of the classification model.

[0197] In one implementation, the first classification result is a first score that the target content belongs to the first category, and the second classification result is a second score that the target content belongs to the first category. The fusion module calculates the score that the target content belongs to the first category according to the following formula:

[0198] S c1 =(a*P c1 +b*F c1 ) / (c+log(N click +1));

[0199] Among them, Sc1 is the score, a and b are the weights of the first and second scoring results respectively; N click The number of requests in the search request sample.

[0200] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.

[0201] like Fig.10 , is a block diagram of an electronic device according to the classification method of an embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present application described and / or required herein.

[0202] like Fig.10 As shown, the electronic device includes: one or more processors 1001, a memory 1002, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of a graphical user interface (GUI) on an external input / output device (such as a display device coupled to the interface). In other embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig.10 A processor 1001 is taken as an example.

[0203] The memory 1002 is a non-transient computer-readable storage medium provided in the present application. The memory stores instructions executable by at least one processor to enable the at least one processor to perform the classification method provided in the present application. The non-transient computer-readable storage medium of the present application stores computer instructions, which are used to enable a computer to perform the classification method provided in the present application.

[0204] The memory 1002 is a non-transient computer-readable storage medium that can be used to store non-transient software programs, non-transient computer executable programs and modules, such as program instructions / modules corresponding to the classification method in the embodiment of the present application (for example, the attached Figure 7 The processor 1001 executes various functional applications and data processing of the server by running the non-transient software programs, instructions and modules stored in the memory 1002, that is, implements the classification method in the above method embodiment.

[0205] The memory 1002 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created according to the use of the classification method electronic device, etc. In addition, the memory 1002 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory 1002 may optionally include a memory remotely arranged relative to the processor 1001, and these remote memories may be connected to the classification method electronic device 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.

[0206] The electronic device of the classification method may further include: an input device 1003 and an output device 1004. The processor 1001, the memory 1002, the input device 1003 and the output device 1004 may be connected via a bus or other means. Fig.10 The example of connecting through bus is taken in the following.

[0207] The input device 1003 can receive input digital or character information, and generate key signal input related to user settings and function control of the electronic device of the classification method, such as a touch screen, a keypad, a mouse, a track pad, a touch pad, an indicator rod, one or more mouse buttons, a trackball, a joystick and other input devices. The output device 1004 may include a display device, an auxiliary lighting device (e.g., an LED) and a tactile feedback device (e.g., a vibration motor), etc. The display device may include, but is not limited to, a liquid crystal display (LCD), a light emitting diode (LED) display and a plasma display. In some embodiments, the display device may be a touch screen.

[0208] Various implementations of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, application specific integrated circuits (ASICs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0209] These computer programs (also referred to as programs, software, software applications, or code) include machine instructions for programmable processors and can be implemented using high-level procedural and / or object-oriented programming languages, and / or assembly / machine languages. As used herein, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or means (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including a machine-readable medium that receives machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.

[0210] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (Cathode Ray Tube) or LCD (Liquid Crystal Display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0211] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: Local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.

[0212] A computer system may include clients and servers. Clients and servers are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship to each other.

[0213] According to the technical solution of the embodiment of the present application, in the embodiment of the present application, the search request sample is obtained through the network log, and the user's real search behavior record is obtained, so that the main demand and the secondary demand can be distinguished under multiple demands, thereby solving the problem of huge classification system and difficult classification. The classification result output by the model and the classification result calculated according to the actual data of the network log have a complementary effect. With the development of the network, many contents will have new meanings, and the corresponding classifications will also change accordingly. The second classification result directly calculated according to the search request sample obtained from the network log can reflect the changes in the classification corresponding to the target content more quickly. The first classification result obtained by using the model has higher accuracy for low-frequency data. Therefore, through the classification method provided by the embodiment of the present application, a more accurate classification result can be obtained.

[0214] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0215] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A classification method, characterized in that: include: Obtaining a sample of search requests based on a web log recording search behavior; The search request sample is a request sample for accessing videos related to the same target content; The search request sample includes a search request, a target content, and a search result corresponding to a click operation on a search result interface of the corresponding target content; Inputting the search request sample into a classification model to obtain a first classification result; Performing a proportional calculation based on the number of search requests included in each category and the total number of search requests in the search request sample to obtain a second classification result; Obtaining a classification of the target content according to the first classification result and the second classification result; Inputting the search request sample into a classification model to obtain a first classification result includes: Performing an embedding operation on the sample word number and the named entity recognition number to obtain a vector result; averaging the vector results to obtain implicit variables; The latent variable is converted into a first classification result.

2. The method according to claim 1, characterized in that The first classification result is a first score for the target content belonging to the first category, and the second classification result is a second score for the target content belonging to the first category. According to the first classification result and the second classification result, obtaining the classification of the target content includes: Linearly weighting the first classification result and the second classification result to obtain a classification of the target content.

3. The method according to claim 1, characterized in that Obtain search request samples from network logs that record search behavior, including: Obtaining the search request sample according to the user demand information in the network log; The target content is classified into categories related to the user demand information.

4. The method according to claim 1, characterized in that: After obtaining the classification of the target content according to the first classification result and the second classification result, the method further includes: The order of the search results in the search result list of the target content is determined according to the category of the target content and the category of the search results related to the target content.

5. The method according to claim 1, characterized in that Obtain search request samples from network logs that record search behavior, including: Obtaining an original request sample according to the network log; Filtering the search requests whose confidence rates are lower than a first set threshold in the original request sample to obtain a first request sample; If the number of search requests for the target content in the first request sample exceeds a set second threshold, resampling the target content to obtain a supplementary sample of the target content; Adding the supplementary sample of the target content to the first request sample to obtain a second request sample; According to the second request sample, a sample word number and a named entity recognition number are obtained; the named entity recognition number is obtained by performing entity name recognition on the second request sample; The search request sample is obtained according to the sample word number and the named entity recognition number.

6. The method according to claim 5, characterized in that The confidence rate is calculated based on at least one of the retrieval frequency, the click frequency, and the click frequency of the main category.

7. The method according to claim 1, characterized in that The method further comprises: Input one or more sets of training samples into the classification model, and obtain that each set of training samples belongs to the corresponding prediction category; Calculate the loss value based on the corresponding prediction category of each group of training samples; The classification model is optimized according to the loss value.

8. A classification device, characterized in that: include: Search request sample acquisition module: used to obtain search request samples based on network logs recording search behaviors; The search request sample is a request sample for accessing videos related to the same target content; The search request sample includes a search request, a target content, and a search result corresponding to a click operation on a search result interface of the corresponding target content; A first classification module: used for inputting the search request sample into a classification model to obtain a first classification result; A second classification module: used for performing a ratio calculation based on the number of search requests included in each classification and the total number of search requests in the search request sample to obtain a second classification result; A fusion module: used for obtaining the classification of the target content according to the first classification result and the second classification result; The first classification module comprises: Embedding unit: used for performing embedding operation on the sample word number and the named entity recognition number to obtain a vector result; Averaging unit: used to average the vector results to obtain implicit variables; Conversion unit: used for converting the implicit variable into a first classification result.

9. The device according to claim 8, characterized in that The first classification result is a first score for the target content belonging to the first category, the second classification result is a second score for the target content belonging to the first category, and the fusion module is further used for: Linearly weighting the first classification result and the second classification result to obtain a classification of the target content.

10. The device according to claim 8, characterized in that The search request sample obtaining module is also used for: Obtaining the search request sample according to the user demand information in the network log; The target content is classified into categories related to the user demand information.

11. The device according to claim 8, characterized in that The device also includes: Sorting module: used to determine the order of the search results in the search result list of the target content according to the category of the target content and the category of the search results related to the target content.

12. The device according to claim 8, characterized in that The search request sample obtaining module comprises: Original request sample unit: used for obtaining original request samples according to the network log; A filtering unit: used to filter the search requests whose confidence rate is lower than a first set threshold in the original request sample to obtain a first request sample; A resampling unit: configured to resample the target content to obtain a supplementary sample of the target content if the number of search requests for the target content in the first request sample exceeds a set second threshold; Supplementing unit: adding the supplementary sample of the target content to the first request sample to obtain a second request sample; An input feature acquisition unit is used to acquire a sample word number and a named entity recognition number according to the second request sample; the named entity recognition number is acquired by performing entity name recognition on the second request sample; A number processing unit is used to obtain the search request sample according to the sample word number and the named entity recognition number.

13. The device according to claim 12, characterized in that The confidence rate is calculated based on at least one of the retrieval frequency, the click frequency, and the click frequency of the main category.

14. The device according to claim 8, characterized in that The device also includes: Training sample prediction module: used to input one or more training samples into the classification model to obtain the corresponding prediction category of each training sample; Loss calculation module: used to calculate the loss value according to the corresponding prediction category of each group of training samples; Loss optimization module: used to optimize the classification model according to the loss value.

15. An electronic device, characterized in that: include: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 7.

16. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1 to 7.

17. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Service providing method and device based on search engine

    CN106326338A

  • Information classification method and device

    CN106649696A