Model training method for category recognition, category recognition method and related device

The model training method enhances category recognition accuracy in live streaming by generating positive and negative samples based on entity information, addressing the issue of incomplete descriptions in neural network models.

CN113902028BActive Publication Date: 2024-12-03BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111233055.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-10-22
Publication Date
2024-12-03
Estimated Expiration
2041-10-22

AI Technical Summary

Technical Problem

Existing neural network models for category recognition in live streaming scenarios suffer from poor accuracy due to incomplete description information, such as missing product titles or blurry images, leading to ineffective category identification of recommended objects.

Method used

A model training method that involves obtaining sample recommendation information, determining target categories and entity information, generating positive and negative samples, and performing supervised learning using a training triplet to enhance category recognition accuracy.

Benefits of technology

Improves the discrimination and accuracy of category recognition, especially in cases of incomplete description information, by leveraging category entity mapping information for better feature extraction and model training.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113902028B_ABST
    Figure CN113902028B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a model training method, a category identification method and related devices for category identification. By obtaining sample recommendation information for a first sample recommendation object, the sample recommendation information is used as a target sample to determine a first target category to which the first sample recommendation object belongs and a second target category to which a second sample recommendation object belongs, and first target entity information corresponding to the first target category and second target entity information corresponding to the second target category are determined according to category entity mapping information, and then a positive sample is generated according to the first target entity information and a negative sample is generated according to the second target entity information, and a training triplet is generated according to the target sample, the positive sample and the negative sample, and the training triplet is used to perform supervised learning on a preset network model to obtain a target model for category identification, so that the model can perform better discrimination training, thereby improving the accuracy of category identification based on the target model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of artificial intelligence technology, and in particular to a model training method for category recognition, a category recognition method and related devices. Background Art

[0002] With the rapid development of the e-commerce live streaming industry, recommending products and other recommended objects through live streaming has become a popular way of information transmission. In some business scenarios, it is necessary to identify the category of the current recommended object at a certain moment of the live streaming, combining the anchor's speech at that moment, the frame image information of the live streaming stream, and the candidate recommended objects associated with the live streaming.

[0003] In the related art, the categories of recommended objects in live broadcasts are identified based on a trained neural network model. However, in actual applications, the accuracy of category recognition based on the trained neural network model is often poor due to incomplete description information of the recommended objects, such as no product title information, the product title information is too simple, or the product image is very blurry. Summary of the invention

[0004] The present disclosure provides a model training method for category recognition, a category recognition method and related devices, so as to at least solve the problem of poor accuracy of category recognition based on a trained neural network model in the related art. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a model training method for category recognition is provided, comprising:

[0006] Obtaining sample recommendation information for a first sample recommendation object in the target virtual space, and using the sample recommendation information as a target sample; the first sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects associated with the target virtual space, and the sample recommendation information includes text information corresponding to the recommendation voice and interface screenshot information of the target virtual space;

[0007] Determine a first target category to which the first sample recommendation object belongs, and a second target category to which the second sample recommendation object belongs; the second sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects except the first sample recommendation object;

[0008] Determine, according to the category-entity mapping information, first target entity information corresponding to the first target category and second target entity information corresponding to the second target category; the category-entity mapping information represents the correspondence between the category and the entity information, and the entity information includes at least one key entity;

[0009] generating a positive sample according to the first target entity information, and generating a negative sample according to the second target entity information;

[0010] Generate a training triplet according to the target sample, the positive sample and the negative sample;

[0011] The preset network model is supervisedly learned according to the training triplet to obtain a target model; the target model is used for category recognition of the recommended object.

[0012] In an exemplary embodiment, the method further comprises:

[0013] Acquire recommended object information from a recommended object knowledge base; the recommended object knowledge base includes a correspondence between the recommended object information and the category;

[0014] Extracting entities from the recommended object information, establishing a correspondence between the entities and the categories based on a correspondence between the recommended object information and the categories, and obtaining an initial category entity correspondence set;

[0015] Aggregating entities corresponding to the same category in the initial category entity correspondence set to obtain an entity set corresponding to each category;

[0016] For each entity set corresponding to a category, determining at least one key entity corresponding to the category according to the occurrence frequency of each entity in the entity set;

[0017] The category entity mapping information is obtained according to at least one key entity corresponding to each of the categories.

[0018] In an exemplary implementation, obtaining the category entity mapping information according to at least one key entity corresponding to each category includes:

[0019] Determining the category level corresponding to each of the categories;

[0020] Generating category entity mapping information corresponding to the category level according to at least one key entity corresponding to a category of the same category level;

[0021] The category entity mapping information is obtained according to the category entity mapping information corresponding to at least one of the category levels.

[0022] In an exemplary embodiment, the first target category includes first target subcategories corresponding to each of the category levels, and the second target category includes second target subcategories corresponding to each of the category levels;

[0023] The determining, according to the category-entity mapping information, first target entity information corresponding to the first target category and second target entity information corresponding to the second target category includes:

[0024] According to the first target sub-categories corresponding to the category levels, determining the first target sub-entity information corresponding to the corresponding first target sub-category from the category entity mapping information corresponding to the category levels, and obtaining at least one first target sub-entity information;

[0025] According to the second target sub-categories corresponding to each of the category levels, second target sub-entity information corresponding to the corresponding second target sub-category is determined from the category entity mapping information corresponding to each of the category levels to obtain at least one piece of second target sub-entity information.

[0026] In an exemplary embodiment, when the at least one category level is a plurality of category levels, the performing supervised learning on the preset network model according to the training triplet to obtain the target model includes:

[0027] Inputting the target sample in the training triplet into the preset network model to obtain a target sample vector;

[0028] Inputting the positive samples in the training triplet into the preset network model, determining the first feature vector corresponding to each of the first target sub-entity information through the preset network model, and obtaining the positive sample vector according to the fusion of each of the first feature vectors;

[0029] Inputting the negative samples in the training triplet into the preset network model, determining the second feature vectors corresponding to each second target sub-entity information through the preset network model, and obtaining the negative sample vector according to the fusion of each second feature vector;

[0030] Determining a first similarity between the target sample vector and the positive sample vector, and a second similarity between the target sample vector and the negative sample vector;

[0031] A loss value is determined based on the difference between the first similarity and the second similarity through a preset loss function, and model parameters of the preset network model are reversely adjusted according to the loss value to perform iterative training until the preset training end condition is met to obtain the target model.

[0032] According to a second aspect of an embodiment of the present disclosure, a category identification method is provided, including:

[0033] In the process of recommending a recommendation object in the virtual space, obtaining recommendation information of the recommendation;

[0034] Determine the category to which each of the candidate recommendation objects associated with the virtual space belongs;

[0035] Determine entity information corresponding to each candidate recommendation object according to category entity mapping information and the category to which each candidate recommendation object belongs; the category entity mapping information represents the corresponding relationship between the category and the entity information, and the entity information includes at least one key entity;

[0036] Inputting the recommendation information and entity information corresponding to each of the candidate recommendation objects into a target model to obtain a similarity between the recommendation information and each of the candidate recommendation objects;

[0037] Determine a target candidate recommendation object according to the similarity between the recommendation information and each of the candidate recommendation objects; and use the category to which the target candidate object belongs as the category of the recommendation object in the recommendation information;

