CN111310025A - Model training method, data processing method, device and related equipment - Google Patents

Model training method, data processing method, device and related equipment Download PDF

Info

Publication number
CN111310025A
CN111310025A CN202010053975.6A CN202010053975A CN111310025A CN 111310025 A CN111310025 A CN 111310025A CN 202010053975 A CN202010053975 A CN 202010053975A CN 111310025 A CN111310025 A CN 111310025A
Authority
CN
China
Prior art keywords
target
service
attribute
recommended
user
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202010053975.6A
Other languages
Chinese (zh)
Other versions
CN111310025B (en
Inventor
潘颖吉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN202010053975.6A priority Critical patent/CN111310025B/en
Publication of CN111310025A publication Critical patent/CN111310025A/en
Application granted granted Critical
Publication of CN111310025B publication Critical patent/CN111310025B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/31Indexing; Data structures therefor; Storage structures
    • G06F16/316Indexing structures
    • G06F16/322Trees
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • G06F16/3331Query processing
    • G06F16/334Query execution
    • G06F16/3346Query execution using probabilistic model
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/35Clustering; Classification
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q30/00Commerce
    • G06Q30/06Buying, selling or leasing transactions
    • G06Q30/0601Electronic shopping [e-shopping]
    • G06Q30/0631Item recommendations

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Engineering & Computer Science (AREA)
  • Business, Economics & Management (AREA)
  • Accounting & Taxation (AREA)
  • Finance (AREA)
  • Development Economics (AREA)
  • Economics (AREA)
  • Marketing (AREA)
  • Strategic Management (AREA)
  • General Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Probability & Statistics with Applications (AREA)
  • Computational Linguistics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the application discloses a model training method, a data processing method, a device and related equipment, wherein the model training method comprises the following steps: sampling at least one service class to obtain a target service class, wherein the target service class comprises a service object set; sampling a service object set to obtain a first service object; acquiring a sample user attribute of a sample user, and acquiring a second service object having an interactive relation with the sample user; determining the sample user attribute and the first service object as negative samples, and determining the sample user attribute and the second service object as positive samples; and training the initial discrimination model by adopting a positive sample and a negative sample to obtain a target discrimination model. By the method and the device, the recommendation accuracy of the model to the business object can be improved.

Description

Model training method, data processing method, device and related equipment
Technical Field
The present application relates to the field of computer technologies, and in particular, to a model training method, a data processing method, an apparatus, a computer device, and a storage medium.
Background
In recent years, with the increasing development and popularization of internet technology, services related to personalized recommendation are widely applied to aspects of life. The personalized recommendation technology can help a user to find the content wanted by the user from massive information.
The personalized recommendation is to predict a recommendation coefficient of a user to a certain business object (for example, a certain book, a certain piece of news information) through a trained recommendation model, so as to provide accurate recommended content and service for the user. However, the training recommendation model requires a positive sample and a negative sample, where the positive sample is a business object that has interacted with the user, for example, a business object that is commented by the user, a business object that is collected by the user, and the like all belong to the positive sample.
In the prior art, the negative samples are determined according to the distribution of the positive samples, that is, the probability that a certain business object will be sampled as a negative sample is determined by the frequency of the business object as a positive sample.
For example, the service object set includes 3 service objects, which are respectively service object 1, service object 2, and service object 3, and the number ratio of the service object 1, the service object 2, and the service object 3 as positive samples is 1:2:3, so that when a negative sample is determined, the 3 service objects are still sampled according to the probability ratio of 1:2: 3.
As can be seen from the above, if the negative samples are determined according to the distribution of the positive samples, a large number of positive samples are also sampled as the negative samples, so that the prediction recommendation coefficient of the trained recommendation model for the service object really interested by the user is low, and the recommendation accuracy of the recommendation model is low.
Disclosure of Invention
The embodiment of the application provides a model training method, a model training device and related equipment, and the accuracy of recommending a business object by a model can be improved.
An aspect of the embodiments of the present application provides a model training method, including:
sampling at least one service class to obtain a target service class, wherein the target service class comprises a service object set;
sampling a service object set to obtain a first service object;
acquiring a sample user attribute of a sample user, and acquiring a second service object having an interactive relation with the sample user;
determining the sample user attribute and the first service object as negative samples, and determining the sample user attribute and the second service object as positive samples;
and training the initial discrimination model by adopting a positive sample and a negative sample to obtain a target discrimination model.
Wherein, the at least one service class comprises at least one primary service class and at least one secondary service class subordinate to each primary service class;
sampling at least one service class to obtain a target service class, comprising:
uniformly sampling at least one primary service class to obtain a target primary service class;
uniformly sampling at least one second-level service class subordinate to the target first-level service class to obtain a target second-level service class;
and taking the target secondary service class as a target service class.
Wherein, at least one service class corresponds to at least one class grade;
sampling at least one service class to obtain a target service class, comprising:
selecting at least one service class corresponding to the minimum class grade from at least one service class, and taking the selected at least one service class as a service class to be sampled;
and uniformly sampling at least one service class to be sampled to obtain a target service class.
The method for training the initial discrimination model by adopting the positive sample and the negative sample to obtain the target discrimination model comprises the following steps:
calling an initial discrimination model to obtain a first recommendation coefficient corresponding to the negative sample and a second recommendation coefficient corresponding to the positive sample;
generating a negative sample recommendation probability corresponding to the negative sample and a positive sample recommendation probability corresponding to the positive sample;
determining a first discrimination error between the first recommendation coefficient and the negative sample recommendation probability and a second discrimination error between the second recommendation coefficient and the positive sample recommendation probability;
adjusting model parameters of the initial discrimination model according to the first discrimination error and the second discrimination error;
and when the adjusted initial discrimination model meets the model convergence condition, taking the adjusted initial discrimination model as a target discrimination model.
The initial discrimination model comprises a user characteristic generator, a business object characteristic generator and a trend discriminator;
calling an initial discrimination model, and acquiring a first recommendation coefficient corresponding to the negative sample and a second recommendation coefficient corresponding to the positive sample, wherein the steps of:
acquiring a first service object attribute of a first service object and a second service object attribute of a second service object;
calling a business object feature generator to obtain a first object attribute feature of a first business object attribute and a second object attribute feature of a second business object attribute;
calling a user characteristic generator to obtain sample user attribute characteristics of the sample user attributes;
calling a trend discriminator to determine a characteristic distance between the sample user attribute feature and the first object attribute feature and a characteristic distance between the sample user attribute feature and the second object attribute feature;
and taking the characteristic distance determined by the attribute characteristics of the first object as a first recommendation coefficient, and taking the characteristic distance determined by the attribute characteristics of the second object as a second recommendation coefficient.
Wherein the interactive relationship comprises an interacted relationship;
acquiring a second business object having an interactive relationship with the sample user, including:
acquiring an interaction record of a sample user; the interaction record is a record generated aiming at the interaction behavior of the sample user;
and taking the business object contained in the interaction record as a second business object having an interactive relation with the sample user.
Wherein, still include:
acquiring N attribute characteristics of the recommended objects, wherein N is an integer greater than 1; each attribute feature of the recommended object is an attribute feature of the recommended service object attribute determined by calling a target discrimination model; the attribute of the recommended service object is the object attribute of the recommended service object; recommending that the service class to which the service object belongs to at least one service class;
acquiring a target user attribute of a target user, and calling a target discrimination model to determine a target user attribute characteristic of the target user attribute;
calling a target discrimination model to respectively determine target recommendation coefficients between the target user attribute features and the N recommendation object attribute features;
recommending a target recommendation service object to a target user according to the N target recommendation coefficients; the target recommendation service object belongs to the N recommendation service objects.
Another aspect of the embodiments of the present application provides a data processing method, including:
acquiring target user attributes and N recommended service objects of a target user, wherein N is an integer greater than 1;
calling a target discrimination model to determine a recommendation prediction trend between the target user attribute and the N recommended service objects; the object discrimination model is obtained by training by adopting the model training method of any one of claims 1 to 8;
recommending a target recommendation service object to a target user according to the recommendation prediction trend; the target recommendation service object belongs to the N recommendation service objects.
The target discrimination model comprises a target user characteristic generator, a target business object characteristic generator and a target trend discriminator;
calling a target discrimination model to determine a recommendation prediction trend between target user attributes and N recommended service objects, wherein the recommendation prediction trend comprises the following steps:
acquiring the attribute of a recommended service object of each recommended service object;
calling a target user characteristic generator, and determining a target user attribute characteristic of a target user attribute;
calling a target business object feature generator, and determining N recommended object attribute features corresponding to the N recommended business object attributes;
calling a target trend discriminator to determine the characteristic distance between the target user attribute characteristics and the N recommended object attribute characteristics;
and taking the characteristic distance determined by the attribute characteristics of the N recommended objects as a recommended prediction trend between the target user attribute and the N recommended service objects.
The recommending the target recommendation service object to the target user according to the recommendation prediction trend comprises the following steps:
acquiring a prediction trend threshold;
and taking the recommended service object corresponding to the recommended prediction trend larger than the prediction trend threshold value as a target recommended service object, and recommending the target recommended service object to the target user.
Another aspect of the embodiments of the present application provides a model training apparatus, including:
the system comprises a first sampling module, a second sampling module and a third sampling module, wherein the first sampling module is used for sampling at least one service class to obtain a target service class, and the target service class comprises a service object set;
the second sampling module is used for sampling the service object set to obtain a first service object;
the first acquisition module is used for acquiring the sample user attribute of the sample user;
the second acquisition module is used for acquiring a second business object which has an interactive relation with the sample user;
the determining module is used for determining the sample user attribute and the first service object as negative samples and determining the sample user attribute and the second service object as positive samples;
and the training module is used for training the initial discrimination model by adopting the positive sample and the negative sample to obtain a target discrimination model.
Wherein, the at least one service class comprises at least one primary service class and at least one secondary service class subordinate to each primary service class;
a first sampling module comprising:
the first sampling unit is used for uniformly sampling at least one primary service class to obtain a target primary service class;
and the second sampling unit is used for uniformly sampling at least one second-level service class which belongs to the target first-level service class to obtain a target second-level service class, and the target second-level service class is used as the target service class.
Wherein, at least one service class corresponds to at least one class grade;
a first sampling module comprising:
the third sampling unit is used for selecting at least one service class corresponding to the minimum class grade from at least one service class, and taking the selected at least one service class as a service class to be sampled;
and the fourth sampling unit is used for uniformly sampling at least one service class to be sampled to obtain a target service class.
Wherein, the training module includes:
the obtaining unit is used for calling the initial discrimination model, and obtaining a first recommendation coefficient corresponding to the negative sample and a second recommendation coefficient corresponding to the positive sample;
the training unit is used for generating a negative sample recommendation probability corresponding to the negative sample and a positive sample recommendation probability corresponding to the positive sample, determining a first discrimination error between a first recommendation coefficient and the negative sample recommendation probability and a second discrimination error between a second recommendation coefficient and the positive sample recommendation probability, adjusting model parameters of the initial discrimination model according to the first discrimination error and the second discrimination error, and taking the adjusted initial discrimination model as a target discrimination model when the adjusted initial discrimination model meets a model convergence condition.
The initial discrimination model comprises a user characteristic generator, a business object characteristic generator and a trend discriminator;
the system comprises an acquisition unit, a service object feature generator, a user feature generator, a trend discriminator, a first recommendation coefficient and a second recommendation coefficient, wherein the acquisition unit is specifically used for acquiring a first service object attribute of a first service object and a second service object attribute of a second service object, acquiring a first object attribute feature of the first service object attribute and a second object attribute feature of the second service object attribute, calling the user feature generator, acquiring a sample user attribute feature of the sample user attribute, calling the trend discriminator, determining a feature distance between the sample user attribute feature and the first object attribute feature and a feature distance between the sample user attribute feature and the second object attribute feature, and taking the feature distance determined by the first object attribute feature as the first recommendation coefficient and the feature distance determined by the second object attribute feature as the second recommendation coefficient.
Wherein, still include:
the third acquisition module is used for acquiring N attribute characteristics of the recommendation objects, wherein N is an integer greater than 1; each attribute feature of the recommended object is an attribute feature of the recommended service object attribute determined by calling a target discrimination model; the attribute of the recommended service object is the object attribute of the recommended service object; recommending that the service class to which the service object belongs to at least one service class;
the third obtaining module is further used for obtaining the target user attribute of the target user, calling the target discrimination model to determine the target user attribute feature of the target user attribute, calling the target discrimination model to respectively determine the target recommendation coefficients between the target user attribute feature and the N recommended object attribute features, and recommending the target recommended service object to the target user according to the N target recommendation coefficients; the target recommendation service object belongs to the N recommendation service objects.
Wherein the interactive relationship comprises an interacted relationship;
the second acquisition module is specifically used for acquiring the interaction records of the sample users and taking the business objects contained in the interaction records as second business objects which have an interactive relationship with the sample users; the interaction record is a record generated for the interaction behavior of the sample user.
Another aspect of the embodiments of the present application provides a data processing apparatus, including:
the fourth acquisition module is used for acquiring the target user attribute of the target user and N recommended service objects, wherein N is an integer greater than 1;
the prediction module is used for calling a target discrimination model to determine a recommendation prediction trend between the target user attribute and the N recommended service objects; the object discrimination model is obtained by training by adopting the model training method of any one of claims 1 to 8;
the recommendation module is used for recommending a target recommendation service object to a target user according to the recommendation prediction trend; the target recommendation service object belongs to the N recommendation service objects.
The target discrimination model comprises a target user characteristic generator, a target business object characteristic generator and a target trend discriminator;
the prediction module is specifically used for acquiring the recommended service object attribute of each recommended service object, calling the target user feature generator, determining the target user attribute feature of the target user attribute, calling the target service object feature generator, determining N recommended object attribute features corresponding to the N recommended service object attributes, calling the target trend discriminator, determining the feature distance between the target user attribute feature and the N recommended object attribute features, and taking the feature distance determined by the N recommended object attribute features as the recommended prediction trend between the target user attribute and the N recommended service objects.
The recommendation module is specifically configured to obtain a prediction trend threshold, use a recommended service object corresponding to a recommended prediction trend larger than the prediction trend threshold as a target recommended service object, and recommend the target recommended service object to a target user.
Another aspect of the embodiments of the present application provides a computer device, including a memory and a processor, where the memory stores a computer program, and when the computer program is executed by the processor, the processor is caused to execute the method in the foregoing embodiments.
Another aspect of the embodiments of the present application provides a computer storage medium, in which a computer program is stored, where the computer program includes program instructions, and the program instructions, when executed by a processor, perform the method in the foregoing embodiments.
The method comprises the steps of obtaining a target business category by sampling from at least one business category, obtaining a first business object by sampling from a business object set subordinate to the target business category, taking the user attribute of a user and the first business object as negative samples, taking the business object which has interactive behaviors with the user as a positive sample, and training an initial discriminant model. Therefore, the negative sample in the application is determined according to the category of the business object and has no direct incidence relation with the positive sample, so that the situation that the prediction recommendation coefficient of the positive sample is low due to the fact that a large number of positive samples are sampled to serve as the negative sample can be avoided, the prediction recommendation coefficient of the initial discrimination model trained by the application to the positive sample interested by the user is high, and the recommendation accuracy of the model is improved; further, the method and the device can also overcome the condition that the accuracy of the model is unstable due to the imbalance of the number of the business objects on the category, and further guarantee the recommendation accuracy of the model.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a system architecture diagram of model training provided by an embodiment of the present application;
2 a-2 d are schematic diagrams of a scenario of model training provided by an embodiment of the present application;
FIG. 3 is a schematic flow chart diagram illustrating a model training method according to an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a product recommendation model provided in an embodiment of the present application;
FIG. 5 is a schematic diagram of a merchandise recommendation provided by an embodiment of the present application;
FIG. 6 is a schematic diagram of an advertisement delivery platform provided in an embodiment of the present application;
fig. 7 is a schematic flowchart of a data processing method according to an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a model training apparatus according to an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
FIG. 10 is a schematic structural diagram of a computer device according to an embodiment of the present disclosure;
fig. 11 is a schematic structural diagram of another computer device provided in an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Artificial Intelligence (AI) is a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human Intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technique of computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can react in a manner similar to human intelligence. Artificial intelligence is the research of the design principle and the realization method of various intelligent machines, so that the machines have the functions of perception, reasoning and decision making.
The artificial intelligence technology is a comprehensive subject and relates to the field of extensive technology, namely the technology of a hardware level and the technology of a software level. The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The scheme provided by the embodiment of the application belongs to Machine Learning (ML) belonging to the field of artificial intelligence, and specifically relates to a hierarchical negative sampling strategy to obtain a negative sample, so as to train a recommendation model for predicting the interest degree of a user in a business object.
Machine learning is a multi-field cross discipline, and relates to a plurality of disciplines such as probability theory, statistics, approximation theory, convex analysis, algorithm complexity theory and the like. The special research on how a computer simulates or realizes the learning behavior of human beings so as to acquire new knowledge or skills and reorganize the existing knowledge structure to continuously improve the performance of the computer. Machine learning is the core of artificial intelligence, is the fundamental approach for computers to have intelligence, and is applied to all fields of artificial intelligence. In the application, specific technical means relate to technologies such as artificial neural networks and rapid text classification in machine learning.
Fig. 1 is a system architecture diagram of model training according to an embodiment of the present application. The application relates to a server 10d and a terminal device cluster, and the terminal device cluster may include: terminal device 10a, terminal device 10 b.
The server 10d samples at least one service class to obtain a target service class, and the server 10d samples a service object set included in the target service class to obtain a first service object. The server 10d obtains a sample user attribute of a sample user, obtains a second business object having an interactive relationship with the sample user, and the server 10d takes the sample user attribute and the first business object as negative samples, takes the sample user attribute and the second business object as positive samples, trains an initial discrimination model by adopting the positive samples and the negative samples, and obtains a target discrimination model. The target discrimination model is used for predicting a recommendation coefficient between a target user and a recommended service object to be recommended.
Subsequently, the server 10d may issue the trained target discrimination model to the terminal device cluster, and any terminal device in the terminal device cluster may predict a recommendation coefficient between the target user and the recommended service object to be recommended based on the target discrimination model.
Or, any terminal device in the terminal device cluster may report the target user attribute of the target user to the server 10d, and the server 10d predicts the recommendation coefficient between the target user and the recommended service object to be recommended based on the trained target discrimination model.
The terminal device 10a, the terminal device 10b, the terminal device 10c, and the like shown in fig. 1 may be a mobile phone, a tablet computer, a notebook computer, a palm computer, a Mobile Internet Device (MID), a wearable device, or the like. The server 10d shown in fig. 1 may refer to a single server device, or may refer to a server cluster including a plurality of server devices.
Fig. 2a to fig. 2b, which are described below, take an example of how the server 10d trains the initial discrimination model to obtain the target discrimination model, and fig. 2c to fig. 2d, which are described below, take an example of how the terminal device 10a predicts the recommendation coefficient between the target user attribute and the recommended service object to be recommended according to the trained target discrimination model.
Please refer to fig. 2 a-2 d, which are schematic views of a scenario of model training according to an embodiment of the present application. As shown in fig. 2a, in a commodity recommendation service scenario, it is assumed that all commodities in a commodity library used for model training correspond to commodity categories of 3 grades, where the commodity categories of one grade include: sports outdoors and movie animation; the first-level commodity category "sports outdoor" belongs to 3 second-level commodity categories, which are respectively: sports accessories, outdoor women's suits, and outdoor men's suits; the first-level commodity category "movie cartoon" belongs to 1 second-level commodity category: and (5) cartoon periphery.
The second-level commodity category "motion accessory" belongs to 3 third-level commodity categories, which are respectively: head bands, sports hats, and messenger bags; the second-level commodity category "outdoor women's dress" belongs to 2 third-level commodity categories, which are respectively: wind coat and outdoor jacket; the second-level commodity category "outdoor men's clothing" also belongs to 2 third-level commodity categories, which are respectively: t-shirts and quick-dry pants; the second-level commodity category "cartoon periphery" belongs to 1 third-level commodity category: and (4) handling.
The server 10d obtains a user attribute (which may be referred to as user attribute 1) of a sample user for model training, and a commodity having an interactive relationship with the sample user in a commodity library.
The user attributes may include: at least one of gender, age, occupation, hobbies, and location.
The commodities with interactive relations can be commodities collected by the sample user, commented commodities, purchased commodities or searched commodities and the like. Assuming that a sample user purchased a headband article, as shown in FIG. 2b, the server 10d may combine the user attribute 1 and the headband article into a positive sample 20 a.
From the foregoing, the commodity categories in the commodity library include 3 levels, and the server 10d can uniformly sample from the finest-grained commodity categories, that is, the server 10d can uniformly sample from the 8 three-level commodity categories (respectively: headband, sports hat, cross-over, wind coat, outdoor jacket, T-shirt, quick-drying pants, and handheld) in fig. 2a, assuming that three-level commodity categories are sampled: wind coat. The server 10d then performs uniform sampling from all of the windbreaker articles under the sampled tertiary article category "windbreaker".
As shown in fig. 2b, the server 10d may combine the sampled items of winddress and the user attribute 1 in the foregoing as a negative example 20 b.
The positive examples 20a and the negative examples 20b may be used to adjust model parameters of the initial discriminant model 20c (the initial discriminant model 20c includes the user feature generator 20d, the commodity feature generator 20e, and the classifier 20f), so that the adjusted initial discriminant model 20c may accurately predict the interest level of the user in a certain commodity, and may be used for commodity recommendation.
The specific adjustment process is as follows: the server 10d acquires the commodity attribute of the headband commodity (may be referred to as a headband commodity attribute), and acquires the commodity attribute of the sampled winddress commodity (may be referred to as a winddress commodity attribute).
The commodity attributes may include: at least one of a commodity name, a commodity picture, and a commodity category to which the commodity belongs.
The server 10d may first perform one-hot encoding (one-hot code) on the user attribute 1 and the headband article attribute, respectively, to convert the user attribute 1 into a vector representation and convert the headband article attribute into a vector representation.
The server 10d may input the vector obtained by converting the user attribute 1 into the user feature generator 20d, and extract the user attribute feature of the user attribute 1 based on the convolution layer, the pooling layer, and the normalization layer in the user feature generator 20 d; the server 10d may input the vector converted from the headband article attribute to the article feature generator 20e, and extract the headband article attribute feature of the headband article attribute based on the convolution layer, the pooling layer, and the normalization layer of the pair in the article feature generator 20 e.
Based on the classifier 20f, a vector distance between the user attribute feature and the headband article attribute feature can be determined, the vector distance represents a recommendation coefficient (the coefficient is in the interval of 0-1) of the headband article to the user attribute 1 (or the headband article to the sample user), and since the headband article belongs to the positive sample, the true recommendation coefficient can be determined to be 1. The server may determine the prediction loss of the positive sample 20a according to the recommendation coefficient determined by the initial discrimination model 20c and the true recommendation coefficient of the positive sample.
Similarly, the server 10d may convert the windbreaker commodity attributes into vector representations, input the vectors obtained by converting the windbreaker commodity attributes into the commodity feature generator 20e, and extract the windbreaker commodity attribute features of the windbreaker commodity attributes based on the convolution layer, pooling layer, and normalization layer pair in the commodity feature generator 20 e.
Based on the classifier 20f, a vector distance between the user attribute feature and the wind clothing article attribute feature in the foregoing description can be determined, the vector distance represents a recommendation coefficient (the coefficient is in the interval of 0-1) of the wind clothing article to the user attribute 1, and since the wind clothing article belongs to a negative sample, a true recommendation coefficient can be determined to be 0. The server may determine the predicted loss of the negative example 20b according to the recommendation coefficient determined by the initial discriminant model 20c and the true recommendation coefficient of the negative example.
The server 10d may superimpose the prediction loss determined by the positive sample 20a and the prediction loss determined by the negative sample 20b into a final prediction loss, and adjust the model parameters of the initial discrimination model 20c based on the final prediction loss.
Alternatively, the server 10d may adjust the initial discrimination model 20c based on the prediction loss determined by the positive sample 20a, and then adjust the initial discrimination model 20c again based on the prediction loss determined by the negative sample 20 b;
alternatively, the server 10d may adjust the initial discrimination model 20c based on the predicted loss determined by the negative sample 20b, and then adjust the initial discrimination model 20c again based on the predicted loss determined by the positive sample 20 a.
The initial discrimination model 20c is adjusted according to a set of positive and negative samples of the same sample user, and the server 10d may obtain the next set of positive and negative samples of the next sample user according to the above manner, adjust the initial discrimination model 20c again, and perform iterative adjustment continuously until the initial discrimination model 20c converges.
When the initial discriminant model 20c satisfies the model convergence condition, the initial discriminant model 20c at this time is taken as the target discriminant model 20c, and it should be noted that the training model is only parameters in the adjustment model, and the model structure is unchanged.
As shown in fig. 2c, the server 10d may transmit the trained target discrimination model 20c to the terminal device 10a, and may specifically transmit the trained target discrimination model to the shopping client in the terminal device 10 a. When the target user starts the shopping client in the terminal device 10a, the shopping client can collect the user attribute of the target user through the page 20g, and the collected user attribute is referred to as user attribute 2.
The shopping client may obtain the to-be-recommended goods according to the business requirement, and of course, the goods category of the to-be-recommended goods belongs to the goods categories (including the first-level goods category, the second-level goods category, and the third-level goods category in fig. 2 a) shown in fig. 2 a. The embodiment assumes that the goods to be recommended are quick-drying clothes goods, and the quick-drying clothes goods belong to the third-class goods category of outdoor men's clothing.
The terminal device 10a may obtain a product attribute of the quick-drying clothing product, which may be referred to as a quick-drying clothing product attribute. Extracting the user attribute features of the user attribute 2 based on the user feature generator 20d in the target discrimination model 20 c; extracting the attribute characteristics of the quick-drying clothes commodity based on the commodity feature generator 20e in the target discrimination model 20 c; the recommendation coefficient of the quick-drying clothing commodity to the target user is determined to be 0.8 based on the classifier 20f in the target discrimination model 20c, and then the terminal device 10a can use the quick-drying clothing commodity as the target recommendation commodity of the target user.
As shown in fig. 2d, the page 20j may be a home page of the shopping client, when the user refreshes the home page 20j, the user may jump from the home page 20j to a page 20k containing a target recommended product "quick drying clothing article", and an image of the target recommended product "quick drying clothing article" is displayed in the page 20 k.
When the number of the aforementioned to-be-recommended commodities is plural, the recommendation coefficient of each to-be-recommended commodity may be determined based on the target discrimination model 20c, and all the recommendation coefficients may be sorted in order from large to small. The shopping client can take the commodities to be recommended corresponding to the first N recommendation coefficients as target recommended commodities, and display the N target recommended commodities in the page 20k so as to achieve the purpose of personalized recommendation.
The specific process of determining a first business object (such as the sampled winddress goods in the above embodiment) and a second business object (such as the headband goods in the above embodiment), and training an initial discriminant model (such as the initial discriminant model 20c in the above embodiment) can be referred to the following embodiments corresponding to fig. 3-7.
Please refer to fig. 3, which is a schematic flow chart of a model training method provided in the embodiment of the present application, the embodiment mainly relates to a training process of an image recognition model, and the model training method may include the following steps:
step S101, sampling at least one service class to obtain a target service class, wherein the target service class comprises a service object set.
Because model training involves a large number of operations, the following embodiments are described with a better performing server as the executing agent, and the model training may be off-line training:
specifically, a server (e.g., the server 10d in the embodiment corresponding to fig. 2a to fig. 2 d) acquires an original object set (e.g., a commodity library in the embodiment corresponding to fig. 2a to fig. 2 d) including a plurality of business objects, where the original object set may correspond to at least one business category. The server may obtain the at least one service category (e.g., the first-level product category "sports outdoors", the first-level product category "cartoon surroundings", the second-level product category "sports accessories", the second-level product category "outdoor women", the second-level product category "outdoor men", the second-level product category "cartoon surroundings", the third-level product category "head belt", the third-level product category "sports cap", the third-level product category "satchel", the third-level product category "windcoat", the third-level product category "jacket", the third-level product category "T-shirt", the third-level product category "quick-drying pants", and the third-level product category "hands" in the embodiments corresponding to fig. 2a to fig. 2d described above). In some embodiments, the original object set may have a tree classification structure, a plurality of business classes in the original object set have a hierarchical structure, and one or more low-level business classes may be included in a high-level hierarchical business class (e.g., as shown in fig. 2 a-2 d).
The business object may be a commodity, or a book, or news information, and the corresponding business category may be a commodity category, or a book category, or a news information category, etc.
The server may sample from the at least one traffic class to obtain a target traffic class (e.g. the sampled three-level goods class: winddress in the embodiments corresponding to fig. 2 a-2 d), where the target traffic class is one of the at least one traffic class.
The target business class includes a business object set, the business object set includes at least one business object, the business class to which each business object in the business object set belongs is the target business class, and it can be known that the business object set is a subset of the original object set.
There are two ways to sample the target traffic class from at least one traffic class, and the first sampling way is first described below:
the at least one service category acquired by the server may include at least one primary service category and at least one secondary service category belonging to each primary service category, all the service categories may be configured into at least one category tree (such as the 2 commodity category trees in fig. 2a described above) according to a hierarchical upper-lower relationship, a vertex of each category tree corresponds to a primary service category, a secondary service category is a sub-tree (or branch) of the primary service category, and the number of the category trees is equal to the number of the primary service categories. The server may first uniformly sample a primary service class from all primary service classes to obtain a target primary service class.
Uniform sampling refers to equal probability sampling, i.e., the probability that each individual in the population is drawn is equal. For example, there are primary class 1, primary class 2 and primary class 3, which are uniformly sampled from the above 3 primary classes, and the probability of each primary class being sampled is 1/3.
The server detects whether the secondary service class subordinate to the target primary service class is a leaf node of a class tree where the target primary service class is located, if so, the server can uniformly sample a secondary service class from at least one secondary service class subordinate to the target primary service class to obtain the target secondary service class.
If the second class service category under the target first class service category is not the leaf node of the category tree where the target first class service category is located, the second class service category adjacent to the target first class service category can be used as a new first class service category in the category tree where the target first class service category is located, and then the new target first class service category is obtained through uniform sampling. And until the second-level service class subordinate to the new target first-level service class is a leaf node of the class tree where the new target first-level service class is located, uniformly sampling by the server from the second-level service class subordinate to the new first-level service class to obtain the target second-level service class.
The server may take the target secondary traffic class as the target traffic class, which is the finest level of granularity of the traffic class in general.
The server may execute the above-described method for multiple times to obtain multiple target service classes, where each target service class includes a service object set corresponding to the target service class.
The sampling can be uniformly performed for a plurality of times in a mode of putting back from at least one service class, so that the sampling probability is the same when each sampling is performed, and a plurality of target service classes are obtained; alternatively, the sampled traffic classes may be all used as target traffic classes by uniformly sampling the traffic classes from at least one traffic class for a plurality of times without replacement.
Taking the 2 commodity category trees shown in fig. 2a as an example, if the sampling is performed in the above manner, the probabilities of the primary service category "sports outdoors" and the primary service category "movie cartoon" being sampled are 1/2 respectively;
the probabilities of the secondary service class 'sports accessories', the secondary service class 'outdoor women' and the secondary service class 'outdoor men' are 1/6 respectively, and the probabilities of the secondary service class 'cartoon surroundings' are 1/2 respectively;
the probabilities that the three-level service class "headband", the three-level service class "sports cap" and the three-level service class "satchel" are sampled as the target service class are 1/18 respectively, the probabilities that the three-level service class "windbreaker" and the three-level service class "jacket" are sampled as the target service class are 1/12 respectively, the probabilities that the three-level service class "T-shirt" and the three-level service class "quick-drying pants" are sampled as the target service class are 1/12 respectively, and the probability that the three-level service class "handheld" is sampled as the target service class is 1/2 respectively.
A second sampling approach for determining a target traffic class from at least one traffic class is described below:
the server acquires at least one service class corresponding to at least one class grade, selects one or more service classes corresponding to the minimum class grade from the at least one service class, and takes the selected service classes as service classes to be sampled. And the server uniformly samples the service classes to be sampled to obtain the target service classes. The target traffic class is 1 traffic class to be sampled.
In this embodiment, the target service class may be a finest granularity service class (for example, a three-level commodity class in fig. 2a to 2 d), and performing uniform sampling based on the finest granularity service class considers the low recall problem of negative sampling and the underestimation problem of positive samples, so that the recommendation effect of the model trained in this way is relatively satisfactory.
Likewise, the server may perform the above-mentioned method multiple times to obtain multiple target traffic classes, in which case, the sampling method is not only equal probability, but also sampling with putting back, and this sampling method may ensure that the probability of each traffic class to be sampled is the same at each sampling.
Alternatively, uniform sampling without replacement may be adopted, that is, the server uniformly samples a plurality of traffic classes from at least one traffic class to be sampled without replacement all at once, and all the traffic classes are taken as the target traffic class.
Still taking the 2 commodity category trees shown in fig. 2a as an example, in fig. 2a, the category grades corresponding to the service categories are: the device comprises a first stage, a second stage and a third stage, wherein the first stage is greater than the second stage, and the second stage is greater than the third stage. Of the 3 class levels in fig. 2a, the third level is the minimum class level, so that the three-level service class "headband", the three-level service class "sports cap", the three-level service class "satchel", the three-level service class "windcoat", the three-level service class "jacket", the three-level service class "T-shirt", the three-level service class "quick-drying pants" and the three-level service class "handheld" are all the service classes to be sampled, and the probabilities that the 8 service classes to be sampled are all 1/8.
Step S102, sampling is carried out on the service object set to obtain a first service object.
The server may uniformly sample a service object set included in the target service category to obtain a first service object (e.g., a winddress commodity sampled in the embodiments corresponding to fig. 2a to fig. 2d described above), where the service object set includes at least one service object, and the first service object is one service object in the service object set.
It should be noted that, when the number of the sampled target service classes is multiple, the number of the corresponding service object sets is also multiple, and the server may sample one service object from the multiple service object sets as the first service object.
Step S103, obtaining the sample user attribute of the sample user, and obtaining a second business object having an interactive relation with the sample user.
Specifically, the server obtains a user attribute of a sample user for model training, which is referred to as a sample user attribute (e.g., user attribute 1 in the corresponding embodiments of fig. 2a to 2 d).
The user attributes may include: at least one of gender, age, occupation, hobbies, location, and application software installed in a terminal device having a binding relationship with the sample user.
The server obtains a business object having an interactive relationship with the sample user from the original object set, which is called a second business object (such as the headband commodity in the corresponding embodiments of fig. 2 a-2 d), and the business class to which the second business object belongs is the at least one business class.
The interaction relationship may be an already-interacted relationship or a to-be-interacted relationship, and the business object having the already-interacted relationship with the sample user means that the sample user and the business object have an interaction behavior (the interaction behavior may be a collection behavior, a comment behavior, a search behavior, or the like); the business object having the to-be-interacted relation with the sample user is a business object set by the server for the sample user according to business requirements, for example, when the business object is a commodity, the commodity having the to-be-interacted relation with the sample user may be a commodity which is very cheap in second, or a very scarce explosive commodity (for example, a certain newly released mobile phone), and the like.
The following is a detailed description of how the server determines the second business object having an interactive relationship with the sample user:
the server obtains an interaction record of a sample user, wherein the interaction record is a record generated by the interaction behavior of the sample user on the business object in the original object set.
And the server takes the business object recorded in the interaction record as a second business object having an interactive relation with the sample user.
And step S104, determining the sample user attribute and the first service object as negative samples, and determining the sample user attribute and the second service object as positive samples.
Specifically, the server may combine the sample user attribute and the first business object into a negative sample for model training (e.g., the negative sample 20b in the corresponding embodiment of fig. 2 a-2 d), and combine the sample user attribute and the second business object into a positive sample for model training (e.g., the positive sample 20a in the corresponding embodiment of fig. 2 a-2 d).
The ratio between positive and negative examples for the same sample user may be 1:5, or 1: 10.
And S105, training the initial discrimination model by adopting a positive sample and a negative sample to obtain a target discrimination model.
Specifically, an initial discriminant model (such as the initial discriminant model 20c in the corresponding embodiments of fig. 2a to 2 d) is invoked to determine a recommendation coefficient (referred to as a first recommendation coefficient) for negative samples, and to determine a recommendation coefficient (referred to as a second recommendation coefficient) for positive samples, where the first recommendation coefficient and the second recommendation coefficient are real numbers in the interval of 0 to 1.
The physical meaning of the first recommendation coefficient is that the initial discrimination model predicts the interest degree of the sample user to the first service object; the physical meaning of the second recommendation coefficient is that the initial discrimination model predicts the interest degree of the sample user in the second business object.
The server may generate a negative sample recommendation probability corresponding to the negative sample and a positive sample recommendation probability corresponding to the positive sample, and it may be known that the negative sample recommendation probability is 0 and the positive sample recommendation probability is 1.
The discrimination error between the first recommendation coefficient and the negative sample recommendation probability is determined based on the following formula (1), referred to as a first discrimination error L1:
L1=-[y1·log(p1)+(1-y1)·log(1-p1)](1)
in the formula (1), y1 represents a negative sample recommendation probability, and p1 represents a first recommendation coefficient.
A discrimination error between the second recommendation coefficient and the positive sample recommendation probability is determined based on the following formula (2), referred to as a second discrimination error L2:
L2=-[y2·log(p2)+(1-y2)·log(1-p2)](2)
in formula (1), y2 represents the positive sample recommendation probability, and p2 represents the second recommendation coefficient.
Based on the following equation (3), the server may superimpose the first discrimination error L1 and the second discrimination error L2 as the target discrimination error L:
L=L1+L2 (3)
and reversely adjusting the model parameters in the initial discrimination model based on the target discrimination error L and the gradient descent rule.
Thus, one adjustment of the initial discrimination model is completed.
The server may obtain the next set of positive and negative samples again in the manner described above, and adjust the initial discrimination model again. When the adjustment times are greater than the time threshold, or the difference between the model parameter before adjustment and the adjusted model parameter is less than the difference threshold, it can be determined that the adjusted initial discrimination model satisfies the model convergence condition.
The server may take the initial discrimination model satisfying the model convergence condition as the target discrimination model.
Optionally, the server may also reversely adjust the model parameters in the initial discrimination model based on the first discrimination error L1 of the negative sample and the gradient descent rule to complete the first adjustment of the initial discrimination model, subsequently determine the discrimination error of the positive sample based on the initial discrimination model that has been adjusted once, and reversely adjust the model parameters in the initial discrimination model again according to the discrimination error of the positive sample and the gradient descent rule to complete the second adjustment of the initial discrimination model. Likewise, the server may take the initial discriminant model satisfying the model convergence condition as the target discriminant model.
Or, the server may also perform reverse adjustment on the model parameters in the initial discrimination model based on the second discrimination error L2 of the positive sample and the gradient descent rule to complete the first adjustment on the initial discrimination model, subsequently determine the discrimination error of the negative sample based on the initial discrimination model that has been adjusted once, and then perform reverse adjustment on the model parameters in the initial discrimination model again according to the discrimination error of the negative sample and the gradient descent rule to complete the second adjustment on the initial discrimination model. Likewise, the server may take the initial discriminant model satisfying the model convergence condition as the target discriminant model.
How to determine the first recommendation coefficient of the negative sample and the second recommendation coefficient of the positive sample based on the initial discriminant model is described in detail as follows:
the initial discriminative model includes a user feature generator (such as the user feature generator 20d in the corresponding embodiment of fig. 2 a-2 d described above), a business object feature generator (such as the merchandise feature generator 20e in the corresponding embodiment of fig. 2 a-2 d described above), and a trend discriminator (such as the classifier 20f in the corresponding embodiment of fig. 2 a-2 d described above).
The user characteristic generator and the business object characteristic generator can comprise an artificial neural network and a fastText network; the trend discriminator may include a point-by-point function.
The artificial Neural network may be a CNN (Convolutional Neural network) back propagation (bp) enabled Neural network.
The server may obtain an object attribute of a first business object (referred to as a first business object attribute) and obtain an object attribute of a second business object (referred to as a second business object attribute).
The object properties may include: at least one of an object image, an object name, and a business class to which the object belongs.
When the business object is a commodity, the object attributes may include: at least one of a commodity name, a commodity image, and a commodity category; when the business object is a book, the object attributes may include: at least one of a book name, a book cover image, and a book category.
And calling a business object feature generator, and extracting attribute features of the first business object attribute (called first object attribute features) and extracting attribute features of the second business object attribute (called second object attribute features).
How to extract the attribute features of the first object is specifically described below:
when the object attribute comprises an object image, an object name and a business category, extracting the image feature of the object image in the first business object attribute based on an artificial neural network in a business object feature generator; carrying out thermal coding on an object name in a first business object attribute to obtain text vector representation of the object name, and extracting text features of the text vector of the object name based on a first fastText network in a business object feature generator; and carrying out thermal coding on the service class in the first service object attribute to obtain the class vector representation of the service class, and extracting the class characteristics of the class vector of the service class based on a second fastText network in a service object characteristic generator. And splicing the image features, the text features and the category features into first object attribute features.
A second object attribute feature of the second business object attribute may also be determined based on the artificial neural network, the first fastText network, and the second fastText network in the business object feature generator.
Of course, the order of determining the first object attribute feature and the second object attribute feature is not limited.
And calling a user feature generator to extract attribute features of the sample user attributes (called sample user attribute features), wherein the process of extracting the sample user attribute features is similar to the process of extracting the first object attribute features in the previous step, and the process of extracting the user attribute features is based on an artificial neural network or a fastText network.
There is no limitation in determining the sequence of the sample user attribute feature, the first object attribute feature, and the second object attribute feature.
And determining a characteristic distance between the sample user attribute feature and the first object attribute feature based on a point multiplication function in the trend discriminator, and taking the determined characteristic distance as a first recommendation coefficient.
And determining a characteristic distance between the sample user attribute feature and the second object attribute feature based on a point multiplication function in the trend discriminator, and taking the determined characteristic distance as a second recommendation coefficient.
It can be known that the subsequent adjustment of the model parameters in the initial discriminant model according to the discriminant error is to adjust the parameters in the artificial neural network and the fastText network.
As can be seen from the foregoing, the service category in the present application may be a commodity category, a book category, or a news information category, and accordingly, the server may sample one commodity category (or one book category, or one news information category) from a plurality of commodity categories (or a plurality of book categories, or a plurality of news information categories) as a target commodity category (or a target book category, or a target news information category). A commodity (or a book or a piece of news information) is sampled from a commodity set (or a book set or a news information set) contained in a target commodity category (or a target book category or a target news information category) to serve as a first business object. And acquiring a sample user attribute of the sample user, and acquiring a commodity (or a book or a piece of news information) which has an interactive relation with the sample user as a second business object.
And taking the sample user attribute and the first business object as negative samples, and taking the sample user attribute and the second business object as positive samples. Thus, a group of positive and negative samples are determined, a plurality of groups of positive and negative samples can be determined in the same mode, and model training is carried out by adopting the plurality of groups of positive and negative samples to obtain a target discrimination model.
The object discrimination model is used for identifying the interest degree of any object user in a certain commodity (or a certain book or a certain piece of news information).
The negative sample in the application is uniformly sampled from a commodity set (or a book set or a news information set) contained in a target commodity category (or a target book category or a target news information category), and the target commodity category (or the target book category or the target news information category) is also uniformly sampled from a plurality of commodity categories (or a plurality of book categories or a plurality of news information categories). Therefore, the method and the device can accurately predict the commodities (or books or news information) which are interested by the user, and improve the prediction accuracy of the model.
Further, when the second method (i.e. directly sampling from the finest granularity service category) is adopted for determining the target commodity category (or target book category, or target news information category), the underestimation of the positive samples caused by the imbalance of the commodity number (or book number, or news information number) on the categories can be overcome, and the recommendation accuracy and stability of the model are further ensured.
Optionally, the foregoing embodiment specifically describes how to determine a group of positive and negative samples of the same sample user, and how to off-line train the initial discrimination model based on the positive and negative samples, and how to use the trained target discrimination model by the server is described in detail below:
from the foregoing, the initial discriminant model includes a user feature generator, a business object feature generator and a trend discriminator, and the trained target discriminant model also includes a user feature generator (referred to as a target user feature generator), a business object feature generator (referred to as a target business object feature generator) and a trend discriminator (referred to as a target trend discriminator).
The server receives a recommendation request sent by a terminal device (e.g. the terminal device 10a in the embodiment corresponding to fig. 2 a-2 d described above), where the recommendation request includes a user attribute (referred to as a target user attribute, e.g. the user attribute 2 in the embodiment corresponding to fig. 2 a-2 d described above) of a current user to be processed (referred to as a target user).
The method comprises the steps that a server obtains N attribute features of recommended objects, wherein N is an integer larger than 1, each attribute feature of the recommended objects is an attribute feature of an attribute of the recommended service object determined by the server by calling a target service object feature generator, the attribute of the recommended service object is an object attribute of the recommended service object, the recommended service object is a service object determined according to service requirements, the service category to which the recommended service object belongs to at least one service category, and the recommended service object can belong to an original object set or not.
Generally speaking, one recommended service object corresponds to one recommended service object attribute, and one recommended service object attribute corresponds to one recommended object attribute feature.
The process of determining the recommended object attribute feature of the recommended service object attribute by the calling target service object feature generator is the same as the process of determining the first object attribute feature of the first service object attribute by the calling service object feature generator.
For the recommended service object, it is only required to ensure that the service class to which the recommended service object belongs to at least one service class for participating in the initial discriminant model training, and therefore, the recommended service object may be the same as or different from the service object participating in the initial discriminant model training.
And the calling target user characteristic generator determines the attribute characteristic (called target user attribute characteristic) of the target user attribute, wherein the process of determining the target user attribute characteristic by calling the target user characteristic generator is the same as the process of determining the sample user attribute characteristic by calling the user characteristic generator in the previous step.
And calling a target trend discriminator, determining the characteristic distance between the attribute feature of the target user and the attribute features of the N recommended objects (the value of the characteristic distance is in the interval of 0-1), and taking the characteristic distance as a target recommendation coefficient between the attribute feature of the target user and the attribute features of the N recommended objects, wherein the physical meaning of the target recommendation coefficient is that the target discrimination model predicts the interest degree of the target user on the N recommended service objects.
The server may take the recommended service object corresponding to the recommendation coefficient threshold value larger than the recommendation coefficient threshold value as a target recommended service object, and recommend the target recommended service object to the target user, that is, send the target recommended service object to the terminal device, so as to respond to the recommendation request.
It should be noted that, the target user attribute features are generated in real time according to the current recommendation request, but the N recommendation object attribute features are determined by the server calling the target discrimination model in advance, because the target discrimination model is trained offline in advance, and it may be determined in advance according to the business requirement to determine the recommended business object. When M recommended service objects need to be recommended to the target user, the interest degree of the target user on the N recommended service objects can be quickly calculated, so that the recommendation speed is increased, and the waiting time of the target user is reduced.
Of course, the server may also generate N recommended object attribute features for the N recommended service objects respectively in real time after receiving the recommendation request sent by the terminal device, and further determine the interest level of the target user in the N recommended service objects.
Multiple experiments prove that if the first sampling mode is adopted to determine the target service class and further determine the first service object, the recall rate of the trained target discrimination model is 76.2%; if the target service type is determined by adopting the second sampling mode, and the first service object is further determined, the recall rate of the trained target discrimination model is 93.4%.
Recall indicates that: and accurately predicting the number of the recommended service objects in the same category as the second service object in the target recommended service object. In the commodity recommendation, a user has n positive samples, and when m commodities in the same category are ranked at the front, m/n is the commodity recall rate of the target discrimination model.
It should be noted that, if the business object having an interaction relationship with the sample user is taken as the second business object according to the foregoing, the trained target discrimination model can be used to find out the business object that the user may have an interaction; however, if only the business object having an interactive relationship with the sample user is used as the second business object, the trained target discrimination model can be used to find the business object having more user tendency.
Please refer to fig. 4, which is a schematic diagram of a product recommendation model provided in an embodiment of the present application, and as shown in fig. 4, when an application scenario of the model training method according to the present application is training of a product recommendation model, a business class is a product class, and a business object is a product.
The server may perform uniform sampling from the finest granularity commodity category to obtain a target commodity category (the target commodity category may correspond to a target business category in the present application).
Uniform sampling is performed on commodities belonging to the target commodity category to obtain a negative sample commodity (the negative sample commodity may correspond to the first business object in the present application).
As shown in fig. 4, an APP installation list, an interest list, location information, age, and the like of the sample user are acquired.
And acquiring a positive sample commodity of which the sample user has an interactive relation (the positive sample commodity can correspond to a second business object in the application).
As shown in fig. 4, the commodity name, the commodity category, and the commodity image of the negative sample commodity are obtained, and a word vector network 1 in a commodity feature extractor (which may correspond to a business object feature generator in the present application) is called to extract a name vector of the commodity name of the negative sample commodity; calling a word vector network 2 in a commodity feature extractor to extract a category vector of a commodity category of the negative sample commodity; and calling a neural network 1 in the commodity feature extractor to extract an image vector of the commodity image of the negative sample commodity. And combining the name vector, the category vector and the image vector into a negative sample vector, and linearizing the negative sample vector based on an activation function in the commodity feature extractor to obtain a final commodity vector of the negative sample commodity.
And determining the commodity vector of the corresponding positive sample commodity in the same way as the positive sample commodity.
Calling a neural network 2 in a user feature extractor (which can correspond to a user feature generator in the application) to extract an APP vector of each APP in an APP installation list, and determining corresponding APP merging vectors of all APP vectors according to a weighted average or superposition mode; calling a neural network 3 in a user feature extractor to extract an interest vector of each interest in an interest list, and determining an interest merging vector corresponding to all the interest vectors according to a weighted average or superposition mode; calling a neural network 4 in a user feature extractor to extract a position vector of the position information; the neural network 5 in the user feature extractor is invoked to extract an age vector for the age. And combining the APP merging vector, the interest merging vector, the position vector and the age vector into a user attribute vector, and linearizing the user attribute vector based on an activation function in a user feature extractor to obtain a final user vector of the sample user.
Carrying out vector dot product operation on the commodity vector of the negative sample commodity and the user vector of the sample user to obtain a prediction recommendation coefficient of the negative sample commodity, and determining the discrimination error of the negative sample commodity according to the prediction recommendation coefficient of the negative sample commodity; performing vector dot product operation on the commodity vector of the positive sample commodity and the user vector of the sample user to obtain a prediction recommendation coefficient of the positive sample commodity, determining a discrimination error of the positive sample commodity according to the prediction recommendation coefficient of the positive sample commodity, superposing the 2 discrimination errors into a target discrimination error, and adjusting the parameters of the word vector network 1, the word vector network 2 and the neural network 1 in the commodity feature extractor, and the parameters of the neural network 2, the neural network 3, the neural network 4 and the neural network 5 in the user feature extractor based on the target error.
When the commodity feature extractor and the user feature extractor meet the model convergence condition, the training of the commodity feature extractor and the user feature extractor at the moment is completed, namely the training of the commodity recommendation model is completed, and the commodity recommendation model can be used for subsequent commodity recommendation.
Please refer to fig. 5, which is a schematic diagram of a product recommendation provided in an embodiment of the present application, and is used for obtaining an APP installation list, an interest list, location information, an age, and the like of a current user to be recommended (which may correspond to a target user in the present application), and extracting a user vector of the user to be recommended based on a trained user feature extractor. The user vector process of extracting the sample user in the previous step of extracting the user vector of the user to be recommended is the same.
The method comprises the steps of obtaining a commodity vector set (which can correspond to N recommended object attribute features in the application), wherein the commodity vector set comprises commodity vectors of a plurality of commodities to be recommended, the commodity vector of each commodity to be recommended is determined by extracting features of a trained commodity feature extractor for the commodity name, the commodity category and the commodity image of each commodity to be recommended, the commodity vector of the commodity to be recommended is determined, the commodity vector of the negative sample commodity is determined, and the commodity vectors of the positive sample commodity are the same.
And performing dot product operation on each commodity vector in the commodity vector set and the user vector of the user to be recommended, wherein the result obtained by the operation represents the recommendation coefficient of the commodity to be recommended to the user to be recommended.
The recommendation coefficients can be sorted from large to small, the goods to be recommended corresponding to the first K recommendation coefficients are used as target recommendation goods (which can correspond to the target recommendation service object in the application) of the user to be recommended, and the target recommendation goods are recommended to the user to be recommended.
Please refer to fig. 6, which is a schematic diagram of an advertisement delivery platform provided in an embodiment of the present application, as shown in fig. 6, a target discrimination model trained by the model training method according to the present application may be applied to the advertisement delivery platform, and an advertiser may select an advertisement delivery form on the advertisement platform, for example, the advertisement delivery form selected by the advertiser is: the advertisement putting form determines the number of the put advertisements.
The advertiser selects a category of goods to be recommended at the advertising platform, for example, the category of goods selected by the advertiser is snack beverages. The method comprises the following steps that an advertiser selects a recommendation mode on an advertising platform, wherein the recommendation mode're-marketing recommendation' refers to a mode of recommending commodities based on user behavior data (browsing/shopping cart/purchase on an advertiser website) of the advertiser; the recommendation mode "pull-up recommendation" refers to that under the condition that no user behavior data exists, commodity recommendation is performed based on data owned by an advertisement platform, namely commodity recommendation is performed based on a trained target discrimination model and a determined commodity to be recommended in the application. After the advertiser finishes selecting, the advertisement platform can call the target discrimination model, determine the commodity recommended to the user of the advertiser, and send the determined commodity to the terminal equipment where the user is located, and certainly, the commodity recommended to the user is beverage and snacks.
Therefore, the negative sample in the application is determined according to the category of the business object and has no direct incidence relation with the positive sample, so that the situation that the prediction recommendation coefficient of the positive sample is low due to the fact that a large number of positive samples are sampled to serve as the negative sample can be avoided, the prediction recommendation coefficient of the initial discrimination model trained by the application to the positive sample interested by the user is high, and the recommendation accuracy of the model is improved; further, the method and the device can also overcome the condition that the accuracy of the model is unstable due to the imbalance of the number of the business objects on the category, and further guarantee the recommendation accuracy of the model.
Please refer to fig. 7, which is a flowchart illustrating a data processing method according to an embodiment of the present application, where the embodiment mainly relates to the use of a target discrimination model, an execution subject using the target discrimination model may be a terminal device, and the target discrimination model may be issued to the terminal device by the server in the foregoing description.
The data processing method may include the steps of:
step S201, obtaining target user attributes and N recommended service objects of a target user, wherein N is an integer greater than 1.
Specifically, when the terminal device receives a recommendation request for a current user (referred to as a target user), a user attribute (referred to as a target user attribute) of the target user is acquired.
The user attributes may include: at least one of gender, age, occupation, hobbies, location, and application software installed in a terminal device having a binding relationship with the sample user.
The terminal device obtains N service objects to be recommended (called recommended service objects), wherein the recommended service objects are determined according to service requirements, but the service class to which each recommended service object belongs to at least one service class used for participating in model training in the foregoing description.
The recommended business object may be: merchandise, books, news information, etc.
Step S202, a target discrimination model is called to determine recommendation prediction trends between target user attributes and N recommended service objects.
Specifically, the server obtains an object attribute (referred to as a recommended service object attribute) of each recommended service object, and it can be known that the number of recommended service object attributes is the number of recommended service objects.
The object properties may include: at least one of an object image, an object name, and a business class to which the object belongs.
For example, when the business object is a good, the object attributes may include: at least one of a commodity name, a commodity image, and a commodity category; when the business object is a book, the object attributes may include: at least one of a book name, a book cover image, and a book category.
The target discrimination model includes a target user feature generator, a target business object feature generator and a target trend discriminator, and the target user feature generator may correspond to the user feature generator in the initial discrimination model in the embodiment corresponding to fig. 3, the target business object feature generator may correspond to the business object feature generator in the initial discrimination model in the embodiment corresponding to fig. 3, and the target trend discriminator may correspond to the trend discriminator in the initial discrimination model in the embodiment corresponding to fig. 3.
And calling a target user characteristic generator to determine the attribute characteristics (called target user attribute characteristics) of the target user attributes, wherein the process of calling the target user characteristic generator to determine the target user attribute characteristics is the same as the process of calling the user characteristic generator to determine the sample user attribute characteristics in the embodiment corresponding to the figure 3.
And calling a target business object feature generator to determine the attribute features (called recommendation object attribute features) of each recommendation business object attribute, wherein the number of the recommendation object attribute features is equal to N.
The terminal device can store the determined attribute characteristics of the recommended objects, so that when the next recommendation request is subsequently received and the recommended service objects are not changed, the attribute characteristics of the recommended objects of each recommended service object do not need to be calculated again.
The sequence of determining the attribute features of the N recommended objects and determining the attribute features of the target user is not limited.
Calling a target trend discriminator, determining a characteristic distance between the target user attribute feature and the N recommended object attribute features, and taking the characteristic distance as a recommended prediction trend between the target user attribute and the N recommended service objects (the characteristic distance is also a target recommendation coefficient between the target user attribute feature and the N recommended object attribute features, and the value of the characteristic distance is in an interval of 0-1), so that the physical meaning of the recommended prediction trend is that the target discrimination model predicts the interest degree of the target user on the recommended service objects.
Step S203, recommending a target recommendation service object to a target user according to the recommendation prediction trend; the target recommendation service object belongs to the N recommendation service objects.
The terminal device may obtain the prediction trend threshold, and use the recommended service object corresponding to the recommended prediction trend greater than the prediction trend threshold as the target recommended service object, and the terminal device may recommend the target recommended service object to the target user, for example, may display an object image of the target recommended service object, or may display a notification message, where the notification message includes an object name of the target recommended service object, and the like.
Optionally, the terminal device may obtain a number threshold M (of course, M is smaller than N), sort the N recommendation prediction trends in a descending order, and take all recommendation service objects corresponding to the M recommendation prediction trends before ranking as target recommendation service objects.
For example, the existing recommended service object 1, recommended service object 2, and recommended service object 3 call a target discrimination model to respectively determine: the distance between the target user attribute feature of the target user and the recommended object attribute feature 1 of the recommended service object 1 is 0.1, the distance between the target user attribute feature of the target user and the recommended object attribute feature 2 of the recommended service object 2 is 0.6, and the distance between the target user attribute feature of the target user and the recommended object attribute feature 3 of the recommended service object 3 is 0.9. It is noted that the recommendation prediction trend between the target user and the recommended service object 1 is 0.1 (i.e., the interest level of the target user in the recommended service object 1 is 0.1), the recommendation prediction trend between the target user and the recommended service object 2 is 0.6 (i.e., the interest level of the target user in the recommended service object 2 is 0.1), and the recommendation prediction trend between the target user and the recommended service object 3 is 0.9 (i.e., the interest level of the target user in the recommended service object 3 is 0.9). If the prediction trend threshold is 0.5, the terminal device may use both the recommended service object 2 and the recommended service object 3 as target recommended service objects, and recommend the recommended service object 2 and the recommended service object 3 to a target user.
The target discrimination model is obtained by performing model training on the initial discrimination model by using positive and negative samples, and the process of acquiring the positive and negative samples and training the initial discrimination model can refer to steps S101 to S105 in the corresponding embodiment of fig. 3.
Therefore, the negative sample in the application is determined according to the category of the business object and has no direct incidence relation with the positive sample, so that the situation that the prediction recommendation coefficient of the positive sample is low due to the fact that a large number of positive samples are sampled to serve as the negative sample can be avoided, the prediction recommendation coefficient of the initial discrimination model trained by the application to the positive sample interested by the user is high, and the recommendation accuracy of the model is improved; further, the method and the device can also overcome the condition that the accuracy of the model is unstable due to the imbalance of the number of the business objects on the category, and further guarantee the recommendation accuracy of the model.
Further, please refer to fig. 8, which is a schematic structural diagram of a model training apparatus according to an embodiment of the present application. As shown in fig. 8, the model training apparatus 1 may be applied to the server in the above-described embodiments corresponding to fig. 3 to 6, and the model training apparatus 1 may include: a first sampling module 11, a second sampling module 12, a first acquisition module 13, a second acquisition module 14, a determination module 15, and a training module 16.
The first sampling module 11 is configured to sample at least one service class to obtain a target service class, where the target service class includes a service object set;
the second sampling module 12 is configured to sample the service object set to obtain a first service object;
a first obtaining module 13, configured to obtain a sample user attribute of a sample user;
a second obtaining module 14, configured to obtain a second business object having an interactive relationship with the sample user;
the determining module 15 is configured to determine the sample user attribute and the first service object as negative samples, and determine the sample user attribute and the second service object as positive samples;
the training module 16 is used for training the initial discrimination model by adopting a positive sample and a negative sample to obtain a target discrimination model;
the interactive relationship comprises an interacted relationship;
the second obtaining module 14 is specifically configured to obtain an interaction record of the sample user, and use a service object included in the interaction record as a second service object having an interaction relationship with the sample user; the interaction record is a record generated for the interaction behavior of the sample user.
For specific functional implementation manners of the first sampling module 11, the second sampling module 12, the first obtaining module 13, the second obtaining module 14, the determining module 15, and the training module 16, reference may be made to steps S101 to S105 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring to fig. 8, the at least one service class includes at least one primary service class and at least one secondary service class subordinate to each primary service class;
the first sampling module 11 may include: a first sampling unit 111 and a second sampling unit 112.
The first sampling unit 111 is configured to perform uniform sampling on at least one primary service class to obtain a target primary service class;
the second sampling unit 112 is configured to uniformly sample at least one second-level service class that belongs to the target first-level service class, to obtain a target second-level service class, and use the target second-level service class as the target service class.
The specific processes of the first sampling unit 111 and the second sampling unit 112 can refer to step S101 in the embodiment corresponding to fig. 3.
Referring to fig. 8, at least one service class corresponds to at least one class level;
the first sampling module 11 may include: a third sampling unit 113 and a fourth sampling unit 114.
A third sampling unit 113, configured to select a service category corresponding to at least one minimum category level from the at least one service category, and use the selected at least one service category as a service category to be sampled;
and a fourth sampling unit 114, configured to perform uniform sampling on at least one service class to be sampled, so as to obtain a target service class.
The specific processes of the third sampling unit 113 and the fourth sampling unit 114 can refer to step S101 in the embodiment corresponding to fig. 3.
It can be known that, when the target traffic class is determined by using the first sampling unit 111 and the second sampling unit 112, the corresponding steps of the third sampling unit 113 and the fourth sampling unit 114 are not executed; when the target traffic class is determined by using the third sampling unit 113 and the fourth sampling unit 114, the corresponding steps of the first sampling unit 111 and the second sampling unit 112 are not executed.
Referring to fig. 8, training module 16 may include: an acquisition unit 161 and a training unit 162.
An obtaining unit 161, configured to invoke an initial discrimination model, and obtain a first recommendation coefficient corresponding to the negative sample and a second recommendation coefficient corresponding to the positive sample;
a training unit 162, configured to generate a negative sample recommendation probability corresponding to a negative sample and a positive sample recommendation probability corresponding to a positive sample, determine a first discrimination error between a first recommendation coefficient and the negative sample recommendation probability and a second discrimination error between a second recommendation coefficient and the positive sample recommendation probability, adjust a model parameter of an initial discrimination model according to the first discrimination error and the second discrimination error, and use the adjusted initial discrimination model as a target discrimination model when the adjusted initial discrimination model satisfies a model convergence condition;
the initial discrimination model comprises a user characteristic generator, a business object characteristic generator and a trend discriminator;
the obtaining unit 161 is specifically configured to obtain a first service object attribute of a first service object and a second service object attribute of a second service object, invoke a service object feature generator, obtain a first object attribute feature of the first service object attribute and a second object attribute feature of the second service object attribute, invoke a user feature generator, obtain a sample user attribute feature of the sample user attribute, invoke a trend discriminator, determine a feature distance between the sample user attribute feature and the first object attribute feature and a feature distance between the sample user attribute feature and the second object attribute feature, use the feature distance determined by the first object attribute feature as a first recommendation coefficient, and use the feature distance determined by the second object attribute feature as a second recommendation coefficient.
The specific processes of the obtaining unit 161 and the training unit 162 may refer to step S105 in the embodiment corresponding to fig. 3, which is not described herein again.
Referring to fig. 8, the model training apparatus 1 may include: a first sampling module 11, a second sampling module 12, a first obtaining module 13, a second obtaining module 14, a determining module 15 and a training module 16; the method can also comprise the following steps: a third acquisition module 17.
A third obtaining module 17, configured to obtain N attribute features of the recommendation object, where N is an integer greater than 1; each attribute feature of the recommended object is an attribute feature of the recommended service object attribute determined by calling a target discrimination model; the attribute of the recommended service object is the object attribute of the recommended service object; recommending that the service class to which the service object belongs to at least one service class;
the third obtaining module 17 is further configured to obtain a target user attribute of the target user, invoke a target discrimination model to determine a target user attribute feature of the target user attribute, invoke the target discrimination model to determine target recommendation coefficients between the target user attribute feature and the N recommended object attribute features, and recommend the target recommended service object to the target user according to the N target recommendation coefficients; the target recommendation service object belongs to the N recommendation service objects.
The specific process of the third obtaining module 17 may refer to step S105 in the embodiment corresponding to fig. 3, which is not described herein again.
Further, please refer to fig. 9, which is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application. As shown in fig. 9, the data processing apparatus 2 may be applied to the terminal device in the above-described embodiment corresponding to fig. 7, and the data processing apparatus 2 may include: a fourth obtaining module 21, a prediction module 22 and a recommendation module 23.
A fourth obtaining module 21, configured to obtain a target user attribute of a target user and N recommended service objects, where N is an integer greater than 1;
the prediction module 22 is used for calling a target discrimination model to determine a recommendation prediction trend between the target user attribute and the N recommended service objects; the target discrimination model is obtained by training by adopting the model training method of the embodiment corresponding to the embodiment shown in FIG. 3;
the recommending module 23 is configured to recommend a target recommended service object to a target user according to the recommended prediction trend; the target recommendation service object belongs to N recommendation service objects;
the recommending module 23 is specifically configured to obtain a prediction trend threshold, regard a recommended service object corresponding to the recommended prediction trend larger than the prediction trend threshold as a target recommended service object, and recommend the target recommended service object to the target user.
The target discrimination model comprises a target user characteristic generator, a target business object characteristic generator and a target trend discriminator;
the prediction module 22 is specifically configured to obtain a recommended service object attribute of each recommended service object, invoke a target user feature generator, determine a target user attribute feature of the target user attribute, invoke the target service object feature generator, determine N recommended object attribute features corresponding to the N recommended service object attributes, invoke a target trend discriminator, determine a feature distance between the target user attribute feature and the N recommended object attribute features, and use the feature distance determined by the N recommended object attribute features as a recommended prediction trend between the target user attribute and the N recommended service objects;
for specific functional implementation manners of the fourth obtaining module 21, the predicting module 22 and the recommending module 23, reference may be made to steps S201 to S203 in the embodiment corresponding to fig. 7, which is not described herein again.
Further, please refer to fig. 10, which is a schematic structural diagram of a computer device according to an embodiment of the present application. The server in the embodiments corresponding to fig. 3 to fig. 6 may be a computer device 1000, and as shown in fig. 10, the computer device 1000 may include: a user interface 1002, a processor 1004, an encoder 1006, and a memory 1008. Signal receiver 1016 is used to receive or transmit data via cellular interface 1010, WIFI interface 1012. The encoder 1006 encodes the received data into a computer-processed data format. The memory 1008 has stored therein a computer program by which the processor 1004 is arranged to perform the steps of any of the method embodiments described above. The memory 1008 may include volatile memory (e.g., dynamic random access memory DRAM) and may also include non-volatile memory (e.g., one time programmable read only memory OTPROM). In some instances, the memory 1008 can further include memory located remotely from the processor 1004, which can be connected to the computer device 1000 via a network. The user interface 1002 may include: a keyboard 1018, and a display 1020.
In the computer device 1000 shown in fig. 10, the processor 1004 may be configured to call the memory 1008 to store a computer program to implement:
sampling at least one service class to obtain a target service class, wherein the target service class comprises a service object set;
sampling a service object set to obtain a first service object;
acquiring a sample user attribute of a sample user, and acquiring a second service object having an interactive relation with the sample user;
determining the sample user attribute and the first service object as negative samples, and determining the sample user attribute and the second service object as positive samples;
and training the initial discrimination model by adopting a positive sample and a negative sample to obtain a target discrimination model.
In one embodiment, the at least one traffic class includes at least one primary traffic class and at least one secondary traffic class subordinate to each primary traffic class;
when the processor 1004 performs sampling on at least one service class to obtain a target service class, the following steps are specifically performed:
uniformly sampling the at least one primary service class to obtain a target primary service class;
uniformly sampling at least one second-level service category which belongs to the target first-level service category to obtain a target second-level service category;
and taking the target secondary service class as the target service class.
In one embodiment, the at least one traffic class corresponds to at least one class level;
when the processor 1004 performs sampling on at least one service class to obtain a target service class, the following steps are specifically performed:
selecting at least one service class corresponding to the minimum class grade from the at least one service class, and taking the selected at least one service class as a service class to be sampled;
and uniformly sampling at least one service class to be sampled to obtain the target service class.
In one embodiment, when the processor 1004 performs training on the initial discriminant model by using the positive samples and the negative samples to obtain the target discriminant model, specifically perform the following steps:
calling the initial discrimination model to obtain a first recommendation coefficient corresponding to the negative sample and a second recommendation coefficient corresponding to the positive sample;
generating a negative sample recommendation probability corresponding to the negative sample and a positive sample recommendation probability corresponding to the positive sample;
determining a first discrimination error between the first recommendation coefficient and the negative sample recommendation probability and a second discrimination error between the second recommendation coefficient and the positive sample recommendation probability;
adjusting the model parameters of the initial discrimination model according to the first discrimination error and the second discrimination error;
and when the adjusted initial discrimination model meets the model convergence condition, taking the adjusted initial discrimination model as the target discrimination model.
In one embodiment, the initial discriminant model comprises a user feature generator, a business object feature generator and a trend discriminant;
when the processor 1004 executes and calls the initial discrimination model to obtain the first recommendation coefficient corresponding to the negative sample and the second recommendation coefficient corresponding to the positive sample, the following steps are specifically executed:
acquiring a first service object attribute of the first service object and a second service object attribute of the second service object;
calling the service object feature generator to obtain a first object attribute feature of the first service object attribute and a second object attribute feature of the second service object attribute;
calling the user characteristic generator to obtain a sample user attribute characteristic of the sample user attribute;
calling the trend discriminator to determine the characteristic distance between the sample user attribute characteristic and the first object attribute characteristic and the characteristic distance between the sample user attribute characteristic and the second object attribute characteristic;
and taking the characteristic distance determined by the first object attribute characteristic as the first recommendation coefficient, and taking the characteristic distance determined by the second object attribute characteristic as the second recommendation coefficient.
In one embodiment, the interactive relationships include interacted-with relationships;
when the processor 1004 executes the step of obtaining the second business object having an interactive relationship with the sample user, specifically executing the following steps:
acquiring an interaction record of the sample user; the interaction record is a record generated for the interaction behavior of the sample user;
and taking the business object contained in the interaction record as the second business object having the interacted relation with the sample user.
In one embodiment, the processor 1004 further performs the following steps:
acquiring N attribute characteristics of a recommended object, wherein N is an integer greater than 1; each attribute feature of the recommended object is the attribute feature of the recommended service object attribute determined by calling the target discrimination model; the attribute of the recommended service object is the object attribute of the recommended service object; the service class to which the recommended service object belongs to the at least one service class;
acquiring a target user attribute of a target user, and calling the target discrimination model to determine a target user attribute characteristic of the target user attribute;
calling the target discrimination model to respectively determine target recommendation coefficients between the target user attribute features and the N recommendation object attribute features;
recommending a target recommendation service object to the target user according to the N target recommendation coefficients; the target recommendation service object belongs to N recommendation service objects.
It should be understood that the computer device 1000 described in this embodiment of the present application may perform the description of the model training method in the embodiment corresponding to fig. 3 to fig. 6, and may also perform the description of the model training apparatus 1 in the embodiment corresponding to fig. 8, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: an embodiment of the present application further provides a computer storage medium, and the computer storage medium stores the aforementioned computer program executed by the model training apparatus 1, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the model training method in the embodiment corresponding to fig. 3 to fig. 6 can be performed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer storage medium referred to in the present application, reference is made to the description of the embodiments of the method of the present application.
Further, please refer to fig. 11, which is a schematic structural diagram of another computer device according to an embodiment of the present application. The terminal device in the embodiment corresponding to fig. 7 may be an electronic device 2000, and as shown in fig. 11, the electronic device 2000 may include: a user interface 2002, a processor 2004, an encoder 2006, and a memory 2008. The signal receiver 2016 is configured to receive or transmit data via the cellular interface 2010, the WIFI interface 2012, the. Encoder 2006 encodes the received data into a computer-processed data format. The memory 2008 has stored therein a computer program, and the processor 2004 is arranged to execute the steps of any of the method embodiments described above by means of the computer program. The memory 2008 may include a volatile memory (e.g., dynamic random access memory DRAM) and may also include a non-volatile memory (e.g., an otp rom OTPROM). In some examples, the memory 2008 may further include memory remotely located from the processor 2004, which may be connected to the electronic device 2000 via a network. The user interface 2002 may include: a keyboard 2018 and a display 2020.
In the electronic device 2000 shown in fig. 11, the processor 2004 may be configured to call the memory 2008 to store a computer program to implement:
acquiring target user attributes and N recommended service objects of a target user, wherein N is an integer greater than 1;
calling a target discrimination model to determine a recommendation prediction trend between the target user attribute and the N recommended service objects; the target discrimination model is obtained by training by the model training method shown in the previous fig. 3 to fig. 6;
recommending a target recommendation service object to a target user according to the recommendation prediction trend; the target recommendation service object belongs to the N recommendation service objects.
In one embodiment, the target discrimination model comprises a target user feature generator, a target business object feature generator and a target trend discriminator;
when the processor 2004 executes and calls the target discrimination model to determine the recommendation prediction trend between the target user attribute and the N recommended service objects, the following steps are specifically executed:
acquiring the attribute of a recommended service object of each recommended service object;
calling the target user characteristic generator to determine the target user attribute characteristics of the target user attributes;
calling the target service object feature generator to determine N recommended object attribute features corresponding to the N recommended service object attributes;
calling the target trend discriminator to determine the characteristic distance between the target user attribute characteristic and the N recommended object attribute characteristics;
and taking the characteristic distance determined by the attribute characteristics of the N recommended objects as a recommended prediction trend between the target user attribute and the N recommended service objects.
In one embodiment, the processor 2004 specifically performs the following steps when executing recommendation of a target recommended service object to the target user according to the recommendation prediction trend:
acquiring a prediction trend threshold;
and taking the recommended service object corresponding to the recommended prediction trend larger than the prediction trend threshold value as the target recommended service object, and recommending the target recommended service object to the target user.
It should be understood that the electronic device 2000 described in this embodiment may perform the description of the data processing method in the embodiment corresponding to fig. 7, and may also perform the description of the data processing apparatus 2 in the embodiment corresponding to fig. 10, which is not described herein again. In addition, the beneficial effects of the same method are not described in detail.
Further, here, it is to be noted that: the embodiment of the present application further provides a computer storage medium, and the computer storage medium stores the aforementioned computer program executed by the data processing apparatus 2, and the computer program includes program instructions, and when the processor executes the program instructions, the description of the data processing method in the embodiment corresponding to fig. 7 can be executed, so that details are not repeated here. In addition, the beneficial effects of the same method are not described in detail. For technical details not disclosed in the embodiments of the computer storage medium referred to in the present application, reference is made to the description of the embodiments of the method of the present application.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The storage medium may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
The above disclosure is only for the purpose of illustrating the preferred embodiments of the present application and is not to be construed as limiting the scope of the present application, so that the present application is not limited thereto, and all equivalent variations and modifications can be made to the present application.

Claims (14)

1. A method of model training, comprising:
sampling at least one service class to obtain a target service class, wherein the target service class comprises a service object set;
sampling the service object set to obtain a first service object;
acquiring a sample user attribute of a sample user, and acquiring a second service object having an interactive relation with the sample user;
determining the sample user attribute and the first business object as negative samples, and determining the sample user attribute and the second business object as positive samples;
and training an initial discrimination model by adopting the positive sample and the negative sample to obtain a target discrimination model.
2. The method of claim 1, wherein the at least one traffic class comprises at least one primary traffic class and at least one secondary traffic class subordinate to each primary traffic class;
the sampling at least one service class to obtain a target service class includes:
uniformly sampling the at least one primary service class to obtain a target primary service class;
uniformly sampling at least one second-level service category which belongs to the target first-level service category to obtain a target second-level service category;
and taking the target secondary service class as the target service class.
3. The method of claim 1, wherein the at least one traffic class corresponds to at least one class;
the sampling at least one service class to obtain a target service class includes:
selecting at least one service class corresponding to the minimum class grade from the at least one service class, and taking the selected at least one service class as a service class to be sampled;
and uniformly sampling at least one service class to be sampled to obtain the target service class.
4. The method of claim 1, wherein training an initial discriminant model using the positive samples and the negative samples to obtain a target discriminant model comprises:
calling the initial discrimination model to obtain a first recommendation coefficient corresponding to the negative sample and a second recommendation coefficient corresponding to the positive sample;
generating a negative sample recommendation probability corresponding to the negative sample and a positive sample recommendation probability corresponding to the positive sample;
determining a first discrimination error between the first recommendation coefficient and the negative sample recommendation probability and a second discrimination error between the second recommendation coefficient and the positive sample recommendation probability;
adjusting the model parameters of the initial discrimination model according to the first discrimination error and the second discrimination error;
and when the adjusted initial discrimination model meets the model convergence condition, taking the adjusted initial discrimination model as the target discrimination model.
5. The method of claim 4, wherein the initial discriminative model comprises a user feature generator, a business object feature generator and a trend discriminator;
the calling the initial discrimination model to obtain a first recommendation coefficient corresponding to the negative sample and a second recommendation coefficient corresponding to the positive sample includes:
acquiring a first service object attribute of the first service object and a second service object attribute of the second service object;
calling the service object feature generator to obtain a first object attribute feature of the first service object attribute and a second object attribute feature of the second service object attribute;
calling the user characteristic generator to obtain a sample user attribute characteristic of the sample user attribute;
calling the trend discriminator to determine the characteristic distance between the sample user attribute characteristic and the first object attribute characteristic and the characteristic distance between the sample user attribute characteristic and the second object attribute characteristic;
and taking the characteristic distance determined by the first object attribute characteristic as the first recommendation coefficient, and taking the characteristic distance determined by the second object attribute characteristic as the second recommendation coefficient.
6. The method of claim 1, wherein the interaction relationship comprises an interacted-with relationship;
the obtaining of the second business object having an interactive relationship with the sample user includes:
acquiring an interaction record of the sample user; the interaction record is a record generated for the interaction behavior of the sample user;
and taking the business object contained in the interaction record as the second business object having the interacted relation with the sample user.
7. The method of any one of claims 1-6, further comprising:
acquiring N attribute characteristics of a recommended object, wherein N is an integer greater than 1; each attribute feature of the recommended object is the attribute feature of the recommended service object attribute determined by calling the target discrimination model; the attribute of the recommended service object is the object attribute of the recommended service object; the service class to which the recommended service object belongs to the at least one service class;
acquiring a target user attribute of a target user, and calling the target discrimination model to determine a target user attribute characteristic of the target user attribute;
calling the target discrimination model to respectively determine target recommendation coefficients between the target user attribute features and the N recommendation object attribute features;
recommending a target recommendation service object to the target user according to the N target recommendation coefficients; the target recommendation service object belongs to N recommendation service objects.
8. A data processing method, comprising:
acquiring target user attributes of a target user and N recommended service objects, wherein N is an integer greater than 1;
calling a target discrimination model to determine a recommendation prediction trend between the target user attribute and the N recommended service objects; the target discrimination model is obtained by training by adopting the model training method of any one of claims 1 to 8;
recommending a target recommended service object to the target user according to the recommendation prediction trend; and the target recommended service object belongs to the N recommended service objects.
9. The method of claim 8, wherein the target discriminant model comprises a target user feature generator, a target business object feature generator, and a target trend discriminant;
the calling a target discrimination model to determine a recommendation prediction trend between the target user attribute and the N recommended service objects includes:
acquiring the attribute of a recommended service object of each recommended service object;
calling the target user characteristic generator to determine the target user attribute characteristics of the target user attributes;
calling the target service object feature generator to determine N recommended object attribute features corresponding to the N recommended service object attributes;
calling the target trend discriminator to determine the characteristic distance between the target user attribute characteristic and the N recommended object attribute characteristics;
and taking the characteristic distance determined by the attribute characteristics of the N recommended objects as a recommended prediction trend between the target user attribute and the N recommended service objects.
10. The method of claim 8, wherein recommending a target recommended business object to the target user based on the recommendation prediction trend comprises:
acquiring a prediction trend threshold;
and taking the recommended service object corresponding to the recommended prediction trend larger than the prediction trend threshold value as the target recommended service object, and recommending the target recommended service object to the target user.
11. A model training apparatus, comprising:
the system comprises a first sampling module, a second sampling module and a third sampling module, wherein the first sampling module is used for sampling at least one service class to obtain a target service class, and the target service class comprises a service object set;
the second sampling module is used for sampling the service object set to obtain a first service object;
the first acquisition module is used for acquiring the sample user attribute of the sample user;
the second acquisition module is used for acquiring a second business object which has an interactive relation with the sample user;
the determining module is used for determining the sample user attribute and the first business object as negative samples and determining the sample user attribute and the second business object as positive samples;
and the training module is used for training the initial discrimination model by adopting the positive sample and the negative sample to obtain a target discrimination model.
12. A data processing apparatus, comprising:
a fourth obtaining module, configured to obtain a target user attribute of a target user and N recommended service objects, where N is an integer greater than 1;
the prediction module is used for calling a target discrimination model to determine a recommendation prediction trend between the target user attribute and the N recommended service objects; the target discrimination model is obtained by training by adopting the model training method of any one of claims 1 to 8;
the recommending module is used for recommending a target recommended service object to the target user according to the recommended forecasting trend; and the target recommended service object belongs to the N recommended service objects.
13. A computer device comprising a memory and a processor, the memory storing a computer program that, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1-11.
14. A computer storage medium, characterized in that the computer storage medium stores a computer program comprising program instructions which, when executed by a processor, perform the method according to any one of claims 1-11.
CN202010053975.6A 2020-01-17 2020-01-17 Model training method, data processing device and related equipment Active CN111310025B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010053975.6A CN111310025B (en) 2020-01-17 2020-01-17 Model training method, data processing device and related equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010053975.6A CN111310025B (en) 2020-01-17 2020-01-17 Model training method, data processing device and related equipment

Publications (2)

Publication Number Publication Date
CN111310025A true CN111310025A (en) 2020-06-19
CN111310025B CN111310025B (en) 2023-07-28

Family

ID=71145136

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010053975.6A Active CN111310025B (en) 2020-01-17 2020-01-17 Model training method, data processing device and related equipment

Country Status (1)

Country Link
CN (1) CN111310025B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112529102A (en) * 2020-12-24 2021-03-19 深圳前海微众银行股份有限公司 Feature expansion method, device, medium, and computer program product
CN112633962A (en) * 2020-12-03 2021-04-09 北京道隆华尔软件股份有限公司 Service recommendation method and device, computer equipment and storage medium
CN113190725A (en) * 2021-03-31 2021-07-30 北京达佳互联信息技术有限公司 Object recommendation and model training method and device, equipment, medium and product

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130262165A1 (en) * 2012-03-27 2013-10-03 Alibaba Group Holding Limited Sending recommendation information associated with a business object
CN107423335A (en) * 2017-04-27 2017-12-01 电子科技大学 A kind of negative sample system of selection for single class collaborative filtering problem
US20180189609A1 (en) * 2017-01-04 2018-07-05 Qualcomm Incorporated Training data for machine-based object recognition
CN108596695A (en) * 2018-05-15 2018-09-28 口口相传(北京)网络技术有限公司 Entity method for pushing and system
CN110163647A (en) * 2019-03-14 2019-08-23 腾讯科技(深圳)有限公司 A kind of data processing method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130262165A1 (en) * 2012-03-27 2013-10-03 Alibaba Group Holding Limited Sending recommendation information associated with a business object
US20180189609A1 (en) * 2017-01-04 2018-07-05 Qualcomm Incorporated Training data for machine-based object recognition
CN107423335A (en) * 2017-04-27 2017-12-01 电子科技大学 A kind of negative sample system of selection for single class collaborative filtering problem
CN108596695A (en) * 2018-05-15 2018-09-28 口口相传(北京)网络技术有限公司 Entity method for pushing and system
CN110163647A (en) * 2019-03-14 2019-08-23 腾讯科技(深圳)有限公司 A kind of data processing method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SHAN-BIN CHAN ET AL: "A Negative Sample Image Selection Method Referring to Semantic Hierarchical Structure for Image Annotation", 《2013 INTERNATIONAL CONFERENCE ON SIGNAL-IMAGE TECHNOLOGY & INTERNET-BASED SYSTEMS》 *
张星明 等: "基于独立负样本集和SVM的人脸确认算法", 《计算机研究与发展》 *

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112633962A (en) * 2020-12-03 2021-04-09 北京道隆华尔软件股份有限公司 Service recommendation method and device, computer equipment and storage medium
CN112529102A (en) * 2020-12-24 2021-03-19 深圳前海微众银行股份有限公司 Feature expansion method, device, medium, and computer program product
CN112529102B (en) * 2020-12-24 2024-03-12 深圳前海微众银行股份有限公司 Feature expansion method, device, medium and computer program product
CN113190725A (en) * 2021-03-31 2021-07-30 北京达佳互联信息技术有限公司 Object recommendation and model training method and device, equipment, medium and product
CN113190725B (en) * 2021-03-31 2023-12-12 北京达佳互联信息技术有限公司 Object recommendation and model training method and device, equipment, medium and product

Also Published As

Publication number Publication date
CN111310025B (en) 2023-07-28

Similar Documents

Publication Publication Date Title
CN108446390A (en) Method and apparatus for pushed information
CN111310025B (en) Model training method, data processing device and related equipment
CN110909182A (en) Multimedia resource searching method and device, computer equipment and storage medium
CN111353091A (en) Information processing method and device, electronic equipment and readable storage medium
CN110364146A (en) Audio recognition method, device, speech recognition apparatus and storage medium
CN113254711B (en) Interactive image display method and device, computer equipment and storage medium
CN112989212B (en) Media content recommendation method, device and equipment and computer storage medium
CN111475731B (en) Data processing method, device, storage medium and equipment
CN112749330A (en) Information pushing method and device, computer equipment and storage medium
Kang et al. Tree-based real-time advertisement recommendation system in online broadcasting
CN113379449A (en) Multimedia resource recall method and device, electronic equipment and storage medium
CN115545832A (en) Commodity search recommendation method and device, equipment and medium thereof
CN113656699B (en) User feature vector determining method, related equipment and medium
CN116823410B (en) Data processing method, object processing method, recommending method and computing device
CN112989182B (en) Information processing method, information processing device, information processing apparatus, and storage medium
CN113822127A (en) Video processing method, video processing device, video processing equipment and storage medium
CN115482021A (en) Multimedia information recommendation method and device, electronic equipment and storage medium
CN116955591A (en) Recommendation language generation method, related device and medium for content recommendation
CN116957128A (en) Service index prediction method, device, equipment and storage medium
CN115329183A (en) Data processing method, device, storage medium and equipment
CN111325575A (en) Question information recommendation method and device, computer equipment and storage medium
CN117575894B (en) Image generation method, device, electronic equipment and computer readable storage medium
CN113449198B (en) Training method, device and equipment of feature extraction model and storage medium
CN114417875A (en) Data processing method, device, equipment, readable storage medium and program product
CN111047360A (en) Data processing method and system based on visual portrait

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
REG Reference to a national code

Ref country code: HK

Ref legal event code: DE

Ref document number: 40024898

Country of ref document: HK

GR01 Patent grant
GR01 Patent grant