Detailed Description
Embodiments of the present application are described in detail below with reference to the accompanying drawings.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone.
The terms "first" and "second" and the like in the description and drawings of the present application are used for distinguishing different objects or for distinguishing different processes for the same object, and are not used for describing a specific order of the objects.
Furthermore, the terms "including" and "having," and any variations thereof, as referred to in the description of the present application, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described herein as "exemplary" or "e.g.," is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present concepts related in a concrete fashion.
In the description of the present application, the meaning of "a plurality" means two or more unless otherwise specified.
Multimedia recommendation is one of the more common and popular issues in recent years. At present, the problem of recommending specific multimedia for a specific user is mainly solved by applying a recommendation algorithm commonly used in machine learning. Commonly used recommendation algorithms mainly include content-based recommendation, collaborative filtering recommendation, and association rule-based recommendation. These algorithms study, for example, the user-to-user relationship, the user-to-multimedia relationship, and the multimedia-to-multimedia relationship, respectively. However, these recommendation algorithms only consider a certain dimension when performing multimedia recommendation for a user, and the recommendation accuracy is low.
In order to solve the above problems, embodiments of the present application provide a multimedia recommendation method and apparatus, where the multimedia recommendation apparatus recommends multimedia for a user based on at least two of user similarity, multimedia similarity, and search record, so as to effectively improve recommendation accuracy.
The multimedia recommendation method provided by the embodiment of the application is suitable for a communication system. The communication system may include a terminal and a server. As shown in fig. 1, the communication system includes a terminal 10 and a server 11.
The multimedia recommendation device may be the terminal 10. The terminal 10 may be a portable device such as a mobile phone, a tablet computer, and a wearable electronic device, or may be a vehicle-mounted device or an intelligent robot. For example, the terminal 10 may recommend at least one multimedia to be recommended to the user according to the calculated user similarity, multimedia similarity, search record, and the like.
A client for multimedia recommendation may be installed in the terminal 10. The client can obtain the user similarity, the multimedia similarity, the search record and the like to recommend at least one multimedia to be recommended to the user after logging in the management account.
The client for multimedia recommendation described above may be an embedded application installed in the terminal 10 (i.e., a system application of the terminal 10) or a downloadable application. Where the embedded application is an application provided as part of the implementation of the terminal 10, such as a cell phone. The downloadable application is an application that can provide its own internet protocol multimedia subsystem (IMS) connection, and is an application that can be pre-installed in the terminal 10 or a third party application that can be downloaded by the user and installed in the terminal 10.
In addition, the multimedia recommendation apparatus may also be a Personal Computer (PC), a Personal Digital Assistant (PDA), a netbook, a server, or other computing devices, such as the server 11 in fig. 1 as an example. The server 11 may determine at least one multimedia to be recommended according to the calculated user similarity, multimedia similarity, search record, and the like, and send information (such as an identifier of the multimedia to be recommended) of the determined at least one multimedia to be recommended to the terminal 10. After the terminal 10 receives the information of the at least one multimedia to be recommended, the terminal 10 recommends the at least one multimedia to be recommended to the user.
The multimedia in the embodiment of the present application includes, but is not limited to, various forms of carriers such as text, images, animation, sound, video, and the like. For convenience of description, the embodiment of the present application takes multimedia as an example of a movie.
Since the application environment of the "user similarity" is a heterogeneous information network, for convenience of understanding the embodiment in the present application, as shown in fig. 2, the embodiment in the present application constructs a heterogeneous information network including a user and a movie in advance.
Some concepts are explained below in conjunction with fig. 2:
1. information network: the information network is a structured text mode of knowledge representation, and the network comprises a series of nodes and edges which are used for connecting the nodes. Nodes represent objects and edges represent relationships, the structure of which reflects the structure of the information stored in the nodes, and are therefore referred to as an information network.
2. Heterogeneous information networks: it means that the types of nodes in the information network are at least 2 and more, and the types of relationships in the network are also at least 2 and more.
Taking the heterogeneous information network containing users and movies in fig. 2 as an example, the nodes in the heterogeneous information network include five types of node users, movies, actors, movie types, and directors. Wherein node 211 represents user 1 and node 212 represents user 2; node 221 represents movie 1, node 222 represents movie 2, and node 223 represents movie 3; node 231 represents actor 1, node 232 represents actor 2, and node 233 represents actor 3; node 241 represents movie type 1, node 242 represents movie type 2; node 251 represents director 1 and node 252 represents director 2. Here, user 1 is targeted (the multimedia device recommends a movie for the user).
The edges in the heterogeneous information network in fig. 2 include four types of user-connected movies, movie-connected actors, movie-connected directors, and movie-connected movie types, which respectively represent: the four relations of the user watching the movie, the movie being deducted by actors, the movie being shot by the director, the movie having various movie types (swordsmen, family ethics, suspense, police gangster, etc.).
Specifically, in fig. 2, node 211 (user 1) connects node 221 (movie 1) and node 222 (movie 2), indicating that user 1 has viewed movies 1 and 2. Node 212 (user 2) connects node 222 (movie 2) and node 223 (movie 3), indicating that user 2 has watched movie 2 and movie 3. Node 221 (movie 1) connects node 231 (actor 1), node 232 (actor 2), node 241 (movie type 1), and node 251 (director 1), indicating that movie 1 is starring by actor 1 and actor 2, that movie 1 belongs to movie type 1, and that movie 1 is being directed by director 1. Node 222 (movie 2) connects node 232 (actor 2) and node 233 (actor 3), node 242 (movie type 2), and node 252 (director 2), indicating that movie 2 is starring by actor 2 and actor 3, that movie 2 belongs to movie type 2, and that movie 2 is being directed by director 2. Node 223 (movie 3) connects node 233 (actor 3), node 242 (movie type 2), and node 251 (director 1), indicating that movie 3 was starred by actor 3, movie 3 belongs to movie type 2, and movie 3 was directed by director 1.
3. Meta-path: a meta-path is a path defined in a heterogeneous information network connecting class 2 nodes formally defined as
A
iRepresenting the type of object, R
iIndicating the type of relationship. Taking the heterogeneous information network in fig. 2 as an example, the paths of the symmetric elements of the heterogeneous information network including the user and the movie are: user-movie-user, user-movie-actor-movie-user, user-movie-genre-movie-user.
4. Similarity calculation for objects of the same type:
a. for a given 1 symmetry-element path P, a formula is defined that computes the similarity between 2 objects x and y of the same type as follows:
wherein p isx→y,px→x,py→yExamples of paths between x and y, x and x, and y, respectively.
The same type of object refers to an object that starts from a certain type and finally returns to the type, for example, the symmetric meta-path "user-movie-actor-movie-user" starts from an object of the type of the user and finally returns to an object of the type of the user.
b. The similarity between 2 objects is calculated by matrix multiplication, and the element path P is equal to (A)
1A
2...A
l) The next adjacency matrix is called a relationship matrix and is defined
Wherein
Is of type A
iAnd type A
jAn adjacency matrix in between. M (i, j) represents object x on meta-path P
i∈A
1And object y
i∈A
lNumber of path instances in between.
Therefore, the calculation formula of the similarity between 2 objects of the same type can be converted into:
c.2 the final similarity between objects of the same type needs to be calculated by combining the similarities calculated based on multiple meta-paths. Given r meta-paths P starting from type A and returning to type A1,P2,P3....PrAnd its corresponding relationship matrix M1,M2,M3....MrThe different lengths of the meta-path indicate that the strength of the 2 object relationships is different, and the weight given to the meta-path is defined as w1,w2,w3....wrThen object xi,xjThe similarity between e A can be defined as:
since the application environment of the above-mentioned "movie similarity" is also a heterogeneous information network, and the heterogeneous information network is similar to the heterogeneous information network of fig. 2. Therefore, as shown in fig. 3, in this embodiment, a heterogeneous information network including a movie needs to be established in advance.
From the contents of fig. 3, it can be seen that the nodes in the heterogeneous information network include five types of languages, movies, actors, movie types, and directors. Wherein fig. 3 is different from the heterogeneous information network of fig. 2 in that the node 311 of the heterogeneous information network containing the movie in fig. 3 represents language 1, and the node 312 represents language 2; node 321 represents movie 1, node 322 represents movie 2, and node 323 represents movie 3; here, movie 1 is used as a target movie (a movie used here to calculate the similarity between the movie and another movie may be any movie in practice).
The edges in the heterogeneous information network in fig. 3 include four types of language-connected movies, movie-connected actors, movie-connected directors, and movie-connected movie types, which respectively represent: the language used in the movie, the actor performing the movie, the director shooting the movie, and the movie has a variety of movie types (swordsmen, family ethics, suspense, police gangster, etc.). Different from the heterogeneous information network of fig. 2 is "language-connected movie", which indicates that the movie uses the language, and taking node 311 (language 1) connected to node 321 (movie 1) as an example, which indicates that movie 1 uses language 1.
Since the construction of the heterogeneous information network including the movie is similar to the construction of the heterogeneous information network including the user and the movie, for other nodes and relationships in fig. 3, reference may be made to the corresponding description in fig. 2, and details are not repeated here.
The multimedia recommendation method provided by the embodiment of the application is described in detail below with reference to the accompanying drawings.
An embodiment of the present application provides a multimedia recommendation method, which is shown in fig. 4 and includes the following steps:
401. the multimedia recommendation device acquires the first information and the second information.
The first information and the second information are respectively one of user similarity, movie similarity, and search record, and the second information is different from the first information.
The user similarity is the similarity between the target user (for which the multimedia recommendation device recommends multimedia) and each of the other users.
The movie similarity is the similarity between the target movie and each other movie, and the target movie is a movie played by the target user in a first preset time period.
Alternatively, the target movie (a certain movie that may be of interest to the target user) in the first preset time period may be the last movie viewed by the target user in a certain time period; or the last N movies in the movies watched by the target user within a certain time period, wherein N is a positive integer; or the second last in a movie that the user watched within a certain time period. The duration of the first preset time period may be set according to practical situations, and is not limited herein.
The search record is the search record of the target user in a second preset time period.
Optionally, the search record in the second preset time period may be the last search record in a certain time period of the target user; or M search records in the movie searched by the target user within a certain time period, wherein M is a positive integer; or may be the entire search record of the target user over a certain period of time. The specific duration of the second preset time period may be set according to practical situations, and is not limited herein.
402. The multimedia recommendation device determines a first movie set according to the first information and determines a second movie set according to the second information.
Optionally, if the first information is the user similarity, the multimedia recommendation device selects a user (e.g., user a) whose similarity to the target user is higher than the preset threshold st1, and obtains a movie watching record of the user a. Then, the multimedia recommendation apparatus selects S (S is a positive integer) movies from the movie viewing record of the user a, and takes the selected S movies as a first movie set.
Optionally, the manner in which the multimedia recommendation apparatus selects S movies may be: the multimedia recommendation device arranges the movies in the movie watching record of the user A in the order of the scores from top to bottom, and then selects the movies with the scores of the first S.
Optionally, if the first information is the similarity of movies, the multimedia recommendation device selects Q movies as the first movie set from the movies whose similarity to the target movie is higher than a preset threshold st2, where Q is a positive integer.
Optionally, the manner in which the multimedia recommendation device selects Q movies may be: the similarity of the movies is sorted firstly, and Q movies with the similarity from high to low are selected.
Optionally, if the first information is a search record, the multimedia recommendation device determines movies meeting preset conditions according to the search record, and determines the first movie set. The first movie set includes movies satisfying a preset condition.
The preset condition may be one or more of the following: searching partial or all movies starring by the actor with the most times by the target user; searching for a part or all of the movies shot by the director with the largest number of target users; the target user searches for the most frequent movie type.
Optionally, before determining the first movie set, the multimedia recommendation device may further sort the time of putting on shelf of movies that meet a preset condition, and select X latest movies on shelf, where X is a positive integer; the scores of the movies meeting the preset condition can also be sorted, and Y movies with scores from high to low are selected, wherein Y is a positive integer.
The method for determining the second movie set by the multimedia recommendation device is similar to the method for determining the first movie set by the multimedia recommendation device, and is not described in detail here.
403. The multimedia recommendation device determines at least one movie to be recommended, and the at least one movie to be recommended belongs to the intersection of the first movie set and the second movie set.
404. The multimedia recommendation device recommends at least one movie to be recommended for the target user.
Therefore, the multimedia recommendation method provided by the application can simultaneously consider a plurality of relationships and finally recommend more accurate movies to the user.
Further optionally, the multimedia recommendation apparatus may further obtain third information, and determine a third movie set according to the third information. The third information is one of user similarity, movie similarity, and search record, and is different from the first information, and the third information is different from the second information. In this scenario, the multimedia recommendation apparatus may further determine at least one movie to be recommended in combination with the third set of movies.
In this scenario, a multimedia recommendation method provided by the embodiment of the present application will now be described. With reference to fig. 4, as shown in fig. 5, the multimedia recommendation method provided in the embodiment of the present application further includes steps 501 to 504.
501. And the multimedia recommendation device acquires the third information.
The third information is one of user similarity, movie similarity, and search record, and is different from the first information, and the third information is different from the second information.
Optionally, the multimedia recommendation apparatus in step 501 may obtain the third information before the multimedia recommendation apparatus obtains the first information and the second information in step 401, or after step 401, or simultaneously with step 401, and this embodiment is exemplified in fig. 5 by being performed simultaneously with step 401.
The method for the multimedia recommendation apparatus to obtain the third information may refer to the description of step 401, and is not described in detail here.
502. The multimedia recommending device determines a third movie set according to the third information.
Optionally, the multimedia recommendation device determines the third movie set according to the third information in step 502, where the multimedia recommendation device determines the first movie set according to the first information in step 402, and determines the second movie set according to the second information, or after step 402, or simultaneously with step 402, and this embodiment is exemplified in fig. 5 by being performed simultaneously with step 402.
The method for determining the third movie set by the multimedia recommendation device is similar to the method for determining the first movie set by the multimedia recommendation device, and detailed description is omitted here.
Accordingly, step 403 in FIG. 4 may be replaced with step 503.
503. The multimedia recommendation device determines at least one movie to be recommended, wherein the at least one movie to be recommended belongs to the intersection of the first movie set, the second movie set and the third movie set.
Accordingly, step 404 in FIG. 4 may be replaced with step 504.
504. The multimedia recommendation device recommends at least one movie to be recommended for the target user.
Therefore, the multimedia recommendation device determines the set of movies to be recommended according to the three of the user similarity, the movie similarity and the search record, and therefore the multimedia recommendation method provided by the application can consider a plurality of relationships at the same time and finally recommend more accurate movies to the user.
As can be seen from the above description, the first information, the second information, and the third information in the embodiment of the present application are respectively one of the user similarity, the movie similarity, and the search record, and are different from each other. The multimedia recommendation device obtains the first information, the second information and the third information in a similar way. For convenience of description, the following description mainly takes the multimedia recommendation apparatus to acquire the first information as an example.
For the case that the first information is the user similarity, as shown in fig. 6, the multimedia recommendation apparatus may employ the following steps 601-603 to obtain the first information, including:
601. the multimedia recommendation device determines at least one target path, wherein the target path is a path which is established in advance and comprises a target user and a first user, and the first user is any other user.
Before step 601, the multimedia recommendation apparatus needs to establish a network including a target user and a first user, for example, a heterogeneous information network of a user watching movie network in fig. 2, where the target path is a symmetric element path starting from the target user and ending with any other user, and the target user and the first user are both "users" in fig. 2, where user 1 is the target user and user 2 is the first user.
602. The multimedia recommendation device determines the sub-similarity between the target user and the first user in each target path of the at least one target path according to a preset algorithm.
Taking the heterogeneous information network in fig. 2 as an example, taking the target path of the movie in the symmetric element path from the target user and ending with the first user includes:
first target path: target user-movie-first user;
the second target path: target user-movie-actor-movie-first user;
third target path: target user-movie-genre-movie-first user.
Step 602, the multimedia recommendation device is based on the formula
And respectively calculating the similarity of the 3 item label paths as 3 sub-similarities between the target user and the first user.
603. And the multimedia recommendation device determines the similarity between the target user and the first user according to all the determined sub-similarities.
Step 603, the multimedia recommendation device is based on the formula
And performing weighted calculation on the 3 sub-similarities obtained in the
step 602 to obtain the similarity between the target user and the first user.
For the case that the first information is the similarity of movies, the multimedia recommendation apparatus may acquire the first information by using the following method, including:
firstly, the multimedia recommendation device acquires a word vector of a target movie and word vectors of other movies according to a preset algorithm. Alternatively, the preset algorithm may be a metapath2vec algorithm. Optionally, the word vector of the target movie is the name of the movie. The specific algorithm chosen is combined with the actual situation and only an example of one algorithm is provided here.
Secondly, the multimedia recommendation device calculates the similarity between the word vector of the target movie and the word vectors of other movies to obtain the similarity of the movies. For example, the multimedia recommendation device calculates cosine similarity between the word vector of a movie recently watched by the target user and the word vectors of other movies in the network. And finally, the cosine similarity is used as the film similarity between the word vector of the target film and the word vector of each other film by the multimedia recommending device.
In the embodiment of the present application, functional modules or functional units may be divided according to the above method examples, for example, each functional module or functional unit may be divided according to each function, or two or more functions may be integrated into one processing module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of a software functional module or a functional unit. The division of the modules or units in the embodiment of the present application is schematic, and is only a logic function division, and there may be another division manner in actual implementation.
Referring to fig. 7, an embodiment of the present application provides a multimedia recommendation apparatus, which includes an obtaining module 71 and a processing module 72.
An obtaining module 71, configured to obtain first information and second information; the first information and the second information are respectively one of user similarity, multimedia similarity and search records, and the second information is different from the first information; the user similarity is the similarity between the target user and each other user; the multimedia similarity is the similarity between a first multimedia and each other multimedia, and the first multimedia is the multimedia played by a target user in a first preset time period; the search record is the search record of the target user in a second preset time period.
A processing module 72, configured to determine a first multimedia set according to the first information acquired by the acquiring module 71, and determine a second multimedia set according to the second information acquired by the acquiring module 71. The processing module 72 is further configured to determine at least one multimedia to be recommended, where the at least one multimedia to be recommended belongs to an intersection of the first multimedia set and the second multimedia set. The processing module 72 is further configured to recommend at least one multimedia to be recommended for the target user.
Optionally, the obtaining module 71 is further configured to obtain third information; the third information is one of user similarity, multimedia similarity, and search record, the third information being different from the first information, and the third information being different from the second information.
Optionally, the processing module 72 is further configured to determine a third multimedia set according to the third information acquired by the acquiring module 71. The processing module 72 is specifically configured to determine at least one multimedia to be recommended, where the at least one multimedia to be recommended belongs to an intersection of the first multimedia set, the second multimedia set, and the third multimedia set.
Optionally, when the first information is the user similarity, the processing module 72 is specifically configured to determine at least one target path, where the target path is a path that is pre-established in a network and includes the target user and the first user, and the first user is any other user. And determining the sub-similarity between the target user and the first user in each target path of the at least one target path according to a preset algorithm. And determining the similarity between the target user and the first user according to all the determined sub-similarities.
Optionally, the processing module 72 is further configured to determine, according to the first information, a second user, where a similarity between the second user and the target user is greater than a preset threshold. Correspondingly, the obtaining module 71 is further configured to obtain the playing multimedia records of the second user, and select N multimedia from the playing multimedia records of the second user, where the first multimedia set includes N multimedia, and N is a positive integer.
Optionally, when the first information is multimedia similarity, the obtaining module 71 is further configured to obtain a word vector of the first multimedia and word vectors of each of other multimedia according to a preset algorithm. Correspondingly, the processing module 72 is further configured to calculate a similarity between the word vector of the first multimedia and the word vectors of each of the other multimedia acquired by the acquiring module 71, so as to obtain a multimedia similarity.
Optionally, when the first information is a search record, the processing module 72 is further configured to determine multimedia meeting a preset condition in the search record; determining that the first multimedia set comprises multimedia meeting a preset condition.
In another scheme, the obtaining module 71 of the multimedia recommendation apparatus shown in fig. 7 may be implemented by using a communication interface, and the processing module 72 may be implemented by using one or more processors; referring now to fig. 8, a multimedia recommendation apparatus is provided, comprising: a processor 801, wherein the processor 801 is configured to execute a program or instructions to implement the multimedia recommendation method provided by the above method embodiments. Also included is a communications interface 802, where the communications interface 802 is coupled to the processor 801, and the exemplary communications interface 802 and processor 801 may be coupled via a bus 803.
The processor 801 may be a Central Processing Unit (CPU), a controller MCU, an application-specific integrated circuit (ASIC), or one or more ics for controlling the execution of the multimedia recommendation program provided herein. In particular implementations, processor 801(801-1 and 801-2) may include one or more central processing units, such as CPU0 and CPU1 shown in FIG. 8, as one example. And as an example, the multimedia recommendation apparatus may include a plurality of processors 801, such as the processor 801-1 and the processor 801-2 shown in fig. 8. Each of the processors 801 may be a single-Core Processor (CPU) or a multi-Core Processor (CPU). Processor 801 herein may refer to one or more devices, circuits, and/or processing cores for processing data (e.g., computer program instructions).
Of course, the processor 801 may also be integrated with a storage device of the program or instructions of the multimedia recommendation method, or the storage device may be separately provided, for example, as shown in fig. 8, the memory 804 is separately provided. The memory 804 may be, but is not limited to, a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a Random Access Memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a compact disk read-only memory (CD-ROM) or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The processor 801 executes a program or instructions to control the communication interface 802 to obtain the terminal location, and to cause the multimedia recommendation apparatus to execute the multimedia recommendation method as described above.
The communication interface 802, which may be any transceiver or other communication device, is used to communicate with other devices or communication networks, such as a control system, a Radio Access Network (RAN), a Wireless Local Area Network (WLAN), a server, and the like. The communication interface 802 may include a receiving unit to implement a receiving function and a transmitting unit to implement a transmitting function.
The bus 803 may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, an Extended ISA (EISA) bus, or the like. The bus 803 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown in FIG. 8, but this is not intended to represent only one bus or type of bus.
The embodiment of the present invention further provides a computer-readable storage medium, which includes instructions, and when the instructions are executed on a computer, the multimedia recommendation method provided in the above embodiment can be implemented.
The embodiment of the present invention further provides a computer program product, where the computer program product includes an instruction code, and the instruction code is used to execute an instruction to implement the multimedia recommendation method provided in the above embodiment.
While the present embodiments have been described with reference to the accompanying drawings, it is to be understood that the invention is not limited to the precise embodiments described above, which are meant to be illustrative and not restrictive, and that various changes may be made therein by those skilled in the art without departing from the spirit and scope of the invention as defined by the appended claims.