[0038] The recommendation model is trained based on the model training method for category recognition in the first aspect.

[0039] According to a third aspect of an embodiment of the present disclosure, a model training device for category recognition is provided, comprising:

[0040] A sample recommendation information acquisition unit is configured to acquire sample recommendation information for a first sample recommendation object in a target virtual space, and use the sample recommendation information as a target sample; the first sample recommendation object is any candidate sample recommendation object among candidate sample recommendation objects associated with the target virtual space, and the sample recommendation information includes text information corresponding to a recommendation voice and interface screenshot information of the target virtual space;

[0041] a target category determination unit, configured to determine a first target category to which the first sample recommendation object belongs, and a second target category to which the second sample recommendation object belongs; the second sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects except the first sample recommendation object;

[0042] a target entity information determination unit, configured to determine first target entity information corresponding to the first target category and second target entity information corresponding to the second target category according to category entity mapping information; the category entity mapping information represents a correspondence between a category and entity information, and the entity information includes at least one key entity;

[0043] a positive and negative sample generating unit, configured to generate positive samples according to the first target entity information, and generate negative samples according to the second target entity information;

[0044] A training triplet generation unit, configured to generate a training triplet according to the target sample, the positive sample and the negative sample;

[0045] The training unit is configured to perform supervised learning on a preset network model according to the training triplet to obtain a target model; the target model is used for category recognition of the recommended object.

[0046] In an exemplary embodiment, the apparatus further comprises:

[0047] A recommended object information acquisition unit is configured to acquire recommended object information from a recommended object knowledge base; the recommended object knowledge base includes a correspondence between recommended object information and categories;

[0048] an entity extraction unit configured to extract entities from the recommended object information, establish a correspondence between the entities and the categories based on a correspondence between the recommended object information and the categories, and obtain an initial category entity correspondence set;

[0049] An entity aggregation unit is configured to aggregate entities corresponding to the same category in the initial category entity correspondence set to obtain an entity set corresponding to each category;

[0050] A key entity determination unit is configured to execute, for each entity set corresponding to a category, determining at least one key entity corresponding to the category according to the occurrence frequency of each entity in the entity set;

[0051] The category-entity mapping information generating unit is configured to obtain the category-entity mapping information according to at least one key entity corresponding to each of the categories.

[0052] In an exemplary embodiment, the category entity mapping information generating unit includes:

[0053] A category level determination unit, configured to determine a category level corresponding to each of the categories;

[0054] A first generating unit is configured to generate category entity mapping information corresponding to the category level according to at least one key entity corresponding to a category of the same category level;

[0055] The second generating unit is configured to execute the category entity mapping information corresponding to at least one of the category levels to obtain the category entity mapping information.

[0056] In an exemplary embodiment, the first target category includes first target subcategories corresponding to each of the category levels, and the second target category includes second target subcategories corresponding to each of the category levels;

[0057] The target entity information determining unit comprises:

[0058] A first target entity information determining unit is configured to determine, according to the first target sub-categories corresponding to the category levels, first target sub-entity information corresponding to the corresponding first target sub-category from the category entity mapping information corresponding to the category levels, to obtain at least one first target sub-entity information;

[0059] The second target entity information determination unit is configured to execute, according to the second target sub-category corresponding to each of the category levels, determine the second target sub-entity information corresponding to the corresponding second target sub-category from the category entity mapping information corresponding to each of the category levels, and obtain at least one second target sub-entity information.

[0060] In an exemplary embodiment, when the at least one category level is a plurality of category levels, the training unit includes:

[0061] A target sample vector determination unit is configured to input the preset network model into the target sample in the training triplet to obtain an output target sample vector;

[0062] A positive sample vector determination unit is configured to input the positive samples in the training triplet into the preset network model, determine the first feature vector corresponding to each of the first target sub-entity information through the preset network model, and obtain the positive sample vector according to the fusion of each of the first feature vectors;

[0063] A negative sample vector determination unit is configured to input the negative samples in the training triplet into the preset network model, determine the second feature vector corresponding to each second target sub-entity information through the preset network model, and obtain a negative sample vector according to the fusion of each second feature vector;

[0064] a similarity calculation unit, configured to determine a first similarity between the target sample vector and the positive sample vector, and a second similarity between the target sample vector and the negative sample vector;

[0065] The training subunit is configured to determine the loss value based on the difference between the first similarity and the second similarity through a preset loss function, and reversely adjust the model parameters of the preset network model according to the loss value to perform iterative training until the preset training end condition is met to obtain the target model.

[0066] According to a fourth aspect of an embodiment of the present disclosure, there is provided a category identification device, including:

[0067] a recommendation information acquisition unit, configured to acquire recommendation information of a recommendation during a process of making a recommendation for a recommendation object in a virtual space;

[0068] A candidate category determination unit is configured to determine the category to which each of the candidate recommendation objects associated with the virtual space belongs;

[0069] an entity information determination unit, configured to determine entity information corresponding to each candidate recommendation object according to category entity mapping information and the category to which each candidate recommendation object belongs; the category entity mapping information represents a correspondence between a category and entity information, and the entity information includes at least one key entity;

[0070] a similarity determination unit configured to input the recommendation information and entity information corresponding to each of the candidate recommendation objects into a target model to obtain a similarity between the recommendation information and each of the candidate recommendation objects;

[0071] a category determination unit configured to determine a target candidate recommendation object according to the similarity between the recommendation information and each of the candidate recommendation objects; and to use the category to which the target candidate object belongs as the category of the recommended object in the recommendation information;

[0072] The target model is trained based on the model training method for category recognition in the first aspect.

[0073] According to a fifth aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0074] processor;

[0075] a memory for storing instructions executable by the processor;

[0076] The processor is configured to execute the instructions to implement the model training method for category recognition of the first aspect or the category recognition method of the second aspect.

[0077] According to the sixth aspect of an embodiment of the present disclosure, a computer-readable storage medium is provided. When the instructions in the computer-readable storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the model training method for category recognition of the first aspect or the category recognition method of the second aspect.

[0078] According to a seventh aspect of an embodiment of the present disclosure, a computer program product is provided, including a computer program, which, when executed by a processor, implements the model training method for category recognition of the first aspect or the category recognition method of the second aspect.

[0079] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0080] By obtaining sample recommendation information for a first sample recommendation object in a target virtual space, taking the sample recommendation information as a target sample, and determining a first target category to which the first sample recommendation object belongs and a second target category to which the second sample recommendation object belongs, and then determining the first target entity information corresponding to the first target category and the second target entity information corresponding to the second target category according to the category entity mapping information, generating a positive sample according to the first target entity information and a negative sample according to the second target entity information, and generating a training triplet according to the target sample, the positive sample and the negative sample, and performing supervised learning on a preset network model according to the training triplet to obtain a target model for category recognition of the recommendation object, thereby enabling the model to perform better discrimination training, thereby improving the category recognition accuracy of the target model, especially when the description information of the recommendation object is incomplete, the accuracy of the target model recognition result can be ensured.

[0081] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0082] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0083] Figure 1 is a schematic diagram of an application environment according to an exemplary embodiment;

[0084] Figure 2 is a flow chart of a model training method for category recognition according to an exemplary embodiment;

[0085] Figure 3 is a flow chart showing a method of generating category entity mapping information according to an exemplary embodiment;

[0086] Figure 4 is a flowchart showing another method of generating category entity mapping information according to an exemplary embodiment;

[0087] Figure 5 is a flow chart of another model training method for category recognition according to an exemplary embodiment;

[0088] Figure 6a is a flowchart showing a method of obtaining a target model by supervised learning of a preset network model according to a training triplet according to an exemplary embodiment;

[0089] Figure 6b It is an example of training a preset network model to obtain a target model according to an exemplary embodiment;

[0090] Figure 7 is a flow chart of a category identification method according to an exemplary embodiment;

[0091] Figure 8 is a block diagram of a model training device for category recognition according to an exemplary embodiment;

[0092] Fig. 9 is a block diagram of a category identification device according to an exemplary embodiment;

[0093] Fig.10 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0094] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0095] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0096] The related art uses a trained neural network model to identify the categories of recommended objects in live broadcasts. However, in actual applications, the trained neural network model often has poor category recognition accuracy due to incomplete description information of the recommended objects, such as no product title information, the product title information is too simple, or the product image is very blurry.

[0097] In view of this, the embodiments of the present disclosure provide a model training method for category recognition, by obtaining sample recommendation information for a first sample recommendation object in a target virtual space, taking the sample recommendation information as a target sample, and determining a first target category to which the first sample recommendation object belongs and a second target category to which the second sample recommendation object belongs, and then determining first target entity information corresponding to the first target category and second target entity information corresponding to the second target category according to category entity mapping information, generating positive samples according to the first target entity information and generating negative samples according to the second target entity information, and generating training triples according to the target sample, the positive samples and the negative samples, and performing supervised learning on a preset network model according to the training triples to obtain a target model for category recognition of the recommendation object, thereby enabling the model to perform better discrimination training, thereby improving the accuracy of category recognition based on the target model, especially in the case where the description information of the recommendation object is incomplete, the accuracy of the recognition result based on the target model can be ensured.

[0098] See also Figure 1 , which is a schematic diagram of an application environment of a model training method or a category identification method for category identification according to an exemplary embodiment. The application environment may include a terminal 110 and a server 120. The terminal 110 and the server 120 may be directly or indirectly connected via wired or wireless communication.

[0099] The terminal 110 may be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc., but is not limited thereto. The terminal 110 may be installed with client software such as an application (Application, referred to as App) that provides corresponding business functions. The business functions may include, but are not limited to, a recommendation function for recommended objects in a virtual space, such as a live broadcast function. The application may be an independent application or a subprogram in the application. For example, the application may be a live broadcast application, etc. The user of the terminal 110 may log in to the application using pre-registered user information, which may include an account number and a password.

[0100] In order to facilitate the explanation of the technical solution of the disclosed embodiment, the virtual space will be taken as a live broadcast room, and the process of recommending objects in the live broadcast room, i.e., the live broadcast process, will be introduced as an example.

[0101] The server 120 may be a server that provides background services for the application in the terminal 110 , and may be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud computing services.

[0102] In an application scenario, server 120 may be a server in a live broadcast system for providing a service for identifying categories of recommended objects such as commodities. When performing category identification, server 120 may call a model for category identification to identify the categories of recommended objects during the live broadcast. The model for category identification may be trained using the model training method for category identification of an embodiment of the present disclosure.

[0103] It should be noted that the recommended objects in the embodiments of the present disclosure may include clothing, food and other commodities recommended by the host in the live streaming sales scenario, and may also include objects corresponding to the scenario recommended by the host in other live streaming scenarios, such as test questions in the live test question analysis scenario.

[0104] The following is a detailed introduction to the model training method for category recognition.

[0105] Figure 2 is a flow chart of a model training method for category recognition according to an exemplary embodiment. Figure 2 As shown in Figure 2, the model training method for category recognition is applied to Figure 1 Taking the server in as an example, the following steps are included:

[0106] In step S201, sample recommendation information for a first sample recommendation object in a target virtual space is obtained, and the sample recommendation information is used as a target sample.

[0107] The first sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects associated with the target virtual space.

[0108] Taking live broadcast as an example, the target live broadcast can be any live broadcast selected as a sample, and the candidate sample recommendation objects associated with the target live broadcast refer to all the recommendation objects recommended to the audience in the target live broadcast.

[0109] The sample recommendation information may include text information corresponding to the recommended voice and interface screenshot information of the target virtual space. The text information corresponding to the recommended voice may be obtained by obtaining a live video stream of a preset duration for the first sample recommendation object, and performing voice recognition processing on the live voice in the live video stream using automatic speech recognition technology (Automatic Speech Recognition, ASR); the interface screenshot information may include an interface screenshot and an image recognition result corresponding to the interface screenshot, wherein the interface screenshot may be a frame image extracted from the live video stream of the preset duration, and any image recognition method may be used to obtain the image recognition result corresponding to the interface screenshot when performing image recognition on the interface screenshot, such as OCR (Optical Character Recognition, optical character recognition) and the like.

[0110] The first sample recommendation object may be any candidate sample recommendation object among the candidate sample recommendation objects associated with the target live broadcast, and the first sample recommendation object is the recommendation object actually recommended by the anchor in the sample recommendation information.

[0111] In step S203, a first target category to which the first sample recommendation object belongs and a second target category to which the second sample recommendation object belongs are determined; the second sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects except the first sample recommendation object.

[0112] Specifically, the categories to which each candidate sample recommendation object belongs have been pre-entered before the target live broadcast begins. Therefore, the category corresponding to the first sample recommendation object and the category corresponding to the second sample recommendation object can be searched from the pre-entered category information to obtain the first target category and the second target category.

[0113] In step S205, first target entity information corresponding to the first target category and second target entity information corresponding to the second target category are determined according to the category-entity mapping information.

[0114] The category-entity mapping information represents the corresponding relationship between the category and the entity information, and the entity information includes at least one key entity.

[0115] In an exemplary embodiment, the above-mentioned category entity mapping information needs to be generated before model training. Figure 3 is a flow chart of a method for generating category entity mapping information provided by an embodiment of the present disclosure. Figure 3 As shown, it may include:

[0116] In step S301, recommended object information is obtained from a recommended object knowledge base; the recommended object knowledge base includes a correspondence between recommended object information and categories.

[0117] Specifically, the recommended object knowledge base can be an existing structured information base in the live broadcast system, which stores the recommended object information of each recommended object and the category information of the category to which the recommended object belongs. It can be said that the recommended object knowledge base is a complete recommended object information base. When it is necessary to generate category entity mapping information, the recommended object information of each recommended object can be obtained from the recommended object knowledge base, where the recommended object information can include the subject information, related descriptions, and other information of the corresponding recommended object.

[0118] In step S303, entities in the recommended object information are extracted, and a correspondence between the entities and the categories is established based on the correspondence between the recommended object information and the categories to obtain an initial category entity correspondence set.

[0119] Exemplarily, for each recommended object information obtained, the entity extraction model can be used to extract the entities in the recommended object information, and then the recommended object information can be used as a bridge to establish a correspondence between the extracted entities and the categories corresponding to the recommended object information, thereby obtaining an initial category entity correspondence set. The entity extraction model can be a trained machine learning model, and the training of the entity extraction model can refer to any training method in the prior art, which is not specifically limited in this disclosure.

