WO2023024408A1 - 用户特征向量确定方法、相关设备及介质 - Google Patents

用户特征向量确定方法、相关设备及介质 Download PDF

Info

Publication number
WO2023024408A1
WO2023024408A1 PCT/CN2022/071262 CN2022071262W WO2023024408A1 WO 2023024408 A1 WO2023024408 A1 WO 2023024408A1 CN 2022071262 W CN2022071262 W CN 2022071262W WO 2023024408 A1 WO2023024408 A1 WO 2023024408A1
Authority
WO
WIPO (PCT)
Prior art keywords
user
sample
vector
target
operation sequence
Prior art date
Application number
PCT/CN2022/071262
Other languages
English (en)
French (fr)
Inventor
陈浩
谯轶轩
Original Assignee
平安科技(深圳)有限公司
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 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2023024408A1 publication Critical patent/WO2023024408A1/zh

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
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/23Clustering techniques
    • G06F18/232Non-hierarchical techniques
    • G06F18/2321Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
    • G06F18/23213Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/24323Tree-organised classifiers
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/20Natural language analysis
    • G06F40/237Lexical tools
    • G06F40/242Dictionaries
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Definitions

  • the present application relates to the technical field of data analysis, and specifically relates to a method for determining user feature vectors, related equipment and media.
  • user feature vectors can be determined based on user behavior data for use in downstream tasks. Precise delivery, etc.
  • the inventor realizes that the existing method for determining a feature vector usually constructs a feature vector dictionary, and determines the user's feature vector from the feature vector dictionary through the user's feature data or behavior data.
  • this method does not learn the commonality and/or difference of features between multiple users well, which may lead to poor results when the user's feature vector is used for downstream tasks.
  • Embodiments of the present application provide a method for determining a user feature vector, related equipment, and a medium, which can improve the application effect of the generated feature vector.
  • an embodiment of the present application provides a method for determining a user feature vector, the method comprising:
  • the data set includes an object operation sequence composed of multiple objects operated by the sample user;
  • the positive sample sequence includes all objects in the object operation sequence obtained after replacing one or more of the object operation sequences;
  • an embodiment of the present application provides an apparatus for determining user feature vectors, the apparatus comprising:
  • An acquisition module configured to acquire a data set; the data set includes an object operation sequence composed of a plurality of objects operated by the sample user;
  • a determination module configured to determine the positive sample sequence of the sample user according to the object operation sequence; the positive sample sequence includes the object operation sequence obtained after replacing one or more of the object operation sequences all objects;
  • An input module configured to input the object operation sequence and the positive sample sequence into an initial neural network model to obtain the first vector of the object operation sequence and the second vector of the positive sample sequence;
  • a training module configured to use the first vector and the second vector to train the initial neural network model to obtain a trained neural network model
  • the input module is also used to obtain the object operation sequence of the target user, input the object operation sequence of the target user into the trained neural network model, and obtain the feature vector of the target user.
  • an embodiment of the present application provides an electronic device, the electronic device includes a processor and a memory, wherein the memory is used to store a computer program, the computer program includes program instructions, and the processor is configured to call the program instructions, to execute the following method:
  • the data set includes an object operation sequence composed of multiple objects operated by the sample user;
  • the positive sample sequence includes all objects in the object operation sequence obtained after replacing one or more objects in the object operation sequence;
  • an embodiment of the present application provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, they are used to perform the following methods:
  • the data set includes an object operation sequence composed of multiple objects operated by the sample user;
  • the positive sample sequence includes all objects in the object operation sequence obtained after replacing one or more objects in the object operation sequence;
  • the initial neural network model can be trained using the object operation sequence and positive sample sequence of the sample user, and a trained neural network model that can be used to generate the feature vector of the target user can be obtained.
  • the similarities and/or differences in features between multiple sample users are well learned, so that the features of the target user represented by the feature vectors are more comprehensive, and the application effect of the generated feature vectors can be improved.
  • FIG. 1 is a schematic flowchart of a method for determining a user feature vector provided in an embodiment of the present application
  • FIG. 2 is a schematic flowchart of a method for determining a user feature vector provided in an embodiment of the present application
  • FIG. 3 is a schematic diagram of a scene of a training model provided by an embodiment of the present application.
  • FIG. 4 is a schematic structural diagram of an apparatus for determining a user feature vector provided in an embodiment of the present application
  • FIG. 5 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • the method for determining a user feature vector proposed in the embodiment of the present application is implemented in an electronic device, and the electronic device may be a terminal device or a server.
  • the terminal device may be a smart phone, a tablet computer, a notebook computer, a desktop computer, and the like.
  • the server can be an independent server, or a server cluster or distributed system composed of multiple physical servers, or it can provide cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware Services, domain name services, security services, content delivery network (Content Delivery Network, CDN), and cloud servers for basic cloud computing services such as big data and artificial intelligence platforms, but are not limited to this.
  • This application involves blockchain technology.
  • Electronic devices can write related data such as feature vectors of multiple target users into the blockchain, so that electronic devices can obtain the required information on the blockchain, such as the specified target The feature vector of the user; or the obtained similar users of each target user can also be written into the block chain, when the target user needs to be recommended, the similar user can be obtained on the block chain, and the similar user The manipulated object is pushed to the target user.
  • the electronic device may execute the method for determining user feature vectors according to actual service requirements, so as to improve the application effect of the generated feature vectors.
  • the technical solution of the present application can be applied in a recommendation scenario.
  • the electronic device obtains the target user's object operation sequence according to the target user's operation behavior for a specified object (such as a product, book, etc.) in the recommendation scenario, and inputs the object operation sequence
  • the feature vector of the target user is obtained, and the target user can be applied to downstream tasks, for example, the correlation between multiple target users can be obtained by using the feature vectors of multiple target users, and in In the recommendation scenario, the precise push of the specified object can be realized based on the correlation degree, or the target user can be classified by using the feature vector of the target user, and the interest analysis of different groups can be carried out later;
  • the trained neural network model can use multiple
  • the object operation sequence of a sample user is obtained by training with a contrastive learning method.
  • an embodiment of the present application proposes a method for determining a user feature vector, which can be executed by the above-mentioned electronic device.
  • the flow of the method for determining the user feature vector in the embodiment of the present application may include the following:
  • the multiple objects operated by the sample user may be multiple objects displayed and touched by the sample user on the interface of the corresponding user terminal, such as objects that have been clicked or purchased, and the interface may be an application
  • the interface provided by the program or it can be the interface provided by the applet, or it can be the interface provided by the web program, etc.
  • the object can be the target element displayed on the interface, such as commodity, news, book, etc. There is no limitation on the object here .
  • the above-mentioned objects may be determined according to specific application scenarios, such as specific recommendation scenarios.
  • the recommendation scenario is an e-commerce product recommendation scenario
  • the object may be an e-commerce product.
  • the recommended The scene is a book recommendation scene, and the object may be a book or the like.
  • the electronic device can form a sample user's object operation sequence according to multiple objects operated by the sample user as a data set. Specifically, it can be to obtain the sample user within a preset time period (such as within 3 months) According to the object operation record, multiple objects operated by the sample user are obtained, and according to the operation time of the sample user on the multiple objects, the multiple objects are arranged in reverse order to obtain the sample user's object operation sequence.
  • the number of objects included can be the same or different; or, it can also be to obtain the objects operated by a specified number (such as 100) of sample users, and according to the sample user’s
  • the operation time of the specified number of objects is arranged in reverse order to obtain the object operation sequence of the sample user. At this time, the number of objects included in the object operation sequence of different sample users is the same; optionally, the The operation may be a click operation or the like.
  • the electronic device can construct a sample user set, which can be used to train the initial neural network model, so the sample user can be a sample user randomly selected from the sample user set, or can be The sample user selected by the feature of each sample user in the user set can have multiple sample users.
  • the model can be trained with batch data. For example, the sample users can be classified according to the characteristic data of each sample user in the sample user set (such as the sample user's gender, age, occupation, etc.), and a plurality of sample users are randomly selected from the sample user subsets belonging to the same category.
  • the positive sample sequence may include all objects in the object operation sequence obtained by performing a replacement operation on one or more objects in the object operation sequence of the sample user.
  • a replace operation means replacing the object or objects with other objects of the same class. Therefore, the electronic device determines the positive sample sequence of the sample user according to the object operation sequence, specifically, selecting a target number of objects from the multiple objects included in the object operation sequence of the sample user, and obtaining objects of the same category as the selected objects, In the object operation sequence, the selected object is replaced with the object of the same category as the selected object to obtain a positive sample sequence of sample users; the target number can be one or more.
  • the object operation sequence of the sample user is [object 1, object 2, object 3, ..., object N]
  • the object selected in the object operation sequence is object 2
  • the category of object 2 is set
  • the same object is object M, so the obtained positive sample sequence is [object 1, object M, object 3, ..., object N].
  • the neural network model can be a transformer model
  • the electronic device can input the sample user's object operation sequence and positive sample sequence into the initial transformer model, and use the encoder part of the transformer model to obtain the sample user's object The first vector of the operation sequence and the second vector of the positive sample sequence of the sample user. Therefore, in the training process of the initial neural network model, the encoder part of the neural network model is trained.
  • the electronic device uses the neural network model to obtain the first vector of the sample user's object operation sequence and the second vector of the sample user's positive sample sequence.
  • the object operation sequence of the sample user is obtained through the initial neural network model.
  • the initial vector set of the sequence, the initial vector set includes the initial vector of each object in the multiple objects included in the object operation sequence, and the initial vector of each object is respectively subjected to mean value processing to obtain the mean value processing result of each object, which will be calculated by each
  • a vector composed of the average processing results of objects is determined as the first vector of the object operation sequence of the sample user.
  • the object operation sequence is input into the initial neural network model, and the multiple objects included in the object operation sequence can be encoded through the encoder included in the neural network model to obtain the initial vector corresponding to each object, and can be based on each The initial vector corresponding to the object obtains the first vector of the object operation sequence of the sample user.
  • the first vector of the object operation sequence of the sample user can be obtained based on the initial vector corresponding to each object in the initial neural network model, or the sample user can be obtained by the electronic device based on the initial vector corresponding to each object The first vector of sequences of object operations.
  • the object operation sequence is [object 1, object 2, object 3, ..., object N], and the initial vector corresponding to each object is [initial vector 1, initial vector 2, initial vector 3, ... ..., initial vector N], and perform mean value processing on each initial vector to obtain the mean value processing result of each object (set the mean value processing result of the initial vector 1 of object 1 as the mean value 1 and the initial vector 2 of object 2
  • the result of mean processing is mean 2
  • the result of mean processing of initial vector 3 of object 3 is mean 3
  • the result of mean processing of initial vector N of object N is mean N
  • the mean value of each object can be
  • the vector [mean value 1, mean value 2, mean value 3, ..., mean value N] formed by the processing results is used as the first vector of the object operation sequence.
  • obtaining the first vector of the object operation sequence of the sample user by the electronic device may also be to obtain the initial vector of each object in the object operation sequence through the initial neural network model, and determine the weight parameter of each object, using each The weight parameters of each object are weighted and summed to the initial vector of each object to obtain the first vector of the object operation sequence.
  • the weight parameters of each object can be set by relevant business personnel according to experience values.
  • the data set can include the object operation sequence of each sample user in the N sample users, and the positive sample sequence of each sample user can be In the positive sample sequence
  • the first vector of the object operation sequence may include the first vector of the object operation sequence of each sample user in the N sample users
  • the second vector of the positive sample sequence includes the positive vector of each sample user in the N sample users. Second vector of sample sequences.
  • the electronic device can use the first vector and the second vector to train the initial neural network model based on the method of contrastive learning, specifically, each sample user in the N sample users
  • the second vector of the positive sample sequence is used as the positive sample corresponding to the first vector of the object operation sequence of each sample user, and the first vector of the object operation sequence and the second vector of the positive sample sequence of the remaining sample users among the multiple sample users
  • the vector is used as the negative sample corresponding to the first vector of the object operation sequence of each sample user, and the initial neural network model is trained by using the first vector, positive sample and negative sample of the object operation sequence to obtain the trained neural network model .
  • the feature vector of the target user obtained by using the trained neural network model can represent the target user's operation behavior characteristics for the object, such as the click behavior feature for the object.
  • the model can be trained by contrastive learning by setting positive samples and negative samples.
  • This method is self-supervised learning, so it is possible to use unlabeled data sets and set positive and negative samples of the data set.
  • the purpose is to make the characteristics of the learned input object operation sequence more similar to the characteristics of the positive sample. Therefore, the positive sample sequence should be a sequence similar to the object operation sequence, that is, the object operation sequence One (or more) objects randomly selected in the sequence are replaced with the target object of the same category as the positive sample sequence of the object operation sequence.
  • the random selection method can improve the generalization ability of the model, and it also needs Let the characteristics of the learned input object operation sequence be less similar to the characteristics of N-1 negative samples at the same time. Since the object operation sequences of different sample users are different, it is possible to directly use the same batch of samples in a certain round of model training Other samples in the user The user's object operation sequence and the vector corresponding to the positive sample sequence are used as negative samples.
  • the goal of model training can be understood as making the distance between the vectors predicted by different sequences farther. If there is no positive sample (or negative sample), only use the object operation sequence of other sample users as negative samples (or only use Positive samples) to train, can only realize that the characteristics of the learned input object operation sequence are less similar to the characteristics of N-1 negative samples (or can only realize that the characteristics of the learned input object operation sequence and the positive The characteristics of samples are more similar), and there is no positive sample (or negative sample) feature to constrain the characteristics of the learned object operation sequence. Therefore, during model training, for sample user i, positive samples and negative samples need mutual existence.
  • the object operation sequence and positive sample sequence of different sample users are usually different, so for a sample user, only the object operation sequence of one object is replaced as the positive sample sequence, so that the object operation sequence and the positive sample sequence (which can be understood as positive sample sequence)
  • the trained neural network model can learn more features from the object operation sequence, and then the features of the target user covered by the target user's feature vector predicted by the trained neural network model It can be more accurate and complete, so that in subsequent applications, the eigenvector of the target user can achieve higher application effects. For example, in the recommendation scenario, using the eigenvector of the target user can obtain more accurate similar users to achieve precise push .
  • the feature vector of the target user that is, the vector output by the trained neural network model on the object operation sequence can be used as the feature vector of the target user for downstream tasks, such as the recommendation task of the target user or the classification task of the target user.
  • the electronic device can obtain a data set, which includes an object operation sequence composed of multiple objects operated by the sample user, determine the positive sample sequence of the sample user according to the object operation sequence, and combine the object operation sequence and the positive sample Sequentially input the initial neural network model to obtain the first vector of the object operation sequence and the second vector of the positive sample sequence, use the first vector and the second vector to train the initial neural network model, obtain the trained neural network model, and obtain the target
  • the object operation sequence of the user input the object operation sequence of the target user into the trained neural network model, and obtain the feature vector of the target user.
  • the initial neural network model can be trained using the object operation sequence and positive sample sequence of the sample user, and a trained neural network model that can be used to generate the feature vector of the target user can be obtained.
  • the similarities and/or differences in features between multiple sample users are well learned, so that the features of the target user represented by the feature vectors are more comprehensive, and the application effect of the generated feature vectors can be improved.
  • FIG. 2 is a schematic flowchart of a method for determining a user feature vector provided in an embodiment of the present application, and the method may be executed by the above-mentioned electronic device.
  • the flow of the method for determining the user feature vector in the embodiment of the present application may include the following:
  • step S201 Acquire a data set; the data set includes an object operation sequence composed of multiple objects operated by a sample user.
  • the data set includes an object operation sequence composed of multiple objects operated by a sample user.
  • the electronic device may construct a preset category dictionary, and the preset category dictionary records a mapping relationship between each object in the object set and the category it belongs to in the category set.
  • the object set can be constructed according to multiple objects contained in the object operation sequence (or object operation record) of each sample user in the sample user set; or according to the object operation sequence (or object operation record) of all target users in the recommended scenario operation records) or by counting all objects in the database used to store object information in the recommendation scenario to construct an object set.
  • the object is a book
  • the electronic device can construct a book set according to the multiple books contained in the book click sequence (or book click record) of each sample user in the sample user set
  • the book collection is constructed from the book information counted by the book click sequences (or book click records) of all users on the management platform; or the book collection can be constructed according to all the book information in the database storing the book information.
  • the electronic device establishes a mapping relationship between each object in the object set and the category to which each object in the category set belongs, and constructs a preset category dictionary according to the mapping relationship.
  • the category collection of the book collection may include: city, romance, martial arts, fantasy, suspense, game, reasoning, etc.
  • the electronic device determines the positive sample sequence of the sample user according to the object operation sequence, specifically, randomly selects a target number of objects from the object operation sequence of the sample user, and the objects searched and selected from the preset category dictionary have For the target objects of the same category, replace the randomly selected target number of objects in the object operation sequence with the target objects, and use all the objects in the replaced object operation sequence as the positive sample sequence of the sample user.
  • the randomly selected target number of objects may be one or more objects in the object operation sequence.
  • the electronic device may determine the category of the selected object according to the category dictionary, and determine an object subset in the object collection according to the category dictionary and the category of the selected object, and the object subset includes all objects of the same category as the selected object (excluding the selected object), randomly select an object from the object subset as an object of the same type as the selected object, so as to replace the selected object in the object operation sequence.
  • step S203 Input the object operation sequence and the positive sample sequence into the initial neural network model to obtain the first vector of the object operation sequence and the second vector of the positive sample sequence.
  • step S203 reference may be made to the relevant description of the above step S103.
  • the data set includes the object operation sequence of each sample user in the N sample users, and the positive sample sequence of each sample user is The user’s positive sample sequence, the first vector of the object operation sequence includes the first vector of the object operation sequence of each sample user in the N sample users, and the second vector of the positive sample sequence includes the N sample user’s The second vector of positive sample sequences.
  • the specific way for the electronic device to use the first vector and the second vector to train the initial neural network model may be to determine the object operation sequence of each sample user according to the second vector of the positive sample sequence of each sample user among the N sample users
  • the positive sample corresponding to the first vector of each sample user that is, the second vector of the positive sample sequence of each sample user can be determined as the positive sample corresponding to the first vector of the object operation sequence of each sample user, and according to N sample users
  • the first vector of the object operation sequence of each sample user other than sample user i and the second vector of the positive sample sequence of each sample user determine the negative sample corresponding to the first vector of the object operation sequence of sample user i, and use each
  • the positive sample corresponding to the first vector of each sample user’s object operation sequence is obtained through the second vector of the sample user’s positive sample sequence
  • the negative sample corresponding to the first vector of each sample user’s object operation sequence is obtained through the first vector of the object operation sequence of other sample users and the second vector of the positive sample sequence.
  • the model can be trained in contrastive learning by combining positive and negative samples.
  • multiple sample users include sample user 1, sample user 2, and sample user 3.
  • sample user 1 let the first vector corresponding to the object click sequence of sample user 1 be E u1 , and the positive sample sequence of sample user 1
  • the second vector of is The first vector corresponding to the object click sequence of sample user 2 is E u2
  • the second vector of the positive sample sequence of sample user 2 is The first vector corresponding to the object click sequence of sample user 3 is E u3
  • the second vector of the positive sample sequence of sample user 3 is Therefore, during model training, the positive sample of the first vector corresponding to the object click sequence of sample user 1 is And the negative samples are E u2 , E u3 and The positive sample of the first vector corresponding to the object click sequence of sample user 2 is And the negative samples are E u1 , E u3 and The positive sample of the first vector corresponding to the object click sequence of sample user 3 is And the negative samples are E u1 , E u2 and
  • the number of elements in the first vector or the second vector may be different, so when using When the first vector and the second vector are used to train the model, it is necessary to perform interpolation processing (padding processing) on the first vector and/or the second vector so that each sample user's object click sequence corresponds to the first vector and the positive sample sequence
  • the number of elements contained in the second vector is the same.
  • the interpolation process can be to insert a specified value after the first vector and/or the second vector, such as 0 (that is, zero padding operation), etc. There is no limit to the specified value inserted here .
  • the electronic device uses the first vector of the object operation sequence of each sample user, the positive sample corresponding to the first vector of the object operation sequence of each sample user, and the object operation sequence of each sample user
  • Training the initial neural network model with the negative samples corresponding to the first vector can be specifically, using the first vector, the positive samples corresponding to the first vector, and the corresponding negative samples to obtain the value of the loss function, and using the value of the loss function to correct the initial neural network model The model parameters of the network model until the model converges to obtain the trained neural network model.
  • the electronic device uses the first vector, the positive sample corresponding to the first vector, and the corresponding negative sample to obtain the value of the loss function.
  • the initial loss value corresponding to the sample user i is obtained from the sample and the corresponding negative sample, and the value of the loss function is obtained according to the sum of the initial loss values corresponding to each sample user. That can be,
  • B represents multiple sample users in the data set
  • L ui represents the initial loss value corresponding to sample user i.
  • L ui can be calculated as follows:
  • E ui represents the first vector of the object operation sequence of sample user i
  • sim() can represent the similarity between two vectors, that is, the calculation method can be:
  • Figure 3 is a schematic diagram of a scene of a training model provided by the embodiment of the present application, wherein a plurality of sample users include sample user 1, sample user 2, and sample user 3, for sample user 1 , let the object click sequence of sample user 1 be R u1 and the positive sample sequence be
  • the object click sequence of sample user 2 is R u2 and the positive sample sequence is
  • the object click sequence of sample user 3 is R u3 and the positive sample sequence is Therefore, R u1 , R u2 , R u3 and Input the initial neural network model in turn, and get the first vector corresponding to R u1 as E u1
  • the corresponding second vector is The first vector corresponding to R u2 is E u2
  • the corresponding second vector is The first vector corresponding to R u3 is E u3
  • the corresponding second vector is
  • the aforementioned first vector and/or second vector can be interpolated, and the interpolated first vector and/or second vector can be used to train the
  • step S205 Obtain an object operation sequence of the target user, input the object operation sequence of the target user into the trained neural network model, and obtain a feature vector of the target user.
  • step S205 reference may be made to the relevant description of the above-mentioned step S105.
  • the electronic device can calculate the similarity between the M target users according to the feature vector of each of the M target users, and calculate the Identify similar users corresponding to each target user.
  • the process and principle of the electronic device determining similar users of each target user are the same.
  • the determination of similar users of target user j is taken as an example for illustration.
  • Target user j refers to any target user among the M target users, so the electronic device Determining the similar users of the target user j may specifically be, according to the similarity between the M target users, determining K target users whose similarity with the target user j satisfies a preset condition from the M target users, and Determine K target users as similar users to target user j; K is a positive integer smaller than M.
  • the preset condition may be to determine similar users among the M target users whose similarity with the target user j is greater than a similarity threshold as K target users, and the similarity threshold may be set by relevant business personnel according to experience values; or It is also possible to sort the target users of the M target users except the target user j in descending order according to the similarity, and determine K target users from the sorted target users except the target user j.
  • the time K can be set by relevant business personnel according to experience values.
  • the feature vectors corresponding to target user 1, the feature vectors corresponding to target user 2, target user 3, and target user 4 are obtained, and taking target user 1 as an example, the feature vectors corresponding to target user 1 and The eigenvector corresponding to target user 2 is substituted into the vector cosine value formula to obtain the similarity between target user 1 and target user 2, and the eigenvector corresponding to target user 1 and the eigenvector corresponding to target user 3 are substituted into the vector cosine value formula to obtain the target user 1 and target user 3, the eigenvector corresponding to target user 1 and the eigenvector corresponding to target user 4 are substituted into the vector cosine value formula to obtain the similarity between target user 1 and target user 4, and target user 2
  • target users whose similarity is greater than the similarity threshold are used as similar users of target user 1; or, use similarity to sort target users 2-4, and select K target users from the sorted target users 2-4 as A similar user of the target user
  • the electronic device calculates the similarity between the M target users according to the feature vector of each target user among the M target users. Specifically, it can be calculated by using the vector cosine value formula to calculate the The value between the feature vectors is used as the similarity between the two target users; or, according to the feature vector of each target user in the M target users, the calculation of the similarity between the M target users can also be specifically , obtain the feature data of each target user, and construct the feature matrix corresponding to each target user according to the feature data of each target user, and calculate M target users according to the feature matrix and corresponding feature vector corresponding to each target user similarity between.
  • the feature data of the target user can include the characteristics of the target user in multiple dimensions, such as the target user's age, gender, occupation, the object with the highest number of operations (such as the book with the most clicks) and the favorite object category (such as favorite book category), etc.
  • respectively constructing the characteristic matrix corresponding to each target user may be specifically, performing hot unique encoding on the characteristic data of the target user, and obtaining initial vectors respectively corresponding to various characteristics included in the characteristic data, according to The initial vectors corresponding to the various features respectively obtain the feature matrix of the target user.
  • the feature data of the target user includes age features, and the age features are divided into [ ⁇ 18, 19-30, 31-40, 41-50, 51-60, >60], if the age of the target user is 24 , then the initial vector corresponding to the age feature obtained by one-hot encoding can be expressed as [0,1,0,0,0,0].
  • the electronic device calculates the similarity between M target users according to the feature matrix and corresponding feature vector corresponding to each target user. Specifically, it may be to calculate M according to the feature matrix of each target user.
  • the first initial similarity between target users, and according to the feature vector of each target user calculate the second initial similarity between M target users, according to the first initial similarity and the second initial similarity, determine The similarity between M target users.
  • the electronic device calculates the first initial similarity between the M target users according to the feature matrix of each target user. Specifically, the distance formula is used to calculate the feature matrix of the target user j. The matrix distance between the feature matrices of each user is calculated, and the matrix distance of each other user is normalized, and the first initial similarity is determined according to the normalized matrix distance. The electronic device determines the first initial similarity according to the matrix distance after normalization processing. Specifically, the value of [1-matrix distance after normalization processing] is used as the feature matrix of target user j and the feature matrix of each other user. The first initial similarity of the matrix, thereby obtaining the first initial similarity between the M target users.
  • the distance formula is used to calculate the feature matrix of the target user j.
  • the matrix distance between the feature matrices of each user is calculated, and the matrix distance of each other user is normalized, and the first initial similarity is determined according to the normalized matrix distance.
  • the electronic device determines the first initial similarity according to the matrix distance after
  • the matrix distance between the feature matrix of target user 1 and the feature matrix of target users 2-4 is normalized to obtain the normalized matrix distance corresponding to target user 2, and [1- Normalized matrix distance] as the first initial similarity of target user 2.
  • the electronic device calculates the second initial similarity between the M target users according to the feature vector of each target user. Specifically, it may use the vector cosine value formula to calculate the feature vector corresponding to the target user j and the features corresponding to each of the other users The cosine value between the vectors is used as the second initial similarity, thereby obtaining the second initial similarity between the M target users.
  • the electronic device determines the similarity between the M target users according to the first initial similarity and the second initial similarity. Specifically, it may be to obtain the first weight parameter of the first initial similarity and the second initial The second weight parameter of the similarity, using the first weight parameter to weight the first initial similarity, using the second weight parameter to weight the second initial similarity, and combining the weighted first initial similarity and the weighted first The two initial similarities are summed to obtain the similarities between M target users. Subsequently, similar users of each target user can be determined based on the similarity.
  • the target user in addition to using the feature vector to obtain similar users of the target user, the target user can also be classified into user categories for group analysis, such as analyzing target user groups with the same object category preferences (that is, age distribution of target user groups of the same user category), etc. There may be multiple user categories for classifying target users, and may be set by relevant business personnel according to actual business requirements.
  • the electronic device may use the feature vector of the target user to classify the target user by using the k-means clustering algorithm, or it may also be to construct a decision tree model and use the feature vector corresponding to the sample user and the user of the sample user Category (the sample users of the training model here can be the same as the sample users used in the above-mentioned training initial neural network model or can be another sample user) to train the decision tree model.
  • the electronic device can use the target user
  • the feature vector of the target user is input into the pre-trained decision tree model, and the feature vector of the target user is divided into features using at least one decision tree included in the pre-trained decision tree model, so as to determine each of the feature vectors of the target user in at least one decision tree.
  • the leaf node in the decision tree determine the predicted classification value of the target user according to the leaf node, and determine the target category of the target user according to the predicted classification value; the pre-trained decision tree model can be used to classify the target user, the target category Belongs to the user class.
  • determining the predicted classification value of the target user by the electronic device according to the leaf node where it is located may be determining the sum of values represented by the leaf node where it is located as the predicted classification value.
  • determining the target category of the target user according to the predicted classification value may be to establish a correspondence table between the predicted classification value and the user category, and obtain the target category of the target user in the user category according to the corresponding relationship table after obtaining the predicted classification value of the target user .
  • the electronic device can obtain a data set, which includes an object operation sequence composed of multiple objects operated by the sample user, determine the positive sample sequence of the sample user according to the object operation sequence, and combine the object operation sequence and the positive sample Sequentially input the initial neural network model to obtain the first vector of the object operation sequence and the second vector of the positive sample sequence, use the first vector and the second vector to train the initial neural network model, obtain the trained neural network model, and obtain the target
  • the object operation sequence of the user input the object operation sequence of the target user into the trained neural network model, and obtain the feature vector of the target user, if there are M target users, according to the feature vector of each target user in the M target users, determine Each target user corresponds to a similar user, and pushes a plurality of objects included in the object operation sequence of each target user corresponding to a similar user to the user terminal of each target user.
  • the initial neural network model can be trained using the object operation sequence and positive sample sequence of the sample user, and the trained neural network model that can be used to generate the feature vector of the target user can be obtained, which can improve the generation
  • the application effect of the feature vector that is, the more accurate similar users corresponding to the target user can be obtained according to the feature vector, and then accurate recommendation can be realized.
  • FIG. 4 is a schematic structural diagram of an apparatus for determining a user feature vector provided in the present application.
  • the user feature vector determination device shown in FIG. 4 is used to execute the method of the embodiment shown in FIG. 1 and FIG. 2 of the present application.
  • the device 400 for determining user feature vectors may include: an acquisition module 401 , a determination module 402 , an input module 403 , and a training module 404 . in:
  • An acquisition module 401 configured to acquire a data set; the data set includes an object operation sequence composed of a plurality of objects operated by a sample user;
  • the determination module 402 is configured to determine the positive sample sequence of the sample user according to the object operation sequence; the positive sample sequence includes the object operation sequence obtained after replacing one or more of the object operation sequences all objects of
  • An input module 403, configured to input the object operation sequence and the positive sample sequence into the initial neural network model to obtain the first vector of the object operation sequence and the second vector of the positive sample sequence;
  • a training module 404 configured to use the first vector and the second vector to train the initial neural network model to obtain a trained neural network model
  • the input module 403 is further configured to obtain an object operation sequence of the target user, input the object operation sequence of the target user into the trained neural network model, and obtain a feature vector of the target user.
  • the determining module 402 when used to determine the positive sample sequence of the sample user according to the object operation sequence, it is specifically used to:
  • the target number of randomly selected objects in the object operation sequence are replaced with the target object, and all objects in the replaced object operation sequence are used as the positive sample sequence of the sample user.
  • the input module 403 when used to obtain the first vector of the object operation sequence, it is specifically used to:
  • the initial vector set includes an initial vector of each object in a plurality of objects included in the object operation sequence;
  • the vector formed by the mean value processing results of each object is determined as the first vector of the object operation sequence of the sample user.
  • N sample users there are N sample users, and N is an integer greater than 1, and the data set includes an object operation sequence of each sample user in the N sample users, and the sample user
  • the positive sample sequence of is the positive sample sequence of each sample user
  • the first vector of the object operation sequence includes the first vector of the object operation sequence of each sample user in the N sample users
  • the second vector of the sequence includes the second vector of the positive sample sequence of each sample user in the N sample users
  • the training module 404 is used to train the initial neural network model by using the first vector and the second vector to obtain the trained neural network model, it is specifically used for:
  • the positive sample corresponding to the first vector of the object operation sequence of each sample user, and the first vector corresponding to the object operation sequence of each sample user negative samples to train the initial neural network model.
  • M target users there are M target users, and M is an integer greater than 1; after the input module 403 is used to obtain the feature vector of the target user, it is further used to:
  • the similarities between the M target users determine K target users whose similarities with the target user j meet the preset conditions from the M target users, and store the K target users Determined as a similar user of the target user j; the target user j is any target user in the M target users; K is a positive integer less than M;
  • the input module 403 is used to calculate the similarity between the M target users according to the feature vector of each target user in the M target users, and is also used to:
  • the input module 403 is used to obtain the feature vector of the target user, it is also used to:
  • a target category of the target user is determined according to the predicted category value.
  • the acquisition module acquires a data set, the data set includes an object operation sequence composed of multiple objects operated by the sample user; the determination module determines the positive sample sequence of the sample user according to the object operation sequence, and the positive sample sequence includes One or more of the object operation sequences are replaced by all objects in the object operation sequence; the input module inputs the object operation sequence and positive sample sequence into the initial neural network model, and obtains the first vector and positive sample of the object operation sequence The second vector of the sequence; the training module uses the first vector and the second vector to train the initial neural network model to obtain the trained neural network model; the input module obtains the object operation sequence of the target user, and inputs the object operation sequence of the target user into the training After the neural network model, the feature vector of the target user is obtained.
  • the initial neural network model can be trained using the object operation sequence and the positive sample sequence of the sample user, and a trained neural network model that can be used to generate the feature vector of the target user can be obtained.
  • the similarities and/or differences in features between multiple sample users are well learned, so that the features of the target user represented by the feature vectors are more comprehensive, and the application effect of the generated feature vectors can be improved.
  • the electronic device 500 includes: at least one processor 501 and a memory 502 .
  • the electronic device may also include a network interface.
  • the processor 501, the memory 502 and the network interface can exchange data, the network interface is controlled by the processor 501 for sending and receiving messages, and the memory 502 is used for storing computer programs, and the computer programs include program instructions,
  • the processor 501 is used to execute program instructions stored in the memory 502 .
  • the processor 501 is configured to call the program instruction to execute the above method.
  • the memory 502 may include a volatile memory (volatile memory), such as a random-access memory (random-access memory, RAM); the memory 502 may also include a non-volatile memory (non-volatile memory), such as a flash memory (flash memory), solid state disk (solid-state drive, SSD) etc.; Described memory 502 can also comprise the combination of above-mentioned types of memory.
  • volatile memory volatile memory
  • RAM random-access memory
  • non-volatile memory such as a flash memory (flash memory), solid state disk (solid-state drive, SSD) etc.
  • flash memory flash memory
  • SSD solid-state drive
  • the processor 501 may be a central processing unit 501 (central processing unit, CPU). In one embodiment, the processor 501 may also be a graphics processor 501 (Graphics Processing Unit, GPU). The processor 501 may also be a combination of a CPU and a GPU.
  • CPU central processing unit
  • GPU Graphics Processing Unit
  • the memory 502 is used to store program instructions, and the processor 501 can invoke the program instructions to perform the following steps:
  • the data set includes an object operation sequence composed of multiple objects operated by the sample user;
  • the positive sample sequence includes all objects in the object operation sequence obtained after replacing one or more of the object operation sequences;
  • the processor 501 when the processor 501 is used to determine the positive sample sequence of the sample user according to the object operation sequence, it is specifically used to:
  • the processor 501 when the processor 501 is used to obtain the first vector of the object operation sequence, it is specifically used to:
  • the initial vector set includes an initial vector of each object in a plurality of objects included in the object operation sequence;
  • the vector formed by the mean value processing results of each object is determined as the first vector of the object operation sequence of the sample user.
  • N sample users there are N sample users, and N is an integer greater than 1, and the data set includes an object operation sequence of each sample user in the N sample users, and the sample user
  • the positive sample sequence of is the positive sample sequence of each sample user
  • the first vector of the object operation sequence includes the first vector of the object operation sequence of each sample user in the N sample users
  • the second vector of the sequence includes the second vector of the positive sample sequence of each sample user in the N sample users
  • the processor 501 When the processor 501 is used to train the initial neural network model by using the first vector and the second vector to obtain the trained neural network model, it is specifically used to:
  • the positive sample corresponding to the first vector of the object operation sequence of each sample user, and the first vector corresponding to the object operation sequence of each sample user negative samples to train the initial neural network model.
  • the processor 501 is further configured to:
  • the similarities between the M target users determine K target users whose similarities with the target user j meet the preset conditions from the M target users, and store the K target users Determined as a similar user of the target user j; the target user j is any target user in the M target users; K is a positive integer less than M;
  • the processor 501 when the processor 501 is used to calculate the similarity between the M target users according to the feature vector of each target user in the M target users, it is also used to:
  • the processor 501 After the processor 501 is used to obtain the feature vector of the target user, it is further used to:
  • a target category of the target user is determined according to the predicted category value.
  • the device, processor 501, memory 502, etc. described in the embodiments of this application can execute the implementation methods described in the above method embodiments, or the implementation methods described in the embodiments of this application, which are not repeated here repeat.
  • An embodiment of the present application also provides a computer (readable) storage medium, the computer storage medium stores a computer program, the computer program includes program instructions, and when the program instructions are executed by a processor, the processor Part or all of the steps performed in the foregoing method embodiments may be performed.
  • the computer storage medium may be volatile or non-volatile.
  • the computer-readable storage medium may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application program required by at least one function, etc.; Use the created data etc.
  • Blockchain essentially a decentralized database, is a series of data blocks associated with each other using cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify its Validity of information (anti-counterfeiting) and generation of the next block.
  • the blockchain can include the underlying platform of the blockchain, the platform product service layer, and the application service layer.
  • the "plurality” mentioned herein means two or more.
  • “And/or” describes the association relationship of associated objects, indicating that there may be three types of relationships, for example, A and/or B may indicate: A exists alone, A and B exist simultaneously, and B exists independently.
  • the character “/” generally indicates that the contextual objects are an "or” relationship.
  • the program can be stored in a computer storage medium, and the computer storage medium can be As for the computer-readable storage medium, when the program is executed, it may include the processes of the embodiments of the above-mentioned methods.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM), etc.

Abstract

本申请实施例公开了一种用户特征向量确定方法、相关设备及介质,应用于数据分析技术领域。其中方法包括:获取数据集,数据集包括由样本用户操作过的多个对象组成的对象操作序列(S101),根据对象操作序列确定样本用户的正样本序列(S102),将对象操作序列和正样本序列输入初始的神经网络模型,得到对象操作序列的第一向量以及正样本序列的第二向量(S103),利用第一向量和第二向量训练初始的神经网络模型,得到训练后的神经网络模型(S104),获取目标用户的对象操作序列,将目标用户的对象操作序列输入训练后的神经网络模型,得到目标用户的特征向量(S105)。采用本申请实施例,可以提高生成的特征向量的应用效果。本申请涉及区块链技术,如可将目标用户的特征向量等写入区块链。

Description

用户特征向量确定方法、相关设备及介质
本申请要求于2021年8月25日提交中国专利局、申请号为202110979364.9,发明名称为“用户特征向量确定方法、相关设备及介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据分析技术领域,具体涉及一种用户特征向量确定方法、相关设备及介质。
背景技术
目前,在推荐场景等领域中,可以根据用户的行为数据确定用户的特征向量以用于下游任务中,例如利用用户的特征向量进行用户之间相似度计算,进而基于相似度实现推荐场景下的精准推送等。发明人意识到,现有的特征向量确定方法通常是通过构建特征向量词典,通过用户的特征数据或行为数据从特征向量词典中确定该用户的特征向量。然而,此方法并没有很好的学习到多个用户之间特征的共同之处和/或不同之处,可能会导致后续将用户的特征向量用于下游任务时取得的效果不佳。
发明内容
本申请实施例提供了一种用户特征向量确定方法、相关设备及介质,可以提高生成的特征向量的应用效果。
一方面,本申请实施例提供了一种用户特征向量确定方法,该方法包括:
获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述对象操作序列中的一个或多个进行替换操作后得到的对象操作序列中的所有对象;
将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神经网络模型,得到所述目标用户的特征向量。
一方面,本申请实施例提供了一种用户特征向量确定装置,该装置包括:
获取模块,用于获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
确定模块,用于根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述对象操作序列中的一个或多个进行替换操作后得到的对象操作序列中的所有对象;
输入模块,用于将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
训练模块,用于利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
所述输入模块,还用于获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神经网络模型,得到所述目标用户的特征向量。
一方面,本申请实施例提供了一种电子设备,该电子设备包括处理器和存储器,其中,存储器用于存储计算机程序,该计算机程序包括程序指令,处理器被配置用于调用该程序指令,以执行以下方法:
获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述 对象操作序列中的一个或多个对象进行替换操作后得到的对象操作序列中的所有对象;
将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神经网络模型,得到所述目标用户的特征向量。
一方面,本申请实施例提供了一种计算机可读存储介质,该计算机可读存储介质存储有计算机程序,该计算机程序包括程序指令,该程序指令被处理器执行时,用于执行以下方法:
获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述对象操作序列中的一个或多个对象进行替换操作后得到的对象操作序列中的所有对象;
将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神经网络模型,得到所述目标用户的特征向量。
通过实施本申请实施例所提出的方法,可以利用样本用户的对象操作序列和正样本序列训练初始的神经网络模型,得到可以用于生成目标用户的特征向量的训练后的神经网络模型,该模型可以很好的学习到多个样本用户之间针对特征的共同之处和/或不同之处,以使得特征向量所表征的目标用户特征更全面,进而可以提高生成的特征向量的应用效果。
附图说明
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种用户特征向量确定方法的流程示意图;
图2为本申请实施例提供的一种用户特征向量确定方法的流程示意图;
图3为本申请实施例提供的一种训练模型的场景示意图;
图4为本申请实施例提供的一种用户特征向量确定装置的结构示意图;
图5为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述。
本申请实施例提出的用户特征向量确定方法实现于电子设备,该电子设备可以为终端设备或服务器。其中,终端设备可以为智能手机、平板电脑、笔记本电脑、台式计算机等。服务器可以是独立的服务器,也可以是多个物理服务器构成的服务器集群或者分布式系统,还可以是提供云服务、云数据库、云计算、云函数、云存储、网络服务、云通信、中间件服务、域名服务、安全服务、内容分发网络(Content Delivery Network,CDN)、以及大数据和人工智能平台等基础云计算服务的云服务器,但并不局限于此。本申请涉及区块链技术,电子设备可将涉及的数据如多个目标用户的特征向量等写入区块链中,以便于电子设备可以在区块链上获取所需信息,如指定的目标用户的特征向量;或者还可以将得到的每个目标用户的相似用户写入区块链中,当需要对目标用户进行推荐时,可以在区块链上获取该 相似用户,并将该相似用户所操作过的对象推送给目标用户。
在一些实施例中,电子设备可根据实际的业务需求,执行该用户特征向量确定方法,以提高所生成的特征向量的应用效果。例如,本申请技术方案可以应用于推荐场景中,电子设备根据目标用户在推荐场景下针对指定对象(如商品、图书等)的操作行为得到目标用户的对象操作序列,并将该对象操作序列输入训练后的神经网络模型中,得到目标用户的特征向量,后续可以将目标用户应用到下游任务中,如可以是利用多个目标用户的特征向量得到多个目标用户之间的相关度,并在推荐场景下基于相关度实现该指定对象的精准推送,或者,可以利用目标用户的特征向量对目标用户进行分类,后续可以对不同群体进行兴趣分析等;该训练后的神经网络模型可以是利用多个样本用户的对象操作序列并采用对比学习方式训练得到的。
可以理解的是,上述场景仅是作为示例,并不构成对于本申请实施例提供的技术方案的应用场景的限定,本申请的技术方案还可应用于其他场景。例如,本领域普通技术人员可知,随着系统架构的演变和新业务场景的出现,本申请实施例提供的技术方案对于类似的技术问题,同样适用。
基于上述的描述,本申请实施例提出了一种用户特征向量确定方法,该方法可以由上述提及的电子设备来执行。如图1所示,本申请实施例的用户特征向量确定方法的流程可以包括如下:
S101、获取数据集;该数据集包括由样本用户操作过的多个对象组成的对象操作序列。
其中,样本用户操作过的多个对象可以为样本用户在对应的用户终端的界面上所显示的且触控过的多个对象,如点击过或者购买过的对象等,以及该界面可以是应用程序提供的界面,或者可以是小程序提供的界面,或者可以是网页程序提供的界面等,该对象可以是界面上显示的目标元素,如商品、新闻、图书等等,此处对对象不作限制。
可选的,在一些实施例中,上述对象可以根据具体的应用场景确定,如根据具体的推荐场景确定,例如,若推荐场景为电商产品推荐场景,则对象可以是电商产品,若推荐场景为图书推荐场景,则对象可以是图书等等。
在一些实施例中,电子设备可以根据样本用户操作过的多个对象组成样本用户的对象操作序列,以作为数据集,具体可以是获取样本用户在预设时间段内(如3个月内)的对象操作记录,并根据该对象操作记录得到样本用户操作过的多个对象,并根据样本用户针对该多个对象的操作时间按照倒序对多个对象进行排列得到样本用户的对象操作序列,此时,在不同的样本用户的对象操作序列中,包括的对象个数可以相同也可以不同;或者,也可以是获取指定数量(如100)个样本用户操作过的对象,并根据样本用户针对该指定数量个对象的操作时间按照倒序对该指定数量个对象进行排列得到样本用户的对象操作序列,此时,在不同样本用户的对象操作序列中,包括的对象个数相同;可选的,该操作可以是点击操作等。
在一些实施例中,电子设备可以构建样本用户集合,该样本用户集合可以用于训练初始的神经网络模型,因此该样本用户可以是从样本用户集合中随机选取的样本用户,也可以是根据样本用户集合中每个样本用户的特征选取的样本用户,该样本用户可以有多个,当样本用户为多个时,即实现以批量数据对模型进行训练。例如,可以根据样本用户集合中每个样本用户的特征数据(如样本用户的性别、年龄、职业等)对样本用户进行分类,从属于同一类别的样本用户子集中随机选取多个样本用户。
S102、根据对象操作序列确定样本用户的正样本序列。
在一些实施例中,正样本序列可以包括对样本用户的对象操作序列中的一个或多个对象进行替换操作后得到的对象操作序列中的所有对象。替换操作表示将该一个或多个对象替换为同类别的其他对象。因此,电子设备根据对象操作序列确定样本用户的正样本序列 具体可以是,从样本用户的对象操作序列包括的多个对象中选取目标数量个对象,并获取与所选取的对象类别相同的对象,在对象操作序列中,将所选取的对象替换为该与所选取的对象类别相同的对象,得到样本用户的正样本序列;目标数量可以为一个或多个。
例如,样本用户的对象操作序列为【对象1、对象2、对象3、.....、对象N】,在该对象操作序列中所选取的对象为对象2,以及设与该对象2类别相同的对象为对象M,因此得到正样本序列为【对象1、对象M、对象3、.....、对象N】。
S103、将对象操作序列和正样本序列输入初始的神经网络模型,得到对象操作序列的第一向量以及正样本序列的第二向量。
在一个可能的实施方式中,该神经网络模型可以是transformer模型,电子设备可以将样本用户的对象操作序列和正样本序列输入初始的transformer模型,并利用transformer模型中的编码器部分得到样本用户的对象操作序列的第一向量和样本用户的正样本序列的第二向量。因此,在对初始的神经网络模型的训练过程中,训练的是神经网络模型中编码器部分。
在一些实施例中,电子设备利用神经网络模型得到样本用户的对象操作序列的第一向量以及样本用户的正样本序列的第二向量具体可以是,通过初始的神经网络模型得到样本用户的对象操作序列的初始向量集合,该初始向量集合包括对象操作序列包括的多个对象中每个对象的初始向量,分别对每个对象的初始向量进行均值处理,得到每个对象的均值处理结果,将由每个对象的均值处理结果组成的向量,确定为样本用户的对象操作序列的第一向量。即,将对象操作序列输入初始的神经网络模型,可以通过神经网络模型中包括的编码器对对象操作序列包括的多个对象进行编码处理,得到每个对象对应的初始向量,并可以基于每个对象对应的初始向量得到样本用户的对象操作序列的第一向量。可选的,可以是在初始的神经网络模型中基于每个对象对应的初始向量得到样本用户的对象操作序列的第一向量,也可以是由电子设备基于每个对象对应的初始向量得到样本用户的对象操作序列的第一向量。
例如,对象操作序列为【对象1、对象2、对象3、.....、对象N】,每个对象对应的初始向量依次为【初始向量1、初始向量2、初始向量3、.....、初始向量N】,并对每个初始向量进行均值处理,得到每个对象的均值处理结果(设对象1的初始向量1的均值处理结果为均值1、对象2的初始向量2的均值处理结果为均值2、对象3的初始向量3的均值处理结果为均值3、.....、对象N的初始向量N的均值处理结果为均值N),因此可以将每个对象的均值处理结果所组成的向量【均值1、均值2、均值3、.....、均值N】,作为对象操作序列的第一向量。
可选的,电子设备得到样本用户的对象操作序列的第一向量还可以是,通过初始的神经网络模型得到对象操作序列中每个对象的初始向量,并确定每个对象的权重参数,利用每个对象的权重参数对每个对象的初始向量进行加权求和,得到对象操作序列的第一向量。每个对象的权重参数可由相关业务人员根据经验值设置。
S104、利用第一向量和第二向量训练初始的神经网络模型,得到训练后的神经网络模型。
可选的,样本用户可以为N个,N为大于1的整数,因此数据集可以包括N个样本用户中每个样本用户的对象操作序列,样本用户的正样本序列可以为每个样本用户的正样本序列,对象操作序列的第一向量可以包括N个样本用户中每个样本用户的对象操作序列的第一向量,正样本序列的第二向量包括N个样本用户中每个样本用户的正样本序列的第二向量。
因此,在一个可能的实施方式中,电子设备可以基于对比学习的方式并利用第一向量和第二向量对初始的神经网络模型进行训练,具体可以是,将N个样本用户中每个样本用 户的正样本序列的第二向量作为每个样本用户的对象操作序列的第一向量对应的正样本,并将多个样本用户中其余样本用户的对象操作序列的第一向量和正样本序列的第二向量作为每个样本用户的对象操作序列的第一向量对应的负样本,并利用对象操作序列的第一向量、正样本和负样本对初始的神经网络模型进行训练,得到训练后的神经网络模型。利用该训练后的神经网络模型所得到的目标用户的特征向量可以表示目标用户针对对象的操作行为特征,如针对对象的点击行为特征,两个目标用户的特征向量的距离越近,表示两个目标用户越相似,针对对象的操作行为也相似。
由于此处训练模型,可以通过设置正样本和负样本实现以对比学习的方式训练模型,该方式为自监督学习,因此可以通过未进行标注的数据集以及设置该数据集的正样本和负样本进行模型训练,在模型训练过程中,目的就是让学习到的输入的对象操作序列的特征和正样本的特征更相似,因此正样本序列应为与对象操作序列相似的序列,即此处将对象操作序列中随机选取的一个(或多个)对象替换为同类别的目标对象以作为该对象操作序列的正样本序列,随机选取的方式可以提高模型的泛化能力,以及在模型训练过程中还需要让学习到的输入的对象操作序列的特征同时和N-1个负样本的特征更不相似,由于不同的样本用户的对象操作序列不同,因此可以直接将某一轮模型训练中同一批量的样本用户中的其他样本用户的对象操作序列和正样本序列对应的向量作为负样本。
以及,模型训练目标可以理解为使得越不同的序列预测到的向量的距离越远,如果不存在正样本(或负样本),仅是利用其他样本用户的对象操作序列作为负样本(或仅利用正样本)来训练,只能实现使得学习到的输入的对象操作序列的特征和N-1个负样本的特征更不相似(或只能实现使得学习到的输入的对象操作序列的特征与正样本的特征更相似),并没有正样本(或负样本)的特征来对学习到的对象操作序列的特征进行约束,因此在模型训练时,对于样本用户i而言,正样本和负样本需要互相存在。不同样本用户的对象操作序列和正样本序列通常是不同的,因此对于一个样本用户而言,仅替换一个对象的对象操作序列作为正样本序列,使得对象操作序列与正样本序列(可以理解为正的参照物)的预测向量的距离越近,以及将其他样本用户的对象操作序列和正样本序列作为负样本,使得该样本用户的对象操作序列与负样本的距离越远(可以理解为负的参照物)。
通过结合正样本和负样本可以使得训练后的神经网络模型从对象操作序列中学习到更多特征,后续通过该训练后的神经网络模型预测得到的目标用户的特征向量所涵盖的目标用户的特征可以更准确和完整,从而在后续应用中针对目标用户的特征向量所取得的应用效果更高,如在推荐场景中,利用目标用户的特征向量可以获取到更准确的相似用户,以实现精准推送。
S105、获取目标用户的对象操作序列,将目标用户的对象操作序列输入训练后的神经网络模型,得到目标用户的特征向量。
在一个可能的实现方式中,目标用户可以有一个或多个,如可为推荐场景下任一或多个待推荐的用户,电子设备将目标用户的对象操作序列输入训练后的神经网络模型得到目标用户的特征向量,即可以将训练后的神经网络模型对对象操作序列所输出的向量作为目标用户的特征向量,以用于下游任务,如目标用户的推荐任务或目标用户的分类任务等。
本申请实施例中,电子设备可以获取数据集,该数据集包括由样本用户操作过的多个对象组成的对象操作序列,根据对象操作序列确定样本用户的正样本序列,将对象操作序列和正样本序列输入初始的神经网络模型,得到对象操作序列的第一向量以及正样本序列的第二向量,利用第一向量和第二向量训练初始的神经网络模型,得到训练后的神经网络模型,获取目标用户的对象操作序列,将目标用户的对象操作序列输入训练后的神经网络模型,得到目标用户的特征向量。通过实施本申请实施例所提出的方法,可以利用样本用户的对象操作序列和正样本序列训练初始的神经网络模型,得到可以用于生成目标用户的 特征向量的训练后的神经网络模型,该模型可以很好的学习到多个样本用户之间针对特征的共同之处和/或不同之处,以使得特征向量所表征的目标用户特征更全面,进而可以提高生成的特征向量的应用效果。
请参见图2,图2为本申请实施例提供的一种用户特征向量确定方法的流程示意图,该方法可以由上述提及的电子设备执行。如图2所示,本申请实施例中用户特征向量确定方法的流程可以包括如下:
S201、获取数据集;该数据集包括由样本用户操作过的多个对象组成的对象操作序列。其中,步骤S201的具体实施方式可参见上述步骤S101的相关描述。
S202、根据对象操作序列确定样本用户的正样本序列。
在一个可能的实施方式中,电子设备可以构建预设类别词典,该预设类别词典记录了对象集合中每个对象与类别集合中的所属类别之间的映射关系。
其中,对象集合可以是根据样本用户集合中每个样本用户的对象操作序列(或对象操作记录)中包含的多个对象所构建的;或者根据推荐场景下所有目标用户的对象操作序列(或对象操作记录)中包含的多个对象所构建的;或者,通过统计推荐场景下用于存储对象信息的数据库中的所有对象,以构建对象集合。例如,在图书推荐场景下,对象为图书,因此电子设备可以根据样本用户集合中每个样本用户的图书点击序列(或图书点击记录)中包含的多个图书构建图书集合;或者,可以根据图书管理平台上所有用户的图书点击序列(或图书点击记录)所统计到的图书信息构建图书集合;或者可以根据存储图书信息的数据库中的所有图书信息构建图书集合。在得到对象集合后,确定对象集合中每个对象的类别,并根据对象集合中每个对象的类别构建得到类别集合。
因此,电子设备建立对象集合中的每个对象与类别集合中每个对象所属类别之间的映射关系,根据映射关系构建得到预设类别词典。例如,设对象集合为r,类别集合为c,类别词典为D,r>>c,设目标对象为r p(r p表示为对象集合r中的第p个对象),因此类别词典中包括的对象r p到类别c t的映射关系为D r p)=c t,表示对象集合r中第p个样本对象所属类别为类别集合c中第t个类别。以图书推荐场景为例,图书集合的类别集合可以包括:都市、言情、武侠、玄幻、悬疑、游戏、推理等。
在一些实施例中,电子设备根据对象操作序列确定样本用户的正样本序列具体可以是,从样本用户的对象操作序列中随机选取目标数量个对象,从预设类别词典中查找与选取的对象具有相同类别的目标对象,将对象操作序列中的随机选取的目标数量个对象替换为目标对象,并将替换后的对象操作序列中的所有对象作为样本用户的正样本序列。其中,所随机选择的目标数量个对象可以为对象操作序列中的一个或多个对象。
例如,电子设备可以根据类别词典确定选取的对象的类别,并根据类别词典和选取的对象的类别在对象集合中确定出对象子集,该对象子集中包括与选取的对象的类别相同的所有对象(不包括该选取的对象),从对象子集随机选取一个对象作为与选取的对象的类别相同的对象,以用于在对象操作序列中将该选取的对象进行替换。
S203、将对象操作序列和正样本序列输入初始的神经网络模型,得到对象操作序列的第一向量以及正样本序列的第二向量。其中,步骤S203的具体实施方式可参见上述步骤S103的相关描述。
S204、利用第一向量和第二向量训练初始的神经网络模型,得到训练后的神经网络模型。
在一个可能的实施方式中,若样本用户为N个,N为大于1的整数,则数据集包括N个样本用户中每个样本用户的对象操作序列,样本用户的正样本序列为每个样本用户的正 样本序列,对象操作序列的第一向量包括N个样本用户中每个样本用户的对象操作序列的第一向量,正样本序列的第二向量包括N个样本用户中每个样本用户的正样本序列的第二向量。电子设备利用第一向量和第二向量训练初始的神经网络模型的具体方式可以是,根据N个样本用户中每个样本用户的正样本序列的第二向量,确定每个样本用户的对象操作序列的第一向量对应的正样本,即可以是将每个样本用户的正样本序列的第二向量确定为每个样本用户的对象操作序列的第一向量对应的正样本,并根据N个样本用户中除样本用户i以外的各个样本用户的对象操作序列的第一向量以及各个样本用户的正样本序列的第二向量,确定样本用户i的对象操作序列的第一向量对应的负样本,利用每个样本用户的对象操作序列的第一向量、每个样本用户的对象操作序列的第一向量对应的正样本、每个样本用户的对象操作序列的第一向量对应的负样本,训练初始的神经网络模型;其中,i依次取1至N之间的整数。
因此,每个样本用户的对象操作序列的第一向量对应的正样本是通过该样本用户的正样本序列的第二向量得到的,每个样本用户的对象操作序列的第一向量对应的负样本是通过其他样本用户的对象操作序列的第一向量和正样本序列的第二向量得到的。可以通过结合正样本和负样本以对比学习的方式对模型进行训练。
例如,多个样本用户包含样本用户1、样本用户2、样本用户3,对于样本用户1来说,设样本用户1的对象点击序列对应的第一向量为E u1,样本用户1的正样本序列的第二向量为
Figure PCTCN2022071262-appb-000001
样本用户2的对象点击序列对应的第一向量为E u2,样本用户2的正样本序列的第二向量为
Figure PCTCN2022071262-appb-000002
样本用户3的对象点击序列对应的第一向量为E u3,样本用户3的正样本序列的第二向量为
Figure PCTCN2022071262-appb-000003
因此在模型训练时,样本用户1的对象点击序列对应的第一向量的正样本为
Figure PCTCN2022071262-appb-000004
以及负样本为E u2
Figure PCTCN2022071262-appb-000005
E u3
Figure PCTCN2022071262-appb-000006
样本用户2的对象点击序列对应的第一向量的正样本为
Figure PCTCN2022071262-appb-000007
以及负样本为E u1
Figure PCTCN2022071262-appb-000008
E u3
Figure PCTCN2022071262-appb-000009
样本用户3的对象点击序列对应的第一向量的正样本为
Figure PCTCN2022071262-appb-000010
以及负样本为E u1
Figure PCTCN2022071262-appb-000011
E u2
Figure PCTCN2022071262-appb-000012
在一些实施例中,由于每个样本用户的对象点击序列或正样本序列包含的多个对象的个数可能不同,因此得到第一向量或第二向量中的元素个数可能不同,因此在利用第一向量和第二向量对模型进行训练时,需对第一向量和/或第二向量进行插值处理(padding处理)以使每个样本用户的对象点击序列对应的第一向量和正样本序列的第二向量中包含的元素个数相同,该插值处理可以是在第一向量和/或第二向量后插入指定值,如0(即补零操作)等,此处对插入的指定值不作限定。
在一个可能的实施方式中,电子设备利用每个样本用户的对象操作序列的第一向量、每个样本用户的对象操作序列对象的第一向量对应的正样本、每个样本用户的对象操作序列的第一向量对应的负样本训练初始的神经网络模型具体可以是,利用第一向量、第一向量对应的正样本和对应的负样本得到损失函数的值,利用损失函数的值修正初始的神经网络模型的模型参数,直至模型收敛,得到训练后的神经网络模型。
其中,电子设备利用第一向量、第一向量对应的正样本和对应的负样本得到损失函数的值具体可以是,利用样本用户i的对象操作序列的第一向量、该第一向量对应的正样本和对应的负样本得到样本用户i对应的初始损失值,根据每个样本用户对应的初始损失值之和得到损失函数的值。即可以是,
Figure PCTCN2022071262-appb-000013
其中,B表示数据集的多个样本用户,L ui表示样本用户i对应的初始损失值。
可选的,L ui可以通过如下方式计算:
Figure PCTCN2022071262-appb-000014
其中,E ui表示样本用户i的对象操作序列的第一向量,
Figure PCTCN2022071262-appb-000015
表示样本用户i的对象操作序列的第一向量对应的正样本,E k
Figure PCTCN2022071262-appb-000016
表示样本用户i的对象操作序列的第一向量对应的负样本(也即E k表示多个样本用户中除样本用户i以外的样本用户的对象操作序列的第一向量和
Figure PCTCN2022071262-appb-000017
表示除样本用户i以外的样本用户的正样本序列的第二向量);sim()可以表示两个向量的相似度,即计算方式可以为:
Figure PCTCN2022071262-appb-000018
例如,如图3所示,图3为本申请实施例提供的一种训练模型的场景示意图,其中,多个样本用户包含样本用户1、样本用户2、样本用户3,对于样本用户1来说,设样本用户1的对象点击序列为R u1以及正样本序列为
Figure PCTCN2022071262-appb-000019
样本用户2的对象点击序列为R u2以及正样本序列为
Figure PCTCN2022071262-appb-000020
样本用户3的对象点击序列为R u3以及正样本序列为
Figure PCTCN2022071262-appb-000021
因此将R u1
Figure PCTCN2022071262-appb-000022
R u2
Figure PCTCN2022071262-appb-000023
R u3
Figure PCTCN2022071262-appb-000024
依次输入初始的神经网络模型,得到R u1对应的第一向量为E u1
Figure PCTCN2022071262-appb-000025
对应的第二向量为
Figure PCTCN2022071262-appb-000026
R u2对应的第一向量为E u2
Figure PCTCN2022071262-appb-000027
对应的第二向量为
Figure PCTCN2022071262-appb-000028
R u3对应的第一向量为E u3
Figure PCTCN2022071262-appb-000029
对应的第二向量为
Figure PCTCN2022071262-appb-000030
可选的,可以对前述第一向量和/或第二向量进行插值处理,利用插值处理后的第一向量和/或第二向量并以对比学习的方式对模型进行训练,得到训练后的神经网络模型。
S205、获取目标用户的对象操作序列,将目标用户的对象操作序列输入训练后的神经网络模型,得到目标用户的特征向量。其中,步骤S205的具体实施方式可参见上述步骤S105的相关描述。
S206、若目标用户为M个,根据M个目标用户中每个目标用户的特征向量,确定每个目标用户对应的相似用户,并将每个目标用户对应的相似用户的对象操作序列包括的多个对象推送至每个目标用户的用户终端。
在一个可能的实施方式中,若目标用户为M个时,电子设备可以根据M个目标用户中每个目标用户的特征向量,计算M个目标用户之间的相似度,并从M个目标用户中确定出每个目标用户对应的相似用户。其中,电子设备确定每个目标用户的相似用户的过程和原理相同,此处以确定目标用户j的相似用户为例进行说明,目标用户j述M个目标用户中的任一目标用户,因此电子设备确定目标用户j的相似用户具体可以是,根据M个目标用户之间的相似度,从M个目标用户中确定出与目标用户j之间的相似度满足预设条件的K个目标用户,并将K个目标用户确定为目标用户j的相似用户;K为小于M的正整数。
其中,预设条件可以是将M个目标用户中与目标用户j之间的相似度大于相似度阈值的相似用户确定为K个目标用户,相似度阈值可由相关业务人员根据经验值设定;或者还可以是,根据相似度对M个目标用户除目标用户j以外的各目标用户按降序的顺序进行排序,从排序后的除目标用户j以外的各目标用户中确定出K个目标用户,此时K可由相关业务人员根据经验值设定。在得到每个目标用户的相似用户之后,可以将相似用户的对象操作序列包括的多个对象推送至每个目标用户的用户终端,以实现精准推送。
例如,在图书推荐场景中,获取目标用户1对应的特征向量、目标用户2、目标用户3和目标用户4分别对应的特征向量,以目标用户1为例,将目标用户1对应的特征向量和目标用户2对应的特征向量代入向量余弦值公式得到目标用户1和目标用户2之间的相似度,将目标用户1对应的特征向量和目标用户3对应的特征向量代入向量余弦值公式得到目标用户1和目标用户3之间的相似度,将目标用户1对应的特征向量和目标用户4对应的特征向量代入向量余弦值公式得到目标用户1和目标用户4之间的相似度,将目标用户2-4中相似度大于相似度阈值的目标用户作为目标用户1的相似用户;或者,利用相似度对目标用户2-4进行排序,从排序后的目标用户2-4中选取K个目标用户作为目标用户1的相似用户,并将该相似用户的图书点击序列包括的多个图书推送至目标用户1的用户终端。
在一个可能的实施方式中,电子设备根据M个目标用户中每个目标用户的特征向量,计算M个目标用户之间的相似度具体可以是,利用向量余弦值公式计算每两个目标用户的特征向量之间的值,以作为该两个目标用户之间的相似度;或者,根据M个目标用户中每个目标用户的特征向量,计算M个目标用户之间的相似度具体还可以是,获取每个目标用户的特征数据,并根据每个目标用户的特征数据分别构建每个目标用户对应的特征矩阵,根据每个目标用户对应的特征矩阵和对应的特征向量,计算M个目标用户之间的相似度。其中,目标用户的特征数据可以包括目标用户多种维度的特征,如可以是目标用户的年龄、性别、职业、操作次数最高的对象(如点击次数最多的图书)以及最喜欢的对象类别(如最喜欢的图书类别)等等。
其中,根据每个目标用户的特征数据分别构建每个目标用户对应的特征矩阵具体可以是,对目标用户的特征数据进行热独编码,得到特征数据包括的多种特征分别对应的初始向量,根据多种特征分别对应的初始向量得到目标用户的特征矩阵。例如,目标用户的特征数据中包含年龄特征,设将年龄特征划分为[<18,19-30,31-40,41-50,51-60,>60],若该目标用户的年龄为24,则进行热独编码所得到的年龄特征对应的初始向量可以表示为[0,1,0,0,0,0]。
在一个可能的实施方式中,电子设备根据每个目标用户对应的特征矩阵和对应的特征向量,计算M个目标用户之间的相似度具体可以是,根据每个目标用户的特征矩阵,计算M个目标用户之间的第一初始相似度,并根据每个目标用户的特征向量,计算M个目标用户之间的第二初始相似度,根据第一初始相似度和第二初始相似度,确定M个目标用户之间的相似度。
其中,以目标用户j为例,电子设备根据每个目标用户的特征矩阵,计算M个目标用户之间的第一初始相似度具体可以是,利用距离公式计算目标用户j的特征矩阵与其余每个用户的特征矩阵之间的矩阵距离,并对其余每个用户的矩阵距离进行归一化处理,根据归一化处理后的矩阵距离确定第一初始相似度。电子设备根据归一化处理后的矩阵距离确定第一初始相似度具体可以是,将[1-归一化处理后的矩阵距离]的值作为目标用户j的特征矩阵与其余每个用户的特征矩阵的第一初始相似度,由此得到M个目标用户之间的第一初始相似度。例如,对目标用户1的特征矩阵与目标用户2-4的特征矩阵之间的矩阵距离进行归一化处理,得到目标用户2对应的归一化处理后的矩阵距离,并将[1-归一化处理后的矩阵距离]作为目标用户2的第一初始相似度。以及电子设备根据每个目标用户的特征向量,计算M个目标用户之间的第二初始相似度具体可以是,利用向量余弦值公式计算目标用户j对应的特征向量与其余每个用户对应的特征向量之间的余弦值,以作为第二初始相似度,由此得到M个目标用户之间的第二初始相似度。
在一些实施例中,电子设备根据第一初始相似度和第二初始相似度,确定M个目标用户之间的相似度具体可以是,获取第一初始相似度的第一权重参数和第二初始相似度的第二权重参数,利用第一权重参数对第一初始相似度进行加权,利用第二权重参数对第二初始相似度进行加权,将加权后的第一初始相似度和加权后的第二初始相似度求和得到M个目标用户之间的相似度。后续,可以基于该相似度确定每个目标用户的相似用户。
在一个可能的实施方式中,除了可以利用特征向量得到目标用户的相似用户,还可以对目标用户进行用户类别的分类,以进行群体分析,如分析具有相同对象类别喜好的目标用户群体(即为相同用户类别的目标用户群体)的年龄分布等。该对目标用户进行分类的用户类别可以有多个,以及可由相关业务人员根据实际业务需求设置。可选的,电子设备利用目标用户的特征向量对目标用户进行分类可以是利用k-means聚类算法实现,或者,也可以是构建决策树模型并通过样本用户对应的特征向量和样本用户的用户类别(此处训练模型的样本用户可以与上述训练初始的神经网络模型所使用的样本用户相同也可以是另 外的样本用户)对该决策树模型进行训练,训练完成后,电子设备可以将目标用户的特征向量输入预训练的决策树模型,利用预训练的决策树模型包括的至少一个决策树对目标用户的特征向量进行特征划分,以确定目标用户的特征向量在至少一个决策树中的每个决策树中所在的叶子节点,根据所在的叶子节点确定目标用户的预测分类值,根据预测分类值确定目标用户的目标类别;该预训练的决策树模型可以用于对目标用户进行分类,目标类别属于用户类别。
其中,电子设备根据所在的叶子节点确定目标用户的预测分类值可以是将所在叶子节点表示的数值之和确定为预测分类值。以及根据预测分类值确定目标用户的目标类别可以是建立预测分类值与用户类别的对应关系表,在得到目标用户的预测分类值后根据对应关系表得到该目标用户的在用户类别中的目标类别。
本申请实施例中,电子设备可以获取数据集,该数据集包括由样本用户操作过的多个对象组成的对象操作序列,根据对象操作序列确定样本用户的正样本序列,将对象操作序列和正样本序列输入初始的神经网络模型,得到对象操作序列的第一向量以及正样本序列的第二向量,利用第一向量和第二向量训练初始的神经网络模型,得到训练后的神经网络模型,获取目标用户的对象操作序列,将目标用户的对象操作序列输入训练后的神经网络模型,得到目标用户的特征向量,若目标用户为M个,根据M个目标用户中每个目标用户的特征向量,确定每个目标用户对应的相似用户,并将每个目标用户对应的相似用户的对象操作序列包括的多个对象推送至每个目标用户的用户终端。通过实施本申请实施例所提出的方法,可以利用样本用户的对象操作序列和正样本序列训练初始的神经网络模型,得到可以用于生成目标用户的特征向量的训练后的神经网络模型,可以提高生成的特征向量的应用效果,即可以根据特征向量获取到目标用户所对应的更准确的相似用户,进而可以实现精准推荐。
请参见图4,图4为本申请提供的一种用户特征向量确定装置的结构示意图。需要说明的是,图4所示的用户特征向量确定装置,用于执行本申请图1和图2所示实施例的方法,为了便于说明,仅示出了与本申请实施例相关的部分,具体技术细节未揭示,经参照本申请图1和图2所示的实施例。该用户特征向量确定装置400可包括:获取模块401、确定模块402、输入模块403、训练模块404。其中:
获取模块401,用于获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
确定模块402,用于根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述对象操作序列中的一个或多个进行替换操作后得到的对象操作序列中的所有对象;
输入模块403,用于将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
训练模块404,用于利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
所述输入模块403,还用于获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神经网络模型,得到所述目标用户的特征向量。
在一个可能的实施方式中,所述确定模块402在用于根据所述对象操作序列确定所述样本用户的正样本序列时,具体用于:
从所述样本用户的对象操作序列中随机选取目标数量个对象;
从预设类别词典中查找与选取的对象具有相同类别的目标对象;
将所述对象操作序列中随机选取的目标数量个对象替换为所述目标对象,并将替换后的对象操作序列中的所有对象作为所述样本用户的正样本序列。
在一个可能的实施方式中,所述输入模块403在用于得到所述对象操作序列的第一向量时,具体用于:
获取所述样本用户的对象操作序列的初始向量集合;所述初始向量集合包括所述对象操作序列包括的多个对象中每个对象的初始向量;
分别对每个对象的初始向量进行均值处理,得到所述每个对象的均值处理结果;
将由所述每个对象的均值处理结果组成的向量,确定为所述样本用户的对象操作序列的第一向量。
在一个可能的实施方式中,所述样本用户为N个,所述N为大于1的整数,所述数据集包括所述N个样本用户中每个样本用户的对象操作序列,所述样本用户的正样本序列为所述每个样本用户的正样本序列,所述对象操作序列的第一向量包括所述N个样本用户中每个样本用户的对象操作序列的第一向量,所述正样本序列的第二向量包括所述N个样本用户中每个样本用户的正样本序列的第二向量;
所述训练模块404在用于利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型时,具体用于:
根据所述N个样本用户中每个样本用户的正样本序列的第二向量,确定所述每个样本用户的对象操作序列的第一向量对应的正样本;
根据所述N个样本用户中除样本用户i以外的各个样本用户的对象操作序列的第一向量以及所述各个样本用户的正样本序列的第二向量,确定所述样本用户i的对象操作序列的第一向量对应的负样本;i依次取1至N之间的整数;
利用所述每个样本用户的对象操作序列的第一向量、所述每个样本用户的对象操作序列的第一向量对应的正样本、所述每个样本用户的对象操作序列的第一向量对应的负样本,训练所述初始的神经网络模型。
在一个可能的实施方式中,所述目标用户为M个,所述M为大于1的整数;所述输入模块403在用于得到所述目标用户的特征向量之后,还用于:
根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度;
根据所述M个目标用户之间的相似度,从所述M个目标用户中确定出与目标用户j之间的相似度满足预设条件的K个目标用户,并将所述K个目标用户确定为所述目标用户j的相似用户;所述目标用户j为所述M个目标用户中的任一目标用户;K为小于M的正整数;
将所述目标用户j的相似用户的对象操作序列包括的多个对象推送至所述目标用户的用户终端。
在一个可能的实施方式中,所述输入模块403在用于根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度,还用于:
获取所述每个目标用户的特征数据,根据所述每个目标用户的特征数据分别构建所述每个目标用户的特征矩阵;
根据所述每个目标用户的特征矩阵,计算所述M个目标用户之间的第一初始相似度;
根据所述每个目标用户的特征向量,计算所述M个目标用户之间的第二初始相似度;
根据所述第一初始相似度和所述第二初始相似度,确定所述M个目标用户之间的相似度。
在一个可能的实施方式中,所述输入模块403在用于得到所述目标用户的特征向量之后,还用于:
将所述目标用户的特征向量输入预训练的决策树模型;
利用所述预训练的决策树模型包括的至少一个决策树对所述目标用户的特征向量进行 特征划分,以确定所述目标用户的特征向量在所述至少一个决策树中的每个决策树中所在的叶子节点;
根据所述所在的叶子节点确定所述目标用户的预测分类值;
根据所述预测分类值确定所述目标用户的目标类别。
本申请实施例中,获取模块获取数据集,数据集包括由样本用户操作过的多个对象组成的对象操作序列;确定模块根据对象操作序列确定样本用户的正样本序列,该正样本序列包括对对象操作序列中的一个或多个进行替换操作后得到的对象操作序列中的所有对象;输入模块将对象操作序列和正样本序列输入初始的神经网络模型,得到对象操作序列的第一向量以及正样本序列的第二向量;训练模块利用第一向量和第二向量训练初始的神经网络模型,得到训练后的神经网络模型;输入模块获取目标用户的对象操作序列,将目标用户的对象操作序列输入训练后的神经网络模型,得到目标用户的特征向量。通过实施本申请实施例所提出的装置,可以利用样本用户的对象操作序列和正样本序列训练初始的神经网络模型,得到可以用于生成目标用户的特征向量的训练后的神经网络模型,该模型可以很好的学习到多个样本用户之间针对特征的共同之处和/或不同之处,以使得特征向量所表征的目标用户特征更全面,进而可以提高生成的特征向量的应用效果。
请参见图5,图5为本申请实施例提供的一种电子设备的结构示意图。如图5所示,该电子设备500包括:至少一个处理器501、存储器502。可选的,该电子设备还可包括网络接口。其中,所述处理器501、存储器502以及网络接口之间可以交互数据,网络接口受所述处理器501的控制用于收发消息,存储器502用于存储计算机程序,所述计算机程序包括程序指令,处理器501用于执行存储器502存储的程序指令。其中,处理器501被配置用于调用所述程序指令执行上述方法。
所述存储器502可以包括易失性存储器(volatile memory),例如随机存取存储器(random-access memory,RAM);存储器502也可以包括非易失性存储器(non-volatile memory),例如快闪存储器(flash memory),固态硬盘(solid-state drive,SSD)等;所述存储器502还可以包括上述种类的存储器的组合。
所述处理器501可以是中央处理器501(central processing unit,CPU)。在一个实施例中,所述处理器501还可以是图形处理器501(Graphics Processing Unit,GPU)。所述处理器501也可以是由CPU和GPU的组合。
在一个可能的实施方式中,所述存储器502用于存储程序指令,所述处理器501可以调用所述程序指令,执行以下步骤:
获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述对象操作序列中的一个或多个进行替换操作后得到的对象操作序列中的所有对象;
将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神经网络模型,得到所述目标用户的特征向量。
在一个可能的实施方式中,所述处理器501在用于根据所述对象操作序列确定所述样本用户的正样本序列时,具体用于:
从所述样本用户的对象操作序列中随机选取目标数量个对象;
从预设类别词典中查找与选取的对象具有相同类别的目标对象;
将所述对象操作序列中随机选取的目标数量个对象替换为所述目标对象,并将替换后 的对象操作序列中的所有对象作为所述样本用户的正样本序列。
在一个可能的实施方式中,所述处理器501在用于得到所述对象操作序列的第一向量时,具体用于:
获取所述样本用户的对象操作序列的初始向量集合;所述初始向量集合包括所述对象操作序列包括的多个对象中每个对象的初始向量;
分别对每个对象的初始向量进行均值处理,得到所述每个对象的均值处理结果;
将由所述每个对象的均值处理结果组成的向量,确定为所述样本用户的对象操作序列的第一向量。
在一个可能的实施方式中,所述样本用户为N个,所述N为大于1的整数,所述数据集包括所述N个样本用户中每个样本用户的对象操作序列,所述样本用户的正样本序列为所述每个样本用户的正样本序列,所述对象操作序列的第一向量包括所述N个样本用户中每个样本用户的对象操作序列的第一向量,所述正样本序列的第二向量包括所述N个样本用户中每个样本用户的正样本序列的第二向量;
所述处理器501在用于利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型时,具体用于:
根据所述N个样本用户中每个样本用户的正样本序列的第二向量,确定所述每个样本用户的对象操作序列的第一向量对应的正样本;
根据所述N个样本用户中除样本用户i以外的各个样本用户的对象操作序列的第一向量以及所述各个样本用户的正样本序列的第二向量,确定所述样本用户i的对象操作序列的第一向量对应的负样本;i依次取1至N之间的整数;
利用所述每个样本用户的对象操作序列的第一向量、所述每个样本用户的对象操作序列的第一向量对应的正样本、所述每个样本用户的对象操作序列的第一向量对应的负样本,训练所述初始的神经网络模型。
在一个可能的实施方式中,所述目标用户为M个,所述M为大于1的整数;所述处理器501在用于得到所述目标用户的特征向量之后,还用于:
根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度;
根据所述M个目标用户之间的相似度,从所述M个目标用户中确定出与目标用户j之间的相似度满足预设条件的K个目标用户,并将所述K个目标用户确定为所述目标用户j的相似用户;所述目标用户j为所述M个目标用户中的任一目标用户;K为小于M的正整数;
将所述目标用户j的相似用户的对象操作序列包括的多个对象推送至所述目标用户的用户终端。
在一个可能的实施方式中,所述处理器501在用于根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度时,还用于:
获取所述每个目标用户的特征数据,根据所述每个目标用户的特征数据分别构建所述每个目标用户的特征矩阵;
根据所述每个目标用户的特征矩阵,计算所述M个目标用户之间的第一初始相似度;
根据所述每个目标用户的特征向量,计算所述M个目标用户之间的第二初始相似度;
根据所述第一初始相似度和所述第二初始相似度,确定所述M个目标用户之间的相似度。
在一个可能的实施方式中,所述处理器501在用于得到所述目标用户的特征向量之后,还用于:
将所述目标用户的特征向量输入预训练的决策树模型;
利用所述预训练的决策树模型包括的至少一个决策树对所述目标用户的特征向量进行特征划分,以确定所述目标用户的特征向量在所述至少一个决策树中的每个决策树中所在的叶子节点;
根据所述所在的叶子节点确定所述目标用户的预测分类值;
根据所述预测分类值确定所述目标用户的目标类别。
具体实现中,本申请实施例中所描述的装置、处理器501、存储器502等可执行上述方法实施例所描述的实现方式,也可执行本申请实施例所描述的实现方式,在此不再赘述。
本申请实施例中还提供一种计算机(可读)存储介质,所述计算机存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令被处理器执行时,使所述处理器可执行上述方法实施例中所执行的部分或全部步骤。可选的,该计算机存储介质可以是易失性的,也可以是非易失性的。所述的计算机可读存储介质可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序等;存储数据区可存储根据区块链节点的使用所创建的数据等。
其中,本申请所指区块链是分布式数据存储、点对点传输、共识机制、加密算法等计算机技术的新型应用模式。区块链(Blockchain),本质上是一个去中心化的数据库,是一串使用密码学方法相关联产生的数据块,每一个数据块中包含了一批次网络交易的信息,用于验证其信息的有效性(防伪)和生成下一个区块。区块链可以包括区块链底层平台、平台产品服务层以及应用服务层等。
在本文中提及的“多个”是指两个或两个以上。“和/或”,描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。字符“/”一般表示前后关联对象是一种“或”的关系。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机存储介质中,该计算机存储介质可以为计算机可读存储介质,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random Access Memory,RAM)等。
以上所揭露的仅为本申请的部分实施例而已,当然不能以此来限定本申请之权利范围,本领域普通技术人员可以理解实现上述实施例的全部或部分流程,并依本申请权利要求所作的等同变化,仍属于本申请所涵盖的范围。

Claims (20)

  1. 一种用户特征向量确定方法,其中,所述方法包括:
    获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
    根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述对象操作序列中的一个或多个对象进行替换操作后得到的对象操作序列中的所有对象;
    将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
    利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
    获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神经网络模型,得到所述目标用户的特征向量。
  2. 根据权利要求1所述的方法,其中,所述根据所述对象操作序列确定所述样本用户的正样本序列,包括:
    从所述样本用户的对象操作序列中随机选取目标数量个对象;
    从预设类别词典中查找与选取的对象具有相同类别的目标对象;
    将所述对象操作序列中随机选取的目标数量个对象替换为所述目标对象,并将替换后的对象操作序列中的所有对象作为所述样本用户的正样本序列。
  3. 根据权利要求1或2所述的方法,其中,所述得到所述对象操作序列的第一向量,包括:
    获取所述样本用户的对象操作序列的初始向量集合;所述初始向量集合包括所述对象操作序列包括的多个对象中每个对象的初始向量;
    分别对每个对象的初始向量进行均值处理,得到所述每个对象的均值处理结果;
    将由所述每个对象的均值处理结果组成的向量,确定为所述样本用户的对象操作序列的第一向量。
  4. 根据权利要求1所述的方法,其中,所述样本用户为N个,所述N为大于1的整数,所述数据集包括所述N个样本用户中每个样本用户的对象操作序列,所述样本用户的正样本序列为所述每个样本用户的正样本序列,所述对象操作序列的第一向量包括所述N个样本用户中每个样本用户的对象操作序列的第一向量,所述正样本序列的第二向量包括所述N个样本用户中每个样本用户的正样本序列的第二向量;
    所述利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型,包括:
    根据所述N个样本用户中每个样本用户的正样本序列的第二向量,确定所述每个样本用户的对象操作序列的第一向量对应的正样本;
    根据所述N个样本用户中除样本用户i以外的各个样本用户的对象操作序列的第一向量以及所述各个样本用户的正样本序列的第二向量,确定所述样本用户i的对象操作序列的第一向量对应的负样本;i依次取1至N之间的整数;
    利用所述每个样本用户的对象操作序列的第一向量、所述每个样本用户的对象操作序列的第一向量对应的正样本、所述每个样本用户的对象操作序列的第一向量对应的负样本,训练所述初始的神经网络模型。
  5. 根据权利要求1所述的方法,其中,所述目标用户为M个,所述M为大于1的整数;所述得到所述目标用户的特征向量之后,所述方法还包括:
    根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度;
    根据所述M个目标用户之间的相似度,从所述M个目标用户中确定出与目标用户j 之间的相似度满足预设条件的K个目标用户,并将所述K个目标用户确定为所述目标用户j的相似用户;所述目标用户j为所述M个目标用户中的任一目标用户;K为小于M的正整数;
    将所述目标用户j的相似用户的对象操作序列包括的多个对象推送至所述目标用户的用户终端。
  6. 根据权利要求5所述的方法,其中,所述根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度,包括:
    获取所述每个目标用户的特征数据,根据所述每个目标用户的特征数据分别构建所述每个目标用户的特征矩阵;
    根据所述每个目标用户的特征矩阵,计算所述M个目标用户之间的第一初始相似度;
    根据所述每个目标用户的特征向量,计算所述M个目标用户之间的第二初始相似度;
    根据所述第一初始相似度和所述第二初始相似度,确定所述M个目标用户之间的相似度。
  7. 根据权利要求1所述的方法,其中,所述得到所述目标用户的特征向量之后,所述方法还包括:
    将所述目标用户的特征向量输入预训练的决策树模型;
    利用所述预训练的决策树模型包括的至少一个决策树对所述目标用户的特征向量进行特征划分,以确定所述目标用户的特征向量在所述至少一个决策树中的每个决策树中所在的叶子节点;
    根据所述所在的叶子节点确定所述目标用户的预测分类值;
    根据所述预测分类值确定所述目标用户的目标类别。
  8. 一种用户特征向量确定装置,其中,所述装置包括:
    获取模块,用于获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
    确定模块,用于根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述对象操作序列中的一个或多个进行替换操作后得到的对象操作序列中的所有对象;
    输入模块,用于将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
    训练模块,用于利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
    所述输入模块,还用于获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神经网络模型,得到所述目标用户的特征向量。
  9. 一种电子设备,其中,包括处理器和存储器,其中,所述存储器用于存储计算机程序,所述计算机程序包括程序指令,所述处理器被配置用于调用所述程序指令,执行以下方法:
    获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
    根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述对象操作序列中的一个或多个对象进行替换操作后得到的对象操作序列中的所有对象;
    将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
    利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
    获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神 经网络模型,得到所述目标用户的特征向量。
  10. 根据权利要求9所述的电子设备,其中,执行所述根据所述对象操作序列确定所述样本用户的正样本序列,包括:
    从所述样本用户的对象操作序列中随机选取目标数量个对象;
    从预设类别词典中查找与选取的对象具有相同类别的目标对象;
    将所述对象操作序列中随机选取的目标数量个对象替换为所述目标对象,并将替换后的对象操作序列中的所有对象作为所述样本用户的正样本序列。
  11. 根据权利要求9所述的电子设备,其中,所述样本用户为N个,所述N为大于1的整数,所述数据集包括所述N个样本用户中每个样本用户的对象操作序列,所述样本用户的正样本序列为所述每个样本用户的正样本序列,所述对象操作序列的第一向量包括所述N个样本用户中每个样本用户的对象操作序列的第一向量,所述正样本序列的第二向量包括所述N个样本用户中每个样本用户的正样本序列的第二向量;
    执行所述利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型,包括:
    根据所述N个样本用户中每个样本用户的正样本序列的第二向量,确定所述每个样本用户的对象操作序列的第一向量对应的正样本;
    根据所述N个样本用户中除样本用户i以外的各个样本用户的对象操作序列的第一向量以及所述各个样本用户的正样本序列的第二向量,确定所述样本用户i的对象操作序列的第一向量对应的负样本;i依次取1至N之间的整数;
    利用所述每个样本用户的对象操作序列的第一向量、所述每个样本用户的对象操作序列的第一向量对应的正样本、所述每个样本用户的对象操作序列的第一向量对应的负样本,训练所述初始的神经网络模型。
  12. 根据权利要求9所述的电子设备,其中,所述目标用户为M个,所述M为大于1的整数;所述得到所述目标用户的特征向量之后,所述处理器还用于执行:
    根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度;
    根据所述M个目标用户之间的相似度,从所述M个目标用户中确定出与目标用户j之间的相似度满足预设条件的K个目标用户,并将所述K个目标用户确定为所述目标用户j的相似用户;所述目标用户j为所述M个目标用户中的任一目标用户;K为小于M的正整数;
    将所述目标用户j的相似用户的对象操作序列包括的多个对象推送至所述目标用户的用户终端。
  13. 根据权利要求12所述的电子设备,其中,执行所述根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度,包括:
    获取所述每个目标用户的特征数据,根据所述每个目标用户的特征数据分别构建所述每个目标用户的特征矩阵;
    根据所述每个目标用户的特征矩阵,计算所述M个目标用户之间的第一初始相似度;
    根据所述每个目标用户的特征向量,计算所述M个目标用户之间的第二初始相似度;
    根据所述第一初始相似度和所述第二初始相似度,确定所述M个目标用户之间的相似度。
  14. 根据权利要求9所述的电子设备,其中,所述得到所述目标用户的特征向量之后,所述处理器还用于执行:
    将所述目标用户的特征向量输入预训练的决策树模型;
    利用所述预训练的决策树模型包括的至少一个决策树对所述目标用户的特征向量进行 特征划分,以确定所述目标用户的特征向量在所述至少一个决策树中的每个决策树中所在的叶子节点;
    根据所述所在的叶子节点确定所述目标用户的预测分类值;
    根据所述预测分类值确定所述目标用户的目标类别。
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序包括程序指令,所述程序指令当被处理器执行时使所述处理器执行以下方法:
    获取数据集;所述数据集包括由样本用户操作过的多个对象组成的对象操作序列;
    根据所述对象操作序列确定所述样本用户的正样本序列;所述正样本序列包括对所述对象操作序列中的一个或多个对象进行替换操作后得到的对象操作序列中的所有对象;
    将所述对象操作序列和所述正样本序列输入初始的神经网络模型,得到所述对象操作序列的第一向量以及所述正样本序列的第二向量;
    利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型;
    获取目标用户的对象操作序列,将所述目标用户的对象操作序列输入所述训练后的神经网络模型,得到所述目标用户的特征向量。
  16. 根据权利要求15所述的计算机可读存储介质,其中,执行所述根据所述对象操作序列确定所述样本用户的正样本序列,包括:
    从所述样本用户的对象操作序列中随机选取目标数量个对象;
    从预设类别词典中查找与选取的对象具有相同类别的目标对象;
    将所述对象操作序列中随机选取的目标数量个对象替换为所述目标对象,并将替换后的对象操作序列中的所有对象作为所述样本用户的正样本序列。
  17. 根据权利要求15所述的计算机可读存储介质,其中,所述样本用户为N个,所述N为大于1的整数,所述数据集包括所述N个样本用户中每个样本用户的对象操作序列,所述样本用户的正样本序列为所述每个样本用户的正样本序列,所述对象操作序列的第一向量包括所述N个样本用户中每个样本用户的对象操作序列的第一向量,所述正样本序列的第二向量包括所述N个样本用户中每个样本用户的正样本序列的第二向量;
    执行所述利用所述第一向量和所述第二向量训练所述初始的神经网络模型,得到训练后的神经网络模型,包括:
    根据所述N个样本用户中每个样本用户的正样本序列的第二向量,确定所述每个样本用户的对象操作序列的第一向量对应的正样本;
    根据所述N个样本用户中除样本用户i以外的各个样本用户的对象操作序列的第一向量以及所述各个样本用户的正样本序列的第二向量,确定所述样本用户i的对象操作序列的第一向量对应的负样本;i依次取1至N之间的整数;
    利用所述每个样本用户的对象操作序列的第一向量、所述每个样本用户的对象操作序列的第一向量对应的正样本、所述每个样本用户的对象操作序列的第一向量对应的负样本,训练所述初始的神经网络模型。
  18. 根据权利要求15所述的计算机可读存储介质,其中,所述目标用户为M个,所述M为大于1的整数;所述得到所述目标用户的特征向量之后,所述程序指令当被处理器执行时还使所述处理器执行:
    根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度;
    根据所述M个目标用户之间的相似度,从所述M个目标用户中确定出与目标用户j之间的相似度满足预设条件的K个目标用户,并将所述K个目标用户确定为所述目标用户 j的相似用户;所述目标用户j为所述M个目标用户中的任一目标用户;K为小于M的正整数;
    将所述目标用户j的相似用户的对象操作序列包括的多个对象推送至所述目标用户的用户终端。
  19. 根据权利要求18所述的计算机可读存储介质,其中,执行所述根据所述M个目标用户中每个目标用户的特征向量,计算所述M个目标用户之间的相似度,包括:
    获取所述每个目标用户的特征数据,根据所述每个目标用户的特征数据分别构建所述每个目标用户的特征矩阵;
    根据所述每个目标用户的特征矩阵,计算所述M个目标用户之间的第一初始相似度;
    根据所述每个目标用户的特征向量,计算所述M个目标用户之间的第二初始相似度;
    根据所述第一初始相似度和所述第二初始相似度,确定所述M个目标用户之间的相似度。
  20. 根据权利要求15所述的计算机可读存储介质,其中,所述得到所述目标用户的特征向量之后,所述程序指令当被处理器执行时还使所述处理器执行:
    将所述目标用户的特征向量输入预训练的决策树模型;
    利用所述预训练的决策树模型包括的至少一个决策树对所述目标用户的特征向量进行特征划分,以确定所述目标用户的特征向量在所述至少一个决策树中的每个决策树中所在的叶子节点;
    根据所述所在的叶子节点确定所述目标用户的预测分类值;
    根据所述预测分类值确定所述目标用户的目标类别。
