CN110502701B - Friend recommendation method, system and storage medium introducing attention mechanism - Google Patents

Friend recommendation method, system and storage medium introducing attention mechanism Download PDF

Info

Publication number
CN110502701B
CN110502701B CN201910608392.2A CN201910608392A CN110502701B CN 110502701 B CN110502701 B CN 110502701B CN 201910608392 A CN201910608392 A CN 201910608392A CN 110502701 B CN110502701 B CN 110502701B
Authority
CN
China
Prior art keywords
user
vector
target user
features
attention mechanism
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.)
Active
Application number
CN201910608392.2A
Other languages
Chinese (zh)
Other versions
CN110502701A (en
Inventor
毛承洁
贺毅
汤庸
王柳
傅城州
常超
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
South China Normal University
Original Assignee
South China Normal University
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 South China Normal University filed Critical South China Normal University
Priority to CN201910608392.2A priority Critical patent/CN110502701B/en
Publication of CN110502701A publication Critical patent/CN110502701A/en
Application granted granted Critical
Publication of CN110502701B publication Critical patent/CN110502701B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9536Search customisation based on social or collaborative filtering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
    • G06Q50/01Social networking

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Business, Economics & Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Computing Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Economics (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a friend recommendation method introducing an attention mechanism, which comprises the following steps of: extracting features of a user pair to obtain multi-dimensional feature information, wherein the user pair comprises a target user and a candidate user; dynamically weighting the multidimensional characteristic information through an attention mechanism to obtain an output result; and recommending friends according to the output result. The invention provides a friend recommendation method introducing an attention mechanism to improve the practicability and effectiveness of a recommendation function. The friend recommendation method, the friend recommendation system and the storage medium which introduce the attention mechanism can be widely applied to the internet technology.

Description

Friend recommendation method, system and storage medium introducing attention mechanism
Technical Field
The invention relates to the internet technology, in particular to a friend recommendation method, a friend recommendation system and a storage medium, which introduce an attention mechanism.
Background
In recent years, with the rapid development of internet technology, online social network platforms are widely popularized, and users can conveniently communicate information and share information through the social network platforms. However, as the number of users increases, more and more information can be obtained, and a large amount of redundant information may affect the use of the users. Therefore, recommendation systems have appeared which can find and recommend content meeting interests to users from a huge amount of information, help alleviate the problem of information overload, and are widely researched nowadays.
The traditional recommendation method based on the content only performs recommendation by learning a simple linear relationship among the features, and cannot capture a more complex relationship. By using the deep network, more complex and various nonlinear relations between the target user and the recommended items can be obtained, and compared with the traditional recommendation method, a better recommendation effect can be obtained, but the nonlinear relations obtained by the deep neural network model are related to all features. In practical situations, a target user usually does not pay attention to all features of a recommended item, for example, in a friend recommendation task in a social network, different users can select friends according to different features, part of the users select more users in a similar research field to become friends, and more friends of part of the users come from the same school, so that the existing friend recommendation method cannot accurately obtain different preferences of different users, cannot give reasonable recommendation results according to the attention degree of the users to different features, and is poor in practicability and effectiveness of a recommendation function.
Disclosure of Invention
In view of the above, in order to solve the above technical problems, an object of the present invention is to provide a friend recommendation method, system and storage medium with attention mechanism introduced, so as to improve the practicability and effectiveness of the recommendation function.
The technical scheme adopted by the invention is as follows: a friend recommendation method introducing an attention mechanism comprises the following steps:
extracting features of a user pair to obtain multi-dimensional feature information, wherein the user pair comprises a target user and a candidate user;
dynamically weighting the multidimensional characteristic information through an attention mechanism to obtain an output result;
and recommending friends according to the output result.
Further, the method also comprises the following steps:
sampling a first user and a second user according to a preset proportion, wherein the first user is a user with a friend relationship with a target user, and the second user is a candidate user without the friend relationship with the target user;
obtaining a trained model according to a sampling result;
the user pairs are input into the trained model.
Further, the step of extracting the features of the user pair to obtain the multi-dimensional feature information includes the following steps:
extracting academic features of the user pairs, combining the extracted academic features into an academic feature list, and obtaining multi-dimensional feature information, wherein the academic features comprise: attribute features, relationship features, and text features.
Further, the step of dynamically weighting the multi-dimensional feature information through the attention mechanism to obtain the output result includes the following steps:
converting academic features of the target user into low-dimensional dense target user vectors;
converting the academic feature list into a list vector;
obtaining the attention of the target user vector to the list vector;
and dynamically weighting the attention of the list vector and the attention of the target user vector to the list vector through an attention mechanism to obtain an output result.
Further, the step of recommending friends according to the output result includes the following steps:
acquiring a first potential nonlinear relation between the output result and the target user vector according to the output result and the target user vector;
and recommending friends according to the first potential nonlinear relation.
Further, the step of performing friend recommendation according to the first potential nonlinear relationship includes the following steps:
converting academic features of the candidate users into low-dimensional dense candidate user vectors;
acquiring a second potential nonlinear relation between the candidate user vector and the target user vector according to the candidate user vector and the target user vector;
and recommending friends according to the first potential nonlinear relation and the second potential nonlinear relation.
Further, the step of performing friend recommendation according to the first potential nonlinear relationship and the second potential nonlinear relationship includes the following steps:
determining weights occupied by the first potential nonlinear relationship and the second potential nonlinear relationship;
outputting a prediction result through a prediction function according to the weight occupied by the first potential nonlinear relation and the second potential nonlinear relation;
and recommending friends according to the prediction result.
The invention also provides a friend recommendation system introducing an attention mechanism, which comprises:
the system comprises a characteristic extraction module, a characteristic extraction module and a characteristic extraction module, wherein the characteristic extraction module is used for extracting characteristics of a user pair to obtain multi-dimensional characteristic information, and the user pair comprises a target user and a candidate user;
the weighting module is used for dynamically weighting the multi-dimensional characteristic information through an attention mechanism to obtain an output result;
and the recommendation module is used for recommending friends according to the output result.
The invention also provides a friend recommendation system introducing an attention mechanism, which comprises:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the friend recommendation method that draws attention mechanism.
The invention also provides a storage medium which stores instructions executable by the processor, and the friend recommendation method based on the attention-drawing mechanism is executed when the processor executes the instructions executable by the processor.
The invention has the beneficial effects that: dynamically weighting the multidimensional characteristic information through an attention mechanism to obtain an output result, and recommending friends according to the output result; according to the invention, an attention mechanism is introduced, dynamic weighting is carried out on the characteristics, the attention degrees of different users to different characteristics can be obtained, the user preference is accurately obtained, and the performance of a recommendation task is improved, so that a reasonable recommendation result can be better provided according to the actual situation, and the recommendation function has strong practicability and effectiveness.
Drawings
FIG. 1 is a schematic diagram illustrating a process flow of a friend recommendation method with attention mechanism introduced according to the present invention;
FIG. 2 is a diagram illustrating a process of a friend recommendation method with attention mechanism according to an embodiment of the present invention;
fig. 3 is a block diagram of a friend recommendation method system with attention mechanism.
Detailed Description
The invention will be further explained and explained with reference to the drawings and the embodiments in the description. The step numbers in the embodiments of the present invention are set for convenience of illustration only, the order between the steps is not limited at all, and the execution order of each step in the embodiments can be adaptively adjusted according to the understanding of those skilled in the art.
As shown in fig. 1, the friend recommendation method with attention mechanism includes the following steps:
extracting features of a user pair to obtain multi-dimensional feature information, wherein the user pair comprises a target user and a candidate user;
dynamically weighting the multidimensional characteristic information through an attention mechanism to obtain an output result;
and recommending friends according to the output result.
In this embodiment, the target user refers to a current user, that is, a user who needs the recommendation system to perform friend recommendation; the candidate user refers to a user other than the target user, or may be a user other than the target user and not in a friend relationship with the target user.
Further as a preferred embodiment, the method further comprises the following steps:
sampling a first user and a second user according to a preset proportion, wherein the first user is a user with a friend relationship with a target user, and the second user is a candidate user without the friend relationship with the target user;
obtaining a trained model according to a sampling result;
the user pairs are input into the trained model.
In this implementation, the first user and the second user are assigned a 1: a ratio of 4, and in other embodiments may be sampled at other ratios. Extracting a first user from a user set with friend relationship with a target user, forming a first user combination with the target user, extracting four second users from a user set without friend relationship with the target user, and respectively forming second user combinations with the target user; performing model training by using the first user combination and the four second user combinations to obtain a trained model; and then randomly extracting candidate users from the user set without friend relationship with the target user, forming a user pair with the target user, and inputting the trained model.
As shown in fig. 2, in a further preferred embodiment, the step of extracting features of the user pair to obtain multi-dimensional feature information includes the following steps:
extracting academic features of the user pairs, combining the extracted academic features into an academic feature list, and obtaining multi-dimensional feature information, wherein the academic features comprise: attribute features, relationship features, and text features.
In this embodiment, the attribute features and text features of the candidate users are extracted, and the relationship features between the target user and the candidate users are extracted.
Specifically, with regard to the extraction of the attribute feature, there are a variety of attributes, such as belonging units, research areas, and the like, for each user in the academic social network. All attributes of the candidate user are defined as an attribute list, and the attribute list comprises the attribute category and the attributes belonging to the attribute category. If one attribute category has a plurality of attributes at the same time, the attributes are respectively represented, and the attributes in the list are converted into corresponding binary vectors for representation through coding. Using attrviRepresenting the ith attribute category in the attribute list of the candidate user V, and representing the converted corresponding binary feature vector as Vvi
Figure BDA0002121454950000041
Wherein R represents a real number set, KiThe dimension representing the attribute class i, i.e. the attribute class contains KiA different attribute. If candidate user V has jth attribute in attribute class i, then Vvi[j]1, otherwise Vvi[j]0, i.e. Vvi[j]E {0,1}, each attribute is expressed as a corresponding one-hot code (one-hot code) by transformation. Finally, all binary vectors corresponding to the attributes of the candidate user v are merged to obtain the attribute characteristics of the candidate user v
Figure BDA0002121454950000042
In correspondence with a in figure 2 a,
Figure BDA0002121454950000043
the nth attribute is represented, and since different users have different numbers of attributes, n has different values, in this embodiment, the number of encoded attributes does not exceed 27, that is, n is less than or equal to 27.
Specifically, regarding the extraction of the relationship characteristics between the target user and the candidate user, in the academic social network, besides the established friend relationship, there are other types of relationships, and these relationships may also reflect the characteristics of the user. In the embodiment, academic collaboration relations, team relations and course relations common in the academic social network are extracted to represent the relation characteristics between users, but other relations may be extracted in other embodiments. For example, if the target user u has an academic cooperative relationship with the candidate user v, co-adaptive (u, v) ═ 1 is defined, otherwise co-adaptive (u, v) ═ 0. Similarly, defining co-court (u, v) ═ 1 indicates that the target user u has the same course as the candidate user v, otherwise co-court (u, v) ═ 0; the target user u and the candidate user v join the same team as indicated by co-team (u, v) ═ 1, otherwise co-team (u, v) ═ 0. In this embodiment, the three types of relationships are combined and converted into three-dimensional binary codes to represent the relationship characteristics between users, for example, when the target user u and the candidate user v have an academic cooperation relationship but do not have a team relationship or a course relationship, a corresponding relationship can be obtainedIs a characteristic Ruv=[1,0,0]Corresponding to R in fig. 2.
Specifically, regarding the extraction of text features, in an academic social network, each academic achievement is usually represented as a text containing information of the type, title, content and the like of the academic achievement, and for users in the academic social network, the academic achievement can well embody the research interests of the users, and the research interests of the users are mined by using the LDA topic model. Firstly, combining all extracted academic achievement information of a single candidate user v to obtain a long text representing the academic achievement of the candidate user v, then training the extracted academic achievement text of the candidate user v by using an LDA topic model, calculating research interest topic distribution of the candidate user v, constructing corresponding research interest topic models, calculating research interest vectors corresponding to each user v through the models as text features of the users, and using TvThis is shown, corresponding to T in fig. 2.
Finally, all the academic characteristics obtained above, namely Av、Ruv、TvAnd merging the two into an academic feature list F corresponding to Pair (u, v) by the useruvAnd obtaining multi-dimensional characteristic information. Since different users have different numbers of features, the resulting feature list will also be of different lengths.
Further, as a preferred embodiment, the step of obtaining the output result by dynamically weighting the multidimensional feature information through the attention mechanism includes the following steps:
converting academic features of the target user into low-dimensional dense target user vectors;
converting the academic feature list into a list vector;
obtaining the attention of the target user vector to the list vector;
and dynamically weighting the attention of the list vector and the attention of the target user vector to the list vector through an attention mechanism to obtain an output result.
In the present embodiment, all academic features of the target user u are represented as corresponding binary vectors C by one-hot encoding (one-hot encoding)u=[0,...,1,...,0]∈RMWhere M represents the number of users, one for each user. Since a feature possessed by a user may have a high dimension after being subjected to unique hot coding, for example, a unit to which the user attribute feature belongs may be one of thousands of units, which is expressed as thousands of dimensions after being subjected to unique hot coding, and the unique hot coding is converted into a feature vector (target user vector) corresponding to the user through the embedding layer, that is, a low-dimension dense vector. In particular by embedding the matrix W by the userU=[WU 1,...,WU u,...,WU M]∈RD×M(D represents the dimension of the output target user vector, WU 1Is the embedding vector of the 1 st user, WU uI.e. the embedding vector of the u-th user, and so on) the binary vector C of the target user uu=[0,...,1,...,0]∈RMConverting into corresponding low-dimensional dense target user vector EuWherein R isMRepresenting an M-dimensional vector, Eu=WU*Cu∈RD. Likewise, academic feature list FuvAnd also converted into another corresponding feature vector, namely a list vector, through the embedding layer.
Then, the attention of the target user vector to the list vector is obtained, and the attention of the list vector and the attention of the target user vector to the list vector are dynamically weighted through an attention mechanism to obtain an output result, in this example, the output result is F'uvThe specific calculation process is as follows:
Figure BDA0002121454950000061
Figure BDA0002121454950000062
wherein N represents the number of attributes, and in the embodiment, N is less than or equal to 30;
Figure BDA0002121454950000063
representing the kth feature in the list vector by computing the target user vector EuAnd feature vector
Figure BDA0002121454950000064
Outer product of (D), and then Eu
Figure BDA0002121454950000065
Are combined to obtain hk;WkRepresenting the attention of the target user vector u to the list vector, in particular the target user vector u to the list vector
Figure BDA0002121454950000066
To calculate WkThe function used is an activation function in a neural network. Pair list vector and W by attention mechanismkCarrying out dynamic weighting to obtain an output result F'uv
Further, as a preferred embodiment, the step of recommending friends according to the output result includes the following steps:
acquiring a first potential nonlinear relation between the output result and the target user vector according to the output result and the target user vector;
and recommending friends according to the first potential nonlinear relation.
In this embodiment, result F 'will be output'uvAnd a target user vector EuAfter concat is carried out, output is carried out through an MLP layer, wherein MLP refers to merging input low-dimensional dense embedded vectors, then the merged vectors are sent to a full-connection layer of a neural network through forward transmission, potential nonlinear relations among the vectors are automatically learned, and the specific calculation process is as follows:
Z(L+1)=f(W(L)Z(L)+b(L))
where L represents the number of MLP levels, W is the activation function f (-) using ReLUs for sparse data(L)And b(L)Respectively representing the weight matrix and the offset vector of the L-th layer to finally obtain an output result F'uvAnd a target user vector EuFirst potential nonlinear relationship Z(L+1)As output of the MLP layer
Figure BDA0002121454950000071
Further, as a preferred embodiment, the step of performing friend recommendation according to the first potential nonlinear relationship includes the following steps:
converting academic features of the candidate users into low-dimensional dense candidate user vectors;
acquiring a second potential nonlinear relation between the candidate user vector and the target user vector according to the candidate user vector and the target user vector;
and recommending friends according to the first potential nonlinear relation and the second potential nonlinear relation.
In the present embodiment, the academic features of the candidate user v are represented as corresponding binary vectors by the one-hot encoding, and the binary vectors are converted into the low-dimensional dense candidate user vector E in the same manner as described abovev(ii) a Target user vector EuAnd candidate user vector EvInputting another MLP layer, and obtaining a candidate user vector E by the same calculation method as abovevAnd a target user vector EuAs the output of the MLP layer
Figure BDA0002121454950000072
Further, as a preferred embodiment, the step of performing friend recommendation according to the first potential nonlinear relationship and the second potential nonlinear relationship includes the following steps:
determining weights occupied by the first potential nonlinear relationship and the second potential nonlinear relationship;
outputting a prediction result through a prediction function according to the weight occupied by the first potential nonlinear relation and the second potential nonlinear relation;
and recommending friends according to the prediction result.
In this implementation, the predicted result is
Figure BDA0002121454950000073
Represents the probability that the target user u and the candidate user v are suitable (or have a chance) to become friends, and is therefore also called the predicted probability
Figure BDA0002121454950000074
The value range is [0,1 ]]The specific calculation formula is as follows:
Figure BDA0002121454950000081
wherein, WTRepresenting two output results in a model
Figure BDA00021214549500000813
And
Figure BDA00021214549500000814
weight of (1), WTT in (1) represents transposition and can be obtained through automatic network learning; output of
Figure BDA0002121454950000084
The prediction function of (a) is an activation function in the neural network. Then by predicting the probability
Figure BDA0002121454950000085
And carrying out friend recommendation.
For more accurate prediction, the model is trained through a Loss function Loss, and the Loss function Loss formula is as follows:
Figure BDA0002121454950000086
wherein S represents the total training set, i.e. all user pairs Pair (u, v), y of the target user u and the candidate user vuvE {0,1}, which represents the actual situation that the user has a friend relationship with Pair (u, v) in the academic social network and the prediction probability
Figure BDA0002121454950000087
Correspondingly, 1 means having a friend relationship, and 0 means none.
Further preferably, the probability is predicted
Figure BDA0002121454950000088
Friend recommendation is performed, and in this embodiment, the method includes the following steps:
according to predicted probability
Figure BDA0002121454950000089
Building recommendation lists, predicting probabilities
Figure BDA00021214549500000815
The larger the candidate users are, the more front the candidate users are, the first K candidate users v (K can be set according to requirements) with the top ranking are taken as recommendation results to recommend to the target user u, the target user u can select a proper recommended candidate user v to apply for friends, and more candidate user v recommendation results can be checked.
Further, as a preferred embodiment, in this embodiment, when the target user u requests the friend recommendation service, the type of the target user u is determined, and according to different user types, different recommendation strategies are selected:
(1) if the target user u is a newly registered user and has no specific information, all users are used as candidate users v, sorting is carried out according to the recommendation degree of the candidate users v, and a recommendation list is constructed according to the popularity of the target user u;
(2) if the target user u is a new registered user but fills in specific information, taking users in the same field as the candidate user v, selecting the candidate user v similar to the target user u according to the specific information of the target user u, and calculating the prediction probability of the candidate user v through a model
Figure BDA00021214549500000811
According to predicted probability
Figure BDA00021214549500000816
Sorting is carried out, and a recommendation list is constructed;
(3) and if the target user is not the new registered user, taking the users in the same field as the candidate user v, calculating the prediction probability of the current target user u and the candidate user v through the model, sequencing according to the prediction probability, and constructing a recommendation list.
Further as a preferred implementation, in this embodiment, at a fixed time node, data in the system is updated, and the recommendation model is retrained.
As shown in fig. 2, to sum up, in the present embodiment, the friend recommendation method with attention mechanism is described as follows:
1) data sampling, namely extracting a first user from a user set with friend relationship with a target user to form a first user combination with the target user, extracting four second users from a user set without friend relationship with the target user to respectively form second user combinations with the target user, and performing model training by using the first user combination and the four second user combinations;
2) forming a user Pair Pair (u, v) by the target user u and the id of a candidate user v randomly extracted from a user set with no friend relationship of the target user through an Input Layer (Input Layer), and inputting a trained model;
3) extracting academic features of Pair (u, v) by a user through a Feature Layer (Feature Layer), and merging the extracted academic features into an academic Feature list FuvI.e. multi-dimensional feature information;
4) respectively representing the academic features of the target user u and the candidate user v as a low-dimensional dense target user vector E through an Embedding Layer (Embedding Layer)uAnd candidate user vector EvWhile listing the academic features in a list FuvRepresented as a corresponding list vector;
5) the multi-dimensional feature information is dynamically weighted by an Attention Layer (Attention Layer), specifically:
obtain target user vector EuAttention to list vector Wk
Pair list vector and W by attention mechanismkCarrying out dynamic weighting to obtain an output result F'uv
6) Obtaining an output result F 'through an MLP Layer (MLP Layer)'uvAnd target user vector EuIs output in a first potentially non-linear relationship of
Figure BDA0002121454950000091
Obtaining a target user vector E through another MLP Layer (MLP Layer)uAnd candidate user vector EvSecond potential non-linear relationship therebetween, output
Figure BDA0002121454950000092
7) Combining the two output results by the prediction function of the output Layer (Top Layer or Top Layer)
Figure BDA0002121454950000093
Outputting prediction probabilities
Figure BDA0002121454950000094
The prediction result is finally obtained by the model;
8) according to predicted probability
Figure BDA0002121454950000095
And constructing a recommendation list and recommending friends.
In summary, compared with the prior art, the invention has the following advantages:
1) by calculating the attention of the target user vector to the list vector, different influence factors of different academic features on the recommended task are obtained, user preference is accurately obtained, and the performance of the recommendation system is improved;
2) the attention of different users to different characteristics can be obtained by dynamically weighting the attention of the list vector and the attention of the target user vector to the list vector through an attention mechanism, the user preference can be accurately obtained, and the performance of a recommended task is improved, so that a reasonable recommendation result can be better provided for actual conditions, and the recommendation function has strong practicability and effectiveness;
3) friend recommendation is carried out through the first potential nonlinear relation and the second potential nonlinear relation, a complex relation between user characteristics can be captured, and a simple linear relation is not captured, so that the recommendation result of the recommendation system is more reasonable;
4) according to the weights occupied by the first potential nonlinear relation and the second potential nonlinear relation, the prediction result is output through the prediction function to perform friend recommendation, so that the prediction result is more accurate, and the performance of a recommendation system is further improved;
5) different recommendation strategies are selected according to different user types, and a recommendation system can give the most reasonable recommendation result according to actual conditions, so that the practicability is high;
6) and at a fixed time node, updating data in the system, and retraining the recommendation model, thereby ensuring the practicability and effectiveness of the recommendation system.
As shown in fig. 3, the present invention further provides a friend recommendation system with attention mechanism, including:
the system comprises a characteristic extraction module, a characteristic extraction module and a characteristic extraction module, wherein the characteristic extraction module is used for extracting characteristics of a user pair to obtain multi-dimensional characteristic information, and the user pair comprises a target user and a candidate user;
the weighting module is used for dynamically weighting the multi-dimensional characteristic information through an attention mechanism to obtain an output result;
and the recommendation module is used for recommending friends according to the output result.
Further as a preferred embodiment, the system also comprises an AMAF module and an MLP module;
wherein, AMAF module includes: feature extraction module (feature layer) and weighting module (attention layer) and an MLP layer, an embedding layer, AMAF module for output
Figure BDA0002121454950000101
Namely, output result F'uvAnd a target user vector EuFirst potential nonlinear relationship Z(L+1)
The MLP module includes: input layer, embedded layer, another MLP layer, MLP module for output
Figure BDA0002121454950000102
Prediction function pair through top layer (toplayer)
Figure BDA0002121454950000103
And
Figure BDA0002121454950000104
calculating to obtain the prediction probability
Figure BDA0002121454950000105
The embodiment of the invention also provides a friend recommendation system introducing the attention mechanism, which comprises the following steps:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the friend recommendation method that draws attention mechanism.
The contents in the above method embodiments are all applicable to the present system embodiment, the functions specifically implemented by the present system embodiment are the same as those in the above method embodiment, and the beneficial effects achieved by the present system embodiment are also the same as those achieved by the above method embodiment.
In alternative embodiments, the functions/acts noted in the block diagrams may occur out of the order noted in the operational illustrations. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality/acts involved. Furthermore, the embodiments presented and described in the flow charts of the present invention are provided by way of example in order to provide a more thorough understanding of the technology. The disclosed methods are not limited to the operations and logic flows presented herein. Alternative embodiments are contemplated in which the order of various operations is changed and in which sub-operations described as part of larger operations are performed independently.
Furthermore, while the invention is described in the context of functional modules and illustrated in the form of block diagrams, it should be understood that, unless otherwise stated to the contrary, one or more of the described functions and/or features may be integrated into a single physical device and/or software module or one or more functions and/or features may be implemented in a separate physical device or software module. It will also be appreciated that a detailed discussion of the actual implementation of each module is not necessary for an understanding of the present invention. Rather, the actual implementation of the various functional modules in the apparatus disclosed herein will be understood within the ordinary skill of an engineer, given the nature, function, and internal relationship of the modules. Accordingly, those skilled in the art can, using ordinary skill, practice the invention as set forth in the claims without undue experimentation. It is also to be understood that the specific concepts disclosed are merely illustrative of and not intended to limit the scope of the invention, which is defined by the appended claims and their full scope of equivalents.
The embodiment of the invention also provides a storage medium, which stores instructions executable by a processor, and when the processor executes the instructions executable by the processor, the friend recommendation method introducing the attention mechanism is executed.
It can also be seen that the contents in the above method embodiments are all applicable to the present storage medium embodiment, and the realized functions and advantageous effects are the same as those in the method embodiments.
The functions, if implemented in the form of software functional units 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 invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The logic and/or steps represented in the flowcharts or otherwise described herein, e.g., an ordered listing of executable instructions that can be considered to implement logical functions, can be embodied in any computer-readable medium for use by or in connection with an instruction execution system, apparatus, or device, such as a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions. For the purposes of this description, a "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device.
More specific examples (a non-exhaustive list) of the computer-readable medium would include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the computer-readable medium could even be paper or another suitable medium upon which the program is printed, as the program can be electronically captured, via for instance optical scanning of the paper or other medium, then compiled, interpreted or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
In the description herein, references to the description of the term "one embodiment," "the present embodiment," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While the preferred embodiments of the present invention have been illustrated and described, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (8)