[0120] In step S305, entities corresponding to the same category in the initial category entity correspondence set are aggregated to obtain an entity set corresponding to each category.

[0121] In step S307, for each entity set corresponding to a category, at least one key entity corresponding to the category is determined according to the occurrence frequency of each entity in the entity set.

[0122] The frequency of occurrence of an entity is the ratio of the number of occurrences of the entity in the entity set to the total number of entities in the entity set. Exemplarily, for the entity set corresponding to each category, the entities in the entity set can be sorted in descending order from high to low frequency of occurrence, and then a preset number of entities in the front are taken as the key entities corresponding to the category, wherein the preset number can be set according to actual needs, for example, the preset number can be 100.

[0123] A large number of related entities can be obtained for each category in step S305 , and key entity information corresponding to each category can be obtained by screening these related entities.

[0124] In step S309, the category entity mapping information is obtained according to at least one key entity corresponding to each category.

[0125] The disclosed embodiment uses the recommended object information in the recommended object knowledge base as a bridge, extracts entities in the recommended object information, establishes a correspondence between the category corresponding to the recommended object information and the extracted entity, and obtains an initial category entity correspondence set, and then aggregates the entities corresponding to the same category in the initial category entity correspondence set, and determines at least one key entity corresponding to the category based on the entity set corresponding to the same category, so that category entity mapping information can be quickly and accurately generated according to at least one key entity corresponding to each category.

[0126] In practical applications, multiple category levels are often set. In order to improve the efficiency of category-based indexing entity information and the accuracy of model training in the process of generating positive samples and negative samples, in an exemplary implementation, Figure 4 As shown, when obtaining the category entity mapping information according to at least one key entity corresponding to each category, the following steps may be included:

[0127] In step S3091, the category level corresponding to each of the categories is determined.

[0128] In step S3093, category entity mapping information corresponding to the category level is generated according to at least one key entity corresponding to a category of the same category level.

[0129] In step S3095, the category entity mapping information is obtained according to the category entity mapping information corresponding to at least one of the category levels.

[0130] For example, there are three category levels, namely the first-level category level, the second-level category level and the third-level category level. The category corresponding to the first-level category is the first-level category, the category corresponding to the second-level category is the second-level category, and the category corresponding to the third-level category is the third-level category. Among them, the second-level category is a subcategory of the corresponding first-level category, and the third-level category is a subcategory of the corresponding second-level category. For example, "outdoor sports" belongs to the first-level category, "sports protective gear" belongs to the second-level category, and "swimming supplies" belongs to the third-level category.

[0131] Then all categories can be divided according to category levels, so as to obtain category entity mapping information corresponding to the first-level category level according to at least one key entity corresponding to each first-level category, obtain category entity mapping information corresponding to the second-level category level according to at least one key entity corresponding to each second-level category, and obtain category entity mapping information corresponding to the tertiary category level according to at least one key entity corresponding to each tertiary category. Then, the category entity mapping information corresponding to the first-level category level, the category entity mapping information corresponding to the second-level category level and the category entity mapping information corresponding to the tertiary category level constitute the category entity mapping information.

[0132] Based on this, in an exemplary embodiment, the first target category in step S203 includes first target subcategories corresponding to each category level, and the second target category includes second target subcategories corresponding to each category level. Then, step S205 may include, when determining the first target entity information corresponding to the first target category and the second target entity information corresponding to the second target category according to the category entity mapping information. Figure 5 The following steps:

[0133] In step S2051, according to the first target sub-category corresponding to each of the category levels, the first target sub-entity information corresponding to the corresponding first target sub-category is determined from the category entity mapping information corresponding to each of the category levels to obtain at least one first target sub-entity information; the at least one first target sub-entity information is the first target entity information.

[0134] In step S2053, according to the second target sub-categories corresponding to each of the category levels, the second target sub-entity information corresponding to the corresponding second target sub-category is determined from the category entity mapping information corresponding to each of the category levels, and at least one second target sub-entity information is obtained. The at least one second target sub-entity information is the second target entity information.

[0135] Still taking the above example of including three category levels, the first target category includes three first target subcategories corresponding to the first category level, the second category level and the third category level, that is, the first target category can be expressed as {C level_1 , C level_2 , C level_3}, the second target category also includes three second target subcategories corresponding to the first-level category level, the second-level category level and the third-level category level, that is, the second target category can be expressed as {C′ level_1 , C′ level_2 , C′ level_3}.

[0136] When determining the first target entity information corresponding to the first target category, according to C level_1 Find the C from the category entity mapping information corresponding to the first-level category level level_1 Corresponding entity information S level_1 , according to C level_2 Find C from the category entity mapping information corresponding to the secondary category level level_2 Corresponding entity information S level_2 , according to C level_3 Find C from the category entity mapping information corresponding to the third-level category level_3 Corresponding entity information S level_3 , then {S level_1 , S level_2 , S level_3} is the at least one first target sub-entity information obtained; similarly, when determining the second target entity information corresponding to the second target category, according to C′ level_1 Find the C' from the category entity mapping information corresponding to the first-level category level level_1 Corresponding entity information S′ level_1 , according to C′ level_2 Find C' from the category entity mapping information corresponding to the secondary category level level_2Corresponding entity information S′ level_2 , according to C′ level_3 Find C' from the category entity mapping information corresponding to the third-level category level_3 Corresponding entity information S′ level_3 , then {S′ level_1 , S′ level_2 , S′ level_3} is the at least one second target sub-entity information obtained.

[0137] In the embodiment of the present disclosure, when the first target category includes first target subcategories corresponding to each category level and the second target category includes second target subcategories corresponding to each category level, the first target sub-entity information corresponding to the first target subcategory is determined from the category entity mapping information corresponding to each category level according to the first target subcategories corresponding to each category level, and the second target sub-entity information corresponding to the second target subcategory is determined from the category entity mapping information corresponding to each category level according to the second target subcategories corresponding to each category level, thereby improving the efficiency of determining the entity information corresponding to the target category, which is beneficial to improving the overall training efficiency of the model.

[0138] In step S207, a positive sample is generated according to the first target entity information, and a negative sample is generated according to the second target entity information.

[0139] In step S209, a training triplet is generated according to the target sample, the positive sample and the negative sample.

[0140] Specifically, the positive sample is determined based on the first target entity information, that is, the positive sample may include the first target entity information, and of course may also include the description information, pictures and other information of the first sample recommended object; the negative sample is determined based on the second target entity information, that is, the negative sample may include the second target entity information, and of course may also include the description information, pictures and other information of the second sample recommended object.

[0141] In step S211, supervised learning is performed on the preset network model according to the training triplet to obtain a target model;

[0142] The target model is used to identify the category of the recommended object.

[0143] Specifically, a preset network model can be trained using a preset loss function according to the training triplet, wherein the preset loss function is determined based on the similarity between the target sample and the positive sample and the similarity between the target sample and the negative sample in the training triplet.

[0144] In a specific implementation, the preset loss function may be a triplet loss function. Exemplarily, the triplet loss function Loss may be expressed as follows:

[0145] Loss=max{d(a, p)-d(a, n)+margin, 0}