PCT/CN2022/071262 2021-08-25 2022-01-11 用户特征向量确定方法、相关设备及介质 WO2023024408A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110979364.9A CN113656699B (zh) 2021-08-25 2021-08-25 用户特征向量确定方法、相关设备及介质
CN202110979364.9 2021-08-25

Publications (1)

Publication Number Publication Date
WO2023024408A1 true WO2023024408A1 (zh) 2023-03-02

Family

ID=78481886

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/071262 WO2023024408A1 (zh) 2021-08-25 2022-01-11 用户特征向量确定方法、相关设备及介质

Country Status (2)

Country Link
CN (1) CN113656699B (zh)
WO (1) WO2023024408A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113656699B (zh) * 2021-08-25 2024-02-13 平安科技(深圳)有限公司 用户特征向量确定方法、相关设备及介质
CN114756677B (zh) * 2022-03-21 2023-07-25 马上消费金融股份有限公司 样本生成方法、文本分类模型的训练方法及文本分类方法

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110413812A (zh) * 2019-08-06 2019-11-05 北京字节跳动网络技术有限公司 神经网络模型的训练方法、装置、电子设备及存储介质
US20200226476A1 (en) * 2019-01-10 2020-07-16 Visa International Service Association System, Method, and Computer Program Product for Incorporating Knowledge from More Complex Models in Simpler Models
CN111681059A (zh) * 2020-08-14 2020-09-18 支付宝(杭州)信息技术有限公司 行为预测模型的训练方法及装置
CN112560880A (zh) * 2019-09-25 2021-03-26 中国电信股份有限公司 目标分类方法、目标分类装置及计算机可读存储介质
CN112734034A (zh) * 2020-12-31 2021-04-30 平安科技(深圳)有限公司 模型训练方法、调用方法、装置、计算机设备和存储介质
CN113127727A (zh) * 2019-12-31 2021-07-16 国信优易数据股份有限公司 信息推荐模型确定方法、信息推荐方法及装置
CN113656699A (zh) * 2021-08-25 2021-11-16 平安科技(深圳)有限公司 用户特征向量确定方法、相关设备及介质

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110134783B (zh) * 2018-02-09 2023-11-10 阿里巴巴集团控股有限公司 个性化推荐的方法、装置、设备和介质
CN110415022B (zh) * 2019-07-05 2023-08-18 创新先进技术有限公司 处理用户行为序列的方法及装置
CN111160484B (zh) * 2019-12-31 2023-08-29 腾讯科技(深圳)有限公司 数据处理方法、装置、计算机可读存储介质及电子设备
CN111461812A (zh) * 2020-02-28 2020-07-28 北京三快在线科技有限公司 对象推荐方法、装置、电子设备及可读存储介质
CN111738311A (zh) * 2020-06-04 2020-10-02 北京字节跳动网络技术有限公司 面向多任务的特征提取方法、装置及电子设备
CN112085565B (zh) * 2020-09-07 2022-10-25 中国平安财产保险股份有限公司 基于深度学习的信息推荐方法、装置、设备及存储介质
CN112380319B (zh) * 2020-11-12 2023-10-17 平安科技(深圳)有限公司 一种模型训练的方法及相关装置
CN112307351A (zh) * 2020-11-23 2021-02-02 中国科学院计算技术研究所 用户行为的模型训练、推荐方法、装置和设备
CN112836081A (zh) * 2021-03-01 2021-05-25 腾讯音乐娱乐科技(深圳)有限公司 一种神经网络模型训练方法、信息推荐方法及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200226476A1 (en) * 2019-01-10 2020-07-16 Visa International Service Association System, Method, and Computer Program Product for Incorporating Knowledge from More Complex Models in Simpler Models
CN110413812A (zh) * 2019-08-06 2019-11-05 北京字节跳动网络技术有限公司 神经网络模型的训练方法、装置、电子设备及存储介质
CN112560880A (zh) * 2019-09-25 2021-03-26 中国电信股份有限公司 目标分类方法、目标分类装置及计算机可读存储介质
CN113127727A (zh) * 2019-12-31 2021-07-16 国信优易数据股份有限公司 信息推荐模型确定方法、信息推荐方法及装置
CN111681059A (zh) * 2020-08-14 2020-09-18 支付宝(杭州)信息技术有限公司 行为预测模型的训练方法及装置
CN112734034A (zh) * 2020-12-31 2021-04-30 平安科技(深圳)有限公司 模型训练方法、调用方法、装置、计算机设备和存储介质
CN113656699A (zh) * 2021-08-25 2021-11-16 平安科技(深圳)有限公司 用户特征向量确定方法、相关设备及介质

