CN114817734A - Recommendation model training method, recommendation method and device, electronic device and medium - Google Patents
Recommendation model training method, recommendation method and device, electronic device and medium Download PDFInfo
- Publication number
- CN114817734A CN114817734A CN202210510338.6A CN202210510338A CN114817734A CN 114817734 A CN114817734 A CN 114817734A CN 202210510338 A CN202210510338 A CN 202210510338A CN 114817734 A CN114817734 A CN 114817734A
- Authority
- CN
- China
- Prior art keywords
- recommendation
- target
- local
- model
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 110
- 238000012549 training Methods 0.000 title claims abstract description 98
- 239000013598 vector Substances 0.000 claims abstract description 104
- 230000004927 fusion Effects 0.000 claims abstract description 57
- 238000000605 extraction Methods 0.000 claims abstract description 39
- 238000013528 artificial neural network Methods 0.000 claims abstract description 37
- 230000007246 mechanism Effects 0.000 claims abstract description 35
- 238000004364 calculation method Methods 0.000 claims abstract description 34
- 230000006399 behavior Effects 0.000 claims description 88
- 238000012545 processing Methods 0.000 claims description 35
- 230000006870 function Effects 0.000 claims description 25
- 230000015654 memory Effects 0.000 claims description 22
- 238000004891 communication Methods 0.000 claims description 18
- 238000013473 artificial intelligence Methods 0.000 abstract description 15
- 230000000694 effects Effects 0.000 abstract description 13
- 230000008569 process Effects 0.000 description 24
- 238000005516 engineering process Methods 0.000 description 13
- 238000003058 natural language processing Methods 0.000 description 7
- 238000010801 machine learning Methods 0.000 description 5
- 238000013136 deep learning model Methods 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013135 deep learning Methods 0.000 description 3
- 238000011160 research Methods 0.000 description 3
- 230000002776 aggregation Effects 0.000 description 2
- 238000004220 aggregation Methods 0.000 description 2
- 238000004458 analytical method Methods 0.000 description 2
- 238000013527 convolutional neural network Methods 0.000 description 2
- 230000004913 activation Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000012790 confirmation Methods 0.000 description 1
- 230000009193 crawling Effects 0.000 description 1
- 238000013480 data collection Methods 0.000 description 1
- 238000007418 data mining Methods 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000014509 gene expression Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000005065 mining Methods 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000000306 recurrent effect Effects 0.000 description 1
- 238000013468 resource allocation Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 238000000638 solvent extraction Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
- 238000013519 translation Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/25—Fusion techniques
- G06F18/253—Fusion techniques of extracted features
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/048—Activation functions
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Life Sciences & Earth Sciences (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- Computing Systems (AREA)
- Biomedical Technology (AREA)
- General Health & Medical Sciences (AREA)
- Computational Linguistics (AREA)
- Biophysics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Molecular Biology (AREA)
- Health & Medical Sciences (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the application provides a training method, a recommendation method and device, electronic equipment and a medium for a recommendation model, and belongs to the technical field of artificial intelligence. The method comprises the following steps: acquiring target behavior data and target recommendation data of a target user; performing feature extraction on the target behavior data and the target recommendation data through a neural network of a local recommendation model to obtain target behavior implicit features and target item implicit features; performing feature fusion on the target behavior implicit features and the target item implicit features through an attention mechanism of a local recommendation model to obtain target fusion feature vectors; performing loss calculation according to the target fusion feature vector to obtain local model parameters of a local recommendation model; sending the local model parameters to a server side; downloading global model parameters from a server side; and updating local model parameters according to the downloaded global model parameters to train the local recommendation model. The embodiment of the application can improve the training effect of the model.
Description
Technical Field
The present application relates to the field of artificial intelligence technologies, and in particular, to a training method, a recommendation method and apparatus, an electronic device, and a medium for a recommendation model.
Background
When the current recommendation system carries out recommendation, the recommendation is often carried out through the interest preferences of users, and the recommendation system often can only adopt different recommendation models to carry out recommendation aiming at users with different interest preferences because the recommendation system can not obtain comprehensive user data. Therefore, it is necessary to train a plurality of different recommendation models of a recommendation system, training efficiency is low, and the training effect of the recommendation models is affected due to lack of sufficient training data, so how to improve the training effect of the models becomes a technical problem to be solved urgently.
Disclosure of Invention
The embodiment of the application mainly aims to provide a training method, a recommendation method and device, electronic equipment and a medium for recommending a model, and aims to improve the training effect of the model.
In order to achieve the above object, a first aspect of the embodiments of the present application provides a training method for a recommendation model, which is applied to a client, where a local recommendation model trained in advance is stored in the client, and the method includes:
acquiring target user data of a target user; wherein the target user data comprises target behavior data and target recommendation data of the target user;
performing feature extraction on the target behavior data through a neural network of the local recommendation model to obtain target behavior implicit features, and performing feature extraction on the target recommendation data through the neural network to obtain target item implicit features;
performing feature fusion on the target behavior implicit features and the target item implicit features through an attention mechanism of the local recommendation model to obtain target fusion feature vectors;
performing loss calculation according to the target fusion feature vector to obtain local model parameters of the local recommendation model;
sending the local model parameters to a server side;
downloading global model parameters from the server side; the global model parameters are obtained by updating preset original model parameters by the server according to local model parameters sent by the plurality of clients;
and updating the local model parameters according to the downloaded global model parameters so as to train the local recommendation model.
In some embodiments, the step of performing feature extraction on the target behavior data through a neural network of the local recommendation model to obtain target behavior implicit features, and performing feature extraction on the target recommendation data through the neural network to obtain target item implicit features includes:
embedding the target behavior data to obtain a target behavior embedding vector, and embedding the target recommendation data to obtain a target recommendation embedding vector;
and carrying out dimension changing processing on the target behavior embedded vector to obtain the target behavior implicit characteristic, and carrying out dimension changing processing on the target recommendation embedded vector to obtain the target recommendation implicit characteristic.
In some embodiments, the step of performing loss calculation according to the target fusion feature vector to obtain a local model parameter of the local recommendation model includes:
carrying out score prediction according to the target fusion feature vector to obtain a recommendation score corresponding to a candidate item;
and performing loss calculation on the recommendation score through a preset loss function to obtain a local model parameter of the local recommendation model.
In some embodiments, the step of performing score prediction according to the target fusion feature vector to obtain a recommendation score corresponding to a candidate item includes:
carrying out dimension changing processing on the target fusion characteristic vector according to a preset dimension parameter to obtain a dimension changing characteristic vector;
performing attention calculation on the variable-dimension characteristic vector to obtain the attention corresponding to the variable-dimension characteristic vector;
performing vector multiplication on the variable-dimension characteristic vector and the attention degree to obtain a weighted characteristic vector;
and carrying out score prediction on the weighted feature vector through a preset function to obtain a recommendation score corresponding to the candidate item.
In order to achieve the above object, a second aspect of the embodiments of the present application provides a method for training a recommendation model, which is applied to a server side, and the method includes:
sending preset original model parameters to a client;
obtaining common user data of a plurality of clients and local model parameters sent by the clients; the local model parameters are obtained by updating the original model parameters by the client;
training a local global recommendation model according to the local model parameters and the public user data to obtain global model parameters; the global model parameters are used for being downloaded by the client, so that the client updates the local model parameters according to the downloaded global model parameters.
In order to achieve the above object, a third aspect of the embodiments of the present application provides a recommendation method, applied to a client, where the method includes:
acquiring current user data of a target user;
inputting the current user data into a local recommendation model for prediction processing to obtain a recommendation list, wherein the local recommendation model is obtained by training according to the training method of the first aspect;
and pushing the recommendation list to the target user.
In order to achieve the above object, a fourth aspect of the embodiments of the present application provides a training apparatus for a recommendation model, which is applied to a client, where a local recommendation model trained in advance is stored in the client, and the apparatus includes:
the target user data acquisition module is used for acquiring target user data of a target user; wherein the target user data comprises target behavior data and target recommendation data of the target user;
the characteristic extraction module is used for extracting the characteristics of the target behavior data through the neural network of the local recommendation model to obtain target behavior implicit characteristics, and extracting the characteristics of the target recommendation data through the neural network to obtain target item implicit characteristics;
the characteristic fusion module is used for carrying out characteristic fusion on the target behavior implicit characteristic and the target item implicit characteristic through an attention mechanism of the local recommendation model to obtain a target fusion characteristic vector;
the loss calculation module is used for performing loss calculation according to the target fusion feature vector to obtain a local model parameter of the local recommendation model;
the parameter sending module is used for sending the local model parameters to the server side;
the parameter downloading module is used for downloading the global model parameters from the server side; the global model parameters are obtained by updating preset original model parameters by the server according to local model parameters sent by the plurality of clients;
and the training module is used for updating the local model parameters according to the downloaded global model parameters so as to train the local recommendation model.
To achieve the above object, a fifth aspect of an embodiment of the present application provides a recommendation apparatus, including:
the current user data acquisition module is used for acquiring current user data of a target user;
the prediction module is used for inputting the current user data into a local recommendation model for prediction processing to obtain a recommendation list, wherein the local recommendation model is obtained by training according to the training method of the first aspect;
and the pushing module is used for pushing the recommendation list to the target user.
In order to achieve the above object, a sixth aspect of embodiments of the present application provides an electronic device, which includes a memory, a processor, a program stored in the memory and executable on the processor, and a data bus for implementing connection communication between the processor and the memory, wherein the program, when executed by the processor, implements the method of the first aspect, or the method of the second aspect, or the method of the third aspect.
To achieve the above object, a seventh aspect of embodiments of the present application proposes a storage medium, which is a computer-readable storage medium for computer-readable storage, and stores one or more programs, which are executable by one or more processors to implement the method of the first aspect, the method of the second aspect, or the method of the third aspect.
The recommendation model training method, the recommendation model training device, the recommendation device, the electronic equipment and the storage medium are provided by the application, and target user data of a target user are obtained; the target user data comprises target behavior data and target recommendation data of a target user, the target behavior data is subjected to feature extraction through a neural network of a local recommendation model to obtain target behavior implicit features, the target recommendation data is subjected to feature extraction through the neural network to obtain target item implicit features, the recommendation item data is subjected to feature extraction through the local recommendation model to obtain item implicit feature vectors, and more complex behavior data of the target user can be extracted through a deep learning model so that diversified heterogeneous data such as images, videos, audios and texts can be blended in the model training process. Furthermore, the attention mechanism of the local recommendation model is used for carrying out feature fusion on the target behavior implicit features and the target item implicit features to obtain target fusion feature vectors, loss calculation is carried out according to the target fusion feature vectors to obtain local model parameters of the local recommendation model, the attention mechanism is introduced into the local recommendation model, the attention parameters of the local recommendation model can be effectively optimized, and the accuracy of the obtained local model parameters is improved. And finally, sending the local model parameters to a server, downloading the global model parameters from the server, updating the local model parameters according to the downloaded global model parameters to train the local recommendation model, effectively avoiding the over-fitting problem of the local recommendation model of the client in a federal modeling mode, and simultaneously combining an attention mechanism with federal recommendation learning to improve the training effect of the model.
Drawings
FIG. 1 is a flowchart of a training method of a recommendation model provided in an embodiment of the present application;
FIG. 2 is a flowchart of step S102 in FIG. 1;
FIG. 3 is a flowchart of step S104 in FIG. 1;
fig. 4 is a flowchart of step S301 in fig. 3;
FIG. 5 is another flowchart of a training method for a recommendation model provided in an embodiment of the present application;
FIG. 6 is a flowchart of a recommendation method provided by an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a training apparatus for a recommendation model provided in an embodiment of the present application;
FIG. 8 is a schematic structural diagram of a recommendation device provided in an embodiment of the present application;
fig. 9 is a schematic hardware structure diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
It should be noted that although functional blocks are partitioned in a schematic diagram of an apparatus and a logical order is shown in a flowchart, in some cases, the steps shown or described may be performed in a different order than the partitioning of blocks in the apparatus or the order in the flowchart. The terms first, second and the like in the description and in the claims, and the drawings described above, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the present application only and is not intended to be limiting of the application.
First, several terms referred to in the present application are resolved:
artificial Intelligence (AI): is a new technical science for researching and developing theories, methods, technologies and application systems for simulating, extending and expanding human intelligence; artificial intelligence is a branch of computer science that attempts to understand the essence of intelligence and produces a new intelligent machine that can react in a manner similar to human intelligence, and research in this field includes robotics, language recognition, image recognition, natural language processing, and expert systems, among others. The artificial intelligence can simulate the information process of human consciousness and thinking. Artificial intelligence is also a theory, method, technique and application system that uses a digital computer or a machine controlled by a digital computer to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use the knowledge to obtain the best results.
Natural Language Processing (NLP): NLP uses computer to process, understand and use human language (such as chinese, english, etc.), and belongs to a branch of artificial intelligence, which is a cross discipline between computer science and linguistics, also commonly called computational linguistics. Natural language processing includes parsing, semantic analysis, discourse understanding, and the like. Natural language processing is commonly used in the technical fields of machine translation, character recognition of handwriting and print, speech recognition and text-to-speech conversion, information intention recognition, information extraction and filtering, text classification and clustering, public opinion analysis and viewpoint mining, and relates to data mining, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, linguistic research related to language calculation and the like related to language processing.
Information Extraction (Information Extraction): and extracting the fact information of entities, relations, events and the like of specified types from the natural language text, and forming a text processing technology for outputting structured data. Information extraction is a technique for extracting specific information from text data. The text data is composed of specific units, such as sentences, paragraphs and chapters, and the text information is composed of small specific units, such as words, phrases, sentences and paragraphs or combinations of these specific units. The extraction of noun phrases, names of people, names of places, etc. in the text data is text information extraction, and of course, the information extracted by the text information extraction technology can be various types of information.
Federal Learning (fed Learning): union learning, league learning. Federal learning is a machine learning framework, and can effectively help a plurality of organizations to perform data use and machine learning modeling under the condition of meeting the requirements of user privacy protection, data safety and government regulations. The federated learning is used as a distributed machine learning paradigm, the data island problem can be effectively solved, participators can jointly model on the basis of not sharing data, the data island can be technically broken, and AI cooperation is realized. Federal learning has three major components: data source, federal learning system, user. Under a federal learning system, each data source side carries out data preprocessing, establishes and learns models together, and feeds back output results to a user.
Attention Mechanism (Attention Mechanism): the attention mechanism may enable a neural network to have the ability to focus on a subset of its inputs (or features), selecting a particular input, and be applied to any type of input regardless of its shape. In situations where computing power is limited, the attention mechanism is a resource allocation scheme that is the primary means to solve the information overload problem, allocating computing resources to more important tasks.
When the existing recommendation system carries out recommendation, recommendation is often carried out through the interest preference of the user, and the recommendation system often can only adopt different recommendation models to carry out recommendation on users with different interest preferences because comprehensive user data cannot be obtained. Therefore, it is necessary to train a plurality of different recommendation models of a recommendation system, training efficiency is low, and a lack of sufficient training data affects training effect of the recommendation models, so how to improve training effect of the models becomes a technical problem to be solved urgently.
Based on this, the embodiment of the application provides a training method and a training device for a recommendation model, a recommendation device, an electronic device and a storage medium, and aims to improve the training effect of the model.
The training method and the recommendation method for the recommendation model, the training device and the recommendation device for the recommendation model, the electronic device, and the storage medium provided in the embodiments of the present application are specifically described in the following embodiments, and first, the training method for the recommendation model in the embodiments of the present application is described.
The embodiment of the application can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The embodiment of the application provides a training method of a recommendation model, and relates to the technical field of artificial intelligence. The training method of the recommendation model provided by the embodiment of the application can be applied to a terminal, a server side and software running in the terminal or the server side. In some embodiments, the terminal may be a smartphone, tablet, laptop, desktop computer, or the like; the server side can be configured into an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and cloud servers for providing basic cloud computing services such as cloud service, a cloud database, cloud computing, cloud functions, cloud storage, network service, cloud communication, middleware service, domain name service, security service, CDN (content delivery network) and big data and artificial intelligence platforms; the software may be an application of a training method or the like that implements the recommendation model, but is not limited to the above form.
The application is operational with numerous general purpose or special purpose computing system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The recommendation model and the recommendation method in the embodiment of the application are applicable to a federal recommendation system, in the federal recommendation system, a set of all users (user) is represented by U, a set of all items (item) is represented by I, and the users are divided into two types according to privacy preferences of the users: the users who agree to share personal data with the server are called public users, whose data are stored in the server of the publisher, denoted U Pub (ii) a Private users (i.e. target users in the application) refuse to share data with the server, the data is stored on the local device and cannot be accessed by the publisher, and the data is recorded as U Pri . Wherein U is U ═ U Pub +U Pri . The entire system framework is made up of two components: one piece of clothesThe system comprises a server and a plurality of clients (such as notebook computers, smart phones, tablet computers and the like), wherein each client represents a private user and stores user data of the user.
Fig. 1 is an optional flowchart of a training method for a recommendation model provided in an embodiment of the present application, and is applied to a client, where a local recommendation model trained in advance is stored in the client, and the method in fig. 1 may include, but is not limited to, steps S101 to S107.
Step S101, acquiring target user data of a target user; the target user data comprises target behavior data and target recommendation data of a target user;
step S102, extracting the characteristics of target behavior data through a neural network of a local recommendation model to obtain target behavior implicit characteristics, and extracting the characteristics of the target recommendation data through the neural network to obtain target item implicit characteristics;
step S103, performing feature fusion on the target behavior implicit features and the target item implicit features through an attention mechanism of a local recommendation model to obtain target fusion feature vectors;
step S104, loss calculation is carried out according to the target fusion characteristic vector to obtain local model parameters of a local recommendation model;
step S105, sending the local model parameters to a server;
step S106, downloading global model parameters from a server side; the global model parameters are obtained by updating preset original model parameters by the server side according to local model parameters sent by the plurality of client sides;
and step S107, updating local model parameters according to the downloaded global model parameters to train a local recommendation model.
In steps S101 to S107 illustrated in the embodiment of the application, feature extraction is performed on target behavior data through a neural network of a local recommendation model to obtain target behavior implicit features, feature extraction is performed on the target recommendation data through the neural network to obtain target item implicit features, feature extraction is performed on the recommendation item data through the local recommendation model to obtain item implicit feature vectors, and extraction can be performed on more complex behavior data of a target user through a deep learning model, so that diversified heterogeneous data such as images, videos, audios, texts and the like can be merged into a model training process. The method comprises the steps of performing feature fusion on target behavior implicit features and target item implicit features through an attention mechanism of a local recommendation model to obtain target fusion feature vectors, performing loss calculation according to the target fusion feature vectors to obtain local model parameters of the local recommendation model, and introducing the attention mechanism into the local recommendation model to effectively optimize the attention parameters of the local recommendation model and improve the accuracy of the obtained local model parameters. And finally, sending the local model parameters to a server, downloading the global model parameters from the server, updating the local model parameters according to the downloaded global model parameters to train the local recommendation model, effectively avoiding the over-fitting problem of the local recommendation model of the client in a federal modeling mode, and simultaneously combining an attention mechanism with federal recommendation to improve the training effect of the model.
In each embodiment of the present application, when data related to the user identity or characteristic, such as user information, user behavior data, user history data, and user location information, is processed, permission or consent of the user is obtained, and the data collection, use, and processing comply with relevant laws and regulations and standards of relevant countries and regions. In addition, when the embodiment of the present application needs to acquire the target personal information of the user, the user may obtain the individual permission or the individual consent through a pop-up window or a jump to a confirmation page, and after the individual permission or the individual consent of the user is definitely obtained, necessary user-related data for enabling the embodiment of the present application to normally operate may be acquired.
In step S101 of some embodiments, the target user data of the target user may be obtained by writing a web crawler, and performing targeted crawling on the data in the client after the data source is set. Target user data of the target user can also be obtained in other manners, without being limited thereto, where the target user data includes target behavior data of the target user and target recommendation data, the target behavior data includes data of a click rate, a browsing duration, and the like of the target user, the target recommendation data refers to data recommended to the target user, and the target recommendation data includes data of image content, text content, and the like.
Referring to fig. 2, in some embodiments, step S102 may include, but is not limited to, step S201 to step S202:
step S201, embedding the target behavior data to obtain a target behavior embedding vector, and embedding the target recommendation data to obtain a target recommendation embedding vector;
and step S202, carrying out dimension-changing processing on the target behavior embedded vector to obtain target behavior implicit characteristics, and carrying out dimension-changing processing on the target recommendation embedded vector to obtain target recommendation implicit characteristics.
In step S201 of some embodiments, word embedding processing is performed on the target behavior data through a preset word2vec algorithm, and the target behavior data is mapped to a preset mathematical space to obtain a target behavior embedding vector. Similarly, word embedding processing is carried out on the target recommendation data through a preset word2vec algorithm, and the target recommendation data are mapped to a preset mathematical space to obtain a target recommendation embedding vector.
In step S202 of some embodiments, the target behavior embedded vector is subjected to dimension-changing processing, and the embedded vector in the high-dimensional space is compressed into the low-dimensional space, so as to obtain the low-dimensional target behavior implicit characteristic. Similarly, the target recommendation embedded vector is subjected to variable-dimension processing, and the embedded vector of a high-dimension space is compressed to a low-dimension space to obtain the low-dimension target recommendation implicit characteristic.
In a specific embodiment, the process of extracting features of the target behavior data and the target recommendation data in a certain client may be as shown in formula (1) and formula (2):
wherein, U pri Is the input target behavior data, I is the input target recommendation data,representing neural network operations, U Pr Is target behavior implicit characteristic output through a neural network, I' is target recommendation implicit characteristic output through the neural network, K Pri 、K I Is an intermediate parameter in the operation process.
Through the feature extraction process, the embedded user data and project data can be compressed into low-dimensional hidden vectors, so that feature interaction information between a user and a project can be captured better, and the training cost of the model can be reduced.
In step S103 of some embodiments, the attention mechanism of the local recommendation model may capture the influence of the key input on the output through the probability distribution of the attention, and by introducing the attention mechanism, the local recommendation model can focus on recommendation information of different aspects, such as a recommendation page theme, a recommendation page style, and the like. The specific process of performing feature fusion on the target behavior implicit feature and the target item implicit feature by the attention mechanism of the local recommendation model mainly comprises two parts of feature extraction and attention calculation, specifically, in the feature extraction stage, the target behavior implicit feature and the target recommendation implicit feature output by the neural network are fused into the attention mechanism to obtain a target fusion feature vector phi between a user and an item NN 。
In a specific embodiment, a specific process of performing feature fusion on the target behavior implicit feature and the target item implicit feature in a certain client may be as shown in formula (3):
wherein, U Pr Is target behavior implicit characteristic output through the neural network, I' is target recommendation implicit characteristic output through the neural network, f a Is a mapping function of the attention mechanism, a g Is an activation function of the neural network, W g And b g Are the weight parameters and bias parameters of the neural network,is W g The transposing of (1).
Referring to fig. 3, in some embodiments, step S104 may include, but is not limited to, step S301 to step S302:
step S301, carrying out score prediction according to the target fusion feature vector to obtain a recommendation score corresponding to the candidate item;
and step S302, performing loss calculation on the recommendation score through a preset loss function to obtain a local model parameter of the local recommendation model.
Referring to fig. 4, in some embodiments, step S301 may include, but is not limited to, step S401 to step S404:
step S401, carrying out dimension changing processing on the target fusion characteristic vector according to preset dimension parameters to obtain a dimension changing characteristic vector;
step S402, calculating the attention degree of the variable-dimension characteristic vector to obtain the attention degree corresponding to the variable-dimension characteristic vector;
step S403, carrying out vector multiplication on the variable-dimension characteristic vector and the attention degree to obtain a weighted characteristic vector;
and S404, performing score prediction on the weighted feature vectors through a preset function to obtain a recommendation score corresponding to the candidate item.
In step S401 of some embodiments, the target fusion feature vector is dimension-changed into m-dimensional vector space, resulting in m-dimensional dimension-changed feature vector H m And the dimension parameters can be set according to the application scene and the actual situation.
In step S402 of some embodiments, the attention degree calculation is performed on the variable-dimension feature vector through a preset prediction function, for exampleFor example, the prediction function may be a softmax function, which is a m-dimensional variable-dimension feature vector H m Inputting the variable dimension characteristic vector into a softmax function to obtain a variable dimension characteristic vector H m Corresponding attention A m Wherein A is m =Softmax(H m )。
In step S403 of some embodiments, the feature vector H is scaled for variable dimensions m And degree of attention A m Carrying out vector multiplication to obtain a variable dimension characteristic vector A * ,A * =H m ⊙A m Wherein, the "" is a dot product operation.
In step S404 of some embodiments, the preset function is a Sigmoid function, and the feature vector a is weighted by the Sigmoid function * Performing score prediction to obtain the recommendation score of interaction between the target user and the candidate itemWherein,
in step S302 of some embodiments, the preset loss function may be defined according to the minimized cross entropy error, and the process of performing the loss calculation on the recommendation score may be expressed as shown in formula (4), and the calculated loss value is obtained according to the calculationContinuously adjusting the model parameters to obtain the loss value of the loss functionAnd if the local model parameter is smaller than or equal to the preset threshold value, obtaining the local model parameter of the local recommendation model.
Wherein N is the number of candidates.
In step S105 of some embodiments, the local model parameters are sent to the server side through the federal recommendation system, so that the server side can aggregate the local model weight parameters of all the clients, and simultaneously use the common user data of the common user to train to obtain a global ranking model and global model parameters of the global ranking model.
Specifically, when the global ranking model is trained, the local model weight parameters and the common user data of all the clients are used as training data and input into a preset original model, loss calculation is performed on the training data through a preset loss function to obtain a model loss value, parameter fine adjustment is performed through the model loss value, and multiple iterative calculation is performed, so that the model loss value is in a preset value range, training of the model is completed, and the global ranking model is obtained. And carrying out fine tuning processing on the local model weight parameters of all the clients through the trained global ranking model to obtain new model weight parameters, and taking the series of new model weight parameters as global model parameters.
In step S106 of some embodiments, the global model parameters are downloaded from the server side through the federal recommendation system; the global model parameters are obtained by updating preset original model parameters by the server side according to the local model parameters sent by the plurality of client sides.
It should be noted that, in some specific embodiments, according to an application scenario and actual data, both the global ranking model and the local recommendation model may be trained as recommendation models for a variety of Deep learning based on attention-driven Deep Neural Networks (DNNs), Convolutional Neural Networks (CNNs), Recurrent Neural Networks (RNNs), Graph Neural Networks (GNNs), and the like, without limitation.
In step S107 of some embodiments, the local model parameters are updated according to the downloaded global model parameters, thereby training the local recommendation model. Specifically, when the local model parameters are updated according to the downloaded global model parameters, an attention mechanism can be introduced to train the local recommendation model, and the attention parameters of each recommended item are optimized, so that the model parameters of the local recommendation model are optimal, and the local recommendation model can meet personalized requirements.
Specifically, when the local model parameters are updated according to the downloaded global model parameters and the local recommendation model is trained, behavior data and recommendation data of the target user are obtained again, and model training is performed according to the obtained behavior data and recommendation data, wherein the training process is basically consistent with the data processing process of the step S102 and the step S103, and is not repeated here.
According to the training method of the recommendation model, the target user data of the target user are obtained; the target user data comprises target behavior data and target recommendation data of a target user, the target behavior data is subjected to feature extraction through a neural network of a local recommendation model to obtain target behavior implicit features, the target recommendation data is subjected to feature extraction through the neural network to obtain target item implicit features, the recommendation item data is subjected to feature extraction through the local recommendation model to obtain item implicit feature vectors, and more complex behavior data of the target user can be extracted through a deep learning model so that diversified heterogeneous data such as images, videos, audios and texts can be blended in the model training process. Furthermore, the attention mechanism of the local recommendation model is used for carrying out feature fusion on the target behavior implicit features and the target item implicit features to obtain target fusion feature vectors, loss calculation is carried out according to the target fusion feature vectors to obtain local model parameters of the local recommendation model, the attention mechanism is introduced into the local recommendation model, the attention parameters of the local recommendation model can be effectively optimized, and the accuracy of the obtained local model parameters is improved. And finally, sending the local model parameters to a server, downloading the global model parameters from the server, and updating the local model parameters according to the downloaded global model parameters to train the local recommendation model. Due to the fact that the number of data samples of each target user (such as a private user) is limited, and most target users only have a small number of new data samples, the over-fitting problem of the local recommendation model of the client during training can be effectively avoided through a federal modeling mode. In addition, the battery and the computing power of the client side such as a mobile phone or a tablet personal computer are limited, and each client side can achieve training of the model only by uploading specific user data in the training process, so that computing resources can be effectively saved, attention mechanism and federal recommended learning are combined, and the training effect of the model can be improved.
Fig. 5 is another alternative flowchart of the training method of the recommendation model provided in the embodiment of the present application, and is applied to a server side, where the method in fig. 5 may include, but is not limited to, steps S501 to S503.
Step S501, sending preset original model parameters to a client;
step S502, obtaining common user data of a plurality of clients and local model parameters sent by the plurality of clients; the local model parameters are obtained by updating the original model parameters by the client;
step S503, training a local global recommendation model according to the local model parameters and the public user data to obtain global model parameters; the global model parameters are used for being downloaded by the client, so that the client updates the local model parameters according to the downloaded global model parameters.
In step S501 of some embodiments, the server sends preset original model parameters to the client through network communication, so that the client can perform initialization operation on the local recommendation model through the original model parameters.
In step S502 of some embodiments, after the local recommendation model processes the acquired target user data and generates local model parameters, the server side acquires common user data of a plurality of clients and local model parameters sent by the plurality of clients in a network communication manner, where the common user data may be directly stored at the server side so that the server side can call and extract the common user data at any time, and the local model parameters of the clients need to be acquired from the clients in a communication manner, so that data acquisition is performed in this manner, which can reduce communication cost.
In step S503 of some embodiments, the server performs aggregation processing on the local model parameters and the public user data, uses the parameters obtained through the aggregation processing as training data, inputs the training data into a preset original model, performs loss calculation on the training data through a preset loss function to obtain a model loss value, performs parameter fine-tuning on the model loss value, and performs iterative calculation for multiple times, so that the model loss value is within a preset value range, thereby completing the training of the model and obtaining the global ranking model. And carrying out fine tuning processing on the local model weight parameters of all the clients through the trained global ranking model to obtain new model weight parameters, and taking the series of new model weight parameters as global model parameters.
According to the training method of the recommendation model, the common user data and the target user data can be fused simultaneously for training the model by acquiring the local model parameters output by the client, the problem that overfitting easily occurs in the training process due to the sample data process of the local recommendation model is effectively solved, all user data can be processed and analyzed conveniently through the server, the attention mechanism is introduced to carry out attention adjustment on the global model parameters so as to determine the optimal global model parameters, the attention mechanism is combined with the federal recommendation learning, and the training effect of the model can be improved.
Fig. 6 is an optional flowchart of the recommendation method provided in the embodiment of the present application, and is applied to a client, where the method in fig. 6 may include, but is not limited to, step S601 to step S603.
Step S601, acquiring current user data of a target user;
step S602, inputting the current user data into a local recommendation model for prediction processing to obtain a recommendation list, wherein the local recommendation model is obtained by training according to the training method of the embodiment of the first aspect;
step S603, pushing the recommendation list to the target user.
In step S601 in some embodiments, the web crawler may be written, and after the data source is set, the data in the client is crawled in a targeted manner, so as to obtain the current user data of the target user. The current user data of the target user can also be obtained in other manners, which is not limited to this, where the current user data includes current behavior data and current recommended data of the target user, the current behavior data includes data of a click rate, browsing duration, and the like of the target user, and different from the target user data, the current user data is a click rate and browsing duration currently generated by the current user, and the click rate and browsing duration in the target user data are historical data of the target user; the current recommendation data includes data such as image content, text content, and the like.
In step S602 in some embodiments, current user data is input into a local recommendation model, and feature extraction is performed on the current user data through the local recommendation model to obtain a current behavior implicit feature and a current recommendation implicit feature; and further, performing feature fusion on the current behavior implicit features and the current recommended implicit features through an attention mechanism of a local recommendation model to obtain current fusion feature vectors. And recommending and scoring the current fusion feature vector through a preset function (such as a softmax function) to obtain a recommended score corresponding to each preset recommended item, and performing descending order arrangement on the preset recommended items according to the recommended scores to obtain a recommended list.
In step S603 of some embodiments, the recommendation list is directly pushed to the target user, or a more advanced item in the recommendation list is selected and pushed to the target user, so that personalized recommendation is realized and communication cost is reduced.
According to the recommendation method, the current user data are acquired, wherein the current user data comprise the current behavior data and the current recommendation data of the target user, the current behavior data and the current recommendation data are extracted through the local recommendation model, and the more complex behavior data of the local user can be extracted in a deep learning mode, so that diversified heterogeneous data such as images, videos, audios and texts can be blended in the recommendation process. Furthermore, feature fusion is carried out on the current behavior implicit features and the current recommendation implicit features through an attention mechanism of a local recommendation model to obtain a current fusion feature vector, recommendation scoring is carried out on the current fusion feature vector through a preset function, the attention mechanism is introduced in the recommendation scoring process, important information of different recommendation projects or recommendation pages can be concerned, and the influence of irrelevant information on the recommendation process is reduced. And finally, performing descending order arrangement on the preset recommended items according to the recommendation scores to obtain a recommendation list, and pushing the recommendation list to the target user. Compared with a low-level embedded model in the related technology, the attention mechanism can endow different parts of the attention object with different weights, so that the effects of other irrelevant parts are reduced, a recommendation result which better accords with the preference of a user can be obtained in the prediction process, and the recommendation accuracy and the recommendation performance of the recommendation system are improved.
Referring to fig. 7, an embodiment of the present application further provides a training apparatus for a recommendation model, which is applied to a client, where a local recommendation model trained in advance is stored in the client, and the training method for the recommendation model can be implemented, where the apparatus includes:
a target user data obtaining module 701, configured to obtain target user data of a target user; the target user data comprises target behavior data and target recommendation data of a target user;
the feature extraction module 702 is configured to perform feature extraction on the target behavior data through a neural network of the local recommendation model to obtain target behavior implicit features, and perform feature extraction on the target recommendation data through the neural network to obtain target item implicit features;
the feature fusion module 703 is configured to perform feature fusion on the target behavior implicit features and the target item implicit features through an attention mechanism of the local recommendation model to obtain a target fusion feature vector;
the loss calculation module 704 is used for performing loss calculation according to the target fusion feature vector to obtain a local model parameter of the local recommendation model;
a parameter sending module 705, configured to send the local model parameter to the server;
a parameter downloading module 706, configured to download global model parameters from a server; the global model parameters are obtained by updating preset original model parameters by the server side according to local model parameters sent by the plurality of client sides;
and a training module 707, configured to update local model parameters according to the downloaded global model parameters to train a local recommendation model.
In some embodiments, the feature extraction module 702 includes:
the embedding unit is used for embedding the target behavior data to obtain a target behavior embedding vector and embedding the target recommendation data to obtain a target recommendation embedding vector;
and the first dimension changing unit is used for carrying out dimension changing processing on the target behavior embedded vector to obtain the target behavior implicit characteristic and carrying out dimension changing processing on the target recommendation embedded vector to obtain the target recommendation implicit characteristic.
In some embodiments, loss calculation module 704 includes:
the second dimension changing unit is used for carrying out dimension changing processing on the target fusion characteristic vector according to the preset dimension parameters to obtain a dimension changing characteristic vector;
the first calculation unit is used for calculating the attention degree of the variable-dimension characteristic vector to obtain the attention degree corresponding to the variable-dimension characteristic vector;
the second calculation unit is used for carrying out vector multiplication on the variable-dimension characteristic vector and the attention degree to obtain a weighted characteristic vector;
and the prediction unit is used for carrying out score prediction on the weighted feature vector through a preset function to obtain a recommendation score corresponding to the candidate item.
And the third calculating unit is used for performing loss calculation on the recommendation score through a preset loss function to obtain a local model parameter of the local recommendation model.
The specific implementation of the training apparatus of the recommendation model is substantially the same as the specific implementation of the training method of the recommendation model, and is not described herein again.
Referring to fig. 8, an embodiment of the present application further provides a recommendation apparatus, which can implement the recommendation method described above, and the apparatus includes:
a current user data obtaining module 801, configured to obtain current user data of a target user;
the prediction module 802 is configured to input current user data into a local recommendation model for prediction processing to obtain a recommendation list, where the local recommendation model is obtained by training according to the training method of the first aspect;
and the pushing module 803 is configured to push the recommendation list to the target user.
The specific implementation of the recommendation apparatus is substantially the same as the specific implementation of the recommendation method, and is not described herein again.
An embodiment of the present application further provides an electronic device, where the electronic device includes: the device comprises a memory, a processor, a program stored on the memory and capable of running on the processor, and a data bus for realizing connection communication between the processor and the memory, wherein the program realizes the training method or the recommendation method of the recommendation model when being executed by the processor. The electronic equipment can be any intelligent terminal including a tablet computer, a vehicle-mounted computer and the like.
Referring to fig. 9, fig. 9 illustrates a hardware structure of an electronic device according to another embodiment, where the electronic device includes:
the processor 901 may be implemented by a general-purpose CPU (central processing unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits, and is configured to execute a relevant program to implement the technical solution provided in the embodiment of the present application;
the memory 902 may be implemented in the form of a Read Only Memory (ROM), a static storage device, a dynamic storage device, or a Random Access Memory (RAM). The memory 902 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present disclosure is implemented by software or firmware, the related program codes are stored in the memory 902 and the processor 901 calls the training method or the recommendation method for executing the recommendation model of the embodiments of the present disclosure;
an input/output interface 903 for implementing information input and output;
a communication interface 904, configured to implement communication interaction between the device and another device, where communication may be implemented in a wired manner (e.g., USB, network cable, etc.), or in a wireless manner (e.g., mobile network, WIFI, bluetooth, etc.);
a bus 905 that transfers information between various components of the device (e.g., the processor 901, the memory 902, the input/output interface 903, and the communication interface 904);
wherein the processor 901, the memory 902, the input/output interface 903 and the communication interface 904 enable a communication connection within the device with each other through a bus 905.
The embodiment of the present application further provides a storage medium, which is a computer-readable storage medium for computer-readable storage, and the storage medium stores one or more programs, and the one or more programs are executable by one or more processors to implement the training method or the recommendation method of the recommendation model.
The memory, which is a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. Further, the memory may include high speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and these remote memories may be connected to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The training method and the training device for the recommendation model, the recommendation device, the electronic equipment and the storage medium provided by the embodiment of the application are used for acquiring target user data of a target user; the target user data comprises target behavior data and target recommendation data of a target user, the target behavior data is subjected to feature extraction through a neural network of a local recommendation model to obtain target behavior implicit features, the target recommendation data is subjected to feature extraction through the neural network to obtain target item implicit features, the recommendation item data is subjected to feature extraction through the local recommendation model to obtain item implicit feature vectors, and more complex behavior data of the target user can be extracted through a deep learning model so that diversified heterogeneous data such as images, videos, audios and texts can be blended in the model training process. Furthermore, the attention mechanism of the local recommendation model is used for carrying out feature fusion on the target behavior implicit features and the target item implicit features to obtain target fusion feature vectors, loss calculation is carried out according to the target fusion feature vectors to obtain local model parameters of the local recommendation model, the attention mechanism is introduced into the local recommendation model, the attention parameters of the local recommendation model can be effectively optimized, and the accuracy of the obtained local model parameters is improved. And finally, sending the local model parameters to a server, downloading the global model parameters from the server, updating the local model parameters according to the downloaded global model parameters to train the local recommendation model, effectively avoiding the over-fitting problem of the local recommendation model of the client in a federal modeling mode, and simultaneously combining an attention mechanism with federal recommendation learning to improve the training effect of the model.
The embodiments described in the embodiments of the present application are for more clearly illustrating the technical solutions of the embodiments of the present application, and do not constitute a limitation to the technical solutions provided in the embodiments of the present application, and it is obvious to those skilled in the art that the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems with the evolution of technology and the emergence of new application scenarios.
Those skilled in the art will appreciate that the embodiments shown in fig. 1-4, 5, and 6 do not limit the embodiments of the present application, and may include more or less steps than those shown, or may combine some of the steps, or different steps.
The above-described embodiments of the apparatus are merely illustrative, wherein the units illustrated as separate components may or may not be physically separate, i.e. may be located in one place, or may also be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
One of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the application and the above-described figures, if any, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one" means one or more, "a plurality" means two or more. "and/or" for describing an association relationship of associated objects, indicating that there may be three relationships, e.g., "a and/or B" may indicate: only A, only B and both A and B are present, wherein A and B may be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship. "at least one of the following" or similar expressions refer to any combination of these items, including any combination of single item(s) or plural items. For example, at least one (one) of a, b, or c, may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the above-described division of units is only one type of division of logical functions, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes multiple instructions for causing a computer device (which may be a personal computer, a server, or a network device) to perform all or part of the steps of the method of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing programs, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
The preferred embodiments of the present application have been described above with reference to the accompanying drawings, and the scope of the claims of the embodiments of the present application is not limited thereto. Any modifications, equivalents and improvements that may occur to those skilled in the art without departing from the scope and spirit of the embodiments of the present application are intended to be within the scope of the claims of the embodiments of the present application.
Claims (10)
1. A training method of a recommendation model is applied to a client, wherein the client stores a local recommendation model trained in advance, and the method comprises the following steps:
acquiring target user data of a target user; wherein the target user data comprises target behavior data and target recommendation data of the target user;
performing feature extraction on the target behavior data through a neural network of the local recommendation model to obtain target behavior implicit features, and performing feature extraction on the target recommendation data through the neural network to obtain target item implicit features;
performing feature fusion on the target behavior implicit features and the target item implicit features through an attention mechanism of the local recommendation model to obtain target fusion feature vectors;
performing loss calculation according to the target fusion feature vector to obtain local model parameters of the local recommendation model;
sending the local model parameters to a server side;
downloading global model parameters from the server side; the global model parameters are obtained by updating preset original model parameters by the server according to local model parameters sent by the plurality of clients;
and updating the local model parameters according to the downloaded global model parameters so as to train the local recommendation model.
2. The training method according to claim 1, wherein the step of performing feature extraction on the target behavior data through the neural network of the local recommendation model to obtain target behavior implicit features, and performing feature extraction on the target recommendation data through the neural network to obtain target item implicit features includes:
embedding the target behavior data to obtain a target behavior embedding vector, and embedding the target recommendation data to obtain a target recommendation embedding vector;
and carrying out dimension changing processing on the target behavior embedded vector to obtain the target behavior implicit characteristic, and carrying out dimension changing processing on the target recommendation embedded vector to obtain the target recommendation implicit characteristic.
3. The training method according to claim 1 or 2, wherein the step of performing loss calculation according to the target fusion feature vector to obtain a local model parameter of the local recommendation model comprises:
carrying out score prediction according to the target fusion feature vector to obtain a recommendation score corresponding to a candidate item;
and performing loss calculation on the recommendation score through a preset loss function to obtain a local model parameter of the local recommendation model.
4. The training method according to claim 3, wherein the step of performing score prediction according to the target fusion feature vector to obtain a recommendation score corresponding to a candidate item comprises:
carrying out dimension changing processing on the target fusion characteristic vector according to a preset dimension parameter to obtain a dimension changing characteristic vector;
performing attention calculation on the variable-dimension characteristic vector to obtain the attention corresponding to the variable-dimension characteristic vector;
performing vector multiplication on the variable-dimension characteristic vector and the attention degree to obtain a weighted characteristic vector;
and carrying out score prediction on the weighted feature vector through a preset function to obtain a recommendation score corresponding to the candidate item.
5. A training method of a recommendation model is applied to a server side, and comprises the following steps:
sending preset original model parameters to a client;
obtaining common user data of a plurality of clients and local model parameters sent by the clients; the local model parameters are obtained by updating the original model parameters by the client;
training a local global recommendation model according to the local model parameters and the public user data to obtain global model parameters; the global model parameters are used for being downloaded by the client, so that the client updates the local model parameters according to the downloaded global model parameters.
6. A recommendation method is applied to a client side, and comprises the following steps:
acquiring current user data of a target user;
inputting the current user data into a local recommendation model for prediction processing to obtain a recommendation list, wherein the local recommendation model is obtained by training according to the training method of any one of claims 1 to 4;
and pushing the recommendation list to the target user.
7. A training device of a recommendation model is applied to a client, and the client stores a local recommendation model trained in advance, and is characterized by comprising:
the target user data acquisition module is used for acquiring target user data of a target user; wherein the target user data comprises target behavior data and target recommendation data of the target user;
the characteristic extraction module is used for extracting the characteristics of the target behavior data through the neural network of the local recommendation model to obtain target behavior implicit characteristics, and extracting the characteristics of the target recommendation data through the neural network to obtain target item implicit characteristics;
the characteristic fusion module is used for carrying out characteristic fusion on the target behavior implicit characteristic and the target item implicit characteristic through an attention mechanism of the local recommendation model to obtain a target fusion characteristic vector;
the loss calculation module is used for performing loss calculation according to the target fusion feature vector to obtain a local model parameter of the local recommendation model;
the parameter sending module is used for sending the local model parameters to a server side;
the parameter downloading module is used for downloading the global model parameters from the server side; the global model parameters are obtained by updating preset original model parameters by the server according to local model parameters sent by the plurality of clients;
and the training module is used for updating the local model parameters according to the downloaded global model parameters so as to train the local recommendation model.
8. A recommendation device, characterized in that the device comprises:
the current user data acquisition module is used for acquiring current user data of a target user;
the prediction module is used for inputting the current user data into a local recommendation model for prediction processing to obtain a recommendation list, wherein the local recommendation model is obtained by training according to the training method of any one of claims 1 to 4;
and the pushing module is used for pushing the recommendation list to the target user.
9. An electronic device, characterized in that the electronic device comprises a memory, a processor, a program stored on the memory and executable on the processor, and a data bus for enabling a connection communication between the processor and the memory, the program, when executed by the processor, implementing the training method of any one of claims 1 to 4, or the training method of claim 5, or the steps of the recommendation method of claim 6.
10. A storage medium being a computer readable storage medium for computer readable storage, characterized in that the storage medium stores one or more programs executable by one or more processors to implement the training method of any one of claims 1 to 4, or the training method of claim 5, or the steps of the recommendation method of claim 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210510338.6A CN114817734A (en) | 2022-05-11 | 2022-05-11 | Recommendation model training method, recommendation method and device, electronic device and medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210510338.6A CN114817734A (en) | 2022-05-11 | 2022-05-11 | Recommendation model training method, recommendation method and device, electronic device and medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114817734A true CN114817734A (en) | 2022-07-29 |
Family
ID=82513281
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210510338.6A Pending CN114817734A (en) | 2022-05-11 | 2022-05-11 | Recommendation model training method, recommendation method and device, electronic device and medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114817734A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115292612A (en) * | 2022-10-10 | 2022-11-04 | 北京锘崴信息科技有限公司 | Information and financial information recommendation method and device based on privacy protection |
-
2022
- 2022-05-11 CN CN202210510338.6A patent/CN114817734A/en active Pending
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115292612A (en) * | 2022-10-10 | 2022-11-04 | 北京锘崴信息科技有限公司 | Information and financial information recommendation method and device based on privacy protection |
CN115292612B (en) * | 2022-10-10 | 2023-01-24 | 北京锘崴信息科技有限公司 | Information and financial information recommendation method and device based on privacy protection |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN114240552A (en) | Product recommendation method, device, equipment and medium based on deep clustering algorithm | |
CN116561538A (en) | Question-answer scoring method, question-answer scoring device, electronic equipment and storage medium | |
CN115222066A (en) | Model training method and device, behavior prediction method and device, and storage medium | |
CN115239675A (en) | Training method of classification model, image classification method and device, equipment and medium | |
CN116258137A (en) | Text error correction method, device, equipment and storage medium | |
CN114841146A (en) | Text abstract generation method and device, electronic equipment and storage medium | |
CN114722174A (en) | Word extraction method and device, electronic equipment and storage medium | |
CN115223251A (en) | Training method and device for signature detection model, electronic equipment and storage medium | |
CN116468130A (en) | Sample selection method, system, electronic equipment and medium based on federal learning | |
CN117271736A (en) | Question-answer pair generation method and system, electronic equipment and storage medium | |
CN116702736A (en) | Safe call generation method and device, electronic equipment and storage medium | |
CN114817734A (en) | Recommendation model training method, recommendation method and device, electronic device and medium | |
CN113342944A (en) | Corpus generalization method, apparatus, device and storage medium | |
CN116701604A (en) | Question and answer corpus construction method and device, question and answer method, equipment and medium | |
CN114398903B (en) | Intention recognition method, device, electronic equipment and storage medium | |
CN116432705A (en) | Text generation model construction method, text generation device, equipment and medium | |
CN116364054A (en) | Voice synthesis method, device, equipment and storage medium based on diffusion | |
CN115828153A (en) | Task prediction method, device, equipment and medium based on artificial intelligence | |
CN114996458A (en) | Text processing method and device, equipment and medium | |
CN114090778A (en) | Retrieval method and device based on knowledge anchor point, electronic equipment and storage medium | |
CN115204300A (en) | Data processing method, device and storage medium for text and table semantic interaction | |
CN115034317A (en) | Training method and device of policy identification model and policy identification method and device | |
CN114925199A (en) | Image construction method, image construction device, electronic device, and storage medium | |
CN115270746A (en) | Question sample generation method and device, electronic equipment and storage medium | |
CN114492437A (en) | Keyword recognition method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |