Data processing method and device, equipment and storage medium
Patent Information
- Application Number
- CN202210600242.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-27
- Publication Date
- 2026-09-04
- Estimated Expiration
- 2042-05-27
AI Technical Summary
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description.
Smart Images

Figure CN117171201B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and more particularly to the field of deep learning. Background Technology
[0002] When faced with massive random searches, it is necessary to identify whether the query term (or search term) belongs to a certain domain, and then send it to that domain for processing in order to obtain better processing results. Summary of the Invention
[0003] This disclosure provides a data processing method, apparatus, device, and storage medium.
[0004] According to one aspect of this disclosure, a data processing method is provided, comprising:
[0005] Based on the feature information corresponding to the first search term in the positive sample data, the negative sample category is obtained; wherein, the positive sample data package contains multiple first search terms belonging to the target domain; the negative sample category is the category corresponding to the search term that does not belong to the target domain;
[0006] A second search term is selected from the negative sample categories as negative sample data; the negative sample data package contains multiple second search terms that do not belong to the target domain.
[0007] According to another aspect of this disclosure, a data processing apparatus is provided, comprising:
[0008] The first determining unit is used to obtain the negative sample category based on the feature information corresponding to the first search term in the positive sample data; wherein, the positive sample data package contains multiple first search terms belonging to the target domain; and the negative sample category is the category corresponding to the search term that does not belong to the target domain.
[0009] The second determining unit is used to select a second search term from the negative sample category as negative sample data; the negative sample data package contains multiple second search terms that do not belong to the target domain.
[0010] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0011] At least one processor; and
[0012] The memory is communicatively connected to the at least one processor; wherein,
[0013] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the methods of any embodiment of the present disclosure.
[0014] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are used to cause the computer to perform a method according to any embodiment of this disclosure.
[0015] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements a method according to any embodiment of this disclosure.
[0016] In this way, the disclosed solution can automatically perform sampling, reducing sampling costs.
[0017] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0018] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0019] Figure 1 This is an illustrative flow diagram of a data processing method according to an embodiment of this application. Figure 1 ;
[0020] Figure 2 This is an illustrative flow diagram of a data processing method according to an embodiment of this application. Figure 2 ;
[0021] Figure 3 This is an illustrative flow diagram of a data processing method according to an embodiment of this application. Figure 3 ;
[0022] Figure 4 This is an illustrative flow diagram of a data processing method according to an embodiment of this application. Figure 4 ;
[0023] Figures 5(a) and 5(b) are schematic flowcharts of a data processing method according to another embodiment of the present application in a specific example;
[0024] Figure 6 This is a schematic diagram of the structure of a data processing apparatus according to an embodiment of this application. Figure 1 ;
[0025] Figure 7 This is a schematic diagram of the structure of a data processing apparatus according to an embodiment of this application. Figure 2 ;
[0026] Figure 8 This is a block diagram of an electronic device used to implement the data processing method of the embodiments of this disclosure. Detailed Implementation
[0027] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0028] When dealing with massive random searches, it's necessary to identify whether the query term (i.e., search term) belongs to a specific domain before processing it within that domain to achieve better results. Identification methods include traditional rule-based discrimination and machine learning methods, such as deep learning. However, rule-based discrimination has poor generalization performance, while model-based processing requires extensive labeling, increasing processing costs.
[0029] Based on this, the present disclosure provides a data processing method, specifically, Figure 1 This is an illustrative flow diagram of a data processing method according to an embodiment of this application. Figure 1 This method can optionally be applied to electronic devices, such as personal computers, servers, or server clusters, etc., and this disclosure does not impose specific limitations in this regard. The method includes at least some of the following: [e.g., ...] Figure 1 As shown, it includes:
[0030] Step S101: Based on the feature information corresponding to the first search term in the positive sample data, obtain the negative sample category; wherein, the positive sample data package contains multiple first search terms belonging to the target domain; the negative sample category is the category corresponding to the search term that does not belong to the target domain.
[0031] Understandably, this disclosed solution starts with easily obtainable positive sample data and collects negative sample data based on the relationship between "positive sample - feature information - negative sample". In this way, negative sample data is obtained automatically, solving the problem that existing negative sample data is difficult to sample or that the sampled negative sample data is inaccurate. This reduces sampling costs and lays the foundation for improving the generalization ability of the model.
[0032] In a specific example, the feature information may specifically include at least one of the following: behavioral features, category features; further, the behavioral features include at least one of the following: playing videos, clicking images, jumping to links, etc.; the category features may specifically refer to the category of items or commodities corresponding to the search term. It is understood that the feature information described in this disclosure may also be features of other dimensions, and this disclosure does not limit this, as long as the feature of that dimension can directly or indirectly obtain the negative sample category, it is within the protection scope of this disclosure.
[0033] Step S102: Select a second search term from the negative sample category as negative sample data; the negative sample data package contains multiple second search terms that do not belong to the target domain.
[0034] It is understandable that, since the negative sample category is the category corresponding to the search term that does not belong to the target domain, the search term that does not belong to the target domain can be directly collected from the negative sample category as negative sample data. In this way, the sampling of negative sample data is realized from the category dimension, which enriches the sampling dimension and also improves the sampling volume and sampling efficiency of negative sample data.
[0035] Thus, this disclosed solution can automatically perform sampling, that is, it can obtain negative sample categories based on positive sample data, and then automatically sample negative sample data in negative sample categories. This reduces sampling costs and lays the foundation for reducing model training costs. At the same time, it also lays the foundation for improving model training efficiency and model generalization ability.
[0036] In a specific example of the disclosed solution, a data processing method is provided, specifically, Figure 2 This is an illustrative flow diagram of a data processing method according to an embodiment of this application. Figure 2 This method can optionally be applied to electronic devices, such as personal computers, or servers, server clusters, etc., but is not limited to these. The method includes at least some of the following: [e.g., ...] Figure 2 As shown, the specific steps are as follows:
[0037] Step S201: Based on the feature information corresponding to the first search term in the positive sample data, obtain the positive sample category; wherein, the positive sample data package contains multiple first search terms belonging to the target domain; the positive sample category is the category corresponding to the search term belonging to the target domain.
[0038] Understandably, this disclosed solution starts with easily obtainable positive sample data and collects negative sample data based on the relationship between "positive sample - feature information - negative sample". Specifically, given the positive sample data, the category of the item or commodity corresponding to the first search term is obtained based on the feature information corresponding to the first search term itself in the positive sample data, and then the category of the item or commodity corresponding to the first search term is taken as the positive sample category.
[0039] In a specific example, positive sample categories can be obtained in the following way. Specifically, step S201 can include: taking the category features corresponding to the first search term in the positive sample data as the positive sample category. That is, in this method, after obtaining the positive sample data, the category of the item or commodity corresponding to the search term in the positive sample data, i.e., the first search term, is directly taken as the positive sample category. Alternatively, if the behavioral features of the first search term in the positive sample data are within the preset behavioral range of the target domain, the category features corresponding to the first search term in the positive sample data are taken as the positive sample category. That is, in this example, the preset behaviors of the target domain are pre-statistically obtained, i.e., the relationship between search terms and user behaviors is established. Thus, if the behavioral features of the search term (i.e., the first search term) in the positive sample data are within the preset behavioral range of the target domain, the category features corresponding to the first search term whose behavioral features are within the preset behavioral range of the target domain are taken as the positive sample category.
[0040] It is understood that in practical applications, positive sample categories can be obtained using any one or both of the above methods, and this disclosure does not impose any restrictions on this.
[0041] In this way, the proposed solution fully considers the category characteristics corresponding to the search terms during the sampling process, thereby enriching the sampling dimensions and providing support for improving sampling efficiency and increasing the sampling volume, while also supporting the reduction of sampling costs.
[0042] Step S202: Obtain negative sample categories based on the positive sample categories; the negative sample categories are the categories corresponding to search terms that do not belong to the target domain.
[0043] In other words, the negative sample categories in this disclosed scheme are obtained based on the positive sample categories. This enriches the sampling dimensions of negative sample sampling and lays the foundation for improving the amount and efficiency of negative sample sampling.
[0044] In a specific example, the negative sample category can be obtained in the following manner. Specifically, step S202 includes: removing the positive sample category from the preset category set to obtain the negative sample category; or, if the behavioral features of the first search term in the positive sample data are not within the preset behavioral range of the target domain, the category features corresponding to the first search term that are not within the preset behavioral range of the target domain are taken as the negative sample category.
[0045] In other words, this example provides two ways to obtain negative sample categories:
[0046] Firstly, based on obtaining positive sample categories, negative sample categories can be obtained by removing positive sample categories from the preset category set. For example, after removing positive sample categories, some or all of the remaining categories can be directly used as negative sample categories.
[0047] Secondly, based on obtaining the positive sample categories, the positive sample categories are determined based on the behavioral features corresponding to the search terms in the positive sample data. For example, the category features corresponding to the first search term whose behavioral features are not within the preset behavioral range of the target domain are taken as the negative sample categories. This facilitates the removal of noise from the positive sample data. For instance, the first search term whose behavioral features are not within the preset behavioral range of the target domain can be considered noise in the positive sample data. In this case, this noise can be removed, further improving the accuracy of the samples, thus laying the foundation for improving the accuracy of the model.
[0048] It is understood that either or both of the above methods can be used to obtain negative sample categories, and this disclosure does not restrict this.
[0049] Thus, this disclosed solution provides a specific method for obtaining negative sample categories based on positive sample categories. This method fully considers the category characteristics corresponding to the search terms, thereby enriching the sampling dimensions of negative sample data and improving the accuracy of negative sample data. It solves the problem that existing negative sample data is difficult to sample or that the sampled negative sample data is inaccurate.
[0050] Step S203: Select a second search term from the negative sample category as negative sample data; the negative sample data package contains multiple second search terms that do not belong to the target domain.
[0051] Thus, this disclosure provides a scheme for obtaining positive sample categories based on positive sample data, then obtaining negative sample categories based on positive sample categories, and sampling negative sample data from negative sample categories. In this way, the category characteristics corresponding to the search terms are fully considered during the sampling process, enriching the sampling dimensions of negative sample data, providing support for improving sampling efficiency and increasing sampling volume, and also providing support for reducing sampling costs.
[0052] In a specific example, the positive sample data can be determined in the following manner; specifically, the positive sample data is obtained through at least one of the following:
[0053] (1) Sample the search terms belonging to the target domain to obtain the positive sample data; this method directly samples the search terms belonging to the target domain to obtain positive sample data. This method is simple and efficient.
[0054] (2) The associated words that match the first search term in the positive sample data are used as the positive sample data. After obtaining some positive sample data, this method can be used to further expand the sample data, that is, the associated words corresponding to the search terms in the positive sample data are also used as positive sample data, so as to enrich the amount of positive sample data.
[0055] (3) If the behavioral features corresponding to the search term are within a preset behavioral range of the target domain, the search terms within the preset behavioral range of the target domain are used as the positive sample data. This method fully considers behavioral features during the positive sample sampling process, and uses search terms whose behavioral features are within the preset behavioral range of the target domain as positive sample data, further increasing the amount of positive sample data.
[0056] It is understood that positive sample data can be obtained by using any one, two, or three of the above methods, and this disclosure does not impose any restrictions on this.
[0057] In a specific example of the disclosed solution, a data processing method is provided, specifically, Figure 3 This is an illustrative flowchart of a data processing method according to an embodiment of this application. Figure 3 This method can optionally be applied to electronic devices, such as personal computers, or servers, server clusters, etc., but is not limited to these. The method includes at least a portion of the following. It is understood that... Figure 1 and Figure 2 The methods shown also apply to... Figure 3 The method shown is based on this. Figure 3 The relevant content shown can be found in the specific examples above, and will not be repeated here.
[0058] Furthermore, such as Figure 3 As shown, the specific steps are as follows:
[0059] Step S301: Based on the feature information corresponding to the first search term in the positive sample data, obtain the negative sample category; wherein, the positive sample data package contains multiple first search terms belonging to the target domain; the negative sample category is the category corresponding to the search term that does not belong to the target domain.
[0060] It is understood that this disclosure does not restrict the specific preset recognition model. Any classification model that can be applied to natural language processing can be applied to this disclosure.
[0061] Step S302: Select a second search term from the negative sample category as negative sample data; the negative sample data package contains multiple second search terms that do not belong to the target domain.
[0062] Step S303: Input the multiple first search terms contained in the positive sample data and the multiple second search terms contained in the negative sample data into the preset recognition model for model training.
[0063] In this way, a training set is formed by combining multiple first search terms contained in the positive sample data and multiple second search terms contained in the negative sample data. The training set is then used to train the preset recognition model. This reduces both sampling costs and model training costs. Furthermore, because this disclosed solution enriches the sampling dimensions and the amount of sampling, it also improves the model training efficiency and the model's generalization ability, providing technical support for realizing massive random queries.
[0064] In a specific example of the disclosed solution, model training can be performed in the following manner, specifically, as follows: Figure 4 As shown, step S303 specifically includes:
[0065] Step S3031: Input the multiple first search terms contained in the positive sample data and the multiple second search terms contained in the negative sample data into the pre-trained teacher model to obtain the first output result.
[0066] Step S3032: Input the multiple first search terms contained in the positive sample data and the multiple second search terms contained in the negative sample data into the initial student model to obtain the second output result.
[0067] Here, the initial student model is distilled from the pre-trained teacher model. In other words, the initial student model is a small model distilled from the pre-trained teacher model, thus laying the foundation for improving the efficiency of subsequent model training.
[0068] Step S3033: Based on the first output result, the second output result, and the label data, calculate the loss value of the target loss function; wherein, the label data includes the positive sample labels of the positive sample data and the negative sample labels of the negative sample data.
[0069] In this way, the proposed solution uses the output of the pre-trained teacher model and the initial student model distilled from the pre-trained teacher model to train the initial student model. This improves the efficiency of model training while ensuring that the recognition accuracy and model generalization are not reduced, thus better handling the massive queries of random traffic.
[0070] In a specific example of the scheme disclosed herein, the target loss function can also be determined in the following manner; specifically, the target loss function is obtained based on a first loss function and a second loss function: the first loss function is used to characterize the cross-entropy between the output of the initial student model and the output of the pre-trained teacher model; the second loss function is used to characterize the cross-entropy between the output of the initial student model and the label data.
[0071] For example, a soft label (i.e., the first loss function) is set, which represents the cross-entropy between the output of the prediction layer of the initial student model and the output of the prediction layer of the pre-trained teacher model; further, a hard label (i.e., the second loss function) is set, which represents the cross-entropy between the output of the prediction layer of the initial student model and the true label.
[0072] Then, the final loss function, i.e. the target loss function, is obtained based on the sum of the soft and hard labels. Backpropagation is then performed based on the loss value. Here, in order to improve training efficiency, only the parameters of the initial student model are updated during the backpropagation stage, and the parameters of the pre-trained teacher model are not updated.
[0073] Step S404: Train the initial student model based on the loss value of the target loss function.
[0074] In this way, a training set is formed by combining multiple first search terms contained in the positive sample data and multiple second search terms contained in the negative sample data. The training set is then used to train the preset recognition model. This reduces both the sampling cost and the model training cost. Furthermore, because this disclosed solution enriches the sampling dimensions and the sampling volume, it improves the model's generalization ability and provides technical support for realizing massive random queries.
[0075] In a specific example of the disclosed solution, a target student model is obtained when the loss value of the target loss function satisfies a preset convergence condition. This target student model is then used to identify the domain of the search term; for example, the search term to be processed is input into the target student model to obtain the domain of the search term. Thus, using the target student model for prediction enables controllable and low-cost achievement of good generalization recognition results, thereby supporting the realization of massive random queries.
[0076] In summary, the disclosed solution has the following advantages:
[0077] First, it reduces the difficulty of sampling negative sample data, achieving low-cost sampling. This disclosed solution, based on the relationship between "positive samples - feature information - negative samples," derives negative sample categories from easily obtainable positive sample data, and then collects negative sample data from these categories. This significantly reduces the difficulty and cost of sampling negative sample data, while improving sampling efficiency and the number of samples. Simultaneously, the quality of both positive and negative sample data is ensured during the sampling process, laying the foundation for the subsequent model to achieve good generalization ability.
[0078] Secondly, it improves the efficiency of model training and the model's generalization ability. Existing solutions suffer from high resource consumption and slow response times when dealing with massive queries from random traffic. This disclosed solution uses a pre-trained model as the teacher model and distills a student model, which is then used to train the student model. This effectively saves resources used for model training, improves training efficiency, and enhances the model's generalization ability. Furthermore, this disclosed solution significantly improves performance while maintaining controllable loss.
[0079] The following provides a detailed explanation of this disclosed solution with specific examples. Specifically, this example proposes a method that can automatically generate labeled training sets to complete model training. It roughly includes: (1) sample labeling stage; (2) training stage; and (3) prediction stage. As shown in Figures 5(a) and 5(b), the main contents of each stage include:
[0080] In the first stage, as shown in Figure 5(a), the samples are labeled:
[0081] (1) Collect positive sample data. This example can be based on the following methods to collect positive sample data and annotate the collected positive sample data, specifically including:
[0082] Method 1: Based on display traffic, positive sample data is obtained by filtering from the logistics database of the target domain. For example, based on display traffic, materials with click behavior (which is a pre-defined behavior belonging to the target domain) are identified and treated as positive sample data. Simultaneously, the score of the category to which the material with click behavior belongs is increased, for example, by adding 1 to the score of the category corresponding to the material with click behavior. Conversely, the score of the category corresponding to the material without click behavior is decreased, for example, by decreasing it by 1.
[0083] Method 2: Use a multi-modal matching machine (Aho-Corasick automaton, AC) to identify keywords for the target domain from the logistics database, and then select materials containing the keywords from the logistics database as positive sample data.
[0084] Method 3: After obtaining positive sample data, use a multi-model matching machine to determine the related words of the search terms in the positive sample data, and use the related words as positive sample data as well (this method is not shown in Figure 5(a)).
[0085] (2) Collecting negative sample data; Here, for negative samples, the existing technology has the problems of small sampling volume and incomplete coverage. Moreover, if random samples are used as negative samples, most samples will be labeled as negative samples, and there will be cases where search terms belonging to the target domain are labeled as negative samples. Based on this, in order to solve this problem, this example first determines the category of negative samples, and then collects data from the category of negative samples to obtain negative sample data.
[0086] Specifically, behavioral characteristics of the target domain are statistically obtained. Categories whose behavioral characteristics of the search term fall within a preset behavioral range of the target domain are designated as positive sample categories. Conversely, categories whose behavioral characteristics of the search term do not fall within the preset behavioral range of the target domain are designated as negative sample categories. Then, negative sample data is obtained by sampling from these negative sample categories.
[0087] In practical applications, the scores of the product categories can be pre-calculated to determine the negative sample categories. For example, categories with scores below a preset threshold can be designated as negative sample categories. Here, the preset threshold can be determined based on the actual situation, and this disclosed solution does not impose any restrictions on it.
[0088] Understandably, during the sampling process, more search terms belonging to the target domain can be sampled, while fewer search terms not belonging to the target domain can be sampled. This maximizes the coverage of all random queries and addresses the issue of long-tail search terms within the target domain. Here, long-tail search terms can be understood as phrases or short sentences consisting of two or more words.
[0089] In this way, the sampling method described above can both ensure the generalization effect of the model and achieve the controllability of the rules.
[0090] The second stage, as shown in Figure 5(b), is the training stage:
[0091] Step 1: Use the pre-prepared model as the teacher model.
[0092] Step 2: Input the obtained unlabeled samples (for example, the materials in the material library in the first stage as unlabeled samples) into the teacher model for pre-training.
[0093] Step 3: Perform data augmentation on the positive and negative sample data obtained in the first stage. Input the augmented positive and negative sample data into the teacher model obtained in Step 2, and fine-tune the parameters of the teacher model based on the training objective (i.e., the loss function) to obtain the pre-trained teacher model.
[0094] For example, using infoNCE loss as the training objective, i.e., the loss function, the infoNCE loss is:
[0095]
[0096] Where i represents a sample and S is the similarity function.
[0097] In practical applications, since product category can also be a useful reference for determining whether a search term belongs to the target domain, the product category dimension can be added to the teacher model for training, thus enabling subsequent prediction of the product category of the search term.
[0098] In this way, since the teacher model can be pre-trained based on the target domain corpus, the adaptability of the pre-trained teacher model in the target domain is enhanced, and the teacher model has a certain recognition ability.
[0099] Step 4: Distill the initial student model from the pre-trained teacher model in Step 3, and input the positive and negative sample data obtained in the first stage into the initial student model to train it.
[0100] Here, although the pre-trained teacher model performs well, it consumes a lot of resources and is slow to respond. Therefore, in order to cope with the massive queries from random traffic, a student model is distilled from the pre-trained teacher model for online prediction. This can greatly improve efficiency and keep the loss under control.
[0101] Furthermore, during the initial training of the student model, distillation loss can be used as the training objective. Specifically, distillation loss can include two parts:
[0102] (1) pred_loss, for example, as a soft label, represents the cross-entropy between the output of the initial student model and the output of the pre-trained teacher model;
[0103] (2) student_ce_loss, for example, as a hard label, represents the cross-entropy between the output of the initial student model and the true label.
[0104] Furthermore, the model training is completed by backpropagating based on the sum of pred_loss and student_ce_loss (i.e., distillation loss, which is also the target loss function mentioned above).
[0105] Here, only the student model parameters are updated during the backpropagation phase; the teacher model parameters are not updated. In this way, the target student model is trained.
[0106] Step 5: If the training termination condition is met, the target student model is obtained.
[0107] The third stage is the prediction stage;
[0108] By inputting the search term into the target student model, the domain of that search term can be obtained. Furthermore, if the target student model also considers the category dimension during training, it will also output the category corresponding to the search term.
[0109] This disclosure also provides a data processing apparatus, such as... Figure 6 As shown, it includes:
[0110] The first determining unit 601 is used to obtain the negative sample category based on the feature information corresponding to the first search term in the positive sample data; wherein, the positive sample data contains multiple first search terms belonging to the target domain; and the negative sample category is the category corresponding to the search term that does not belong to the target domain.
[0111] The second determining unit 602 is used to select a second search term from the negative sample category as negative sample data; the negative sample data package contains multiple second search terms that do not belong to the target domain.
[0112] In a specific example of the disclosed solution, the first determining unit 601 is specifically used for:
[0113] Based on the feature information corresponding to the first search term in the positive sample data, a positive sample category is obtained; wherein, the positive sample category is the category corresponding to the search term belonging to the target domain;
[0114] The negative sample category is obtained based on the positive sample category.
[0115] In a specific example of the disclosed solution, the first determining unit 601 is specifically used for:
[0116] The category features corresponding to the first search term in the positive sample data are taken as the positive sample category;
[0117] or,
[0118] If the behavioral characteristics of the first search term in the positive sample data are within the preset behavioral range of the target domain, the category characteristics corresponding to the first search term in the positive sample data are taken as the positive sample category.
[0119] In a specific example of the disclosed solution, the first determining unit 601 is specifically used for:
[0120] After removing the positive sample categories from the preset category set, the negative sample categories are obtained;
[0121] or,
[0122] If the behavioral characteristics of the first search term in the positive sample data are not within the preset behavioral range of the target domain, the category characteristics corresponding to the first search term that are not within the preset behavioral range of the target domain shall be used as the negative sample category.
[0123] In a specific example of the scheme disclosed herein, the first determining unit 601 is further configured to: determine the positive sample data; wherein the positive sample data is obtained by at least one of the following:
[0124] The positive sample data is obtained by sampling search terms belonging to the target domain;
[0125] The associated words that match the first search term in the positive sample data are used as the positive sample data;
[0126] If the behavioral characteristics corresponding to the search term are within the preset behavioral range of the target domain, the search term within the preset behavioral range of the target domain will be used as the positive sample data.
[0127] In a specific example of the disclosed scheme, such as Figure 7 As shown, it also includes: training unit 701; wherein,
[0128] The training unit 701 is used to input multiple first search terms contained in the positive sample data and multiple second search terms contained in the negative sample data into a preset recognition model for model training.
[0129] In a specific example of the disclosed solution, the training unit 701 is specifically used for:
[0130] The first search terms contained in the positive sample data and the second search terms contained in the negative sample data are input into the pre-trained teacher model to obtain the first output result;
[0131] The positive sample data contains multiple first search terms and the negative sample data contains multiple second search terms, which are then input into the initial student model to obtain a second output result. The initial student model is distilled from the pre-trained teacher model.
[0132] Based on the first output result, the second output result, and the label data, the loss value of the target loss function is calculated; wherein, the label data includes the positive sample labels of the positive sample data and the negative sample labels of the negative sample data;
[0133] The initial student model is trained based on the loss value of the target loss function.
[0134] In a specific example of the scheme disclosed herein, the training unit 701 is further configured to:
[0135] Determine the target loss function; wherein the target loss function is obtained based on a first loss function and a second loss function: the first loss function is used to characterize the cross-entropy between the output of the initial student model and the output of the pre-trained teacher model; the second loss function is used to characterize the cross-entropy between the output of the initial student model and the label data.
[0136] In a specific example of the scheme disclosed herein, the training unit 701 is further configured to:
[0137] The target student model is obtained when the loss value of the target loss function satisfies the preset convergence condition.
[0138] In a specific example of the disclosed solution, it further includes: a prediction unit; wherein,
[0139] The prediction unit is used to input the search term to be processed into the target student model to obtain the domain of the search term to be processed.
[0140] For a description of the specific functions and examples of each unit of the apparatus in this disclosure embodiment, please refer to the relevant descriptions of the corresponding steps in the above method embodiments, which will not be repeated here.
[0141] The acquisition, storage, and application of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0142] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0143] Figure 8A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0144] like Figure 8 As shown, device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 802 or a computer program loaded from storage unit 808 into random access memory (RAM) 803. RAM 803 may also store various programs and data required for the operation of device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via bus 804. Input / output (I / O) interface 805 is also connected to bus 804.
[0145] Multiple components in device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of monitors, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0146] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as data processing methods. For example, in some embodiments, the data processing method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform data processing methods by any other suitable means (e.g., by means of firmware).
[0147] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0148] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0149] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0150] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, 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 sound input, voice input, or tactile input).
[0151] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with embodiments of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0152] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0153] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0154] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand 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 disclosure should be included within the scope of protection of this disclosure.
Claims
1. A data processing method, comprising: Based on the feature information corresponding to the first search term in the positive sample data, negative sample categories are obtained; wherein, the positive sample data package contains multiple first search terms belonging to the target domain; the negative sample categories are categories corresponding to search terms that do not belong to the target domain; A second search term is selected from the negative sample category and used as negative sample data; the negative sample data package contains multiple second search terms that do not belong to the target domain; The process of obtaining negative sample categories based on the feature information corresponding to the first search term in the positive sample data includes: Based on the feature information corresponding to the first search term in the positive sample data, a positive sample category is obtained; wherein, the positive sample category is the category corresponding to the search term belonging to the target domain; Based on the positive sample categories, negative sample categories are obtained; The step of obtaining the positive sample category based on the feature information corresponding to the first search term in the positive sample data includes: The category features corresponding to the first search term in the positive sample data are taken as the positive sample category; or, If the behavioral characteristics of the first search term in the positive sample data are within the preset behavioral range of the target domain, the category characteristics corresponding to the first search term in the positive sample data shall be taken as the positive sample category. The step of obtaining negative sample categories based on the positive sample categories includes: After removing the positive sample categories from the preset category set, the negative sample categories are obtained; or, If the behavioral characteristics of the first search term in the positive sample data are not within the preset behavioral range of the target domain, the category characteristics corresponding to the first search term that are not within the preset behavioral range of the target domain shall be used as the negative sample category.
2. The method according to claim 1, further comprising: Determine the positive sample data; wherein the positive sample data is obtained by at least one of the following: The positive sample data is obtained by sampling search terms belonging to the target domain; The associated words that match the first search term in the positive sample data are used as the positive sample data; If the behavioral characteristics corresponding to the search term are within the preset behavioral range of the target domain, the search term within the preset behavioral range of the target domain will be used as the positive sample data.
3. The method according to claim 1, further comprising: The multiple first search terms contained in the positive sample data and the multiple second search terms contained in the negative sample data are input into a preset recognition model for model training.
4. The method according to claim 3, wherein, The step of inputting multiple first search terms contained in the positive sample data and multiple second search terms contained in the negative sample data into a preset recognition model for model training includes: The first search terms contained in the positive sample data and the second search terms contained in the negative sample data are input into the pre-trained teacher model to obtain the first output result; The positive sample data contains multiple first search terms and the negative sample data contains multiple second search terms, which are then input into the initial student model to obtain a second output result. The initial student model is distilled from the pre-trained teacher model. Based on the first output result, the second output result, and the label data, the loss value of the target loss function is calculated; wherein, the label data includes the positive sample labels of the positive sample data and the negative sample labels of the negative sample data; The initial student model is trained based on the loss value of the target loss function.
5. The method according to claim 4, further comprising: Determine the target loss function; wherein the target loss function is obtained based on a first loss function and a second loss function: the first loss function is used to characterize the cross-entropy between the output of the initial student model and the output of the pre-trained teacher model; the second loss function is used to characterize the cross-entropy between the output of the initial student model and the label data.
6. The method according to claim 5, further comprising: The target student model is obtained when the loss value of the target loss function satisfies the preset convergence condition.
7. The method according to claim 6, further comprising: The search term to be processed is input into the target student model to obtain the domain of the search term to be processed.
8. A data processing apparatus, comprising: The first determining unit is used to obtain the negative sample category based on the feature information corresponding to the first search term in the positive sample data; wherein, the positive sample data package contains multiple first search terms belonging to the target domain; and the negative sample category is the category corresponding to the search term that does not belong to the target domain. The second determining unit is used to select a second search term from the negative sample category as negative sample data; the negative sample data package contains multiple second search terms that do not belong to the target domain; The process of obtaining negative sample categories based on the feature information corresponding to the first search term in the positive sample data includes: Based on the feature information corresponding to the first search term in the positive sample data, a positive sample category is obtained; wherein, the positive sample category is the category corresponding to the search term belonging to the target domain; Based on the positive sample categories, negative sample categories are obtained; The step of obtaining the positive sample category based on the feature information corresponding to the first search term in the positive sample data includes: The category features corresponding to the first search term in the positive sample data are taken as the positive sample category; or, If the behavioral characteristics of the first search term in the positive sample data are within the preset behavioral range of the target domain, the category characteristics corresponding to the first search term in the positive sample data shall be taken as the positive sample category. The step of obtaining negative sample categories based on the positive sample categories includes: After removing the positive sample categories from the preset category set, the negative sample categories are obtained; or, If the behavioral characteristics of the first search term in the positive sample data are not within the preset behavioral range of the target domain, the category characteristics corresponding to the first search term that are not within the preset behavioral range of the target domain shall be used as the negative sample category.
9. The apparatus according to claim 8, wherein, The first determining unit is further configured to: determine the positive sample data; wherein the positive sample data is obtained by at least one of the following: The positive sample data is obtained by sampling search terms belonging to the target domain; The associated words that match the first search term in the positive sample data are used as the positive sample data; If the behavioral characteristics corresponding to the search term are within the preset behavioral range of the target domain, the search term within the preset behavioral range of the target domain will be used as the positive sample data.
10. The apparatus according to claim 8, further comprising: Training unit; where, The training unit is used to input multiple first search terms contained in the positive sample data and multiple second search terms contained in the negative sample data into a preset recognition model for model training.
11. The apparatus according to claim 10, wherein, The training unit is specifically used for: The first search terms contained in the positive sample data and the second search terms contained in the negative sample data are input into the pre-trained teacher model to obtain the first output result; The positive sample data contains multiple first search terms and the negative sample data contains multiple second search terms, which are then input into the initial student model to obtain a second output result. The initial student model is distilled from the pre-trained teacher model. Based on the first output result, the second output result, and the label data, the loss value of the target loss function is calculated; wherein, the label data includes the positive sample labels of the positive sample data and the negative sample labels of the negative sample data; The initial student model is trained based on the loss value of the target loss function.
12. The apparatus according to claim 11, wherein, The training unit is also used for: Determine the target loss function; wherein the target loss function is obtained based on a first loss function and a second loss function: the first loss function is used to characterize the cross-entropy between the output of the initial student model and the output of the pre-trained teacher model; the second loss function is used to characterize the cross-entropy between the output of the initial student model and the label data.
13. The apparatus according to claim 12, wherein, The training unit is also used for: The target student model is obtained when the loss value of the target loss function satisfies the preset convergence condition.
14. The apparatus of claim 13, further comprising: Prediction unit; where, The prediction unit is used to input the search term to be processed into the target student model to obtain the domain of the search term to be processed.
15. An electronic device comprising: 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 to enable the at least one processor to perform the method of any one of claims 1-7.
16. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-7.
17. A computer program product comprising a computer program that, when executed by a processor, implements the method according to any one of claims 1-7.
Citation Information
Patent Citations
Sample data set acquisition method and apparatus, equipment and storage medium
CN111782950A
Model training method and device, equipment, storage medium and program product
CN113326852A
Commodity recommendation method and device
CN113450172A