CN112732936B - Radio and television program recommendation method based on knowledge graph and user microscopic behaviors - Google Patents

Radio and television program recommendation method based on knowledge graph and user microscopic behaviors Download PDF

Info

Publication number
CN112732936B
CN112732936B CN202110033041.0A CN202110033041A CN112732936B CN 112732936 B CN112732936 B CN 112732936B CN 202110033041 A CN202110033041 A CN 202110033041A CN 112732936 B CN112732936 B CN 112732936B
Authority
CN
China
Prior art keywords
user
behavior
program
behaviors
microscopic
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.)
Expired - Fee Related
Application number
CN202110033041.0A
Other languages
Chinese (zh)
Other versions
CN112732936A (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.)
University of Electronic Science and Technology of China
Original Assignee
University of Electronic Science and Technology of China
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 University of Electronic Science and Technology of China filed Critical University of Electronic Science and Technology of China
Priority to CN202110033041.0A priority Critical patent/CN112732936B/en
Publication of CN112732936A publication Critical patent/CN112732936A/en
Application granted granted Critical
Publication of CN112732936B publication Critical patent/CN112732936B/en
Expired - Fee Related 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/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/36Creation of semantic tools, e.g. ontology or thesauri
    • G06F16/367Ontology
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/258Data format conversion from or to a database
    • 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/951Indexing; Web crawling techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/048Activation functions
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • Computing Systems (AREA)
  • Molecular Biology (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Evolutionary Computation (AREA)
  • Biophysics (AREA)
  • Animal Behavior & Ethology (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)

Abstract

The invention provides a radio and television program recommendation method based on a knowledge graph and user microscopic behaviors, which combines item2vec with random walk, trains a random walk sequence of an attribute subgraph and a user behavior sequence together, and obtains an embedded vector fusing similarity of two layers of program content attributes and user interaction sessions. Then, under the condition of obtaining program embedding and classified fusion microscopic behavior embedding, behavior embedding and corresponding program embedding are spliced according to historical interaction records of a user and a program, semantic representation of behaviors-programs with the same dimensionality is obtained through semantic space network mapping, and an embedding sequence of historical behaviors of the user is formed; and finally, performing self-attention coding mapping on the historical behavior sequence of the user based on a Transformer coding-decoding mechanism to obtain user semantic features implying dynamic preference, and decoding the user semantic feature mapping by using the attention of the target program to obtain the user semantic preference.

Description

Radio and television program recommendation method based on knowledge graph and user microscopic behaviors
Technical Field
The invention belongs to the technical field of radio and television program recommendation, and particularly relates to a radio and television program recommendation method based on a knowledge map and user microscopic behaviors.
Background
With the convergence of three network services of a telecommunication network, a broadcast network and a computer communication network, services provided by the broadcast network are richer and faster. Due to the increasing number of television channels and the advent of IPTV services and new media services, more and more television program content is available to users exposed to television terminals. However, such an excessive amount of television programming also places a burden on television viewers because searching for their favorite television programming content takes longer. The recommendation system can help users to efficiently screen out interesting information, and is beneficial to television audiences to conveniently and effectively obtain favorite program contents.
The algorithm research of the existing radio and television field recommendation system can be summarized into several main contents. One is a general recommendation method, including simple statistical algorithms and traditional collaborative filtering. From a user preference modeling perspective, these efforts have focused on mining static correlations between users and projects, ignoring dynamic changes in user preferences over time. Some studies have clustered television viewers according to the types of programs watched and then recommend the programs through collaborative filtering. Some researches set a program type threshold value according to an experience value to cluster television programs, and then perform user clustering according to indexes such as program types, time lengths and the like watched by users for collaborative filtering recommendation. And an implicit scoring function is set in part of research, the watching behavior of the user is converted into the scoring of the program by the user so as to provide a recommendation strategy, and a Hadoop distributed framework is realized. In part of researches, the watching time length of a user and the preference degree are considered to be in a direct proportion relationship, and sequencing recommendation is carried out.
Another content is to take into account the dynamic changes of the user's interest, and introduce a time decay function to characterize the drift of the user's interest over a time span. The time attenuation functions in the models are mostly subjective structures, the effects are different, and in a big data environment, the problems of data sparseness and cold start are faced. Some studies have introduced a time decay function in the underlying factorial model, making the factorization result time dependent. Some researches set a time period function and establish attenuation factors to simulate the interest change of users.
Still another content is to recommend items of interest to a user based on sequence pattern mining, these sequence-based models equate the interaction sequence of user items to the behavior of the user, and ignore the various behavior types of the user, do not consider the user interest differences implied by the different feedback behaviors of the user to the goods, and these works obtain the embedding of items from the aspect of characteristics when mining the dynamic changes of the user preferences often ignore the inherent relation of content attributes between items.
Disclosure of Invention
Aiming at the problems that in the prior art, various behavior types of users are ignored, user interest differences implied by different feedback behaviors of the users are not considered, and when dynamic changes of user preferences are mined, the problem that the intrinsic relation of content attributes among items is often ignored when items are embedded from the aspect of characteristics is obtained, the invention provides a radio and television program recommendation method based on a knowledge graph and user microscopic behaviors, a random walk sequence obtained by a knowledge graph attribute subgraph is trained together with a user behavior sequence based on conversation by combining item2vec and random walk, and the embedded vector obtained by training integrates the similarity of two levels of program content attributes and user interaction sessions. Then, under the condition of obtaining program embedding and classified fusion microscopic behavior embedding, program embedding and splicing corresponding behaviors according to historical interaction records of a user and a program, and obtaining semantic representation of each behavior-program with the same dimensionality through semantic space network mapping to form an embedding sequence of the historical behaviors of the user; and finally, performing self-attention coding mapping on the historical behavior sequence of the user based on a Transformer coding-decoding mechanism to obtain user semantic features with implicit dynamic preference, and decoding the user semantic feature mapping by using the attention of the target program to obtain the user semantic preference. The invention realizes the content recommendation which is more deeply related to the user behavior, the program content attribute and other parties through the operation, and the recommendation is closer to the interest and the preference of the user.
The specific implementation content of the invention is as follows:
the invention provides a radio and television program recommendation method based on a knowledge graph and user microscopic behaviors, which specifically comprises the following steps of:
step S1: constructing a knowledge graph in the field of broadcasting and television;
step S2: combing user microscopic behavior data: dividing behavior interaction data of a user into continuous microscopic behaviors and discrete microscopic behaviors according to behavior duration;
step S3: extracting the attribute subgraph of the knowledge graph in the broadcasting and television field constructed in the step S1, and extracting random walk programs according to the attribute subgraph in a random walk modeA sequence Q; extracting a random walk sequence Q from one attribute subgraph, wherein the random walk sequences Q of all the attribute subgraphs form an item sequence set Hk
Step S4: constructing a time session-behavior type matrix by using the behavior interaction data of the user, which is combed in the step S2, and calculating the session similarity; finally, extracting a user interactive program sequence H based on the conversation;
step S5: collecting the item sequence H obtained in step S3kThe user interactive program sequence H obtained in the step S4 is used as the input of an Item2vec algorithm together, and program embedding is obtained through training;
step S6: generating user microscopic behavior embedding according to the behavior interaction data of the user combed in the step S2; then according to the historical interactive record of the user and the program, splicing the user microscopic behavior embedding and the corresponding program embedding, and generating semantic representation of each behavior-program with the same dimensionality through semantic space network mapping, wherein the semantic representations of all the behaviors-programs form an embedding sequence of the user historical behaviors, namely a user-behavior potential semantic sequence;
step S7: and (3) carrying out user dynamic preference learning based on a transformer mechanism: the transform mechanism comprises a self-attention mechanism and a common attention mechanism based on a multi-head attention mechanism, wherein the self-attention mechanism is used for learning the relevance of each item in a user-behavior latent semantic sequence to obtain the latent semantic features of a user, the common attention mechanism is used for decoding the latent semantic features of the user according to a target program to obtain the semantic preference of the user, and the program recommendation is performed on the user according to the semantic preference of the user.
In order to better implement the present invention, further, the specific operation of step S3 includes:
step S3.1: determining the attributes of the radio and television programs, and querying knowledge map information by using spark ql triple query statements according to the attribute keywords to form a plurality of attribute sub-graphs based on the attributes; the attributes comprise director, actors, language, genre, drama, region;
step S3.2: at each attribute subgraphRandom walk is carried out, a random walk sequence Q is generated, and all the obtained random walk sequences Q jointly form a project sequence set Hk={Q1,Q2,...,QnIn which Qi={x1,x2,...,xnDenotes a random walk sequence generated, i ═ 1,2, 3.., n;
in the process of random walk, given the starting node as v and the ith node as ci,c0The probability of random walk is:
Figure GDA0003494316220000031
therein, IIvxIs the unnormalized transition probability between node v and node x, z is the normalization constant; n shapevxBy entity edge weight wvxMultiplied by a coefficient, expressed as:
vx=αpq(t,x)·wvx
wherein the coefficient alphapqThe formula for the calculation of (t, x) is:
Figure GDA0003494316220000032
at the coefficient alphapq(t, x) in the calculation formula, t represents the previous node of the random walk, x represents the next node of the random walk, and the walk of the depth and the extent is controlled by the values of p and q; dtxRepresenting the shortest distance between node t and node x.
In order to better implement the present invention, further, the step S4 specifically includes the following steps:
step S4.1: constructing a time session-behavior type matrix: assuming that the length of the historical interaction sequence of a user is h, the number of behavior types is n, and the number of programs interacted per session is k, the historical interaction record of the user contains m-h/k sessions, and the time period of each session is tiI 1, 2.. times.m, thenTo form the temporal session-behavior type matrix TSA as:
Figure GDA0003494316220000041
namely: TSA ═ xij}m×n,1≤i≤m,1≤j≤n;
Wherein x isijIs shown over a time period tiIn the method, the microscopic behaviors of a user in the ith conversation are the frequency of j, m and n are rows and columns of a matrix respectively and respectively represent the number of conversations and the number of behavior types divided according to a certain conversation length k;
step S4.2: first, a time period t is calculated from a time session-behavior type matrixiAnd a time period tjDegree of similarity of behaviors between
Figure GDA0003494316220000042
The specific calculation formula is as follows:
Figure GDA0003494316220000043
wherein a is a behavior type, A is a behavior type set,
Figure GDA0003494316220000044
represents tiThe frequency of the user generating behavior type a in the session s in the time period is equivalent to x in the TSA matrixij
Then, the time period t is calculatediAnd time period tjThe interval between dist (t)i,tj) The specific calculation formula is as follows:
Figure GDA0003494316220000045
then, calculating the similarity of the session i and the session j, wherein the specific calculation formula is as follows:
Figure GDA0003494316220000046
step S4.3: combing out a user interactive program sequence, dividing conversations according to the time increasing direction, and sequentially calculating the similarity between adjacent conversations, wherein the calculation formula of the superposition sum of the conversation similarities is as follows:
Figure GDA0003494316220000051
wherein m is the number of sessions divided according to a certain session length k, and if the threshold of the session similarity superposition sum is Y, k when sum (se) of user u is greater than Y is taken as the session length of the user, and the interactive program sequence H of the user is extracted as { S ═ S {1,S2,...Sn}。
In order to better implement the present invention, further, the specific operations of step S6 are:
step S6.1: calculating the user microscopic behavior weight:
firstly, setting N user micro behaviors obtained in the step S2, wherein the N user micro behaviors comprise a continuous micro behavior and a discrete micro behavior; the total times of the micro-behaviors of each user are respectively marked as A1,A2,...,AN
Secondly, respectively calculating the normalization weight a corresponding to each user micro-behavior type1,a2,...,aNThe specific calculation formula is as follows:
Figure GDA0003494316220000052
Figure GDA0003494316220000053
step S6.2: obtaining a type vector vec (a) of the user's microscopic behaviorg): for user microscopic behavior, one-hot coding is used as perAn implicit feedback action obtains a vector representation, and the formula is as follows:
vec(ag)∈R|A| g=1,2,...,|A|
step S6.3: obtaining a duration long vector representation vec (a) of the microscopic behavior of the userd):
For the continuous microscopic behaviors, the continuous microscopic behaviors in the program are divided into [0.0.1 ], [0.1, 0.2 ], [0.2, 0.3 ], and [0.9, 1 ] according to the proportion of the continuous microscopic behaviors of the user in the program to the total time length of the program]For a total of ten levels, a one-hot encoding is used to generate a vector representation vec (a) for the microscopic behavior times of the ten levelsd) And vec (a)d)∈R10
For discrete microscopic behaviors, all-zero equal-length vectors are used for space occupation to generate a vector representation vec (a)d) And vec (a)d)=[0,0,0,...,0];
Step S6.4: vectorizing the user microscopic behaviors of the user u on the program i, wherein the vectorizing is represented as:
vec(au,i)=ai·vec(ag)+vec(ad)
the "+" sign in the formula denotes the join operation of the vector, aiFor microscopic behavioral weighting, vec (a)g) Type vector for microscopic behavior, vec (a)d) A duration vector for the microscopic behavior;
step S6.5: time coding is carried out, continuous time is discretized, then embedding of time is obtained, and a model is introduced for training and learning:
for continuous microscopic behavior: firstly, extracting the historical behavior interaction sequence of the user
Figure GDA0003494316220000061
Then the historical behaviors are interacted with sequences
Figure GDA0003494316220000062
Is extracted as T ═ T1,t2,t3...]Setting the time stamp of the clicked target program as tp
Then, time interval sequence T between the target program and the historical interactive program of the user is calculatedΔThe specific calculation formula is as follows:
TΔ=[tp-t1,tp-t2,tp-t3,...]=[Δt1,Δt2,Δt3,...];
for discrete microscopic behavior: a discretized time interval is defined, denoted as [0, 1), [1, 2, [2, 4 ]k,2k+1) ,..; wherein each time interval is in units of hours, and T isΔEach item of (a) is mapped into a discrete time interval and then mapped into a one-hot code, and a time code vec (t) of the item interaction behavior is obtainedi);
Step S6.6: performing behavior semantic space embedding: defining user behavior u on the basis of obtaining different behavior representations, item embedding and time codingiThe behavior of user u on item i is represented as:
ui=vec(au,i)+vec(xi)+vec(ti);
wherein, vec (x)i) Representing the adoption of the behavior a by the user uu,iEmbedded representation of interaction with item i, vec (x)i) Project embedding for fusing knowledge-graph and user interaction features, vec (t)i) For temporal coding of behaviors, "+" in the formula represents the join operation of vectors; and then, calculating the user-behavior sequence according to the following formula:
Figure GDA0003494316220000071
in the formula (d)xRepresents the dimension size, | L | represents the length of the user-behavior sequence;
then, a user-behavior sequence L is formed by adopting a full connection layeruConversion into user-behavior latent semantic sequences
Figure GDA0003494316220000072
The specific conversion formula is as follows:
Bu=στ(WτL+bτ);
wherein, WτAnd bτFor weights and offsets of fully connected layers, στIs an activation function.
In order to better implement the present invention, further, the step S7 specifically includes the following steps:
step S7.1: carrying out matrix calculation on potential semantic features U of the user, wherein the specific calculation method comprises the following steps:
Figure GDA0003494316220000073
wherein Self _ Attention represents the Self-Attention mechanism operation, BuFor the user-behavior latent semantic sequence, the sequence length is set to be S, the embedding dimension of each item is K, and then Bu∈RS×K(ii) a In the formula
Figure GDA0003494316220000074
Softmax is a function for making the attention score of the generation between 0 and 1, a self-set constant term for avoiding the generation of an excessive value;
step S7.2: user semantic preference B for users using a common attention mechanismembAnd (3) performing matrix calculation, wherein a specific calculation formula is as follows:
Figure GDA0003494316220000075
wherein, Attention represents a common Attention mechanism, U is a potential semantic feature of a user, and U belongs to RS×KTerm of constant
Figure GDA0003494316220000076
And in order to avoid generating excessive values, P is the embedding of the fused knowledge base map and the user interaction characteristics of the target program.
In order to better implement the present invention, in step S7, after step S7.2 is performed, the following operations are performed:
step S7.3: and (3) carrying out nonlinear processing: after the calculation of the self-attention mechanism and the ordinary attention mechanism is carried out, the calculation of a point type feedforward network is added, and the calculation specifically comprises the following steps:
for the point feed-forward network calculation with increased self-attention mechanism:
U=Normalize(Conv1D(Conv1D(U))+U);
wherein normaize is a normalization operation for solving the gradient vanishing problem, and Conv1D represents a one-dimensional convolution network; carrying out nonlinear mapping on the U twice through two layers of convolution networks; u on the left side of the equation in the formula is a potential semantic feature of the user after point feed-forward, and U on the right side of the equation is a potential semantic feature of the user before television feed-forward;
the point feed-forward network for the general attention mechanism addition is calculated as: the structure of the point type feedforward network after the ordinary attention calculation is the same as that of the point type feedforward network added by the self-attention mechanism;
a residual error network for preventing the loss of original information is added after the output of the multi-head attention mechanism and the point type feedforward network, and normalization processing is carried out after the residual error network is passed during calculation;
step S7.4: after the semantic preference vector of the user is obtained, calculating the probability of interaction between the user u and the candidate item v through a prediction function g, wherein the specific calculation formula is as follows:
pu,v=σ(g(Bemb,τv));
the prediction function g is an inner product or an L-layer perceptron; b isembFor semantic preferences of user u, τvIs the embedding of the fused knowledge-graph and the user interaction characteristics of the candidate program v.
In order to better implement the present invention, further, after step S7 is performed, the following steps are also required:
step S8: model training and optimization: training and optimizing an algorithm model by adopting a sigmoid cross entropy loss function, wherein a specific calculation formula is as follows:
Figure GDA0003494316220000081
where u denotes all instances of training users, yi1 denotes a positive example, i.e. the user has interacted with the program, yi0 represents a negative example, i.e. the user has not found an interaction with the program; p is a radical ofu,v∈[0,1]Is the output of the model, representing the click rate of the user; the optimization process of the above model is the process of minimizing the above loss function.
In order to better implement the present invention, further, the specific operations of step S1 are:
the method comprises the steps of forming structured data through entity alignment by crawling network resources of the broadcasting and television programs, and completing ontology construction by utilizing an ontology modeling tool prot g; after the ontology is constructed, the data originally stored in the relational database is converted into a corresponding rdf format by using d2rq, and then the rdf format is stored in a graph database mode, so that the construction of the knowledge graph in the field of broadcasting and television is completed.
In order to better realize the invention, further, when the knowledge map in the field of broadcasting and television is constructed, the knowledge map is constructed in a top-down mode, a data mode is constructed from the topmost concept, the data mode is gradually refined downwards, a taxonomy level with clear structure and clear logic is formed, and the ontology construction is completed; in the body construction, the concept layer inherits the type of the event, such as region, character, type, program and language; the top-level concept of the object attribute comprises program category, program origin, character home country, participation, actor, director, drama editor and program language; the top-level concept of the data attribute includes a region number, a region name, a character birthday, a character foreign language name, a character gender, a character number, a character name, a kind number, a kind name, a program number, a program rating, a program release date, a program introduction, a program name, a language number, and a language name.
In order to better implement the present invention, further, the specific operations of step S2 are: dividing behavior interaction data of a user into continuous microscopic behaviors and discrete microscopic behaviors according to behavior duration; the continuous microscopic behaviors are user behaviors which can last for a certain time, and comprise live watching, on-demand watching and search watching behaviors; the discrete microscopic behaviors are user behaviors which only occur at a certain moment, and comprise purchasing, collecting and praise behaviors; and collecting data detected by a background of the radio and television system to form structured data for recording a user number, a media asset number, a behavior type, a behavior timestamp and a behavior duration, wherein the behavior duration of the continuous microscopic behavior is a corresponding effective value, and the behavior duration of the discrete behavior type is null.
Compared with the prior art, the invention has the following advantages and beneficial effects:
(1) by adopting the mode of the migration attribute subgraph, the programs which have an association relation based on a certain attribute can more easily migrate to form a path, and the extracted program sequences can more reflect the similarity based on the attribute among the programs. Node2vec has two modes of breadth traversal and depth traversal, and can well extract the homogeneity and isomorphism between entities; making the recommendation of programs implicitly more relevant;
(2) considering that the behavior patterns of the users in each session keep statistical similarity, dividing the session time window according to the behavior pattern similarity of the users in a certain time period, so that the time window of each user is divided based on the behavior pattern of the user, and the consistency of the interactive behavior is fully considered;
(3) the project embedding obtained by extracting the sequence through the knowledge map attribute subgraph, the similarity of the content of the project is considered from the project attribute level, the similarity of the project is considered from the interaction context level based on the project embedding obtained by the user interaction sequence of the conversation, the fusion of the project embedding and the project embedding makes up the defect that the sequence embedding is less and the information of the content of the project is considered, and the individuation of the interaction sequence conversation is enhanced;
(4) the method comprises the steps of dividing microscopic behaviors of a user into continuous behaviors and discrete behaviors, fusing and projecting the behaviors to a common potential semantic space for recommendation after different vectorization is carried out, and enabling an algorithm to capture the influence of different behaviors on user preference. On one hand, the user interest degrees of the discrete behaviors such as collection, praise and purchase and the like are different from the user interest degrees of the continuous behaviors such as live broadcast watching and on-demand watching, and the behaviors are different in nature and need different vectorization modes. On the other hand, for the behaviors of live broadcast watching, on-demand watching and the like which are continuous behaviors, the user interest degrees reflected by different behavior durations are also different. Analyzing the microscopic behaviors of the user from a qualitative aspect and a quantitative aspect, and performing vectorization fusion, so that the user interest difference implied by different microscopic feedback behaviors of the user on the program can be reflected;
(5) by calculating the weight of the microscopic behaviors in the existing scene, the user interest degree of the microscopic behaviors based on the property level can be obtained, and the vectorization of the microscopic behaviors obtained based on the property level is corrected;
(6) time coding is introduced, coding is carried out by considering the difference between the interaction time of the target program and the program interaction time in the historical interaction sequence, and time drift of the sequence can be well modeled;
(7) the finally obtained semantic preference of the user implies attribute-based information of the item side in the historical interaction of the user, session context-based information, interactive microscopic behavior information and interactive time information, and well describes the dynamic preference of the user;
(8) and training and optimizing the model through the sigmoid cross entropy loss function, so that the algorithm is more accurate.
Drawings
FIG. 1 is a schematic flow diagram of the present invention;
FIG. 2 is a conceptual schematic diagram of a knowledge-graph according to the present invention.
Detailed Description
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all embodiments, and therefore should not be considered as a limitation to the scope of protection. All other embodiments, which can be obtained by a person skilled in the art without any inventive step based on the embodiments of the present invention, are within the scope of the present invention.
In the description of the present invention, it is to be noted that, unless otherwise explicitly specified or limited, the terms "disposed," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
Example 1:
the invention provides a radio and television program recommendation method based on a knowledge graph and user microscopic behaviors, which specifically comprises the following steps as shown in figure 1:
step S1: constructing a knowledge graph in the field of broadcasting and television;
step S2: combing user microscopic behavior data: dividing behavior interaction data of a user into continuous microscopic behaviors and discrete microscopic behaviors according to behavior duration;
step S3: extracting the attribute subgraph of the knowledge graph in the broadcasting and television field constructed in the step S1, and extracting a random walk program sequence Q according to the attribute subgraph in a random walk mode; extracting a random walk sequence Q from one attribute subgraph, wherein the random walk sequences Q of all the attribute subgraphs form an item sequence set Hk
Step S4: constructing a time session-behavior type matrix by using the behavior interaction data of the user, which is combed in the step S2, and calculating the session similarity; finally, extracting a user interactive program sequence H based on the conversation;
step S5: collecting the item sequence H obtained in step S3kThe user interactive program sequence H obtained in the step S4 is used as the input of an Item2vec algorithm together, and program embedding is obtained through training;
step S6: generating user microscopic behavior embedding according to the behavior interaction data of the user combed in the step S2; then according to the historical interactive record of the user and the program, splicing the user microscopic behavior embedding and the corresponding program embedding, and generating semantic representation of each behavior-program with the same dimensionality through semantic space network mapping, wherein the semantic representations of all the behaviors-programs form an embedding sequence of the user historical behaviors, namely a user-behavior potential semantic sequence;
step S7: and (3) carrying out user dynamic preference learning based on a transformer mechanism: the transform mechanism comprises an attention mechanism and a common attention mechanism based on a multi-head attention mechanism, wherein the attention mechanism is used for learning the correlation of each item in a user-behavior latent semantic sequence to obtain the latent semantic features of a user, then the common attention mechanism is used for decoding the latent semantic features of the user according to a target program to obtain the semantic preference of the user, and the program recommendation is carried out on the user according to the semantic preference of the user;
step S8: model training and optimization: and training and optimizing an algorithm model by adopting a sigmoid cross entropy loss function.
The working principle is as follows: the invention provides a radio and television content recommendation method based on a knowledge graph and user microscopic behaviors, which mainly comprises three parts: program embedding, user micro-behavior embedding, and user dynamic preference learning. The item2vec and the random walk are combined, a random walk sequence obtained by a knowledge map attribute subgraph and a user behavior sequence based on conversation are trained together, and an embedded vector obtained by training combines the similarity of two levels of program content attributes and user interaction conversation. Then, under the condition of obtaining program embedding and classified fusion microscopic behavior embedding, program embedding and splicing corresponding behaviors according to historical interaction records of users and programs, semantic representation of each behavior-program with the same dimensionality is obtained through semantic space network mapping, and an embedding sequence of historical behaviors of the users is formed. Wherein, in consideration of the time sequence of the user behavior sequence, the time coding is also introduced at the user behavior embedding layer in the subsequent embodiment. And finally, performing self-attention coding mapping on the historical behavior sequence of the user based on a transform coding-decoding mechanism to obtain user semantic features with implicit dynamic preference, and decoding the user semantic feature mapping by using the attention of the target program to obtain a user semantic expression vector. And calculating the product of the user semantic expression vector obtained by the text and the target program to predict the click rate. Meanwhile, in step S5, the program sequences obtained in step S3 and step S4 are combined together to be used as the input of item2vec, and finally the embedding vector of the item is obtained. The project embedding obtained through the knowledge map attribute subgraph extraction sequence considers the similarity of the contents of the project from the project attribute level, the project embedding obtained based on the user interaction sequence of the conversation considers the similarity of the projects from the interaction context level, the fusion of the project embedding and the user interaction sequence makes up the defect that the sequence embedding considers the content information of the project less, and the individuation of the interaction sequence conversation is enhanced.
Example 2:
in this embodiment, on the basis of the above embodiment 1, in order to better implement the present invention, as shown in fig. 2, the specific operations are as follows:
step S1: constructing a knowledge graph in the field of broadcasting and TV: the method comprises the steps of forming structured data through entity alignment by crawling network resources of the broadcasting and television programs, and completing ontology construction by utilizing an ontology modeling tool prot g; after the ontology is constructed, the data originally stored in the relational database is converted into a corresponding rdf format by using d2rq, and then the rdf format is stored in a graph database mode, so that the construction of the knowledge graph in the field of broadcasting and television is completed.
In order to better realize the invention, further, when the knowledge map in the field of broadcasting and television is constructed, the knowledge map is constructed in a top-down mode, a data mode is constructed from the topmost concept, the data mode is gradually refined downwards, a taxonomy level with clear structure and clear logic is formed, and the ontology construction is completed; in the body construction, the concept layer inherits the type of the event, such as region, character, type, program and language; the top-level concept of the object attribute comprises program category, program origin, character home country, participation, actor, director, drama editor and program language; the top-level concept of the data attribute includes a region number, a region name, a character birthday, a character foreign language name, a character gender, a character number, a character name, a kind number, a kind name, a program number, a program rating, a program release date, a program introduction, a program name, a language number, and a language name.
Other parts of this embodiment are the same as those of embodiment 1, and thus are not described again.
Example 3:
in this embodiment, on the basis of any one of the above embodiments 1-2, in order to better implement the present invention, further, the specific operation of step S2 is: dividing behavior interaction data of a user into continuous microscopic behaviors and discrete microscopic behaviors according to behavior duration; the continuous microscopic behaviors are user behaviors which can last for a certain time, and comprise live watching, on-demand watching and search watching behaviors; the discrete microscopic behaviors are user behaviors which only occur at a certain moment, and comprise purchasing, collecting and praise behaviors; and collecting data detected by a background of the radio and television system to form structured data for recording a user number, a media asset number, a behavior type, a behavior timestamp and a behavior duration, wherein the behavior duration of the continuous microscopic behavior is a corresponding effective value, and the behavior duration of the discrete behavior type is null.
Other parts of this embodiment are the same as any of embodiments 1-2 described above, and thus are not described again.
Example 4:
in this embodiment, on the basis of any one of the foregoing embodiments 1 to 3, in order to better implement the present invention, further, the specific operation of step S3 includes:
step S3.1: determining the attributes of the radio and television programs, and querying knowledge map information by using spark ql triple query statements according to the attribute keywords to form a plurality of attribute sub-graphs based on the attributes; the attributes comprise director, actors, language, genre, drama, region;
step S3.2: random walk is carried out in each attribute subgraph to generate a random walk sequence Q, and all the obtained random walk sequences Q jointly form an item sequence set Hk={Q1,Q2,...,QnIn which Qi={x1,x2,...,xnDenotes a random walk sequence generated, i ═ 1,2, 3.., n;
in the process of random walk, given the starting node as v and the ith node as ci,c0The probability of random walk is:
Figure GDA0003494316220000131
therein, IIvxIs the unnormalized transition probability between node v and node x, z is the normalization constant; n shapevxBy entity edge weight wvxMultiplied by a coefficient, expressed as:
vx=αpq(t,x)·wvx
wherein the coefficient alphapqThe formula for the calculation of (t, x) is:
Figure GDA0003494316220000132
at the coefficient alphapq(t, x) in the calculation formula, t represents the previous node of the random walk, x represents the next node of the random walk, and the walk of the depth and the extent is controlled by the values of p and q; dtxRepresenting the shortest distance between node t and node x.
The working principle is as follows: and (4) extracting an attribute sub-graph corresponding to each attribute by using the knowledge graph in the step (S1), and extracting a wandering program sequence on each attribute sub-graph in a Node2vec random wandering mode. By adopting the mode of the migration attribute subgraph, the programs which have an association relation based on a certain attribute can more easily migrate to form a path, and the extracted program sequences can more reflect the similarity based on the attribute among the programs. Node2vec has two modes of breadth traversal and depth traversal, and can well extract the homogeneity and isomorphism between entities.
Other parts of this embodiment are the same as any of embodiments 1 to 3, and thus are not described again.
Example 5:
in this embodiment, on the basis of any one of the foregoing embodiments 1 to 4, in order to better implement the present invention, further, the step S4 specifically includes the following steps:
step S4.1: constructing a time session-behavior type matrix: assuming that the length of the historical interaction sequence of a user is h, the number of behavior types is n, and the number of programs interacted per session is k, the historical interaction record of the user contains m-h/k sessions, and the time period of each session is tiI 1, 2.. m, then a temporal session-behavior type matrix TSA may be formed as:
Figure GDA0003494316220000141
namely: TSA ═ xij}m×n,1≤i≤m,1≤j≤n;
Wherein x isijIs shown over a time period tiIn the method, the microscopic behaviors of a user in the ith conversation are the frequency of j, m and n are rows and columns of a matrix respectively and respectively represent the number of conversations and the number of behavior types divided according to a certain conversation length k;
step S4.2: first, a time period t is calculated from a time session-behavior type matrixiAnd a time period tjDegree of similarity of behaviors between
Figure GDA0003494316220000142
The specific calculation formula is as follows:
Figure GDA0003494316220000143
wherein a is a behavior type, A is a behavior type set,
Figure GDA0003494316220000144
represents tiThe frequency of the user generating the behavior type a in the session s in the time period is equivalent toX in TSA matrixij
Then, the time period t is calculatediAnd time period tjThe interval between dist (t)i,tj) The specific calculation formula is as follows:
Figure GDA0003494316220000145
then, calculating the similarity of the session i and the session j, wherein the specific calculation formula is as follows:
Figure GDA0003494316220000146
step S4.3: combing out a user interactive program sequence, dividing conversations according to the time increasing direction, and sequentially calculating the similarity between adjacent conversations, wherein the calculation formula of the superposition sum of the conversation similarities is as follows:
Figure GDA0003494316220000151
wherein m is the number of sessions divided according to a certain session length k, and if the threshold of the session similarity superposition sum is Y, k when sum (se) of user u is greater than Y is taken as the session length of the user, and the interactive program sequence H of the user is extracted as { S ═ S {1,S2,...Sn}。
The working principle is as follows: using the user interaction data in step S2, a session-based user interaction program sequence is extracted. As the user interacts with the program content, the user's viewing history forms a sequence that advances in time, and the sequence grows longer and longer. It is clearly undesirable to capture the interaction context information of an item using the entire interaction sequence of the user. Firstly, the user's interests change over time, and secondly, the computational and space costs associated with large amounts of data are too high. And extracting a user interaction sequence in a session-based mode by considering that the interest of the user is stable and the correlation existing between the interactive items is higher in a certain time. The general solution is to set a fixed time window, the fixed time window includes two types of fixed time length and fixed interactive item number, the time window is slid on the behavior interactive sequence of the user, and only the user interactive items in the time window are extracted each time. In fact, the interaction of the users is not as dense, and the size setting of the time window should be different. Considering that the behavior patterns of the users in each session keep statistical similarity, the session time windows are divided according to the behavior pattern similarity of the users in a certain time period, so that the time window of each user is divided based on the behavior pattern of the user, and the consistency of the interactive behavior is fully considered.
Other parts of this embodiment are the same as any of embodiments 1 to 4, and thus are not described again.
Example 6:
in this embodiment, on the basis of any one of the above embodiments 1 to 5, in order to better implement the present invention, further, the specific operation of step S6 is:
step S6.1: calculating the user microscopic behavior weight:
firstly, setting N user micro behaviors obtained in the step S2, wherein the N user micro behaviors comprise a continuous micro behavior and a discrete micro behavior; the total times of the micro-behaviors of each user are respectively marked as A1,A2,…,AN
Secondly, respectively calculating the normalization weight a corresponding to each user micro-behavior type1,a2,…,aNThe specific calculation formula is as follows:
Figure GDA0003494316220000161
Figure GDA0003494316220000162
step S6.2: obtaining a type vector vec (a) of the user's microscopic behaviorg): for use ofAnd (3) user microscopic behaviors, obtaining a vector representation for each implicit feedback behavior by using one-hot coding, wherein the formula is as follows:
vec(ag)∈R|A| g=1,2,…,|A|
step S6.3: obtaining a duration long vector representation vec (a) of the microscopic behavior of the userd):
For the continuous microscopic behaviors, the continuous microscopic behaviors in the program are divided into [0.0.1 ], [0.1, 0.2 ], [0.2, 0.3 ], and [0.9, 1 ] according to the proportion of the continuous microscopic behaviors of the user in the program to the total time length of the program]For a total of ten levels, a one-hot encoding is used to generate a vector representation vec (a) for the microscopic behavior times of the ten levelsd) And vec (a)d)∈R10
For discrete microscopic behaviors, all-zero equal-length vectors are used for space occupation to generate a vector representation vec (a)d) And vec (a)d)=[0,0,0,...,0];
Step S6.4: vectorizing the user microscopic behaviors of the user u on the program i, wherein the vectorizing is represented as:
vec(au,i)=ai·vec(ag)+vec(ad)
the "+" sign in the formula denotes the join operation of the vector, aiFor microscopic behavioral weighting, vec (a)g) Type vector for microscopic behavior, vec (a)d) A duration vector for the microscopic behavior;
step S6.5: time coding is carried out, continuous time is discretized, then embedding of time is obtained, and a model is introduced for training and learning:
for continuous microscopic behavior: firstly, extracting the historical behavior interaction sequence of the user
Figure GDA0003494316220000163
Then the historical behaviors are interacted with sequences
Figure GDA0003494316220000164
Is extracted as T ═ T1,t2,t3...]Setting target program destinationTime stamp of hit is tp
Then, time interval sequence T between the target program and the historical interactive program of the user is calculatedΔThe specific calculation formula is as follows:
TΔ=[tp-t1,tp-t2,tp-t3,...]=[Δt1,Δt2,Δt3,...];
for discrete microscopic behavior: a discretized time interval is defined, denoted as [0, 1), [1, 2, [2, 4 ]k,2k+1) ,..; wherein each time interval is in units of hours, and T isΔEach item of (a) is mapped into a discrete time interval and then mapped into a one-hot code, and a time code vec (t) of the item interaction behavior is obtainedi) (ii) a For example, if the time interval between the target program and a historical interactive program is 0.5 hours, the time code of the historical interactive movie is [1, 0, 0.,. 0 ]]。
Step S6.6: performing behavior semantic space embedding: defining user behavior u on the basis of obtaining different behavior representations, item embedding and time codingiThe behavior of user u on item i is represented as:
ui=vec(au,i)+vec(xi)+vec(ti);
wherein, vec (x)i) Representing the adoption of the behavior a by the user uu,iEmbedded representation of interaction with item i, vec (x)i) Project embedding for fusing knowledge-graph and user interaction features, vec (t)i) For temporal coding of behaviors, "+" in the formula represents the join operation of vectors; and then, calculating the user-behavior sequence according to the following formula:
Figure GDA0003494316220000171
in the formula (d)xRepresents the dimension size, | L | represents the length of the user-behavior sequence;
then, one full connection layer is adopted to connect the user to the lineIs a sequence LuConversion into user-behavior latent semantic sequences
Figure GDA0003494316220000172
The specific conversion formula is as follows:
Bu=στ(WτL+bτ);
wherein, WτAnd bτFor weights and offsets of fully connected layers, στIs an activation function.
The working principle is as follows: in a recommendation scene in the field of broadcasting and television, a user does not display a score, and user-item interactions collected by a back-end system are a series of microscopic feedback behaviors (such as browsing, watching, collecting and the like) with heterogeneity, ambiguity and dynamics. Based on the characteristics of the scene application, different from a method for visually weighting or converting behaviors into scores, the method divides the microscopic behaviors of the user into continuous behaviors and discrete behaviors, performs different vectorization, fuses and projects the behaviors to a common potential semantic space for recommendation, and enables an algorithm to capture the influence of different behaviors on the preference of the user. On one hand, the user interest degrees of the discrete behaviors such as collection, praise and purchase and the like are different from the user interest degrees of the continuous behaviors such as live broadcast watching and on-demand watching, and the behaviors are different in nature and need different vectorization modes. On the other hand, for the behaviors of live broadcast watching, on-demand watching and the like which are continuous behaviors, the user interest degrees reflected by different behavior durations are also different. The microscopic behaviors of the user are analyzed from the qualitative aspect and the quantitative aspect, vectorization fusion is carried out, and the user interest difference implied by different microscopic feedback behaviors of the program by the user can be reflected. By calculating the weight of the microscopic behaviors in the existing scene, the user interest degree of the microscopic behaviors based on the property level can be obtained, and the vectorization of the microscopic behaviors obtained based on the property level is corrected. Time coding is introduced, coding is carried out by considering the difference between the interaction time of the target program and the program interaction time in the historical interaction sequence, and time drift of the sequence can be well modeled. For continuous behaviors such as on-demand watching and live watching, the user behavior accounts for the program in the program timeThe proportion of the total time length is divided into [0.0.1 ], [0.1, 0.2 ], [0.9, 1 ]]Then using one-hot coding to obtain a vector representation, namely vec (a), for the microscopic behavior time of the ten levelsd)∈R10. For continuous behaviors, different continuous time length vectors represent different interestingness implied by the duration of the user behavior, and the longer the program watching time length is, the more interesting the user is for the program is reflected. For the continuous duration representation of discrete behaviors such as collection, praise and the like, all-zero equal-length vectors are adopted for carrying out occupation, namely vec (a)d)=[0,0,0,...,0]. For discrete behavior, the measure of user preference is the behavior type itself, such as two behaviors of a program collection or praise, representing different interests of the user in the program. The all-zero vector has no excessive information, and the occupation alignment is convenient for subsequent model training.
Other parts of this embodiment are the same as any of embodiments 1 to 5, and thus are not described again.
Example 7:
in this embodiment, on the basis of any one of the foregoing embodiments 1 to 6, in order to better implement the present invention, further, the step S7 specifically includes the following steps:
step S7.1: carrying out matrix calculation on potential semantic features U of the user, wherein the specific calculation method comprises the following steps:
Figure GDA0003494316220000181
wherein Self _ Attention represents the Self-Attention mechanism operation, BuFor the user-behavior latent semantic sequence, the sequence length is set to be S, the embedding dimension of each item is K, and then Bu∈RS×K(ii) a In the formula
Figure GDA0003494316220000182
Softmax is a function for making the attention score of the generation between 0 and 1, a self-set constant term for avoiding the generation of an excessive value;
step S7.2: by applying common attentionUser semantic preference of force mechanism to user BembAnd (3) performing matrix calculation, wherein a specific calculation formula is as follows:
Figure GDA0003494316220000191
wherein, Attention represents a common Attention mechanism, U is a potential semantic feature of a user, and U belongs to RS×KTerm of constant
Figure GDA0003494316220000192
And in order to avoid generating excessive values, P is the embedding of the fused knowledge base map and the user interaction characteristics of the target program.
In order to better implement the present invention, in step S7, after step S7.2 is performed, the following operations are performed:
step S7.3: and (3) carrying out nonlinear processing: after the calculation of the self-attention mechanism and the ordinary attention mechanism is carried out, the calculation of a point type feedforward network is added, and the calculation specifically comprises the following steps:
for the point feed-forward network calculation with increased self-attention mechanism:
U=Normalize(Conv1D(Conv1D(U))+U);
wherein normaize is a normalization operation for solving the gradient vanishing problem, and Conv1D represents a one-dimensional convolution network; carrying out nonlinear mapping on the U twice through two layers of convolution networks; u on the left side of the equation in the formula is a potential semantic feature of the user after point feed-forward, and U on the right side of the equation is a potential semantic feature of the user before television feed-forward;
the point feed-forward network for the general attention mechanism addition is calculated as: the structure of the point type feedforward network after the ordinary attention calculation is the same as that of the point type feedforward network added by the self-attention mechanism;
a residual error network for preventing the loss of original information is added after the output of the multi-head attention mechanism and the point type feedforward network, and normalization processing is carried out after the residual error network is passed during calculation;
step S7.4: after the semantic preference vector of the user is obtained, calculating the probability of interaction between the user u and the candidate item v through a prediction function g, wherein the specific calculation formula is as follows:
pu,v=σ(g(Bemb,τv));
the prediction function g is an inner product or an L-layer perceptron; b isembFor semantic preferences of user u, τvIs the embedding of the fused knowledge-graph and the user interaction characteristics of the candidate program v.
The working principle is as follows: the semantic preference of the user implies attribute-based information of an item side in the historical interaction of the user, session context-based information, interactive microscopic behavior information and interactive time information, and well describes the dynamic preference of the user.
Other parts of this embodiment are the same as any of embodiments 1 to 6, and thus are not described again.
Example 8:
this embodiment is based on any one of embodiments 1 to 7 described above, and further,
step S8: model training and optimization: training and optimizing an algorithm model by adopting a sigmoid cross entropy loss function, wherein a specific calculation formula is as follows:
Figure GDA0003494316220000201
where u denotes all instances of training users, yi1 denotes a positive example, i.e. the user has interacted with the program, yi0 represents a negative example, i.e. the user has not found an interaction with the program; p is a radical ofu,v∈[0,1]Is the output of the model, representing the click rate of the user; the optimization process of the above model is the process of minimizing the above loss function.
The working principle is as follows: the model is a click rate prediction model, the recommended tasks are defined as a binary classification problem, and a sigmoid cross entropy loss function is adopted to train and optimize the model.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention in any way, and all simple modifications and equivalent variations of the above embodiments according to the technical spirit of the present invention are included in the scope of the present invention.

Claims (7)

1. A radio and television program recommendation method based on knowledge graph and user microscopic behaviors is characterized by comprising the following steps:
step S1: constructing a knowledge graph in the field of broadcasting and television;
step S2: combing user microscopic behavior data: dividing behavior interaction data of a user into continuous microscopic behaviors and discrete microscopic behaviors according to behavior duration;
step S3: extracting the attribute subgraph of the knowledge graph in the broadcasting and television field constructed in the step S1, and extracting a random walk program sequence Q according to the attribute subgraph in a random walk mode; extracting a random walk sequence Q from one attribute subgraph, wherein the random walk sequences Q of all the attribute subgraphs form an item sequence set Hk
Step S4: constructing a time session-behavior type matrix by using the behavior interaction data of the user, which is combed in the step S2, and calculating the session similarity; finally, extracting a user interactive program sequence H based on the conversation;
step S5: collecting the item sequence H obtained in step S3kThe user interactive program sequence H obtained in the step S4 is used as the input of an Item2vec algorithm together, and program embedding is obtained through training;
step S6: generating user microscopic behavior embedding according to the behavior interaction data of the user combed in the step S2; then according to the historical interactive record of the user and the program, splicing the user microscopic behavior embedding and the corresponding program embedding, and generating semantic representation of each behavior-program with the same dimensionality through semantic space network mapping, wherein the semantic representations of all the behaviors-programs form an embedding sequence of the user historical behaviors, namely a user-behavior potential semantic sequence;
step S7: and (3) carrying out user dynamic preference learning based on a transformer mechanism: the transform mechanism comprises an attention mechanism and a common attention mechanism based on a multi-head attention mechanism, wherein the attention mechanism is used for learning the correlation of each item in a user-behavior latent semantic sequence to obtain the latent semantic features of a user, then the common attention mechanism is used for decoding the latent semantic features of the user according to a target program to obtain the semantic preference of the user, and the program recommendation is carried out on the user according to the semantic preference of the user;
the specific operation of step S3 includes:
step S3.1: determining the attributes of the radio and television programs, and querying knowledge map information by using spark ql triple query statements according to the attribute keywords to form a plurality of attribute sub-graphs based on the attributes; the attributes comprise director, actors, language, genre, drama, region;
step S3.2: random walk is carried out in each attribute subgraph to generate a random walk sequence Q, and all the obtained random walk sequences Q jointly form an item sequence set Hk={Q1,Q2,...,QnIn which Qi={x1,x2,...,xnDenotes a random walk sequence generated, i ═ 1,2, 3.., n;
in the process of random walk, given the starting node as v and the ith node as ci,c0The probability of random walk is:
Figure FDA0003494316210000021
therein, IIvxIs the unnormalized transition probability between node v and node x, z is the normalization constant; II typevxBy entity edge weight wvxMultiplied by a coefficient, expressed as:
Πvx=αpq(t,x)·wvx
wherein the coefficient alphapqThe formula for the calculation of (t, x) is:
Figure FDA0003494316210000022
at the coefficient alphapq(t, x) in the calculation formula, t represents the previous node of the random walk, x represents the next node of the random walk, and the walk of the depth and the extent is controlled by the values of p and q; dtxRepresents the shortest distance between node t and node x;
the step S4 specifically includes the following steps:
step S4.1: constructing a time session-behavior type matrix: assuming that the length of the historical interaction sequence of a user is h, the number of behavior types is n, and the number of programs interacted per session is k, the historical interaction record of the user contains m-h/k sessions, and the time period of each session is tiI 1, 2.. m, then a temporal session-behavior type matrix TSA may be formed as:
Figure FDA0003494316210000023
namely: TSA ═ xij}m×n,1≤i≤m,1≤j≤n;
Wherein x isijIs shown over a time period tiIn the method, the microscopic behaviors of a user in the ith conversation are the frequency of j, m and n are rows and columns of a matrix respectively and respectively represent the number of conversations and the number of behavior types divided according to a certain conversation length k;
step S4.2: first, a time period t is calculated from a time session-behavior type matrixiAnd a time period tjDegree of similarity of behaviors between
Figure FDA0003494316210000031
The specific calculation formula is as follows:
Figure FDA0003494316210000032
wherein a is a behavior type, A is a behavior type set,
Figure FDA0003494316210000036
represents tiThe frequency of the user generating behavior type a in the session s in the time period is equivalent to x in the TSA matrixij
Then, the time period t is calculatediAnd time period tjThe interval between dist (t)i,tj) The specific calculation formula is as follows:
Figure FDA0003494316210000033
then, the similarity between the session i and the session j is calculated, and the specific calculation formula is as follows:
Figure FDA0003494316210000034
step S4.3: combing out a user interactive program sequence, dividing conversations according to the time increasing direction, and sequentially calculating the similarity between adjacent conversations, wherein the calculation formula of the superposition sum of the conversation similarities is as follows:
Figure FDA0003494316210000035
wherein m is the number of sessions divided according to a certain session length k, and if the threshold of the session similarity superposition sum is Y, k when sum (se) of user u is greater than Y is taken as the session length of the user, and the interactive program sequence H of the user is extracted as { S ═ S {1,S2,...Sn};
The specific operation of step S6 is:
step S6.1: calculating the user microscopic behavior weight:
firstly, setting N user micro behaviors obtained in the step S2, wherein the N user micro behaviors comprise a continuous micro behavior and a discrete micro behavior; the total times of the micro-behaviors of each user are respectively marked as A1,A2,...,AN
Secondly, respectively calculating the normalization weight a corresponding to each user micro-behavior type1,a2,...,aNThe specific calculation formula is as follows:
Figure FDA0003494316210000041
Figure FDA0003494316210000042
step S6.2: obtaining a type vector vec (a) of the user's microscopic behaviorg): for user microscopic behaviors, a one-hot code is used to obtain a vector representation for each implicit feedback behavior, and the formula is as follows:
Figure FDA0003494316210000043
step S6.3: obtaining a duration long vector representation vec (a) of the microscopic behavior of the userd):
For the continuous microscopic behaviors, the continuous microscopic behaviors in the program are divided into [0.0.1 ], [0.1, 0.2 ], [0.2, 0.3 ], and [0.9, 1 ] according to the proportion of the continuous microscopic behaviors of the user in the program to the total time length of the program]For a total of ten levels, a one-hot encoding is used to generate a vector representation vec (a) for the microscopic behavior times of the ten levelsd) And vec (a)d)∈R10
For discrete microscopic behaviors, all-zero equal-length vectors are used for space occupation to generate a vector representation vec (a)d) And vec (a)d)=[0,0,0,...,0];
Step S6.4: vectorizing the user microscopic behaviors of the user u on the program i, wherein the vectorizing is represented as:
vec(au,i)=ai·vec(ag)+vec(ad)
the "+" sign in the formula represents a vectorA connection operation ofiFor microscopic behavioral weighting, vec (a)g) Type vector for microscopic behavior, vec (a)d) A duration vector for the microscopic behavior;
step S6.5: time coding is carried out, continuous time is discretized, then embedding of time is obtained, and a model is introduced for training and learning:
for continuous microscopic behavior: firstly, extracting the historical behavior interaction sequence of the user
Figure FDA0003494316210000051
Then the historical behaviors are interacted with sequences
Figure FDA0003494316210000052
Is extracted as T ═ T1,t2,t3...]Setting the time stamp of the clicked target program as tp
Then, time interval sequence T between the target program and the historical interactive program of the user is calculatedΔThe specific calculation formula is as follows:
TΔ=[tp-t1,tp-t2,tp-t3,...]=[Δt1,Δt2,Δt3,...];
for discrete microscopic behavior: a discretized time interval is defined, denoted as [0, 1), [1, 2, [2, 4 ]k,2k +1) ,..; wherein each time interval is in units of hours, and T isΔMapping each item in the one-hot code into a discrete time interval to obtain a time code uec (t) of the item interaction behaviori);
Step S6.6: performing behavior semantic space embedding: defining user behavior u on the basis of obtaining different behavior representations, item embedding and time codingiThe behavior of user u on item i is represented as:
ui=vec(au,i)+vec(xi)+vec(ti);
wherein, vec (x)i) Representing the adoption of the behavior a by the user uu,iEmbedded representation of interaction with item i, vec (x)i) Project embedding for fusing knowledge-graph and user interaction features, vec (t)i) For temporal coding of behaviors, "+" in the formula represents the join operation of vectors; and then, calculating the user-behavior sequence according to the following formula:
Figure FDA0003494316210000053
in the formula (d)xRepresents the dimension size, | L | represents the length of the user-behavior sequence;
then, a user-behavior sequence L is formed by adopting a full connection layeruConversion into user-behavior latent semantic sequences
Figure FDA0003494316210000054
The specific conversion formula is as follows:
Bu=στ(WτL+bτ);
wherein, WτAnd bτFor weights and offsets of fully connected layers, στIs an activation function.
2. The radio and television program recommendation method based on knowledge-graph and user microscopic behaviors as claimed in claim 1, wherein the step S7 specifically comprises the steps of:
step S7.1: carrying out matrix calculation on potential semantic features U of the user, wherein the specific calculation method comprises the following steps:
Figure FDA0003494316210000061
wherein Self _ Attention represents the Self-Attention mechanism operation, BuFor the user-behavior latent semantic sequence, the sequence length is set to be S, the embedding dimension of each item is K, and then Bu∈RS×K(ii) a In the formulaIs/are as follows
Figure FDA0003494316210000062
Softmax is a function for making the attention score of the generation between 0 and 1, a self-set constant term for avoiding the generation of an excessive value;
step S7.2: user semantic preference B for users using a common attention mechanismembAnd (3) performing matrix calculation, wherein a specific calculation formula is as follows:
Figure FDA0003494316210000063
wherein, Attention represents a common Attention mechanism, U is a potential semantic feature of a user, and U belongs to RS×KTerm of constant
Figure FDA0003494316210000064
And in order to avoid generating excessive values, P is the embedding of the fused knowledge base map and the user interaction characteristics of the target program.
3. The radio and television program recommendation method based on knowledge-graph and user microscopic behaviors as claimed in claim 2, wherein in step S7, after step S7.2, the following operations are further performed:
step S7.3: and (3) carrying out nonlinear processing: after the calculation of the self-attention mechanism and the ordinary attention mechanism is carried out, the calculation of a point type feedforward network is added, and the calculation specifically comprises the following steps:
for the point feed-forward network calculation with increased self-attention mechanism:
U=Normalize(Conv1D(Conv1D(U))+U);
wherein normaize is a normalization operation for solving the gradient vanishing problem, and Conv1D represents a one-dimensional convolution network; carrying out nonlinear mapping on the U twice through two layers of convolution networks; u on the left side of the equation in the formula is a potential semantic feature of the user after point feed-forward, and U on the right side of the equation is a potential semantic feature of the user before television feed-forward;
the point feed-forward network for the general attention mechanism addition is calculated as: the structure of the point type feedforward network after the ordinary attention calculation is the same as that of the point type feedforward network added by the self-attention mechanism;
a residual error network for preventing the loss of original information is added after the output of the multi-head attention mechanism and the point type feedforward network, and normalization processing is carried out after the residual error network is passed during calculation;
step S7.4: after the semantic preference vector of the user is obtained, calculating the probability of interaction between the user u and the candidate item v through a prediction function g, wherein the specific calculation formula is as follows:
pu,v=σ(g(Bemb,τv));
the prediction function g is an inner product or an L-layer perceptron; b isembFor semantic preferences of user u, τvIs the embedding of the fused knowledge-graph and the user interaction characteristics of the candidate program v.
4. The radio and television program recommendation method based on knowledge-graph and user microscopic behaviors as claimed in claim 3, wherein after the step S7, the following steps are required:
step S8: model training and optimization: training and optimizing an algorithm model by adopting a sigmoid cross entropy loss function, wherein a specific calculation formula is as follows:
Figure FDA0003494316210000071
where u denotes all instances of training users, yi1 denotes a positive example, i.e. the user has interacted with the program, yi0 represents a negative example, i.e. the user has not found an interaction with the program; p is a radical ofu,v∈[0,1]Is the output of the model, representing the click rate of the user; the optimization process of the above model is the process of minimizing the above loss function.
5. The broadcasting program recommending method based on the knowledge-graph and the user microscopic behaviors as claimed in any one of claims 1 to 4, wherein the specific operations of the step S1 are:
the method comprises the steps of forming structured data through entity alignment by crawling network resources of the broadcasting and television programs, and completing ontology construction by utilizing an ontology modeling tool prot g; after the ontology is constructed, the data originally stored in the relational database is converted into a corresponding rdf format by using d2rq, and then the rdf format is stored in a graph database mode, so that the construction of the knowledge graph in the field of broadcasting and television is completed.
6. The radio and television program recommendation method based on the knowledge graph and the user microscopic behaviors as claimed in claim 5, wherein when the radio and television field knowledge graph is constructed, the knowledge graph is constructed in a top-down manner, a data mode is constructed from the topmost concept, and is gradually refined downwards to form a taxonomy level with clear structure and clear logic, so as to complete body construction; in the body construction, the concept layer inherits the type of the event, such as region, character, type, program and language; the top-level concept of the object attribute comprises program category, program origin, character home country, participation, actor, director, drama editor and program language; the top-level concept of the data attribute includes a region number, a region name, a character birthday, a character foreign language name, a character gender, a character number, a character name, a kind number, a kind name, a program number, a program rating, a program release date, a program introduction, a program name, a language number, and a language name.
7. The broadcasting program recommending method based on the knowledge-graph and the user microscopic behaviors as claimed in any one of claims 1 to 4, wherein the specific operations of the step S2 are: dividing behavior interaction data of a user into continuous microscopic behaviors and discrete microscopic behaviors according to behavior duration; the continuous microscopic behaviors are user behaviors which can last for a certain time, and comprise live watching, on-demand watching and search watching behaviors; the discrete microscopic behaviors are user behaviors which only occur at a certain moment, and comprise purchasing, collecting and praise behaviors; and collecting data detected by a background of the radio and television system to form structured data for recording a user number, a media asset number, a behavior type, a behavior timestamp and a behavior duration, wherein the behavior duration of the continuous microscopic behavior is a corresponding effective value, and the behavior duration of the discrete behavior type is null.
CN202110033041.0A 2021-01-11 2021-01-11 Radio and television program recommendation method based on knowledge graph and user microscopic behaviors Expired - Fee Related CN112732936B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110033041.0A CN112732936B (en) 2021-01-11 2021-01-11 Radio and television program recommendation method based on knowledge graph and user microscopic behaviors

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110033041.0A CN112732936B (en) 2021-01-11 2021-01-11 Radio and television program recommendation method based on knowledge graph and user microscopic behaviors

Publications (2)

Publication Number Publication Date
CN112732936A CN112732936A (en) 2021-04-30
CN112732936B true CN112732936B (en) 2022-03-29

Family

ID=75590255

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110033041.0A Expired - Fee Related CN112732936B (en) 2021-01-11 2021-01-11 Radio and television program recommendation method based on knowledge graph and user microscopic behaviors

Country Status (1)

Country Link
CN (1) CN112732936B (en)

Families Citing this family (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113378045B (en) * 2021-06-08 2024-02-09 深圳Tcl新技术有限公司 Digital content distribution method, device and storage medium
CN113255597B (en) * 2021-06-29 2021-09-28 南京视察者智能科技有限公司 Transformer-based behavior analysis method and device and terminal equipment thereof
WO2023019427A1 (en) * 2021-08-17 2023-02-23 Robert Bosch Gmbh Method and apparatus for graph-based recommendation
CN113822742B (en) * 2021-09-18 2023-05-12 电子科技大学 Recommendation method based on self-attention mechanism
CN113919923B (en) * 2021-12-15 2022-05-06 北京达佳互联信息技术有限公司 Live broadcast recommendation model training method, live broadcast recommendation method and related equipment
CN114282687B (en) * 2021-12-31 2023-03-07 复旦大学 Multi-task time sequence recommendation method based on factorization machine
CN115379293B (en) * 2022-04-15 2023-10-03 大连理工大学 Method, device and computer readable storage medium for predicting timing behavior of intelligent TV on demand user
CN115018453B (en) * 2022-05-23 2024-04-09 电子科技大学 Automatic post talent portrait generation method
CN114925273B (en) * 2022-05-23 2023-01-10 厦门亿加网络科技有限公司 User behavior prediction method based on big data analysis and AI prediction analysis system
CN114827728B (en) * 2022-06-23 2022-09-13 中国传媒大学 Program data recommendation method and system
CN116612843A (en) * 2023-03-10 2023-08-18 武汉大学 Psychological assessment disguising behavior recognition method and system
CN116204737B (en) * 2023-05-04 2023-07-07 海看网络科技(山东)股份有限公司 Recommendation method, system, equipment and medium based on user behavior codes
CN117436550B (en) * 2023-12-15 2024-04-16 深圳须弥云图空间科技有限公司 Recommendation model training method and device
CN117540935B (en) * 2024-01-09 2024-04-05 上海银行股份有限公司 DAO operation management method based on block chain technology

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10929383B2 (en) * 2017-08-11 2021-02-23 International Business Machines Corporation Method and system for improving training data understanding in natural language processing
CN111143684B (en) * 2019-12-30 2023-03-21 腾讯科技(深圳)有限公司 Artificial intelligence-based generalized model training method and device
CN112100440B (en) * 2020-08-21 2023-12-12 深圳市雅阅科技有限公司 Video pushing method, device and medium

Also Published As

Publication number Publication date
CN112732936A (en) 2021-04-30

Similar Documents

Publication Publication Date Title
CN112732936B (en) Radio and television program recommendation method based on knowledge graph and user microscopic behaviors
CN112765486B (en) Knowledge graph fused attention mechanism movie recommendation method
Panagiotakis et al. Improving recommender systems via a dual training error based correction approach
CN111241394B (en) Data processing method, data processing device, computer readable storage medium and electronic equipment
CN113051468B (en) Movie recommendation method and system based on knowledge graph and reinforcement learning
CN111858972B (en) Movie recommendation method based on family knowledge graph
Yang et al. Personalized channel recommendation deep learning from a switch sequence
CN112464100A (en) Information recommendation model training method, information recommendation method, device and equipment
CN112989212A (en) Media content recommendation method, device and equipment and computer storage medium
CN115964560A (en) Information recommendation method and equipment based on multi-mode pre-training model
CN113590965B (en) Video recommendation method integrating knowledge graph and emotion analysis
CN115640449A (en) Media object recommendation method and device, computer equipment and storage medium
Gupta et al. Machine learning enabled models for YouTube ranking mechanism and views prediction
CN116010696A (en) News recommendation method, system and medium integrating knowledge graph and long-term interest of user
CN113254794B (en) Program data recommendation method and system based on modeling
CN113688281B (en) Video recommendation method and system based on deep learning behavior sequence
Mirhasani et al. Alleviation of cold start in movie recommendation systems using sentiment analysis of multi-modal social networks
CN115809339A (en) Cross-domain recommendation method, system, device and storage medium
Bai et al. Meta-graph embedding in heterogeneous information network for top-n recommendation
Wangwatcharakul et al. Improving dynamic recommender system based on item clustering for preference drifts
Xu BanditMF: Multi-Armed Bandit Based Matrix Factorization Recommender System
CN117648493B (en) Cross-domain recommendation method based on graph learning
Xie et al. A recommendation algorithm for sparse data via implicit relationship
Crainic et al. Live It-Recommendation System based on Emotion Detection.
Hao Cross-domain recommender system through tag-based models

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
CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20220329