[0146] Among them, a represents the target sample, p represents the positive sample, and n represents the negative sample; d(a, p) represents the similarity between the target sample and the positive sample, and d(a, n) represents the similarity between the target sample and the negative sample; margin represents the threshold, which can be set based on experience in practical applications. In practical applications, d(a, p) and d(a, n) can use Euclidean distance, cosine distance, etc. to represent the similarity.

[0147] The preset network model can be any machine learning model with encoding function. Through the training of the preset loss function, the machine learning model can perform similar encoding on the same type of data and make the encoding results of different types of data as different as possible. Exemplarily, the preset network model can be an optimized BERT (Bidirectional Encoder Representations from Transformers) model.

[0148] In an exemplary embodiment, when there are multiple category levels, such as Figure 6a As shown, step S211 may include the following steps when performing supervised learning on the preset network model according to the training triplet to obtain the target model:

[0149] In step S2111, the target sample in the training triplet is input into the preset network model to obtain a target sample vector.

[0150] In step S2113, the positive samples in the training triplet are input into the preset network model, the first feature vectors corresponding to each of the first target sub-entity information are determined by the preset network model, and the positive sample vector is obtained according to the fusion of each of the first feature vectors.

[0151] It can be understood that when the positive sample also includes other descriptive information of the first sample recommendation object (such as subject information, picture information), the preset network model can output the feature vector corresponding to the other descriptive information, and then the first feature vectors and the feature vectors corresponding to the other descriptive information are fused to obtain the positive sample vector.

[0152] In step S2115, the negative samples in the training triplet are input into the preset network model, the second feature vectors corresponding to each second target sub-entity information are determined by the preset network model, and the negative sample vector is obtained by fusion of each second feature vector.

[0153] It can be understood that when the negative sample also includes other descriptive information of the second sample recommendation object (such as subject information, picture information), the preset network model can output the feature vector corresponding to the other descriptive information, and then the second feature vectors and the feature vectors corresponding to the other descriptive information are fused to obtain the negative sample vector.

[0154] In step S2117 , a first similarity between the target sample vector and the positive sample vector, and a second similarity between the target sample vector and the negative sample vector are determined.

[0155] Specifically, the first similarity and the second similarity may be represented by the distance between vectors, such as Euclidean distance, cosine distance, etc.

[0156] In step S2119, a loss value is determined based on the difference between the first similarity and the second similarity through the preset loss function, and the model parameters of the preset network model are reversely adjusted according to the loss value to perform iterative training until the preset training end condition is met to obtain the target model.

[0157] Specifically, the preset loss function can refer to the aforementioned triple loss function. When the preset training end condition is met, the training is terminated, and the preset network model corresponding to the model parameters at the end of the training is used as the target model in the embodiment of the present disclosure. Based on the target model, the category to which the recommended object being broadcast live belongs can be identified.

[0158] Among them, the preset training end condition can be that the loss value reaches the minimum value, or the number of iterations reaches a preset iteration number threshold. The preset number of iterations can be an empirical value, and the embodiments of the present disclosure do not make specific limitations on this.

[0159] The following uses live broadcast and three categories as an example to introduce the above model training process. Figure 6b is an example of training a preset network model to obtain a target model. The first sample recommendation object for the sample live broadcast information is Item_title_1, that is, Item_title_1 is the real sample recommendation object of the sample live broadcast information. Then, the first target category corresponding to Item_title_1 can be determined. level_1 , C level_2 , C level_3}; In addition, Item_title_2 is randomly selected from the remaining candidate sample recommendation objects (i.e., the candidate sample recommendation objects other than Item_title_1) as the second sample recommendation object, and the second target category {C′ corresponding to Item_title_2 can be determined level_1 , C′level_2 , C′ level_3}.

[0160] Then, based on {C level_1 , C level_2 , C level_3} respectively match the corresponding entity information in the Level_1 category entity mapping information, the Level_2 category entity mapping information and the Level_3 category entity mapping information to obtain {S level_1 , S level_2 , S level_3}, based on {C′ level_1 , C′ level_2 , C′ level_3} respectively match the corresponding entity information in the Level_1 category entity mapping information, Level_2 category entity mapping information and Level_3 category entity mapping information to obtain {S′ level_1 , S′ level_2 , S′ level_3}.

[0161] Furthermore, {S level_1 , S level_2 , S level_3} is used as a positive sample and input into the preset network model to obtain three first feature vectors corresponding to the entity information therein, and the three first feature vectors are fused to obtain a positive sample vector; {S′ level_1 , S′ level_2 , S′ level_3} is input as a negative sample into the preset network model to obtain three second eigenvectors corresponding to the entity information therein, and the three second eigenvectors are fused to obtain a negative sample vector; in addition, the sample live broadcast information is input into the preset network model to obtain the corresponding target sample vector.

[0162] Then, the similarity between the target sample vector and the positive sample vector is calculated to obtain a first similarity d(a, p), and the similarity between the target sample vector and the negative sample vector is calculated to obtain a second similarity d(a, n). A triplet loss function is used to obtain a loss value based on d(a, p) and d(a, n). The model parameters of the preset network model are reversely adjusted with the loss value, and iterative training is continued to obtain the target model of the embodiment of the present disclosure.

[0163] In the case where there are multiple category levels, the embodiment of the present disclosure trains the model based on the target sub-entity information obtained by indexing the category entity mapping information of each category level, thereby improving the training efficiency of the model training and the distinguishing ability of the trained model, thereby improving the category recognition accuracy based on the target model.

[0164] In the process of generating positive and negative samples, the disclosed embodiment introduces entity information from the category entity mapping information based on the category, and uses the triples composed of the positive and negative samples to train the target model, so that the target model can better distinguish data of different categories, thereby improving the accuracy of model training. In particular, in the case where the description information of the recommended object is incomplete, the introduction of entity information through the category entity mapping information can better provide the model with supplementary feature information, help the model to better distinguish, and improve the accuracy of the trained model.

[0165] The above introduces the training process of the target model for category recognition. The following introduces category recognition as a specific application scenario. Figure 7 is a flow chart showing a method for category identification according to an exemplary embodiment. Figure 7 As shown, it may include:

[0166] In step S701, in the process of recommending a recommended object in a virtual space, recommendation information of the recommendation is obtained.

[0167] The recommendation information may include text information corresponding to the recommendation voice and interface screenshot information of the target virtual space.

[0168] Exemplarily, a live video stream of a preset length of time in a live broadcast room can be obtained, and automatic speech recognition technology can be used to perform speech recognition processing on the live voice in the live video stream to obtain corresponding text information, and a preset number of frame images can be extracted from the live video stream as corresponding live images, and image recognition processing can be performed on the live images (such as using OCR technology) to obtain image recognition results, and then the above-mentioned text information, image recognition results and live images can be used as the currently obtained recommendation information.

[0169] In step S703, the category to which each of the candidate recommendation objects associated with the virtual space belongs is determined.

[0170] In actual applications, before a live broadcast starts in the live broadcast room, the relevant information (including the categories) of the recommended objects involved in the live broadcast (i.e., the candidate recommended objects associated with the live broadcast) will be entered into the live broadcast system in advance, so that when performing category identification, the category to which each candidate recommended object belongs can be determined from the relevant information of the candidate recommended objects associated with the live broadcast that has been pre-entered and stored in the live broadcast system.

[0171] In step S705, entity information corresponding to each candidate recommendation object is determined according to the category-entity mapping information and the category to which each candidate recommendation object belongs.

[0172] The category entity mapping information represents the corresponding relationship between the category and the entity information, and the entity information includes at least one key entity. The method for generating the category entity mapping information can refer to the aforementioned embodiment of the present disclosure. Figure 3 The method embodiment shown will not be described in detail here.

[0173] Specifically, for each candidate recommendation object, entity information matching the category is searched in the category entity mapping information according to the category to which the candidate recommendation object belongs, so as to obtain the entity information corresponding to the candidate recommendation object.

[0174] It can be understood that when the category entity mapping information includes category entity mapping information corresponding to multiple category levels, the category to which each candidate recommendation object belongs also includes sub-categories corresponding to each category level. Then, when determining the entity information corresponding to the candidate recommendation object, the sub-category matching the corresponding sub-category can be determined from the category entity mapping information corresponding to each category level for the sub-category of the candidate recommendation object at each category level, and the sub-entity information of the candidate recommendation object at each category level can be used as the entity information corresponding to the candidate recommendation object.

[0175] In step S707, the recommendation information and entity information corresponding to each of the candidate recommendation objects are input into a target model to obtain the degree of similarity between the recommendation information and each of the candidate recommendation objects.

[0176] Among them, the target model is trained based on the model training method for category recognition provided in the embodiment of the present disclosure.

[0177] Specifically, the target model represents the entity information corresponding to the recommendation information and each candidate recommendation object respectively, so as to obtain the recommendation feature vector corresponding to the recommendation information and the candidate feature vector corresponding to each candidate recommendation object, and then calculates the similarity between the recommendation feature vector and each candidate feature vector to obtain the similarity between the recommendation information and each candidate recommendation object. The similarity between the recommendation feature vector and each candidate feature vector can be represented by the distance between the vectors, such as the Euclidean distance or the cosine distance.

[0178] It can be understood that, for each candidate recommendation object, in addition to the entity information corresponding to each candidate recommendation object, what is input into the target model may also include other descriptive information such as subject information and picture information corresponding to the candidate recommendation object according to actual needs.

[0179] In step S709, a target candidate recommendation object is determined according to the similarity between the recommendation information and each of the candidate recommendation objects; and the category to which the target candidate object belongs is used as the category of the recommended object in the recommendation information.

[0180] In a specific implementation, the candidate recommendation object corresponding to the maximum similarity may be determined as the target candidate recommendation object, and then the category to which the target candidate recommendation object belongs may be obtained, thereby obtaining the category to which the currently recommended recommendation object belongs.

[0181] For example, suppose a product is "Korean slim blue Levis jeans", the third-level category of the product is jeans, and the entity information matched from the category entity mapping information based on the third-level category is "jeans, work fabrics, velvet, blue, pure cotton, etc.". Then, if at the current moment, the live broadcast host mentions keywords such as pure cotton and blue in the corresponding live broadcast information (such as voice-to-text information) when introducing the product, the target model can associate the entity information with the corresponding live broadcast information, thereby better locating that the category of the product introduced by the current host is jeans, rather than other third-level categories (such as coats, jackets, etc.).

[0182] Since entity information is introduced based on categories to assist in the generation of positive and negative samples during the training process of the target model, and triplets consisting of the positive and negative samples are used for training, the target model can better distinguish data of different categories. Therefore, when identifying the category of the recommended object in the recommendation process based on the target model, it can more accurately locate the category to which the recommended object currently being introduced belongs. In particular, when the description information of the candidate recommended object is incomplete, the entity information corresponding to the candidate recommended object is used as a supplement, which can greatly improve the accuracy of category recognition.

[0183] Figure 8 is a block diagram of a model training device for category recognition according to an exemplary embodiment. Figure 8 The model training device 800 for category recognition includes a sample recommendation information acquisition unit 810, a target category determination unit 820, a target entity information determination unit 830, a positive and negative sample generation unit 840, a training triplet generation unit 850 and a training unit 860, wherein:

[0184] The sample recommendation information acquisition unit 810 is configured to acquire sample recommendation information for a first sample recommendation object in the target virtual space, and use the sample recommendation information as a target sample; the first sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects associated with the target virtual space, and the sample recommendation information includes text information corresponding to the recommendation voice and interface screenshot information of the target virtual space;

[0185] The target category determination unit 820 is configured to determine a first target category to which the first sample recommendation object belongs, and a second target category to which the second sample recommendation object belongs; the second sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects except the first sample recommendation object;

[0186] The target entity information determining unit 830 is configured to determine first target entity information corresponding to the first target category and second target entity information corresponding to the second target category according to category entity mapping information; the category entity mapping information represents the correspondence between the category and the entity information, and the entity information includes at least one key entity;

[0187] A positive and negative sample generating unit 840 is configured to generate positive samples according to the first target entity information and generate negative samples according to the second target entity information;

[0188] A training triplet generation unit 850 is configured to generate a training triplet according to the target sample, the positive sample and the negative sample;

[0189] The training unit 860 is configured to perform supervised learning on a preset network model according to the training triples to obtain a target model; the target model is used for category recognition of the recommended object.

[0190] In an exemplary embodiment, the apparatus further comprises:

[0191] A recommended object information acquisition unit is configured to acquire recommended object information from a recommended object knowledge base; the recommended object knowledge base includes a correspondence between recommended object information and categories;

[0192] an entity extraction unit configured to extract entities from the recommended object information, establish a correspondence between the entities and the categories based on a correspondence between the recommended object information and the categories, and obtain an initial category entity correspondence set;

[0193] An entity aggregation unit is configured to aggregate entities corresponding to the same category in the initial category entity correspondence set to obtain an entity set corresponding to each category;

[0194] A key entity determination unit is configured to execute, for each entity set corresponding to a category, determining at least one key entity corresponding to the category according to the occurrence frequency of each entity in the entity set;

[0195] The category-entity mapping information generating unit is configured to obtain the category-entity mapping information according to at least one key entity corresponding to each of the categories.

[0196] In an exemplary embodiment, the category entity mapping information generating unit includes:

[0197] A category level determination unit, configured to determine a category level corresponding to each of the categories;

[0198] A first generating unit is configured to generate category entity mapping information corresponding to the category level according to at least one key entity corresponding to a category of the same category level;

[0199] The second generating unit is configured to execute the category entity mapping information corresponding to at least one of the category levels to obtain the category entity mapping information.

[0200] In an exemplary embodiment, the first target category includes first target subcategories corresponding to each of the category levels, and the second target category includes second target subcategories corresponding to each of the category levels;

[0201] The target entity information determining unit comprises:

[0202] A first target entity information determining unit is configured to determine, according to the first target sub-categories corresponding to the category levels, first target sub-entity information corresponding to the corresponding first target sub-category from the category entity mapping information corresponding to the category levels, to obtain at least one first target sub-entity information;

[0203] The second target entity information determination unit is configured to execute, according to the second target sub-category corresponding to each of the category levels, determine the second target sub-entity information corresponding to the corresponding second target sub-category from the category entity mapping information corresponding to each of the category levels, and obtain at least one second target sub-entity information.

[0204] In an exemplary embodiment, when the at least one category level is a plurality of category levels, the training unit includes:

[0205] A target sample vector determination unit is configured to input the target sample in the training triplet into the preset network model to obtain an output target sample vector;

[0206] A positive sample vector determination unit is configured to input the positive samples in the training triplet into the preset network model, determine the first feature vector corresponding to each of the first target sub-entity information through the preset network model, and obtain the positive sample vector according to the fusion of each of the first feature vectors;

[0207] A negative sample vector determination unit is configured to input the negative samples in the training triplet into the preset network model, determine the second feature vector corresponding to each second target sub-entity information through the preset network model, and obtain a negative sample vector according to the fusion of each second feature vector;

[0208] a similarity calculation unit, configured to determine a first similarity between the target sample vector and the positive sample vector, and a second similarity between the target sample vector and the negative sample vector;

[0209] The training subunit is configured to determine the loss value based on the difference between the first similarity and the second similarity through a preset loss function, and reversely adjust the model parameters of the preset network model according to the loss value to perform iterative training until the preset training end condition is met to obtain the category recognition model.

[0210] Fig. 9 is a block diagram of a category identification device according to an exemplary embodiment. Fig. 9 The category identification device 900 includes a live broadcast information acquisition unit 910, a candidate category determination unit 920, an entity information determination unit 930, a similarity determination unit 940 and a category determination unit 950, wherein:

[0211] The recommendation information acquisition unit 910 is configured to acquire recommendation information of the recommendation during the process of recommending the recommendation object in the virtual space;

[0212] A candidate category determination unit 920 is configured to determine the category to which each candidate recommendation object belongs among the candidate recommendation objects associated with the virtual space;

[0213] The entity information determining unit 930 is configured to determine the entity information corresponding to each candidate recommendation object according to the category entity mapping information and the category to which each candidate recommendation object belongs; the category entity mapping information represents the correspondence between the category and the entity information, and the entity information includes at least one key entity;

[0214] A similarity determination unit 940 is configured to input the pushing information and the entity information corresponding to each of the candidate recommendation objects into a target model to obtain a similarity between the recommendation information and each of the candidate recommendation objects;

[0215] The category determination unit 950 is configured to determine a target candidate recommendation object according to the similarity between the recommendation information and each candidate recommendation object; and use the category to which the target candidate object belongs as the category of the recommended object in the recommendation information;

[0216] The target model is trained based on the model training method for category recognition in the embodiment of the present disclosure.

[0217] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0218] In an exemplary embodiment, an electronic device is also provided, including a processor; a memory for storing instructions executable by the processor; wherein, when the processor is configured to execute the instructions stored in the memory, it implements any one of the model training or category recognition methods for category recognition provided in the embodiments of the present disclosure.

[0219] The electronic device may be a terminal, a server or a similar computing device. For example, the electronic device is a server. Fig.10 is a block diagram of an electronic device for model training or category recognition according to an exemplary embodiment. Fig.10 As shown, the server 1000 may have relatively large differences due to different configurations or performances, and may include one or more central processing units (CPU) 1010 (the processor 1010 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 1030 for storing data, and one or more storage media 1020 (such as one or more mass storage devices) for storing application programs 1023 or data 1022. Among them, the memory 1030 and the storage medium 1020 can be short-term storage or permanent storage. The program stored in the storage medium 1020 may include one or more modules, each of which may include a series of instruction operations on the server. Furthermore, the central processing unit 1010 can be configured to communicate with the storage medium 1020 and execute a series of instruction operations in the storage medium 1020 on the server 1000. The server 1000 may also include one or more power supplies 1060, one or more wired or wireless network interfaces 1050, one or more input and output interfaces 1040, and / or one or more operating systems 1021, such as Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0220] The input / output interface 1040 may be used to receive or send data via a network. The specific example of the network may include a wireless network provided by a communication provider of the server 1000. In one example, the input / output interface 1040 includes a network adapter (Network Interface Controller, NIC), which may be connected to other network devices through a base station so as to communicate with the Internet. In one example, the input / output interface 1040 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0221] It can be understood by those skilled in the art that Fig.10 The structure shown is only for illustration and does not limit the structure of the above electronic device. Fig.10 More or fewer components as shown, or with Fig.10 Different configurations are shown.

[0222] In an exemplary embodiment, a computer-readable storage medium including instructions is also provided, such as a memory 1030 including instructions, and the above instructions can be executed by the processor 1010 of the device 1000 to complete any one of the category recognition model training or category recognition methods provided in the embodiments of the present disclosure. Optionally, the computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0223] In an exemplary embodiment, a computer program product is also provided, including a computer program, which, when executed by a processor, implements any one of the model training methods or category identification methods for category identification provided in the embodiments of the present disclosure.

[0224] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0225] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A model training method for category recognition, characterized in that: include: Acquire recommendation object information from a recommendation object knowledge base; The recommended object knowledge base includes the corresponding relationship between recommended object information and categories; Extracting entities from the recommended object information, establishing a correspondence between the entities and the categories based on a correspondence between the recommended object information and the categories, and obtaining an initial category entity correspondence set; Aggregating entities corresponding to the same category in the initial category entity correspondence set to obtain an entity set corresponding to each category; For each entity set corresponding to a category, determining at least one key entity corresponding to the category according to the occurrence frequency of each entity in the entity set; According to at least one key entity corresponding to each of the categories, category entity mapping information is obtained; the category entity mapping information represents the corresponding relationship between the category and the entity information, and the entity information includes at least one key entity; Obtaining sample recommendation information for a first sample recommendation object in the target virtual space, and using the sample recommendation information as a target sample; the first sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects associated with the target virtual space, and the sample recommendation information includes text information corresponding to the recommendation voice and interface screenshot information of the target virtual space; Determine a first target category to which the first sample recommendation object belongs, and a second target category to which the second sample recommendation object belongs; The second sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects except the first sample recommendation object; Determine, according to the category-entity mapping information, first target entity information corresponding to the first target category and second target entity information corresponding to the second target category; generating a positive sample according to the first target entity information, and generating a negative sample according to the second target entity information; Generate a training triplet according to the target sample, the positive sample and the negative sample; The preset network model is supervisedly learned according to the training triplet to obtain a target model; the target model is used for category recognition of the recommended object.

2. The model training method for category recognition according to claim 1, characterized in that: The obtaining the category entity mapping information according to at least one key entity corresponding to each category includes: Determining the category level corresponding to each of the categories; Generating category entity mapping information corresponding to the category level according to at least one key entity corresponding to a category of the same category level; The category entity mapping information is obtained according to the category entity mapping information corresponding to at least one of the category levels.

3. The model training method for category recognition according to claim 2, characterized in that: The first target category includes first target subcategories corresponding to each category level, and the second target category includes second target subcategories corresponding to each category level; The determining, according to the category-entity mapping information, first target entity information corresponding to the first target category and second target entity information corresponding to the second target category includes: According to the first target sub-categories corresponding to the category levels, determining the first target sub-entity information corresponding to the corresponding first target sub-category from the category entity mapping information corresponding to the category levels, and obtaining at least one first target sub-entity information; According to the second target sub-categories corresponding to each of the category levels, second target sub-entity information corresponding to the corresponding second target sub-category is determined from the category entity mapping information corresponding to each of the category levels to obtain at least one piece of second target sub-entity information.

4. The model training method for category recognition according to claim 3, characterized in that: In the case where the at least one category level is a plurality of category levels, the performing supervised learning on the preset network model according to the training triplet to obtain the target model includes: Inputting the target sample in the training triplet into the preset network model to obtain a target sample vector; Inputting the positive samples in the training triplet into the preset network model, determining the first feature vector corresponding to each of the first target sub-entity information through the preset network model, and obtaining the positive sample vector according to the fusion of each of the first feature vectors; Inputting the negative samples in the training triplet into the preset network model, determining the second feature vectors corresponding to each second target sub-entity information through the preset network model, and obtaining the negative sample vector according to the fusion of each second feature vector; Determining a first similarity between the target sample vector and the positive sample vector, and a second similarity between the target sample vector and the negative sample vector; A loss value is determined based on the difference between the first similarity and the second similarity through a preset loss function, and model parameters of the preset network model are reversely adjusted according to the loss value to perform iterative training until the preset training end condition is met to obtain the target model.

5. A category identification method, characterized in that: include: In the process of recommending a recommendation object in the virtual space, obtaining recommendation information of the recommendation; Determine the category to which each of the candidate recommendation objects associated with the virtual space belongs; Determine entity information corresponding to each candidate recommendation object according to the category entity mapping information and the category to which each candidate recommendation object belongs; The category-entity mapping information represents the corresponding relationship between the category and the entity information, and the entity information includes at least one key entity; Inputting the recommendation information and entity information corresponding to each of the candidate recommendation objects into a target model to obtain a similarity between the recommendation information and each of the candidate recommendation objects; Determining a target candidate recommendation object according to the similarity between the recommendation information and each of the candidate recommendation objects; Using the category to which the target candidate object belongs as the category of the recommended object in the recommendation information; The target model is trained based on the model training method for category recognition described in any one of claims 1 to 4.

6. A model training device for category recognition, characterized in that: include: A recommendation object information acquisition unit, configured to acquire recommendation object information from a recommendation object knowledge base; The recommended object knowledge base includes the corresponding relationship between recommended object information and categories; an entity extraction unit configured to extract entities from the recommended object information, establish a correspondence between the entities and the categories based on a correspondence between the recommended object information and the categories, and obtain an initial category entity correspondence set; An entity aggregation unit is configured to aggregate entities corresponding to the same category in the initial category entity correspondence set to obtain an entity set corresponding to each category; A key entity determination unit is configured to execute, for each entity set corresponding to a category, determining at least one key entity corresponding to the category according to the occurrence frequency of each entity in the entity set; A category entity mapping information generating unit is configured to obtain the category entity mapping information according to at least one key entity corresponding to each of the categories; the category entity mapping information represents the corresponding relationship between the category and the entity information, and the entity information includes at least one key entity; A sample recommendation information acquisition unit is configured to acquire sample recommendation information for a first sample recommendation object in a target virtual space, and use the sample recommendation information as a target sample; The first sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects associated with the target virtual space, and the sample recommendation information includes text information corresponding to the recommendation voice and interface screenshot information of the target virtual space; a target category determination unit, configured to determine a first target category to which the first sample recommendation object belongs, and a second target category to which the second sample recommendation object belongs; The second sample recommendation object is any candidate sample recommendation object among the candidate sample recommendation objects except the first sample recommendation object; a target entity information determining unit, configured to determine first target entity information corresponding to the first target category and second target entity information corresponding to the second target category according to the category-entity mapping information; a positive and negative sample generating unit, configured to generate positive samples according to the first target entity information, and generate negative samples according to the second target entity information; A training triplet generation unit, configured to generate a training triplet according to the target sample, the positive sample and the negative sample; The training unit is configured to perform supervised learning on a preset network model according to the training triplet to obtain a target model; the target model is used for category recognition of the recommended object.

7. The model training device for category recognition according to claim 6, characterized in that: The category entity mapping information generating unit includes: A category level determination unit, configured to determine a category level corresponding to each of the categories; A first generating unit is configured to generate category entity mapping information corresponding to the category level according to at least one key entity corresponding to a category of the same category level; The second generating unit is configured to execute the category entity mapping information corresponding to at least one of the category levels to obtain the category entity mapping information.

8. The model training device for category recognition according to claim 7, characterized in that: The first target category includes first target subcategories corresponding to each category level, and the second target category includes second target subcategories corresponding to each category level; The target entity information determining unit comprises: A first target entity information determining unit is configured to determine, according to the first target sub-categories corresponding to the category levels, first target sub-entity information corresponding to the corresponding first target sub-category from the category entity mapping information corresponding to the category levels, to obtain at least one first target sub-entity information; The second target entity information determination unit is configured to execute, according to the second target sub-category corresponding to each of the category levels, determine the second target sub-entity information corresponding to the corresponding second target sub-category from the category entity mapping information corresponding to each of the category levels, and obtain at least one second target sub-entity information.

9. The model training device for category recognition according to claim 8, characterized in that: In the case where the at least one category level is a plurality of category levels, the training unit comprises: A target sample vector determination unit is configured to input the target sample in the training triplet into the preset network model to obtain a target sample vector; A positive sample vector determination unit is configured to input the positive samples in the training triplet into the preset network model, determine the first feature vector corresponding to each of the first target sub-entity information through the preset network model, and obtain the positive sample vector according to the fusion of each of the first feature vectors; A negative sample vector determination unit is configured to input the negative samples in the training triplet into the preset network model, determine the second feature vector corresponding to each second target sub-entity information through the preset network model, and obtain a negative sample vector according to the fusion of each second feature vector; a similarity calculation unit, configured to determine a first similarity between the target sample vector and the positive sample vector, and a second similarity between the target sample vector and the negative sample vector; The training subunit is configured to determine the loss value based on the difference between the first similarity and the second similarity through a preset loss function, and reversely adjust the model parameters of the preset network model according to the loss value to perform iterative training until the preset training end condition is met to obtain the target model.

10. A category recognition device, characterized in that: include: A recommendation information acquisition unit, configured to acquire recommendation information of a recommendation during a process of recommending a recommendation object in a virtual space; A candidate category determination unit is configured to determine the category to which each of the candidate recommendation objects associated with the virtual space belongs; an entity information determining unit, configured to determine entity information corresponding to each candidate recommendation object according to the category-entity mapping information and the category to which each candidate recommendation object belongs; The category-entity mapping information represents the corresponding relationship between the category and the entity information, and the entity information includes at least one key entity; a similarity determination unit configured to input the recommendation information and entity information corresponding to each of the candidate recommendation objects into a target model to obtain a similarity between the recommendation information and each of the candidate recommendation objects; a category determination unit, configured to determine a target candidate recommendation object according to a similarity between the recommendation information and each of the candidate recommendation objects; Using the category to which the target candidate object belongs as the category of the recommended object in the recommendation information; The target model is trained based on the model training method for category recognition described in any one of claims 1 to 4.

11. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the model training method for category recognition as described in any one of claims 1 to 4, or the category recognition method described in claim 5.

12. A computer-readable storage medium, when the instructions in the computer-readable storage medium are executed by a processor of an electronic device, enables the electronic device to execute the model training method for category recognition as described in any one of claims 1 to 4, or the category recognition method described in claim 5.

13. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, it implements the model training method for category recognition described in any one of claims 1 to 4, or the category recognition method described in claim 5.