Also Published As

Publication number Publication date
CN113656699B (zh) 2024-02-13
CN113656699A (zh) 2021-11-16

Similar Documents

Publication Publication Date Title
CN110321422B (zh) 在线训练模型的方法、推送方法、装置以及设备
CN105224699B (zh) 一种新闻推荐方法及装置
US10637826B1 (en) Policy compliance verification using semantic distance and nearest neighbor search of labeled content
WO2023024408A1 (zh) 用户特征向量确定方法、相关设备及介质
CN112434151A (zh) 一种专利推荐方法、装置、计算机设备及存储介质
CN110750658B (zh) 一种媒体资源的推荐方法、服务器及计算机可读存储介质
CN115062732A (zh) 基于大数据用户标签信息的资源共享合作推荐方法及系统
WO2023231542A1 (zh) 表示信息的确定方法、装置、设备及存储介质
Chen et al. Label-free node classification on graphs with large language models (llms)
CN113011884A (zh) 账户特征的提取方法、装置、设备及可读存储介质
Duan et al. A hybrid intelligent service recommendation by latent semantics and explicit ratings
CN116823410B (zh) 数据处理方法、对象处理方法、推荐方法及计算设备
CN114329028A (zh) 一种数据处理方法、设备以及计算机可读存储介质
CN113159213A (zh) 一种业务分配方法、装置及设备
US20230214676A1 (en) Prediction model training method, information prediction method and corresponding device
CN115329183A (zh) 数据处理方法、装置、存储介质及设备
CN111984867A (zh) 一种网络资源确定方法及装置
Fernandes de Araújo et al. Leveraging active learning to reduce human effort in the generation of ground‐truth for entity resolution
CN115278374B (zh) 视频召回方法及装置
CN111291125B (zh) 一种数据处理方法及相关设备
CN110941714A (zh) 分类规则库构建方法、应用分类方法及装置
Assegaff et al. Experimental of vectorizer and classifier for scrapped social media data
CN113505154B (zh) 一种基于大数据的数字阅读统计分析方法及系统
US20220335311A1 (en) Data labeling for training artificial intelligence systems
US20230252419A1 (en) Systems and methods for predictive scoring

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22859769

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE