Model training method, category detection method, and computing device
By using model training methods in the online system, object features and category features are extracted, the degree of matching is calculated and the probability of misplacement is determined, the problem of matching object and category paths is solved, and high accuracy and low cost detection effects are achieved.
Patent Information
- Application Number
- PCT/CN2024/105572
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-09-27
- Filing Date
- 2024-07-15
- Publication Date
- 2025-04-03
AI Technical Summary
In the online system, due to factors such as cognitive errors of the object provider or category structure updates, it is difficult to effectively detect the matching between the object and its corresponding category path, resulting in the object appearing in an irrelevant search result page.
Through a model training method, the object information and class path of the published object are used as the training data set, and the object is trained to process the model to extract object features and class features, calculate the degree of matching between the object and class path, and determine the probability of misplacement through the class identification model to detect whether the object and class path match.
Accurate matching detection of objects and class paths is realized, which reduces training costs and noise impacts, and improves the generalization ability and processing accuracy of the model.
Smart Images

Figure CN2024105572_03042025_PF_FP_ABST
Abstract
Description
Model training method, category detection method and computing equipment
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on September 27, 2023, with application number 202311262808.2 and application name “Model training method, category detection method and computing device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of computer technology, and in particular to a model training method, a category detection method, and a computing device. Background Art
[0003] In some online systems that provide objects for users to perform interactive behaviors, a hierarchical category structure is usually used to organize and classify objects. The category hierarchy usually includes first-level categories, second-level categories...leaf categories. Objects are bound to leaf categories. The path from the first-level category to the leaf category is the category path, and each object corresponds to a category path. When an online system publishes an object, it is usually the object provider who selects a suitable category path for the object to be released. In actual applications, due to factors such as cognitive errors of the object provider or category structure updates, the category path where the object is located may be wrong, that is, the object and the category path are misplaced. This may cause the object to appear on irrelevant search results pages in search scenarios. Therefore, how to effectively detect whether the object and its corresponding category path match is a technical problem that needs to be solved at present.
[0004] Summary of the Invention
[0005] The embodiments of the present application provide a model training method, a category detection method, and a computing device to solve the technical problem in the prior art of how to effectively detect whether an object and a category path match.
[0006] In a first aspect, an embodiment of the present application provides a model training method, comprising:
[0007] Using the object information of the published object and the category path of the object as a training data set;
[0008] Selecting a plurality of training sample pairs of a current training batch from the training data set; wherein the training sample pairs include object information and its corresponding category path;
[0009] Inputting the plurality of training sample pairs into an object processing model, using the training sample pairs as positive samples, and the object information in one positive sample and the category path in another positive sample as negative samples, to train the object processing model;
[0010] The object processing model is used to extract object features from the object information of the target object and to extract category features from the target category path of the target object; the object features and the category features are used to calculate the degree of matching between the target object and the target category path.
[0011] Optionally, inputting the plurality of training sample pairs into the object processing model, with the training sample pairs serving as positive samples and the object information in one positive sample and the category path in another positive sample serving as negative samples, training the object processing model includes:
[0012] Inputting a plurality of object information in the plurality of training sample pairs into the object processing model to obtain a plurality of first sample features;
[0013] Inputting a plurality of category paths in the plurality of training sample pairs into the object processing model to obtain a plurality of second sample features;
[0014] Performing matrix multiplication on a first matrix formed by the plurality of first sample features and a second matrix formed by the plurality of second sample features to obtain a third matrix; wherein the value in the i-th row and j-th column of the third matrix represents the similarity between the i-th object and the j-th category path; wherein i=1, 2, 3...n, j=1, 2, 3...n; i and j are different; and n is a positive integer representing the number of sample pairs in the plurality of training sample pairs;
[0015] The object processing model is trained in a training manner that maximizes the values corresponding to the positive samples in the third matrix and minimizes the values corresponding to the negative samples.
[0016] Optionally, it also includes:
[0017] Constructing a correct category sample pair and a misplaced category sample pair; wherein the correct category sample pair includes a sample object and a correct category path of the sample object; and the misplaced category sample pair includes a sample object and an incorrect category path of the sample object;
[0018] Training a category recognition model using the correct sample pairs of the category and the misplaced sample pairs of the category respectively;
[0019] The category recognition model is used to determine the misplacement probability of the target object and the target category path based on the target object and the target category path; the misplacement probability is used to determine whether the target object and the target category path are misplaced in combination with the matching degree.
[0020] Optionally, constructing the correct sample pairs of categories includes one or more of the following implementations:
[0021] Construct category-correct sample pairs based on the manually maintained object information and its corresponding category path;
[0022] Construct category-correct sample pairs based on the object information and corresponding category paths of objects that are manually detected as category-correct objects;
[0023] as well as,
[0024] Constructing a correct sample pair of categories based on the object information of the object whose matching degree meets the matching condition determined by using the object processing model and its corresponding category path;
[0025] The constructing of category misplaced sample pairs includes one or more of the following implementations:
[0026] Based on the object information of objects detected as misclassified objects by manual inspection and their corresponding category paths, we construct category misplaced sample pairs;
[0027] as well as,
[0028] A category misplaced sample pair is constructed based on the objects in the category correct sample pair and the similar category path corresponding to the category path in the category correct sample pair.
[0029] Optionally, the category recognition model includes a first recognition network and a second recognition network;
[0030] The training of the category recognition model by using the correct sample pairs of the category and the misplaced sample pairs of the category includes:
[0031] Selecting a plurality of training sample pairs including category-correct sample pairs and / or category-misplaced sample pairs;
[0032] Inputting multiple object information in the multiple training sample pairs into a first recognition network to obtain multiple first sample features, and inputting multiple category paths into a second recognition model to obtain multiple second sample features;
[0033] splicing the plurality of first sample features and the plurality of second sample features to obtain a fusion feature;
[0034] Performing dimensionality reduction processing on the fusion features respectively to obtain output data;
[0035] Calculating a second loss value using the output data and the misplacement probabilities of different objects and their corresponding category paths;
[0036] Update the model parameters of the category recognition model according to the second loss value.
[0037] Optionally, using the object information of the published object and the category path corresponding to the object as a training data set includes:
[0038] Determine the published object and the category path where the object is located;
[0039] For any object, if the object meets the screening conditions, the object information of the object and the category path corresponding to the object are added to the training data set.
[0040] Optionally, it also includes:
[0041] The sample objects and category paths in the correct sample pairs of the categories are used as training sample pairs and added into the training data set to retrain the object processing model.
[0042] Optionally, the screening condition includes one or more of the following implementations:
[0043] The exposure is greater than a first exposure threshold;
[0044] as well as,
[0045] The object score determined in combination with the historical interaction data of the object is greater than a second score threshold; wherein the historical interaction data includes the number of behaviors of at least one type of interactive behavior; the higher the number of behaviors, the higher the object score.
[0046] Optionally, the training of the object processing model in a training manner that maximizes the values corresponding to positive samples in the third matrix and minimizes the values corresponding to negative samples includes:
[0047] Calculate a first loss value of the current training batch using a contrastive learning loss function according to the value of the i-th row and j-th column in the third matrix;
[0048] The object processing model is updated according to the first loss value.
[0049] Optionally, using the object information of the published object and the category path corresponding to the object as a training data set includes:
[0050] Select a predetermined number of objects from any category path in the online system;
[0051] The predetermined number of objects and the category paths are added to a training data set.
[0052] Optionally, it also includes:
[0053] In a case where the target category path is a correct category path, the target object and the target category path are added to the training data set as a training sample pair to retrain the object processing model.
[0054] Optionally, constructing the category misplaced sample pair according to the objects in the category correct sample pair and the similar category path corresponding to the correct category path in the category correct sample pair includes:
[0055] Determine the correct category path in the correct category sample pair;
[0056] Determine a category path that has the same primary category as the correct category path and has a word overlap greater than an overlap threshold as a similar category path;
[0057] The object information of the objects in the correct category sample pair and the similar category path are used to obtain the misplaced category sample pair.
[0058] In a second aspect, an embodiment of the present application provides a category detection method, including:
[0059] Obtaining the target object's object information and the target category path corresponding to the target object;
[0060] Extracting target object features from the object information of the target object using an object processing model; the object processing model is trained using a plurality of training sample pairs as positive samples, and the object information in one positive sample and the category path in another positive sample as negative samples; the plurality of training sample pairs are selected from a training dataset; the training dataset consists of the object information of the published objects and the category paths of the objects;
[0061] extracting target category features from the target category path using the object processing model;
[0062] Calculating the degree of matching between the target object characteristics and the target category characteristics;
[0063] According to the matching degree, it is detected whether the target object and the category path are misplaced.
[0064] Optionally, it also includes:
[0065] Inputting the object information and the target category path into a category recognition model, and using the category recognition model to calculate the misplacement probability; the category recognition model is trained using the generated category correct sample pairs and the category misplacement sample pairs;
[0066] The determining, based on the matching degree, whether the target object and the category path are misplaced includes:
[0067] According to the matching degree and the misplacement probability, it is determined whether the target object and the category path are misplaced.
[0068] Optionally, the determining whether the target object and the category path are misplaced according to the matching degree and the misplacement probability includes:
[0069] When the matching degree is less than a first matching threshold, or when the matching degree is less than a second matching threshold and the misplacement probability is greater than a first probability threshold, determining that the target category path is an incorrect category path for the target object; and the second matching threshold is greater than the first matching threshold;
[0070] When the matching degree is greater than the second matching threshold, or the misplacement probability is less than the first probability threshold, the target category path is determined to be the correct category path of the target object.
[0071] Optionally, it also includes:
[0072] Determine multiple objects under any category path based on the search keyword hit;
[0073] using the multiple objects as the target objects respectively;
[0074] After detecting whether the target object and the category path are misplaced based on the matching degree, the method further includes:
[0075] Selecting one or more objects in a correct category path as recall objects for the search keyword based on the detection results of the multiple objects;
[0076] or,
[0077] Based on the detection results of the multiple objects, one or more objects in the correct category path are selected, and from the one or more objects in the incorrect category path, objects whose exposure volume is greater than the second exposure threshold and / or whose sales volume is greater than the first sales threshold are selected as recall objects of the search keyword.
[0078] Optionally, it also includes:
[0079] According to the detection result of the target object, if the target category path is an error category path, setting an error flag for the target object;
[0080] In the case where any category path is hit based on the search keyword, objects with error marks set under the any category path are not used as recall objects of the search keyword.
[0081] Optionally, it also includes:
[0082] Objects with an exposure volume greater than the second exposure threshold or a sales volume greater than the first sales threshold are provided to relevant personnel for manual inspection by the relevant personnel to determine whether the objects are misplaced with the corresponding category paths.
[0083] Optionally, the acquiring the object information of the target object and the target category path corresponding to the target object includes:
[0084] Determining, according to the category selection request of the object provider for the target object, the target category path selected by the object provider and the object information of the target object;
[0085] The method further comprises:
[0086] According to the detection result of the target object, if the target category path is an incorrect category path, a wrong placement prompt message is sent to the object provider.
[0087] In a third aspect, an embodiment of the present application provides a computing device, including a processing component and a storage component;
[0088] The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the model training method as described in the first aspect above or the category detection method as described in the second aspect above.
[0089] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program. When the computer program is executed by a computer, it implements the model training method as described in the first aspect above or the category detection method as described in the second aspect above.
[0090] In an embodiment of the present application, the published objects and the category paths corresponding to the objects are used as training data sets, and a batch training method is adopted. Multiple training sample pairs are selected each time, and the training sample pairs include the object information of the object and its corresponding category path. The multiple training sample pairs are input into the object processing model, and the training sample pairs are used as positive samples. The combination of the object information in one positive sample and the category path in another positive sample is used as a negative sample to train the object processing model; the object processing model is used to extract object features from the object information of the target object and to extract category features from the target category path of the target object; the object features and the category features are used to calculate the degree of matching between the target object and the target category path. By directly using the objects and category paths published by the online system for model training, there is no need to construct a training data set, no need to label, and the training cost is reduced. The use of positive and negative sample comparison training methods can reduce the impact of noise, so that the model can learn the relationship between object information and category path, thereby ensuring the accuracy of model processing, and ultimately achieving the purpose of effectively and accurately detecting objects and categories. These aspects or other aspects of the present application will be more concise and easy to understand in the description of the following embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0091] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0092] FIG1 shows a flow chart of an embodiment of a model training method provided by the present application;
[0093] FIG2 a shows a schematic diagram of training an object processing model in a practical application according to an embodiment of the present application;
[0094] FIG2 b shows a schematic diagram of calculation of an object processing model in a practical application of an embodiment of the present application;
[0095] FIG3 shows a schematic diagram of training a category recognition model in an actual application according to an embodiment of the present application;
[0096] FIG4 shows a flow chart of an embodiment of a category detection method provided by the present application;
[0097] FIG5a shows a schematic diagram of a scene interaction in a practical application of an embodiment of the present application;
[0098] FIG5 b shows another schematic diagram of scene interaction in an actual application of an embodiment of the present application;
[0099] FIG6 shows a schematic diagram of a category detection process in an actual application of an embodiment of the present application;
[0100] FIG7 shows a schematic structural diagram of an embodiment of a model training device provided by the present application;
[0101] FIG8 shows a schematic structural diagram of an embodiment of a category detection device provided by the present application;
[0102] FIG9 shows a schematic structural diagram of an embodiment of a computing device provided by the present application. DETAILED DESCRIPTION
[0103] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0104] In some of the processes described in the specification and claims of this application and the above-mentioned figures, multiple operations that appear in a specific order are included, but it should be clearly understood that these operations may not be executed in the order in which they appear in this document or may be executed in parallel. The serial numbers of the operations, such as 101, 102, etc., are only used to distinguish between different operations, and the serial numbers themselves do not represent any order of execution. In addition, these processes may include more or fewer operations, and these operations may be executed in sequence or in parallel. It should be noted that the descriptions of "first", "second", etc. in this document are used to distinguish different messages, devices, modules, etc., and do not represent a sequential order, nor do they limit "first" and "second" to being different types.
[0105] The technical solutions of the embodiments of this application can be applied to online systems that provide objects for users to perform interactive behaviors. For example, the objects can be commodities, and the online system can be an online trading platform, where users can perform interactive behaviors such as purchasing, adding objects to favorites, and adding items to cart. Of course, objects can also refer to content such as articles and news, and the online system can be an information provider that provides information for users to browse and view, and this application does not limit this.
[0106] As described in the background technology, how to effectively detect objects that are misplaced in categories is a technical problem that needs to be solved at present. In the process of realizing this application, the inventors found that it is possible to consider using model capabilities to realize the detection of objects that are misplaced in categories, such as realizing a processing model for text matching or text classification. However, such models are usually supervised models. For example, a supervised text matching model is used to calculate the probability of misplacement of objects and category paths. Such supervised models require the use of a large number of pre-labeled training samples for training. However, training samples are difficult to obtain, and the workload of manual labeling is large. Categories that cannot be covered in the corresponding training data set cannot be identified. Therefore, these models are usually unable to achieve accurate detection.
[0107] In order to achieve effective and accurate detection of objects that are misplaced in categories, the inventors have developed the technical solution of the present application after a series of studies. In the embodiment of the present application, the published objects and the category paths corresponding to the objects are directly used as training data sets, and a training batch method is adopted. Multiple training sample pairs are selected each time. The training sample pairs are composed of the object information of the object and the corresponding category path. The multiple training sample pairs are input into the object processing model, and each training sample pair is used as a positive sample. The combination of the object information in a positive sample and the category path in another positive sample is used as a negative sample to train the object processing model; the object processing model can be used to extract object features from the object information of the target object and extract category features from the target category path of the target object; the object features and category features are used to calculate the degree of matching between the target object and the target category path. The embodiment of the present application directly uses the published objects and category paths for model training, so there is no need to build a training data set and no need to manually annotate labels, which reduces the training cost; and although there is noise in the published objects and category paths, they still contain a large number of correct category objects. Model training is performed based on this, so that the model has good generalization ability and can learn the implicit association information between objects and category paths, thereby ensuring the accuracy of model processing, and through the comparative training method of positive samples and negative samples, the model is not affected by noise, and ultimately achieves effective detection. The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of this application.
[0108] Figure 1 is a flowchart of an embodiment of a model training method provided in an embodiment of the present application. The technical solution of this embodiment can be executed by a processing end, which can be a server in an online system, or of course, other nodes independent of the server in the online system.
[0109] In practical applications, an online system typically consists of a first client, a second client, and a server. The first client, the second client, and the server are each connected via a network. The network provides the medium for the communication link between the first client, the second client, and the server. Networks can include various connection types, such as wired or wireless communication links or fiber optic cables.
[0110] The first user end may be oriented towards an object provider, operated by the object provider to publish objects, etc., and the second user end may be oriented towards consumer users, allowing consumer users to perform interactive behaviors such as object search and browsing.
[0111] The first and second user terminals can interact with the server terminal via the network to receive or send messages. For example, the first user terminal can perceive the category selection and publishing operations of the object provider and send corresponding requests to the server terminal for processing. The second user terminal can perceive the interactive behavior performed by the consumer and send corresponding interaction requests to the server terminal. The server terminal can process the interaction request and feedback the processing results to the second user terminal.
[0112] The first user terminal or the second user terminal may be a browser, an APP (Application), or a web application such as an H5 (HyperText Markup Language 5) application, a light application (also known as a mini-program, a lightweight application), or a cloud application. The first user terminal or the second user terminal may be deployed in an electronic device and may rely on the device to run or on certain apps in the device to run. The electronic device may, for example, have a display screen and support information browsing, and may be a personal mobile terminal such as a mobile phone, a tablet computer, a personal computer, a desktop computer, a smart speaker, a smart watch, and the like.
[0113] The above-mentioned processing end or service end may include a server that provides various services, such as a server for background training that provides support for the model used on the user end 101, or a server that processes interactive information sent by the user end.
[0114] It should be noted that the processing end or service end can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. The server can also be a server in a distributed system, or a server integrated with blockchain. The server can also be a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology.
[0115] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, user-specific personal data can be used in the scheme described herein within the scope permitted by applicable laws and regulations, subject to the requirements of applicable laws and regulations of the country where the user is located (for example, with the user's explicit consent, effective notification to the user, etc.).
[0116] It should be noted that the technical solution of the embodiment of the present application is applicable to a network virtual environment. The users described generally refer to "virtual users". Real users can register user accounts in the server through registration to obtain user identities in the network environment. In the embodiment of the present application, the same user account can be used to log in to the server through different types of clients, so that the server can identify the same user. Of course, different user accounts can also be used to log in to the server through different types of clients. The server stores binding relationships between different user accounts, so that different user accounts with binding relationships can be considered to be the same user.
[0117] The model training method provided in the embodiment shown in FIG1 may include the following steps:
[0118] 101: The object information of the published object and the category path of the object are used as a training data set.
[0119] Object providers can request the online system to publish objects, making them available for viewing in the online system. These published objects refer to all objects currently available in the online system, meaning all objects currently available for user interaction.
[0120] To facilitate user understanding of objects, online systems typically also provide an object details page to introduce relevant information about the object. This object details page may include basic information such as the object title, details, and an image. Therefore, object information may include, for example, the object title, details, and / or an image. In practical applications, since object titles are typically generated based on the object's own characteristics and can represent the object's characteristics, object information may include at least the object title. An object title may be expressed in text form, such as "Men's Shoes 2023 Autumn / Winter Fashion Korean Style Full Size Basketball Sneakers Men's Running Shoes."
[0121] The category path of an object may refer to the category path selected for the object by the object provider when publishing the object. To facilitate the selection by the object provider, optionally, multiple category paths matching the object may be determined based on the relevant information of the object requested to be published by the object provider, and the multiple category paths may be recommended to the object provider so that the object provider can select the category path to which the object belongs.
[0122] A category path is composed of first-level categories, second-level categories, and so on to leaf categories. For example, a category path can be expressed as: Fashion → Men → Shoes → Sports Shoes. "Sports Shoes" is a leaf category used to bind an object. "Fashion" is a first-level category. From "Fashion" to "Sports Shoes", it is necessary to pass through the second-level category "Men" and the third-level category "Shoes".
[0123] In addition, in order to improve the quality of the training data set, the data can also be cleaned. Optionally, using the object information of the published object and the category path corresponding to the object as the training data set can include: determining the object published by the online system and the category path where the object is located; for any object, if the object meets the screening conditions, the object information and the category path corresponding to the object are added to the training data set.
[0124] That is, only the object information category paths corresponding to the objects that meet the screening conditions are added to the training data set.
[0125] The screening conditions may include, for example, one or more of the following implementations:
[0126] The exposure is greater than a first exposure threshold;
[0127] as well as,
[0128] The object score determined in combination with historical interaction data of the object is greater than a second score threshold; wherein the historical interaction data includes the number of behaviors of at least one type of interactive behavior; the higher the number of behaviors, the higher the object score.
[0129] The object exposure may refer to, for example, the number of times the object is viewed by users.
[0130] Among them, at least one interactive behavior type may include, for example, browsing, saving, adding to a shopping cart, or purchasing. By counting the number of behaviors of at least one interactive behavior type, a score can be assigned to the object. The object score represents the quality of the object to a certain extent. The higher the object score, the better the object quality. There are many ways to score, which can be implemented through scoring rules or models, etc., and this application does not limit this.
[0131] Optionally, since the number of objects under the leaf category presents a long-tail distribution, the number of objects is often large. Optionally, the object information of the published objects and the category path corresponding to the objects can be used as a training data set: select a predetermined number of objects from any category path of the online system; add the predetermined number of objects and category paths to the training data set.
[0132] That is, it is limited to selecting only a predetermined number of objects under each category path as training data. Optionally, a predetermined number of objects may be randomly selected. In actual applications, the predetermined number may be, for example, 50,000.
[0133] 102: Select multiple training sample pairs of the current training batch from the training dataset.
[0134] Among them, the training sample pair consists of object information and its corresponding category path.
[0135] In the training dataset, the object information of each object and its corresponding category path constitute a set of training sample pairs.
[0136] Model training can be performed in batches. For each training batch, multiple training sample pairs can be selected from the training dataset. The number of training sample pairs can be determined based on actual operational conditions. Generally, a larger number of sample pairs results in a more accurate model, but also results in a higher computational load.
[0137] 103: Input multiple training samples into the object processing model, use the training sample as a positive sample, and the object information in one positive sample and the category path in another positive sample as a negative sample to train the object processing model.
[0138] After selecting multiple training sample pairs, the model can be trained using the multiple training sample pairs. In the embodiment of the present application, an unsupervised training method is adopted, and each training sample pair is used as a positive sample, and the object information in any positive sample and the category path in the other positive sample constitute a negative sample to train the object processing model.
[0139] For example, suppose the data set consisting of multiple training sample pairs is [(t1, c1)(t2, c2)……(t n , c n )], t represents the object information, and c represents the category path. The i-th object information and the i-th category path constitute a positive sample, and the i-th object information and the remaining category paths except the i-th category path constitute a negative sample. Where i = 1, 2, 3, ..., n, where n is a positive integer representing the number of sample pairs in the multiple training sample pairs.
[0140] Specifically, a contrastive learning method may be used for model training, with the training objectives being to maximize the matching degree corresponding to positive samples and minimize the matching degree corresponding to negative samples, and to train the object processing model.
[0141] The object processing model can be used to extract object features from the object information of the target object and extract category features from the target category path of the target object; the object features and category features are used to calculate the matching degree between the target object and the target category path.
[0142] The target object is any object to be detected. By combining the degree of match between the target object and the target category path, it is possible to determine whether the target category path is a misplaced category distance, thereby achieving effective and accurate detection of misplaced objects.
[0143] In this embodiment, the objects and category paths published by the online system are directly used for model training, so there is no need to build a training data set or manually annotate labels, which reduces the training cost. Although there is noise in the objects and category paths published by the online system, they still contain a large number of correct category objects. Model training is performed based on this, so that the model has good generalization ability and can learn the implicit association information between objects and category paths, thereby ensuring the accuracy of model processing. The unsupervised training method can reduce the impact of noise, and ultimately achieve effective detection of misplaced objects.
[0144] In some embodiments, the above-mentioned input of multiple training sample pairs into the object processing model, with each training sample pair as a positive sample, and the object information in one positive sample and the category path in another positive sample as a negative sample, the training object processing model includes:
[0145] Input multiple object information in multiple training sample pairs into the object processing model to obtain multiple first sample features; input multiple category paths in the multiple training sample pairs into the object processing model to obtain multiple second sample features; perform matrix multiplication on a first matrix composed of multiple first sample features and a second matrix composed of multiple second sample features to obtain a third matrix; wherein the value of the i-th row and j-th column in the third matrix represents the similarity between the i-th object and the j-th category path; wherein i=1, 2, 3...n, j=1, 2, 3...n; i and j are different; n is a positive integer used to represent the number of sample pairs in the multiple training sample pairs; the object processing model is trained in a training method that maximizes the value corresponding to the positive sample in the third matrix and minimizes the value corresponding to the negative sample.
[0146] Among them, each training sample pair can be expressed as (t i , c i ), t i Indicates the information of the i-th object, c i Represents the i-th category path; the data set composed of the multiple training sample pairs is [(t1, c1)(t2, c2)……(t n , c n )]; wherein, n object information in n training sample pairs is input into the object processing model, and n first sample features can be obtained. These n first sample features can constitute a first matrix ET = [T1, T2, ..., T2]. Similarly, n category paths in n training sample pairs are input into the object processing model, and n second sample features can be obtained. These n second sample features can constitute a second matrix EC = [C1, C2, ..., C2]. Multiplying the first matrix by the second matrix, that is, ET*EC, can obtain an n*n third matrix. This third matrix can be expressed as:
[0147] The values T1C1, T2C2, ..., T n C n They correspond to positive samples respectively, and the values at other positions correspond to negative samples.
[0148] The value of the i-th row and j-th column in the third matrix can represent the matching degree between the object information and the category path, which can be recorded as P(c j |t j ).
[0149] The object processing model can be trained by maximizing the values corresponding to the positive samples in the third matrix and minimizing the values corresponding to the negative samples, that is, using a contrastive learning method.
[0150] Assuming that the first and second sample features are normalized vector features, the degree of match between the object and the category path in the positive sample should be 1, while the degree of match between the object and the category path in the negative sample should be 0. Therefore, the object processing model can be trained by making the values corresponding to the positive samples in the third matrix as close to 1 as possible and the values corresponding to the negative samples as close to 0 as possible. The values corresponding to the positive samples are the values in the i-th row and i-th column, and the values corresponding to the negative samples are the values in the i-th row but not the i-th column.
[0151] In practical applications, the object processing model can be trained in conjunction with a loss function. Therefore, in some embodiments, the object processing model can be trained in a manner that maximizes the values corresponding to positive samples in the third matrix and minimizes the values corresponding to negative samples. The training may include:
[0152] According to the value of the i-th row and j-th column in the third matrix, a first loss value of the current training batch is calculated using a contrastive learning loss function; and the object processing model is updated according to the first loss value.
[0153] Optionally, the contrastive learning loss function may be implemented, for example, by the following function, although the present application is not limited thereto:
[0154] Where τ represents the temperature coefficient, which is a scalar.
[0155] Among them, the first loss value represents the difference between the model prediction result and the actual result. According to the first loss value, the gradient of the model parameters can be calculated, and the object processing model is updated based on the gradient using the back-propagation method. In practical applications, n can be set to 512, the temperature coefficient can be set to 1, and the learning rate of the model can be 3e-5. Among them, the learning rate is one of the important hyperparameters of the training model. It represents the step size of the gradient moving toward the loss function in each iteration. In addition, the object information and category path can be represented in text form. The object information and category path can be processed by word segmentation respectively, and then the text sequence composed of the word segmentation results is input into the model. In order to ensure computing performance, etc., the length of the sequence can be no greater than a predetermined length, which can be 128, for example. After the object information or category path is word segmented, if the number of word segmentation elements obtained is greater than 128, only the first 128 word segmentation elements can be taken to form the corresponding text sequence.
[0156] Among them, the object processing model can be implemented using BERT (Bidirectional Encoder Representations from Transformers, a bidirectional semantic encoding representation model built based on transformers). The object processing model may include a first processing model and a second processing model. The first processing model and the second processing model may, for example, be composed of a BERT-Small (small configuration BERT) model, a Projector (mapper) component, and an L2 Norm (L2 normalization, used to convert a set of numbers into a value between 0 and 1) component. The BERT-Small model is a pre-trained model that can be used to extract feature vectors. The Projector component refers to a linear mapping layer that can be used as a fully connected network to increase the number of feature parameters to increase the model's expressiveness. The L2 Norm component is used to normalize the feature vectors to increase model stability. Among them, the BERT-Small model can use a 4-layer Transformer model with 8 attention heads and a hidden layer dimension of 512. The Projector component can be a linear mapping layer with both input and output dimensions of 512.
[0157] For ease of understanding, in the training diagram of the object processing model shown in Figure 2a, multiple object information in the current training batch can be simultaneously input into the first processing model 201, and multiple category paths can be simultaneously input into the second processing model 202. The first processing model 201 and the second processing model 202 have the same model structure and share parameters.
[0158] In the computational diagram of the object processing model shown in FIG2b , the first processing model 201 is processed to obtain a plurality of first sample features T1, T2, ..., T2, forming a first matrix ET. The second processing model 202 is processed to obtain a plurality of second sample features C1, C2, ..., C2, forming a second matrix EC. The first matrix ET and the second matrix EC are multiplied to obtain a third matrix.
[0159] Afterwards, by combining the values in the third matrix and using the loss function to calculate the first loss value, the parameters of the first processing model or the second processing model can be updated to achieve the purpose of training the object processing model.
[0160] As an optional method, the first processing model and the second processing model can be the same model with the same model structure and parameters. The object information and category path can share the same processing model with consistent structure and shared parameters.
[0161] In addition, as another optional method, the first processing model and the second processing model can also be two different models with the same model structure but different parameters. When training the object processing model, the parameters of the first processing model and the second processing model can be adjusted separately.
[0162] In some embodiments, to further ensure the accuracy of the model, the method may further include:
[0163] When the target category path is a correct category path, the target object and the target category path are added to the training data set as a training sample pair to retrain the object processing model.
[0164] The target category path is the correct category path, and the training sample pair is the correct category sample pair. Therefore, the credibility of the training sample pair can be improved, which is more conducive to the model learning the association between object information and category path.
[0165] In some embodiments, to further improve the accuracy of category detection, the method may further include:
[0166] Constructing category-correct sample pairs and category-misplaced sample pairs; wherein the category-correct sample pairs include sample objects and correct category paths of the sample objects; and the category-misplaced sample pairs include sample objects and incorrect category paths of the sample objects;
[0167] Use the correct category sample pairs and the incorrect category sample pairs to train the category recognition model;
[0168] Among them, the category recognition model is used to determine the misplacement probability of the target object and the target category path based on the target object and the target category path; the misplacement probability is used to determine whether the target object and the target category path are misplaced in combination with the matching degree.
[0169] Among them, the category recognition model is a supervised model, and the training label corresponding to the correct category sample pair can be the misplacement probability of the sample object and the correct category path; the training label of the category misplacement sample pair can be the misplacement probability of the sample object and the wrong category path. The misplacement probability of the sample object and the correct category path can be represented by 0; the misplacement probability of the sample object and the wrong category path can be represented by 1. At this time, the misplacement probability calculated by the category recognition model can be a value between 0 and 1.
[0170] Among them, using the correct category sample pairs and the misplaced category sample pairs respectively, the category recognition model can be trained by: taking the sample objects of the correct category sample pairs and the correct category paths of the sample objects as model input data, and the misplacement probability of the sample objects and the correct category paths as training labels to train the category recognition model; and taking the sample objects of the misplaced category sample pairs and the wrong category paths of the sample objects as model input data, and the misplacement probability of the sample objects and the wrong category paths as training labels to train the category recognition model.
[0171] In some embodiments, the category recognition model may include a first recognition network and a second recognition network. The first and second recognition networks utilize correct category sample pairs and misplaced category sample pairs, respectively. Training the category recognition model may include:
[0172] Selecting multiple training sample pairs including correct category sample pairs and / or misplaced category sample pairs; inputting multiple object information in the multiple training sample pairs into a first recognition network to obtain multiple first sample features, and inputting multiple category paths into a second recognition network to obtain multiple second sample features; concatenating the multiple first sample features and the multiple second sample features to obtain fused features; performing dimensionality reduction processing on the fused features to obtain output data; calculating a second loss value using the output data and the misplacement probability of the object and the correct category path; and updating model parameters of the category recognition model based on the second loss value;
[0173] The training of the category recognition model may also be performed in batches. Each training batch may select multiple training sample pairs, and the multiple training sample pairs may include correct category sample pairs and / or misplaced category sample pairs.
[0174] Among them, splicing multiple first sample features and multiple second sample features can be a vector combination or vector product, etc., so as to obtain a fusion feature. Assuming that each first sample feature is and each second sample feature is a d-dimensional vector, multiple first sample features constitute an m*d-dimensional vector, and multiple second sample features constitute an m*d-dimensional vector, m is the number of sample pairs of multiple training sample pairs, and the combination of multiple first sample features and multiple second sample features can obtain an m*2d-dimensional vector, for example.
[0175] The fused features are subjected to dimensionality reduction processing, for example, to obtain m*1-dimensional output data. Based on this output data and the misplacement probability of different objects and their corresponding paths, a second loss value can be calculated, and the model parameters of the category recognition model can be updated based on the second loss value.
[0176] For example, the second loss value may be calculated using a cross entropy loss function. Of course, the present application is not limited thereto.
[0177] The probability of misplacing an object with a correct category path may be 0, while the probability of misplacing an object with an incorrect category path may be 1.
[0178] Among them, the first recognition network and the second recognition network can be implemented using the same model structure, and can share or not share model parameters, that is, the first recognition network and the second recognition network can have the same model parameters and the same model structure. When performing model training, the model parameters of the first recognition network and the second recognition network are adjusted uniformly, or the model results can be the same but the model parameters are different, and the model parameters of the first recognition network and the second recognition network are adjusted separately during model training.
[0179] Optionally, the category recognition network may further include a connection layer for concatenating multiple first sample features and multiple second sample features to obtain fused features; and may further include an output layer for performing dimensionality reduction processing on the fused features to obtain output data.
[0180] The first recognition network and the second recognition network may adopt the same model structure as the first processing model and the second processing model, for example, they may be composed of a BERT-Small model, a Projector component, and an L2 Norm component.
[0181] For ease of understanding, as shown in Figure 3, a training diagram of the category recognition model is shown. Object information can be input into the first recognition network 301, and the category path can be input into the second recognition network 302. The model results of the first recognition network 301 and the second recognition network 302 are the same, but the parameters are different.
[0182] The multiple first sample features obtained by the first recognition network 301 and the multiple second sample features obtained by the second recognition network 302 can be spliced through the connection layer 303 to obtain fused features. The fused features can be subjected to dimensionality reduction processing in the output layer 304 to obtain output data. Based on the output data, the second loss value can be calculated using the loss function. Based on the first loss value, the model parameters of the first recognition network, the second recognition network, the connection layer and the output can be updated to achieve the purpose of training the category recognition model.
[0183] The gradient of the model parameters can be calculated based on the second loss value, and the category recognition model is updated based on the gradient using the back propagation method. In practical applications, m can be taken as 300, and the learning rate of the model can be 3e-5. In addition, both the object information and the category path can be represented in text form. The object information and the category path can be processed by word segmentation respectively, and then the text sequence composed of the word segmentation results is input into the model. In order to ensure computing performance, etc., the sequence length can be no greater than a predetermined length, which can be 128, for example. After the object information or category path is segmented, if the number of word segmentation elements obtained is greater than 128, only the first 128 word segmentation elements can be taken to form the corresponding text sequence.
[0184] In some embodiments, constructing the correct sample pairs for the categories may include one or more of the following implementations:
[0185] Construct category-correct sample pairs based on manually maintained objects and their corresponding category paths in the online system;
[0186] Construct category-correct sample pairs based on objects that are manually detected as category-correct and their corresponding category paths;
[0187] as well as,
[0188] Constructing category-correct sample pairs based on the object information and corresponding category paths of objects whose matching degree meets the matching conditions determined by the object processing model;
[0189] For example, if the online system is an online trading platform, during promotional product selection activities, operations and maintenance personnel will specifically maintain certain products. The category paths corresponding to these maintained products are correct. Therefore, manually maintained objects and their corresponding category paths can be used as category-correct sample pairs. For example, in a search scenario, search results can be manually evaluated to determine whether the objects match the category paths. Therefore, objects manually detected as category-correct and their corresponding category paths can be used as category-correct sample pairs.
[0190] In addition, the object processing model obtained through the above training can be used to determine the degree of matching between the object information of any object published by the online system and its corresponding category path, so that the object information and category intersections whose matching degree meets the matching conditions can be selected as the correct category sample pairs.
[0191] The matching condition may be, for example, that the degree of matching is greater than a specified threshold.
[0192] In some embodiments, constructing the category misplaced sample pairs may include one or more of the following implementations:
[0193] Based on the object information of objects that are manually detected as misclassified and their corresponding category paths, we construct misclassified sample pairs.
[0194] as well as,
[0195] According to the objects in the correct category sample pairs and the similar category paths corresponding to the category paths in the correct category sample pairs, the misplaced category sample pairs are constructed.
[0196] That is, in one implementation, the object information of the object manually detected as being misclassified and its corresponding category path may be used as a misclassified sample pair.
[0197] In addition, in order to further improve the accuracy of the model, as another implementation method, a category misplaced sample pair can be constructed based on the category correct sample pair. Since one object only corresponds to one category correct sample pair, by finding a similar category path corresponding to the category path in the category correct sample pair, the object information of the similar category and the category correct sample pair can be used as a category misplaced sample pair.
[0198] Of course, as another optional method, the object information of the object in the correct category sample pair and any category path other than the correct category path may be combined to form the misplaced category sample pair.
[0199] In some embodiments, constructing a category misplaced sample pair based on the objects in the category correct sample pair and the similar category path corresponding to the correct category path in the category correct sample pair may include:
[0200] Determine the correct category path in the correct category sample pair;
[0201] Determine similar category paths that meet similar conditions as the correct category path;
[0202] The object information of the object in the correct category sample pair and the similar category path are used to obtain the misplaced category sample pair.
[0203] Among them, the similarity condition can be, for example, that the first-level category is the same and the word overlap is greater than the overlap threshold. Therefore, the category path that is the same as the first-level category of the correct category path and has a word overlap greater than the overlap threshold can be used as a similar category path.
[0204] The word overlap can be calculated as the ratio of the number of identical words to the total number of words. Different category paths can be represented by text sequences of a specified length. By counting the number of identical words, the ratio of the number of identical words to the total number of words corresponding to the specified length can be used as the word overlap.
[0205] In some embodiments, the method may further include:
[0206] The sample objects and category paths in the correct sample pairs of categories are used as training sample pairs and added to the training dataset to retrain the object processing model.
[0207] FIG4 is a flowchart of an embodiment of a category detection method provided by an embodiment of the present application. This embodiment introduces the technical solution of the present application from the perspective of model application. The technical solution of this embodiment can be executed by a processing end or by a server end of an online system. The method may include the following steps:
[0208] 401: Obtain the object information of the target object and the target category path corresponding to the target object.
[0209] The target object may refer to any object published by the online system, or may refer to any object requested to be published by an object provider.
[0210] 402: Extract target object features from the object information of the target object using the object processing model.
[0211] 403: Extract target category features from the target category path using the object processing model.
[0212] Among them, the object processing model is trained using multiple training sample pairs as positive samples, and the object information in one positive sample and the category path in another positive sample as negative samples; multiple training sample pairs are selected from the training data set; the training data set is composed of the object information and category path of the objects published by the online system.
[0213] The specific method of generating the object processing model can be found in the embodiment shown in FIG1 , and will not be described in detail here.
[0214] The object processing model can extract target object features and target category features respectively.
[0215] 404: Calculate the matching degree between the target object characteristics and the target category characteristics.
[0216] Among them, the matching degree can be obtained by multiplying the target object feature with the target category feature. When the feature is represented by a vector, it is obtained by calculating the vector dot product, which is consistent with the calculation method when the object processing model is trained.
[0217] 405: Based on the degree of matching, check whether the target object and target category path are misplaced.
[0218] For example, when the degree of matching is less than a certain threshold, it may be considered that the target object and the target category path are misplaced, and the target category path is an incorrect category path. When the degree of matching is greater than a certain threshold, it may be considered that the target object and the target category path are not misplaced, and the target category path is a correct category path.
[0219] In addition, in order to further improve the detection accuracy, in some embodiments, the method may further include:
[0220] The object information and target category path are input into the category recognition model, and the misplacement probability is calculated using the category recognition model.
[0221] The category recognition model is obtained by training the correct category sample pairs generated by constructing the generated category with the misplaced category sample pairs; the specific generation method of the category recognition model can be found in the corresponding embodiment described above and will not be repeated here.
[0222] The above-mentioned determination of whether the target object and the category path are wrong based on the degree of matching includes:
[0223] Determine whether the target object and category path are misplaced based on the matching degree and misplacement probability.
[0224] That is, the matching degree and misplacement probability can be combined to determine whether the target object and the category path are misplaced.
[0225] As an optional manner, when the matching degree is less than the first matching threshold, or when the matching degree is less than the second matching threshold and the misplacement probability is greater than the first probability threshold, the target category path is determined to be the wrong category path of the target object; and the second matching threshold is greater than the first matching threshold;
[0226] When the matching degree is greater than the second matching threshold, or the misplacement probability is less than the first probability threshold, the target category path is determined to be the correct category path of the target object.
[0227] For example, in actual applications, the first matching threshold may be 0.2, the second matching threshold may be 0.6, the first probability threshold may be 0.85, and so on.
[0228] The technical solutions of the embodiments of the present application can be applied to search scenarios. A search action can be performed based on a search keyword provided by a user through a second user terminal to recall an object. In some embodiments, the method can further include:
[0229] Determine multiple objects under any category path based on the search keyword hit; and use the multiple objects as target objects respectively;
[0230] As an optional approach, after detecting whether the target object and the category path are misplaced based on the matching degree, the method may further include:
[0231] According to the detection results of multiple objects, one or more objects in the correct category path are selected as recall objects for the search keyword.
[0232] That is, the technical solution of the embodiment of the present application can be used to screen multiple objects under any category path hit by the search keyword, and only one or more objects in the correct category path can be used as recall objects.
[0233] After obtaining the recalled objects, the recalled objects may be sorted, and finally, according to the sorting result, the object prompt information of the recalled objects is fed back to the second user terminal as a search result for the user to view.
[0234] As another optional method, after detecting whether the target object and the category path are misplaced based on the matching degree, the method may further include:
[0235] Based on the detection results of multiple objects, one or more objects in the correct category path are selected, and from one or more objects in the wrong category path, objects with exposure greater than a second exposure threshold or sales greater than a first sales threshold are selected as recall objects for the search keywords.
[0236] That is, in addition to recalling one or more objects in the correct category path, one or more objects in the wrong category path can also be screened, and objects with high exposure and / or high sales volume can also be recalled.
[0237] In addition, in some embodiments, the method may further include:
[0238] Objects with an exposure volume greater than the second exposure threshold or a sales volume greater than the first sales threshold are provided to relevant personnel for manual inspection by the relevant personnel to determine whether the objects are misplaced with the corresponding category paths.
[0239] By manually detecting objects with high exposure and / or high sales volume, it is determined whether the corresponding category path is a correct category path or an incorrect category path.
[0240] According to the manual detection results, category-correct sample pairs can be generated for objects with correct category paths, and category-misplaced sample pairs can be generated for objects with incorrect category paths, so that the category recognition model can be retrained to fine-tune and update the category recognition model.
[0241] In addition, in some embodiments, the method may further include:
[0242] According to the detection result of the target object, if the target category path is an error category path, an error flag is set for the target object;
[0243] In the case where any category path is hit based on the search keyword, objects with error marks set under any category path will not be used as recall objects of the search keyword.
[0244] That is, objects that are determined to be misplaced in the category path can be added to the blacklist so that they will no longer be hit by search keywords.
[0245] In the scene interaction diagram shown in Figure 5a, the user can send a search request to the server 502 through the second user terminal 501, and the search request carries the search keyword. The server 502 can determine any category path hit by the search keyword, and can only recall objects under the arbitrary category path that are not set with error marks, and generate search results based on the recall results and feedback to the second user terminal 501; of course, the server 502 can also perform real-time detection and processing on multiple objects under the arbitrary category path to determine the objects of the correct category path and the objects of the incorrect category path, and determine the recalled objects accordingly.
[0246] In addition, the technical solutions of the embodiments of the present application can also be applied to object publishing scenarios to prompt the object provider whether the category path selection is incorrect, etc. Therefore, in some embodiments, the object information of the target object and the target category path corresponding to the target object can include:
[0247] Determine the target category path and the target object information selected by the object provider according to the category selection request of the target object by the object provider;
[0248] The method may further include: according to the detection result of the target object, when the target category path is an erroneous category path, sending a wrong placement prompt message to the object provider.
[0249] Optionally, the misplacement prompt information may be sent to the first user terminal so that the first user terminal generates the misplacement prompt information.
[0250] The above-mentioned category selection request is generated and sent by the first user terminal in response to the category selection operation of the object provider.
[0251] In the scenario interaction diagram shown in FIG5b , the object provider can send a category selection request to the server 502 via the first user terminal 503 for the target object to be published. The server 502 can determine the target category path selected by the object provider and the object information of the target object based on the category selection request, and can perform category detection on it. If it is determined that the target category path is an incorrect category path, the server 502 can feedback a misplacement prompt message to the first user terminal 503, so that the first user terminal 503 can output the misplacement prompt message. The misplacement prompt message can prompt the object provider whether to modify the selected target category path, etc. If the target category path is the correct category path, the target object can be published according to the correct category path.
[0252] In a practical application of an embodiment of the present application, the online system may refer to an online trading platform, and the object may refer to a commodity provided by the online trading platform. The following takes the commodity provided by the online trading platform as an example, and introduces the technical solution of the present application in combination with the category detection process diagram shown in Figure 6.
[0253] First, we can use the product information and corresponding category paths of the products published on online trading platforms as a training dataset. Each product information and its corresponding category path constitute a training sample pair. Next, we select multiple training sample pairs from the current training batch from the training dataset. These pairs can then be input into the object processing model, using the training sample pairs as positive samples and the product information in one positive sample and the category path in the other positive sample as negative samples. We can then use comparative learning to train the object processing model. This effectively utilizes semi-supervised data on the categories published by merchants, giving the model good generalization capabilities and reducing the requirement for manually labeled data.
[0254] In addition, category-correct sample pairs and category-misplaced sample pairs can also be constructed. The construction methods of category-correct sample pairs and category-misplaced sample pairs can be described in detail above, which can include category-misplaced sample pairs composed of similar category paths corresponding to the objects in the category-correct sample pairs and the category paths in the category-correct sample pairs. This application constructs Hard (wrong) type category-misplaced sample pairs through the category path similarity algorithm, which can help improve the model accuracy.
[0255] As shown in Figure 6, the relevant information of the goods requested to be released by the merchant can be stored in the product information library 60, and any product in the product information library 60 can be used as the target product to be detected. Based on the product title and target category path of the target product, the object processing model 61 and the category recognition model 62 obtained by the above training can be processed respectively to obtain the corresponding matching degree SimSore and misplacement probability MiscatScore. In combination with the matching degree and misplacement probability, a misplacement detection operation 601 can be performed, wherein the misplacement detection condition can be, for example: ((MiscatScore>0.8)&(SimScore<0.6))||(SimScore<0.2).
[0256] Combined with the results of the misplacement detection condition, the correct category path and the incorrect category path can be determined. The correct category path products can be recalled, and the incorrect category path products can be further processed in the product judgment module 602 to determine their exposure value (pv) and / or sales volume (order). The product judgment condition can be, for example, (pv < 500) & (order < 2).
[0257] In other words, products with low exposure, such as those with a PV less than 500 and low sales volume, such as those with orders less than 2, can be recalled during the object recall phase 604 of the search scenario. However, products with high exposure, such as those with a PV greater than 500 or high sales volume, such as those with orders greater than 2, can be recalled and sent to relevant personnel for manual inspection 603. Based on the manual inspection results, correct category sample pairs or incorrect category sample pairs can be constructed to further train the category recognition model. Of course, correct category sample pairs can also be used to further train the object processing model.
[0258] In the embodiment of the present application, an object processing model can be constructed based on a comparative learning approach, and the model can be pre-trained using semi-supervised data on categories released by merchants, so that the model can learn the implicit association information and knowledge of product titles and product category paths. In addition, a category recognition model can be constructed, and the model can be trained by creating pairs of category misplaced samples and pairs of category correct samples to enable the model to recognize misplaced products. The technical solution of the embodiment of the present application can be applied to some product search scenarios, thereby improving search relevance, and can accumulate category misplaced sample pairs and category correct sample pairs, so as to achieve the purpose of continuous fine-tuning and optimization of the model.
[0259] FIG7 is a schematic diagram of the structure of an embodiment of a model training device provided in an embodiment of the present application, which may include:
[0260] The data acquisition module 701 is used to use the object information of the published object and the category path of the object as a training data set;
[0261] The data selection module 702 is used to select multiple training sample pairs of the current training batch from the training data set; wherein the training sample pairs include object information and its corresponding category path;
[0262] A first training module 703 is configured to input a plurality of training sample pairs into an object processing model, using the training sample pairs as positive samples, and the object information in one positive sample and the category path in the other positive sample as negative samples, to train the object processing model;
[0263] The object processing model is used to extract object features from the object information of the target object and to extract category features from the target category path of the target object; the object features and category features are used to calculate the matching degree between the target object and the target category path.
[0264] In some embodiments, the first training module is specifically used to input multiple object information in multiple training sample pairs into the object processing model to obtain multiple first sample features; input multiple category paths in multiple training sample pairs into the object processing model to obtain multiple second sample features; perform matrix multiplication on a first matrix composed of multiple first sample features and a second matrix composed of multiple second sample features to obtain a third matrix; wherein the value in the i-th row and j-th column of the third matrix represents the similarity between the i-th object and the j-th category path; wherein, i=1, 2, 3...n, j=1, 2, 3...n; i and j are different; n is a positive integer used to represent the number of sample pairs in multiple training sample pairs; the object processing model is trained in a training method that maximizes the values corresponding to positive samples in the third matrix and minimizes the values corresponding to negative samples.
[0265] In some embodiments, the apparatus may further include:
[0266] A sample construction module is used to construct a correct sample pair of a category and a misplaced sample pair of a category; wherein the correct sample pair of a category includes a sample object and a correct category path of the sample object; and the misplaced sample pair of a category includes a sample object and an incorrect category path of the sample object;
[0267] The second training module is used to train the category recognition model using the correct category sample pairs and the misplaced category sample pairs respectively;
[0268] Among them, the category recognition model is used to determine the misplacement probability of the target object and the target category path based on the target object and the target category path; the misplacement probability is used to determine whether the target object and the target category path are misplaced in combination with the matching degree.
[0269] In some embodiments, the sample construction module specifically constructs category-correct sample pairs according to one or more of the following implementations:
[0270] Construct category-correct sample pairs based on the object information of manually maintained objects and their corresponding category paths;
[0271] Construct category-correct sample pairs based on the object information and corresponding category paths of objects that are manually detected as category-correct objects;
[0272] as well as,
[0273] Constructing category-correct sample pairs based on the object information and corresponding category paths of objects whose matching degree meets the matching conditions determined by the object processing model;
[0274] In some embodiments, the sample construction module specifically constructs the category misplaced sample pairs according to one or more of the following implementations:
[0275] Based on the object information of objects detected as misclassified objects by manual inspection and their corresponding category paths, we construct category misplaced sample pairs;
[0276] as well as,
[0277] According to the objects in the correct category sample pairs and the similar category paths corresponding to the category paths in the correct category sample pairs, the misplaced category sample pairs are constructed.
[0278] In some embodiments, the category recognition model includes a first recognition network and a second recognition network;
[0279] The second training module specifically includes: selecting multiple training sample pairs including category correct sample pairs and / or category misplaced sample pairs; inputting multiple object information in the multiple training sample pairs into the first recognition network to obtain multiple first sample features, and inputting multiple category paths into the second recognition model to obtain multiple second sample features; splicing the multiple first sample features and the multiple second sample features to obtain fusion features; performing dimensionality reduction processing on the fusion features to obtain output data; using the output data and the misplacement probability of different objects and their corresponding category paths to calculate the second loss value; and updating the model parameters of the category recognition model according to the second loss value.
[0280] In some embodiments, the data acquisition module specifically determines the published object and the category path of the object; for any object, if the object meets the screening conditions, the object information and the category path corresponding to the object are added to the training data set.
[0281] In some embodiments, the screening conditions include one or more of the following implementations:
[0282] The exposure is greater than a first exposure threshold;
[0283] as well as,
[0284] The object score determined in combination with historical interaction data of the object is greater than a second score threshold; wherein the historical interaction data includes the number of behaviors of at least one type of interactive behavior; the higher the number of behaviors, the higher the object score.
[0285] In some embodiments, the first training module uses a training method that maximizes the values corresponding to positive samples in the third matrix and minimizes the values corresponding to negative samples. The training object processing model includes: calculating the first loss value of the current training batch using the contrastive learning loss function according to the values of the i-th row and j-th column in the third matrix; and updating the object processing model according to the first loss value.
[0286] In some embodiments, the data acquisition module is further configured to take the sample objects and the category paths in the correct sample pairs of the categories as sample pairs and add them to the training data set to retrain the object processing model.
[0287] In some embodiments, the data acquisition module is specifically configured to select a predetermined number of objects from any category path in the online system; and add the predetermined number of objects and the category path to the training data set.
[0288] In some embodiments, the data acquisition module is further configured to, when the target category path is a correct category path, add the target object and the target category path as a training sample pair to the training data set to retrain the object processing model.
[0289] In some embodiments, the sample construction module constructs the category misplaced sample pair based on the object in the category correct sample pair and the similar category path corresponding to the correct category path in the category correct sample pair, including:
[0290] Determine the correct category path in the correct category sample pair; determine the category path that has the same first-level category as the correct category path and has a word overlap greater than an overlap threshold as a similar category path; and obtain a misplaced category sample pair based on the object information of the object in the correct category sample pair and the similar category path.
[0291] The model training device shown in FIG7 can execute the model training method described in the embodiment shown in FIG1 , and its implementation principle and technical effects are not described in detail here. The specific manner in which each module and unit performs operations in the model training device in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated on here.
[0292] FIG8 is a schematic structural diagram of an embodiment of a category detection device provided in an embodiment of the present application. The device may include:
[0293] The information acquisition module 801 is used to obtain the object information of the target object and the target category path corresponding to the target object;
[0294] The first extraction module 802 is configured to extract target object features from the object information of the target object using an object processing model; the object processing model is trained using multiple training sample pairs as positive samples, with the object information in one positive sample and the category path in another positive sample as negative samples; the multiple training sample pairs are selected from a training dataset; the training dataset consists of the object information and category paths of objects published by the online system;
[0295] The second extraction module 803 is used to extract target category features from the target category path using the object processing model;
[0296] A first calculation module 804 is used to calculate the matching degree between the target object feature and the target category feature;
[0297] The detection module 805 is used to detect whether the target object and the category path are misplaced based on the matching degree.
[0298] In some embodiments, the apparatus may further include:
[0299] The second calculation module is used to input the object information and the target category path into the category recognition model, and use the category recognition model to calculate the misplacement probability; the category recognition model is trained using the generated category correct sample pairs and the category misplacement sample pairs;
[0300] The detection module is specifically used to determine whether the target object and the category path are misplaced based on the matching degree and misplacement probability.
[0301] In some embodiments, the detection module is specifically configured to determine that the target category path is an incorrect category path for the target object when the degree of match is less than a first matching threshold, or when the degree of match is less than a second matching threshold and the misplacement probability is greater than a first probability threshold; the second matching threshold is greater than the first matching threshold;
[0302] When the matching degree is greater than the second matching threshold, or the misplacement probability is less than the first probability threshold, the target category path is determined to be the correct category path of the target object.
[0303] In some embodiments, the apparatus may further include:
[0304] An object determination module is used to determine multiple objects under any category path based on the search keyword hit; and use the multiple objects as target objects respectively;
[0305] The object recall module is used to select one or more objects in the correct category path as the recall objects of the search keyword based on the detection results of multiple objects;
[0306] or,
[0307] Based on the detection results of multiple objects, one or more objects in the correct category path are selected, and from one or more objects in the wrong category path, objects with exposure greater than a second exposure threshold and / or sales greater than a first sales threshold are selected as recall objects for the search keyword.
[0308] In some embodiments, the apparatus may further include:
[0309] The marking module is used to set an error mark for the target object based on the detection result of the target object when the target category path is an error category path; when any category path is hit based on the search keyword, the object with an error mark set under any category path will not be used as the recall object of the search keyword.
[0310] In some embodiments, the apparatus may further include:
[0311] A module is provided for providing objects whose exposure volume is greater than a second exposure threshold or whose sales volume is greater than a first sales threshold to relevant personnel, so that the relevant personnel can manually check whether the objects are misplaced with the corresponding category paths.
[0312] In some embodiments, the information acquisition module may specifically determine the target category path selected by the object provider and the object information of the target object according to the category selection request of the object provider for the target object;
[0313] The device may also include:
[0314] The prompt module is used to send a wrong placement prompt message to the object provider according to the detection result of the target object when the target category path is an incorrect category path.
[0315] The category detection device shown in FIG8 can execute the category detection method described in the embodiment shown in FIG4, and its implementation principle and technical effects are not described in detail here. The specific manner in which each module and unit performs operations in the category detection device in the above embodiment has been described in detail in the embodiment of the method, and will not be elaborated on here.
[0316] The embodiment of the present application further provides a computing device, as shown in FIG9 , which may include a storage component 901 and a processing component 902 ;
[0317] The storage component 901 stores one or more computer instructions, wherein the one or more computer instructions are called and executed by the processing component 902 to implement the model training method of the embodiment shown in Figure 1 or the category detection method shown in Figure 4.
[0318] Of course, a computing device may also include other components, such as input / output interfaces, display components, communication components, etc.
[0319] The input / output interface provides an interface between the processing component and peripheral interface modules, which may be output devices, input devices, etc. The communication component is configured to facilitate wired or wireless communication between the computing device and other devices.
[0320] The processing component may include one or more processors to execute computer instructions to complete all or part of the steps in the above method. Of course, the processing component may also be implemented as one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above method.
[0321] The storage component is configured to store various types of data to support operations at the terminal. The storage component can be implemented by any type of volatile or non-volatile memory device, or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
[0322] The display component may be an electroluminescent (EL) element, a liquid crystal display or a micro display having a similar structure, or a direct retinal display or a similar laser scanning display.
[0323] It should be noted that the computing device can be a physical device or an elastic computing host provided by a cloud computing platform, etc. It can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or as a single server or a single terminal device.
[0324] The present application also provides a computer-readable storage medium storing a computer program. When executed by a computer, the computer program can implement the model training method of the embodiment shown in FIG. 1 or the category detection method of the embodiment shown in FIG. 4 . The computer-readable medium can be included in the electronic device described in the above embodiments, or it can exist independently without being incorporated into the electronic device.
[0325] The embodiment of the present application also provides a computer program product, which includes a computer program carried on a computer-readable storage medium. When the computer program is executed by a computer, it can implement the model training method of the embodiment shown in Figure 1 or the category detection method of the embodiment shown in Figure 2. In such an embodiment, the computer program can be downloaded and installed from the network and / or installed from a removable medium. When the computer program is executed by a processor, the various functions defined in the system of the present application are executed.
[0326] It should be noted that the embodiments of the present application may involve the use of user data. In actual applications, user-specific personal data can be used in the scheme described herein within the scope permitted by applicable laws and regulations, subject to the requirements of applicable laws and regulations of the country where the user is located (for example, with the user's explicit consent, effective notification to the user, etc.).
[0327] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0328] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, i.e., they may be located in one location or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Persons of ordinary skill in the art will be able to understand and implement the present invention without inventive effort.
[0329] Through the description of the above embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by hardware. Based on this understanding, the essence of the above technical solution or the part that contributes to the existing technology can be embodied in the form of a software product. The computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and includes a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or certain parts of the embodiments.
[0330] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A model training method, characterized in that: include: Using the object information of the published object and the category path of the object as a training data set; Selecting a plurality of training sample pairs of a current training batch from the training data set; wherein the training sample pairs include object information and its corresponding category path; Input the plurality of training sample pairs into an object processing model, use the training sample pairs as positive samples, and the object information in one positive sample and the category path in another positive sample as negative samples to train the object processing model; The object processing model is used to extract object features from the object information of the target object and to extract category features from the target category path of the target object; the object features and the category features are used to calculate the matching degree between the target object and the target category path.
2. The method according to claim 1, characterized in that The inputting the plurality of training sample pairs into the object processing model, taking the training sample pairs as positive samples, the object information in one positive sample and the category path in another positive sample as negative samples, and training the object processing model comprises: Inputting a plurality of object information in the plurality of training sample pairs into the object processing model to obtain a plurality of first sample features; Inputting a plurality of category paths in the plurality of training sample pairs into the object processing model to obtain a plurality of second sample features; Performing matrix multiplication processing on the first matrix formed by the plurality of first sample features and the second matrix formed by the plurality of second sample features to obtain a third matrix; wherein the value of the i-th row and j-th column in the third matrix represents the similarity between the i-th object and the j-th category path; wherein i=1, 2, 3...n, j=1, 2, 3...n; i and j are different; n is a positive integer, used to represent the number of sample pairs of the plurality of training sample pairs; The object processing model is trained in a training manner that maximizes the values corresponding to the positive samples in the third matrix and minimizes the values corresponding to the negative samples.
3. The method according to claim 1, characterized in that Also includes: Constructing a correct sample pair of a category and constructing a misplaced sample pair of a category; wherein the correct sample pair of a category includes a sample object and a correct category path of the sample object; and the misplaced sample pair of a category includes a sample object and an incorrect category path of the sample object; Using the correct sample pairs of the categories and the misplaced sample pairs of the categories respectively, training a category recognition model; Among them, the category recognition model is used to determine the misplacement probability of the target object and the target category path based on the target object and the target category path; the misplacement probability is used to determine whether the target object and the target category path are misplaced in combination with the matching degree.
4. The method according to claim 3, characterized in that The constructing of correct sample pairs of categories includes one or more of the following implementations: Construct category-correct sample pairs based on the object information of manually maintained objects and their corresponding category paths; Construct category-correct sample pairs based on the object information and corresponding category paths of objects that are manually detected as category-correct objects; as well as, Constructing a correct sample pair of categories according to the object information of the object whose matching degree satisfies the matching condition determined by using the object processing model and its corresponding category path; The constructing of the category misplaced sample pairs includes one or more of the following implementations: According to the object information of the manually detected category-wrong objects and their corresponding category paths, a category-wrong-placed sample pair is constructed; as well as, According to the objects in the correct category sample pair and the similar category paths corresponding to the category paths in the correct category sample pair, a misplaced category sample pair is constructed.
5. The method according to claim 3, characterized in that: The category recognition model includes a first recognition network and a second recognition network; The training of the category recognition model by using the correct sample pairs of the category and the misplaced sample pairs of the category respectively includes: Selecting a plurality of training sample pairs including correct category sample pairs and / or misplaced category sample pairs; Inputting multiple object information in the multiple training sample pairs into a first recognition network to obtain multiple first sample features, and inputting multiple category paths into a second recognition model to obtain multiple second sample features; Concatenate the plurality of first sample features and the plurality of second sample features to obtain a fusion feature; Performing dimensionality reduction processing on the fused features respectively to obtain output data; Calculating a second loss value using the output data and the misplacement probabilities of different objects and their corresponding category paths; Update the model parameters of the category recognition model according to the second loss value.
6. The method according to claim 1, characterized in that The object information of the published object and the category path corresponding to the object are used as a training data set, including: Determine the published object and the category path where the object is located; For any object, if the object meets the screening conditions, the object information of the object and the category path corresponding to the object are added to the training data set.
7. The method according to claim 4, characterized in that Also includes: The sample objects and the category paths in the correct sample pairs of the categories are taken as training sample pairs and added into the training data set to retrain the object processing model.
8. A category detection method, characterized in that: include: Obtaining object information of a target object and a target category path corresponding to the target object; extracting target object features from the object information of the target object using an object processing model; The object processing model is trained using multiple training sample pairs as positive samples, and object information in one positive sample and a category path in another positive sample as negative samples; the multiple training sample pairs are selected from a training data set; the training data set is composed of object information of a published object and the category path of the object; extracting target category features from the target category path using the object processing model; Calculating the matching degree between the target object characteristics and the target category characteristics; According to the matching degree, it is detected whether the target object and the category path are misplaced.
9. The method according to claim 8, characterized in that Also includes: Inputting the object information and the target category path into a category recognition model, and using the category recognition model to calculate the misplacement probability; The category recognition model is obtained by training the generated category correct sample pairs with the category misplaced sample pairs; The determining, according to the matching degree, whether the target object and the category path are misplaced includes: According to the matching degree and the misplacement probability, it is determined whether the target object and the category path are misplaced.
10. The method according to claim 9, characterized in that The determining, according to the matching degree and the misplacement probability, whether the target object and the category path are misplaced by category includes: When the matching degree is less than the first matching threshold, or the matching degree is less than the second matching threshold and the misplacement probability is greater than the first probability threshold, determining that the target category path is an incorrect category path of the target object; and the second matching threshold is greater than the first matching threshold; When the matching degree is greater than the second matching threshold, or the misplacement probability is less than the first probability threshold, the target category path is determined to be the correct category path of the target object.
11. The method according to claim 10, characterized in that Also includes: Determine multiple objects under any category path based on the search keyword hits; taking the multiple objects as the target objects respectively; After detecting whether the target object and the category path are misplaced according to the matching degree, the method further includes: According to the detection results of the multiple objects, one or more objects in the correct category path are selected as recall objects of the search keyword; or, Based on the detection results of the multiple objects, one or more objects of the correct category path are selected, and from the one or more objects of the incorrect category path, objects whose exposure is greater than the second exposure threshold and / or whose sales are greater than the first sales threshold are selected as recall objects of the search keyword.
12. The method according to claim 8, characterized in that Also includes: According to the detection result of the target object, if the target category path is an error category path, setting an error flag for the target object; In the case where any category path is hit based on the search keyword, the object with an error mark set under the any category path is not used as the recall object of the search keyword.
13. A computing device, characterized in that: including a processing component and a storage component; The storage component stores one or more computer instructions; the one or more computer instructions are used to be called and executed by the processing component to implement the model training method as described in any one of claims 1 to 7 or to implement the category detection method as described in any one of claims 8 to 12.
14. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a computer, the model training method as described in any one of claims 1 to 7 or the category detection method as described in any one of claims 8 to 12 is implemented.
Citation Information
Patent Citations
Information category misplacement identifying method and device
CN106204053A
Method and apparatus for identifying categories of commodities
CN107122980A
Model training method for category recognition, category recognition method and related device
CN113902028A
Class correlation prediction network training method and device and class correlation prediction method and device
CN114139041A
Model training method, category detection method and computing equipment
CN117349669A
Cited By
Printer cartridge and intelligent prediction method for ink consumption thereof
CN121179877A
A printer ink cartridge and its intelligent ink consumption prediction method
CN121179877B
Model training and content generation method, computing device, storage medium and product
CN121683924A