1. A friend recommendation method introducing an attention mechanism is characterized by comprising the following steps:
extracting features of a user pair to obtain multi-dimensional feature information, wherein the user pair comprises a target user and a candidate user;
dynamically weighting the multidimensional characteristic information through an attention mechanism to obtain an output result;
carrying out friend recommendation according to the output result;
the step of extracting the features of the user pair to obtain the multi-dimensional feature information comprises the following steps:
extracting academic features of the user pairs, combining the extracted academic features into an academic feature list, and obtaining multi-dimensional feature information, wherein the academic features comprise: attribute features, relationship features and text features;
the step of obtaining the output result by dynamically weighting the multidimensional characteristic information through the attention mechanism comprises the following steps:
converting academic features of the target user into low-dimensional dense target user vectors;
converting the academic feature list into a list vector;
obtaining the attention of the target user vector to the list vector;
and dynamically weighting the attention of the list vector and the attention of the target user vector to the list vector through an attention mechanism to obtain an output result.
2. The friend recommendation method based on an attention mechanism as claimed in claim 1, wherein: further comprising the steps of:
sampling a first user and a second user according to a preset proportion, wherein the first user is a user with a friend relationship with a target user, and the second user is a candidate user without the friend relationship with the target user;
obtaining a trained model according to a sampling result;
the user pairs are input into the trained model.
3. The friend recommendation method based on an attention mechanism as claimed in claim 1, wherein: the step of recommending friends according to the output result comprises the following steps:
acquiring a first potential nonlinear relation between the output result and the target user vector according to the output result and the target user vector;
and recommending friends according to the first potential nonlinear relation.
4. The friend recommendation method based on an attention mechanism as claimed in claim 3, wherein: the step of recommending friends according to the first potential nonlinear relationship comprises the following steps:
converting academic features of the candidate users into low-dimensional dense candidate user vectors;
acquiring a second potential nonlinear relation between the candidate user vector and the target user vector according to the candidate user vector and the target user vector;
and recommending friends according to the first potential nonlinear relation and the second potential nonlinear relation.
5. The friend recommendation method based on an attention mechanism as claimed in claim 4, wherein: the step of performing friend recommendation according to the first potential nonlinear relationship and the second potential nonlinear relationship comprises the following steps:
determining weights occupied by the first potential nonlinear relationship and the second potential nonlinear relationship;
outputting a prediction result through a prediction function according to the weight occupied by the first potential nonlinear relation and the second potential nonlinear relation;
and recommending friends according to the prediction result.
6. A friend recommendation system incorporating an attention mechanism, comprising:
the system comprises a characteristic extraction module, a characteristic extraction module and a characteristic extraction module, wherein the characteristic extraction module is used for extracting characteristics of a user pair to obtain multi-dimensional characteristic information, and the user pair comprises a target user and a candidate user;
the weighting module is used for dynamically weighting the multi-dimensional characteristic information through an attention mechanism to obtain an output result;
the recommendation module is used for recommending friends according to the output result;
the step of extracting the features of the user pair to obtain the multi-dimensional feature information comprises the following steps:
extracting academic features of the user pairs, combining the extracted academic features into an academic feature list, and obtaining multi-dimensional feature information, wherein the academic features comprise: attribute features, relationship features and text features;
the step of obtaining the output result by dynamically weighting the multidimensional characteristic information through the attention mechanism comprises the following steps:
converting academic features of the target user into low-dimensional dense target user vectors;
converting the academic feature list into a list vector;
obtaining the attention of the target user vector to the list vector;
and dynamically weighting the attention of the list vector and the attention of the target user vector to the list vector through an attention mechanism to obtain an output result.
7. A friend recommendation system incorporating an attention mechanism, comprising:
at least one processor;
at least one memory for storing at least one program;
when executed by the at least one processor, cause the at least one processor to implement the method for friend recommendation incorporating an attention mechanism as recited in any of claims 1-5.
8. A storage medium storing instructions executable by a processor, wherein: the processor, when executing the processor-executable instructions, performs the method of friend recommendation with attention mechanism as recited in any of claims 1-5.
CN201910608392.2A 2019-07-08 2019-07-08 Friend recommendation method, system and storage medium introducing attention mechanism Active CN110502701B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910608392.2A CN110502701B (en) 2019-07-08 2019-07-08 Friend recommendation method, system and storage medium introducing attention mechanism

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910608392.2A CN110502701B (en) 2019-07-08 2019-07-08 Friend recommendation method, system and storage medium introducing attention mechanism

Publications (2)

Publication Number Publication Date
CN110502701A CN110502701A (en) 2019-11-26
CN110502701B true CN110502701B (en) 2022-03-25

Family

ID=68585527

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910608392.2A Active CN110502701B (en) 2019-07-08 2019-07-08 Friend recommendation method, system and storage medium introducing attention mechanism

Country Status (1)

Country Link
CN (1) CN110502701B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026973B (en) * 2019-12-27 2023-04-18 支付宝(杭州)信息技术有限公司 Commodity interest degree prediction method and device and electronic equipment
CN112100514B (en) * 2020-08-31 2021-10-26 浙江工业大学 Friend recommendation method based on global attention mechanism representation learning
CN113486250B (en) * 2021-07-28 2023-09-05 中移(杭州)信息技术有限公司 Content recommendation method, device, equipment and computer readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105069122A (en) * 2015-08-12 2015-11-18 天津大学 Personalized recommendation method and recommendation apparatus based on user behaviors
CN107767279A (en) * 2017-10-12 2018-03-06 燕山大学 A kind of average weighted personalized friend recommendation method based on LDA
CN109410079A (en) * 2018-09-13 2019-03-01 清华大学 Social recommendation method and device under optimal Limited Attention power
CN109767301A (en) * 2019-01-14 2019-05-17 北京大学 Recommended method and system, computer installation, computer readable storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107145518B (en) * 2017-04-10 2020-04-14 同济大学 Personalized recommendation system based on deep learning in social network

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105069122A (en) * 2015-08-12 2015-11-18 天津大学 Personalized recommendation method and recommendation apparatus based on user behaviors
CN107767279A (en) * 2017-10-12 2018-03-06 燕山大学 A kind of average weighted personalized friend recommendation method based on LDA
CN109410079A (en) * 2018-09-13 2019-03-01 清华大学 Social recommendation method and device under optimal Limited Attention power
CN109767301A (en) * 2019-01-14 2019-05-17 北京大学 Recommended method and system, computer installation, computer readable storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"Friend recommendation techniques in social network";Arlina Dcunha等;《2015 International Conference on Communication,Information & Computing Technology》;20150223;1-4 *
"基于注意力机制与文本信息的用户关系抽取";赵赟等;《中文信息学报》;20190429;第33卷(第3期);87-93 *

Also Published As

Publication number Publication date
CN110502701A (en) 2019-11-26

Similar Documents

Publication Publication Date Title
CN110119467B (en) Project recommendation method, device, equipment and storage medium based on session
CN111428147B (en) Social recommendation method of heterogeneous graph volume network combining social and interest information
CN111541570B (en) Cloud service QoS prediction method based on multi-source feature learning
CN111797321B (en) Personalized knowledge recommendation method and system for different scenes
CN110781406B (en) Social network user multi-attribute inference method based on variational automatic encoder
CN110502701B (en) Friend recommendation method, system and storage medium introducing attention mechanism
CN109657156A (en) A kind of personalized recommendation method generating confrontation network based on circulation
CN114817663B (en) Service modeling and recommendation method based on class perception graph neural network
CN111046187B (en) Sample knowledge graph relation learning method and system based on confrontation type attention mechanism
CN110032679B (en) Dynamic news recommendation method based on hierarchical attention network
CN112287170B (en) Short video classification method and device based on multi-mode joint learning
CN110413888B (en) Book recommendation method and device
CN109871485A (en) A kind of personalized recommendation method and device
CN109101629A (en) A kind of network representation method based on depth network structure and nodal community
CN110245310B (en) Object behavior analysis method, device and storage medium
CN112016002A (en) Mixed recommendation method integrating comment text level attention and time factors
CN110489574A (en) A kind of multimedia messages recommended method, device and relevant device
CN112699310A (en) Cold start cross-domain hybrid recommendation method and system based on deep neural network
CN115409203A (en) Federal recommendation method and system based on model independent meta learning
CN115186197A (en) User recommendation method based on end-to-end hyperbolic space
CN113656699B (en) User feature vector determining method, related equipment and medium
CN111444399A (en) Reply content generation method, device, equipment and readable storage medium
CN113361928B (en) Crowd-sourced task recommendation method based on heterogram attention network
CN114676332A (en) Network API recommendation method facing developers
CN112364236A (en) Target object recommendation system, method and device, and data processing method and device

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
GR01 Patent grant
GR01 Patent grant