A video recommendation method, apparatus and electronic device
By vectorizing the historical playback sequence of the target object and learning multi-target features, a multi-target vector of the object is generated, which solves the problems of large computational load and low recall accuracy in the existing technology and achieves efficient and accurate video recommendation.
Patent Information
- Application Number
- CN202211526679.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-30
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-11-30
AI Technical Summary
Existing video recall structures are computationally intensive, resulting in low recommendation efficiency and insufficient recall accuracy, and they cannot simultaneously fit multiple target vectors.
By acquiring the object feature vector and historical playback sequence of the target object, vectorization is performed to generate object enhancement vectors. Vector concatenation and multi-target feature learning are then performed to obtain multi-target vectors of the object, thereby determining the target recommended video in the video library to be recommended.
It reduces the amount of data computation during video recall, improves the efficiency and accuracy of video recommendation, and enables accurate analysis of target objects across multiple dimensions.
Smart Images

Figure CN117009575B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the Internet field, and relate to but are not limited to a video recommendation method and device and electronic equipment. BACKGROUND
[0002] At present, in the field of video recommendation, the commonly used video recall structure includes a double tower structure and a double enhancement double tower structure.
[0003] The double tower structure, as a classic recall structure, has been widely used in recommendation scenarios due to its convenient offline training and fast online retrieval. The most obvious feature of the double tower structure is "double tower independence", that is, the target vector of a large amount of content can be calculated in batches offline, and online does not need to be calculated repeatedly, and only needs to calculate the user target vector once online, and then uses the nearest neighbor algorithm to quickly retrieve similar content. However, "double tower independence" also limits the model effect, and the double tower structure lacks the opportunity for cross learning of user features and content features, but cross features and cross learning can significantly improve the model effect. The double enhancement double tower structure generates a vector used to fit the information of the other tower at the input layer of the user tower and the content tower, which is called an "enhancement vector". The enhancement vector is constantly updated through the target vector of the other tower and participates in the calculation process of the target vector. However, the parameter size of the enhancement vector of the user tower in the double enhancement double tower structure is too large, and the tower structure does not support multiple targets, and the enhancement vector cannot fit multiple target vectors at the same time.
[0004] Therefore, the video recall structure in the related technology has a large parameter size when performing recall calculation, resulting in a large amount of calculation, so that the recall process has a high calculation delay when recommending videos, which reduces the efficiency of video recommendation. Moreover, since multiple-dimensional target vectors cannot be fitted at the same time, the accuracy of the recall calculation is low. SUMMARY
[0005] The embodiments of the present application provide a video recommendation method, device and electronic equipment, which can at least be applied to the fields of artificial intelligence and video recommendation, and can improve the efficiency and accuracy of video recall.
[0006] The technical scheme of the embodiments of the present application is implemented as follows:
[0007] The embodiment of the present application provides a video recommendation method, comprising: obtaining an object feature vector of a target object, a historical play sequence in a preset historical time period and a video multi-target vector index of each to-be-recommended video in a to-be-recommended video library; performing vectorization processing on the historical play sequence to obtain an object enhanced vector of the target object; performing vector splicing processing and multi-target feature learning on the object feature vector and the object enhanced vector in sequence to obtain an object multi-target vector of the target object; and determining a target recommended video corresponding to the target object from the to-be-recommended video library based on the object multi-target vector and the video multi-target vector index of each to-be-recommended video.
[0008] The embodiment of the present application provides a video recommendation device, comprising: an acquisition module, configured to obtain an object feature vector of a target object, a historical play sequence in a preset historical time period and a video multi-target vector index of each to-be-recommended video in a to-be-recommended video library; a vectorization processing module, configured to perform vectorization processing on the historical play sequence to obtain an object enhanced vector of the target object; a multi-target processing module, configured to perform vector splicing processing and multi-target feature learning on the object feature vector and the object enhanced vector in sequence to obtain an object multi-target vector of the target object; and a determination module, configured to determine a target recommended video corresponding to the target object from the to-be-recommended video library based on the object multi-target vector and the video multi-target vector index of each to-be-recommended video.
[0009] The embodiment of the present application provides an electronic device, comprising: a memory, configured to store executable instructions; and a processor, configured to execute the executable instructions stored in the memory to implement the video recommendation method.
[0010] The embodiment of the present application provides a computer program product, comprising executable instructions stored in a computer readable storage medium; wherein the processor of the electronic device reads the executable instructions from the computer readable storage medium and executes the executable instructions to implement the video recommendation method.
[0011] The embodiment of the present application provides a computer readable storage medium, storing executable instructions, configured to cause the processor to execute the executable instructions to implement the video recommendation method.
[0012] The embodiments of the present application have the following beneficial effects: the historical play sequence of the target object is vectorized to obtain an object enhancement vector of the target object, and an object multi-target vector of the target object is obtained based on the object enhancement vector of the target object, and the object multi-target vector is an object feature vector fused with the object enhancement vector. In this way, when the target recommendation video is determined from the video recommendation library based on the object multi-target vector and the video multi-target vector index of each video to be recommended, the target object can be accurately analyzed in combination with the information of the target object in multiple dimensions, so that video recall can be accurately performed. Moreover, since the object enhancement vector is generated based on the historical play sequence of the target object, the historical play sequence is the play record of the target object to the video, and the number of the play record is significantly reduced compared with the number of the target object in the video application, so that the data calculation amount during video recall can be greatly reduced, thereby greatly improving the efficiency of video recommendation. BRIEF DESCRIPTION OF DRAWINGS
[0013] Figure 1 is a structure diagram of a double-tower structure in the related art;
[0014] Figure 2 is a structure diagram of a double-enhanced double-tower structure in the related art;
[0015] Figure 3 is a schematic diagram of one optional architecture of a video recommendation system provided by the embodiments of the present application;
[0016] Figure 4 is a structure diagram of an electronic device provided by the embodiments of the present application;
[0017] Figure 5 is a schematic diagram of one optional flow of a video recommendation method provided by the embodiments of the present application;
[0018] Figure 6 is another schematic diagram of one optional flow of a video recommendation method provided by the embodiments of the present application;
[0019] Figure 7 is a flow diagram of a video multi-target vector index creation method provided by the embodiments of the present application;
[0020] Figure 8 is a flow diagram of vectorization processing of a historical play sequence provided by the embodiments of the present application;
[0021] Figure 9 is a flow diagram of vector splicing processing and multi-target feature learning provided by the embodiments of the present application;
[0022] Figure 10 is a flow diagram of determining a target recommendation video provided by the embodiments of the present application;
[0023] Figure 11 FIG. 1 is a flowchart of a method for training a video recall model according to an embodiment of the present application;
[0024] Figure 12 FIG. 2 is a flowchart of a method for obtaining sample data according to an embodiment of the present application;
[0025] Figure 13 FIG. 3 is a flowchart of a method for determining a target loss result according to an embodiment of the present application;
[0026] Figure 14 FIG. 4 is a flowchart of another method for determining a target loss result according to an embodiment of the present application;
[0027] Figure 15 FIG. 5 is a flowchart of a method for determining an object enhancement loss and a video enhancement loss based on a multi-target network according to an embodiment of the present application;
[0028] Figure 16 FIG. 6 is an interface diagram of a video application home page according to an embodiment of the present application;
[0029] Figure 17 FIG. 7 is an interface diagram of a material card according to an embodiment of the present application;
[0030] Figure 18 FIG. 8 is a flowchart of a calculation process according to an embodiment of the present application;
[0031] Figure 19 FIG. 9 is a flowchart of a feature vector generation process according to an embodiment of the present application;
[0032] Figure 20 FIG. 10 is a flowchart of a user enhancement vector generation process according to an embodiment of the present application;
[0033] Figure 21 FIG. 11 is a structural diagram of a PLE network according to an embodiment of the present application;
[0034] Figure 22 FIG. 12 is a flowchart of a method for determining a similarity score according to an embodiment of the present application;
[0035] Figure 23 FIG. 13 is a flowchart of a training process according to an embodiment of the present application;
[0036] Figure 24 FIG. 14 is a flowchart of an implementation process for screening positive and negative examples according to an embodiment of the present application;
[0037] Figure 25 FIG. 15 is a flowchart of an implementation process for associating features according to an embodiment of the present application;
[0038] Figure 26 FIG. 16 is a structural diagram of an MMOE network according to an embodiment of the present application. DETAILED DESCRIPTION
[0039] In order to make the purposes, technical solutions and advantages of the present application clearer, the following will further describe the present application in conjunction with the accompanying drawings, and the described embodiments should not be regarded as limitations to the present application. All other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0040] In the following description, “some embodiments” are related to a subset of all possible embodiments, but it can be understood that “some embodiments” can be the same subset or different subsets of all possible embodiments, and can be combined with each other without conflict. Unless otherwise defined, all technical and scientific terms used in the embodiments of the present application have the same meaning as understood by those skilled in the art to which the embodiments of the present application belong. The terms used in the embodiments of the present application are only for the purpose of describing the embodiments of the present application and are not intended to limit the present application.
[0041] The related data collection and processing in the embodiments of the present application should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.
[0042] Before explaining the video recommendation method of the embodiments of the present application, the video recommendation method and video recall model in the related art are first described.
[0043] Figure 1 is a structural schematic diagram of the double-tower structure in the related art, as shown in Figure 1 The double-tower structure is composed of a user tower 11 for generating a user target vector and a content tower 12 for generating a content target vector. During offline training, first, the object feature 111 is input into the user tower 11, and the content feature 121 is input into the content tower 12. Then, the inner product and the like of the user target vector 112 and the content target vector 122 output by the double towers are calculated as a prediction value. Finally, the model parameters of the double-tower structure are continuously updated by reducing the loss function of the corresponding scene target. In addition, a double-enhanced double-tower structure is proposed, as shown in Figure 2 The double-enhanced double-tower structure generates a vector for fitting the information of the other tower at the input layer of the user tower 21 and the content tower 22, which is called an “enhancement vector”, i.e., a user enhancement vector 211 and a content enhancement vector 221. The enhancement vector is continuously updated by the target vector of the other tower and participates in the calculation process of the target vector.
[0044] Although the double-enhanced double-tower structure can solve the problem of insufficient user and content cross to a certain extent, the following problems are introduced: first, the parameter size of the user enhancement vector is too large. Second, the tower structure does not support multiple targets. Third, the enhancement vector cannot simultaneously fit multiple target vectors.
[0045] Based on at least one of the above problems existing in the double-enhanced double-tower structure in the related art, the embodiments of the present application provide a video recommendation method. In the video recommendation method provided by the embodiments of the present application, first, the object feature vector of a target object, the historical play sequence in a preset historical time period, and the video multi-target vector index of each to-be-recommended video in a to-be-recommended video library are obtained. Then, the historical play sequence is vectorized to obtain the object enhancement vector of the target object. The object feature vector and the object enhancement vector are sequentially subjected to vector splicing processing and multi-target feature learning to obtain the object multi-target vector of the target object. Finally, based on the object multi-target vector and the video multi-target vector index of each to-be-recommended video, a target recommended video corresponding to the target object is determined from the to-be-recommended video library. In this way, the target object can be accurately analyzed in combination with the information of the target object in multiple dimensions, so that video recall can be accurately performed. Moreover, since the object enhancement vector is generated based on the historical play sequence of the target object, the historical play sequence is the play record of the target object on the video, and the number of the play record will obviously decrease compared to the number of target objects in the video application. Therefore, the data calculation amount during video recall can be greatly reduced, and the efficiency of video recommendation can be greatly improved.
[0046] The following describes an exemplary application of the video recommendation device of the embodiments of the present application, which is an electronic device for implementing the video recommendation method. In an implementation manner, the video recommendation device (i.e., the electronic device) provided by the embodiments of the present application can be implemented as a terminal or a server. In an implementation manner, the video recommendation device provided by the embodiments of the present application can be implemented as any terminal with a video data processing function, such as a notebook computer, a tablet computer, a desktop computer, a mobile phone, a portable music player, a personal digital assistant, a dedicated message device, a portable game device, a smart robot, a smart home appliance, and a smart vehicle device. In another implementation manner, the video recommendation device provided by the embodiments of the present application can also be implemented as a server. The server can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content distribution networks (CDN, Content Delivery Network), and big data and artificial intelligence platforms, and the like. The terminal and the server can be directly or indirectly connected through wired or wireless communication, which is not limited in the embodiments of the present application. The following describes an exemplary application of the video recommendation device implemented as a server.
[0047] Referring to Figure 3 , Figure 3 is an optional architecture schematic diagram of the video recommendation system provided by the embodiments of the present application, and the embodiments of the present application are described by taking an example of the video recommendation method applied to any video application. In the video application, there are multiple curated pages and vertical channels, and a user can see a purposeless area after sliding down the curated pages and the vertical channels. The video recommendation method of the embodiments of the present application can be applied to the recommendation of the videos displayed in the purposeless area. In the embodiments of the present application, the video recommendation system at least includes a terminal 100, a network 200, and a server 300. The server 300 can be a server of the video application. The server 300 can constitute the video recommendation device of the embodiments of the present application. The terminal 100 is connected to the server 300 through the network 200, and the network 200 can be a wide area network or a local area network, or a combination of the two.
[0048] In the embodiments of the present application, when performing video recommendation, the terminal 100 receives a browsing operation (for example, a pull-down operation in any vertical channel) of a user through a client of a video application, and in response to the browsing operation, obtains the object feature and the historical play sequence of the user, encapsulates the object feature and the historical play sequence into a video recommendation request, and sends the video recommendation request to the server 300 through the network 200. After receiving the video recommendation request, the server 300 obtains the object feature and the historical play sequence of the user in response to the video recommendation request, obtains the object feature vector of the user based on the object feature, and obtains the video multi-target vector index of each to-be-recommended video in the to-be-recommended video library. Then, the historical play sequence is processed by vectorization to obtain the object enhancement vector of the target object, and the object feature vector and the object enhancement vector are sequentially processed by vector splicing and multi-target feature learning to obtain the object multi-target vector of the target object. Then, based on the object multi-target vector and the video multi-target vector index of each to-be-recommended video, the target recommended video is determined from the to-be-recommended video library. After obtaining the target recommended video, the server 300 sends the target recommended video to the terminal 100, so that the terminal 100 displays the target recommended video to the user in the purposeless area of the current interface.
[0049] In some other embodiments, the video recommendation device can also be implemented as a terminal, that is, the terminal is the execution subject to implement the video recommendation method of the embodiments of the present application. In the implementation process, the terminal obtains the browsing operation of the user through the client of the video application, and in response to the browsing operation, obtains the object feature vector of the user, the historical play sequence in the preset historical time period, and the video multi-target vector index of each to-be-recommended video in the to-be-recommended video library. Then, the video recommendation method of the embodiments of the present application is used to recall the target recommended video, and after obtaining the target recommended video, the target recommended video is displayed to the user in the purposeless area of the current interface.
[0050] The video recommendation method provided by the embodiments of the present application can also be implemented based on a cloud platform and through cloud technology, for example, the server 300 described above can be a cloud server. The cloud server is used to perform vectorization processing on the historical play sequence, or the cloud server is used to sequentially perform vector splicing processing and multi-target feature learning on the object feature vector and the object enhancement vector, and the cloud server is used to determine the target recommended video from the to-be-recommended video library based on the object multi-target vector and the video multi-target vector index of each to-be-recommended video.
[0051] In some embodiments, a cloud storage can also be provided, and the video library to be recommended and the video multi-target vector index of each video to be recommended can be stored in the cloud storage, or the object feature vector of the user and the historical playback sequence in a preset historical time period can also be stored in the cloud storage, or the target recommended video can also be stored in the cloud storage. In this way, when receiving a video recommendation request, the corresponding information can be obtained from the cloud storage to recall the target recommended video, thereby improving the efficiency of recalling the target recommended video and further improving the efficiency of video recommendation.
[0052] It should be noted that the cloud technology refers to a hosting technology that unifies a series of resources such as hardware, software, network, etc. in a wide area network or a local area network to realize data calculation, storage, processing and sharing. The cloud technology is a general term of network technology, information technology, integration technology, management platform technology, application technology, etc. based on the cloud computing business model application, which can form a resource pool and be used on demand, flexibly and conveniently. Cloud computing technology will become an important support. The background service of the technical network system needs a large amount of computing and storage resources, such as video websites, picture websites and more portals. With the high development and application of the Internet industry, every item in the future may have its own identification mark and needs to be transmitted to the background system for logical processing. Different levels of data will be processed separately, and various industry data needs strong system support, which can be realized through cloud computing.
[0053] Figure 4 is a structural schematic diagram of an electronic device provided by the embodiment of the application, Figure 4 The electronic device shown can be a video recommendation device, and the video recommendation device includes at least one processor 310, a memory 350, at least one network interface 320 and a user interface 330. The various components in the video recommendation device are coupled together through a bus system 340. It can be understood that the bus system 340 is used to realize the connection and communication between the components. In addition to including a data bus, the bus system 340 also includes a power bus, a control bus and a status signal bus. However, for the purpose of clear illustration, all kinds of buses are marked as the bus system 340 in Figure 4 .
[0054] The processor 310 can be an integrated circuit chip with signal processing capability, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor or any conventional processor.
[0055] The user interface 330 includes one or more output devices 331 that enable presentation of media content, and one or more input devices 332.
[0056] The memory 350 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, and the like. The memory 350 optionally includes one or more storage devices remotely located from the processor 310. The memory 350 comprises a volatile memory or non-volatile memory, and can also include both volatile and non-volatile memory. Non-volatile memory can be read only memory (ROM), volatile memory can be random access memory (RAM). The memory 350 described in embodiments of the present application is intended to include any suitable type of memory. In some embodiments, the memory 350 is capable of storing data to support various operations, examples of which include programs, modules, and data structures or a subset or superset thereof, which are exemplarily explained below.
[0057] The operating system 351 includes systems programs for handling various basic system services and for performing hardware dependent tasks, such as a framework layer, a core library layer, a driver layer, and the like, for implementing various basic services and processing hardware-based tasks; a network communication module 352 for reaching other computing devices via one or more (wired or wireless) network interfaces 320, exemplary network interfaces 320 including Bluetooth, wireless fidelity (WiFi), and universal serial bus (USB), and the like; an input processing module 353 for detecting and translating one or more user inputs or interactions from one or more input devices 332.
[0058] In some embodiments, the apparatus provided by embodiments of the present application can be realized in software, Figure 4 A video recommendation apparatus 354 stored in the memory 350 is shown, which can be a video recommendation apparatus in an electronic device, and can be software in the form of programs and plug-ins, etc., including the following software modules: an acquisition module 3541, a vectorization processing module 3542, a multi-target processing module 3543, and a determination module 3544, which are logical, and thus can be combined or further split according to the functions implemented. The functions of each module will be explained below.
[0059] In some embodiments, the apparatus provided by the embodiments of the present application can be implemented in a hardware manner. For example, the apparatus provided by the embodiments of the present application can be a processor in the form of a hardware coding processor programmed to perform the video recommendation method provided by the embodiments of the present application. For example, the processor in the form of a hardware coding processor can be implemented by using one or more application specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field programmable gate arrays (FPGAs), or other electronic elements.
[0060] The video recommendation method provided by the embodiments of the present application can be executed by an electronic device, which can be a server or a terminal. That is, the video recommendation method provided by the embodiments of the present application can be executed by a server, a terminal, or an interaction between the server and the terminal.
[0061] Figure 5 FIG. 1 is a flowchart of a video recommendation method provided by an embodiment of the present application. The video recommendation method provided by the embodiments of the present application will be described below in combination with the steps shown in FIG. 1. It should be noted that the video recommendation method provided by the embodiments of the present application is described below by taking a server as an example of an execution subject. As shown in FIG. 1, the method includes the following steps S101 to S104. Figure 5 Figure 5 Figure 5 As shown in FIG. 1, the method includes the following steps S101 to S104.
[0062] In step S101, an object feature vector of a target object, a historical play sequence in a preset historical time period, and a video multi-target vector index of each to-be-recommended video in a to-be-recommended video library are obtained.
[0063] Here, the object feature vector is obtained by vectorizing the object features of the target object. The object features of the target object include, but are not limited to, at least one of the following: age, gender, education, label, video browsing record, and interest of the target object. The vectorization of the object features can be achieved by feature extraction. When vectorizing, a preset feature vector table can be queried to obtain the feature vector corresponding to each object feature, thereby obtaining the object feature vector of the target object. In the implementation process, since the object features include multiple feature information, the feature vector corresponding to each feature information can be queried from the preset feature vector table, and then the feature vectors corresponding to all the feature information are spliced to form a multi-dimensional object feature vector.
[0064] The feature vector table includes two dimensions, the first dimension is a feature identifier, and the second dimension is a corresponding vector of each feature. Vectors of different features are independent, that is, a target object (for example, a user) can have an object feature vector table, and a video can have a video feature vector table. An object feature vector of the target object and a video feature vector of a video to be recommended can be queried based on the object feature vector table and the video feature vector table, respectively.
[0065] In the embodiments of the present application, since the object features include discrete features and continuous features, when performing vectorization processing, for the discrete features, the feature vector table can be directly queried to obtain the feature vectors of the discrete features; for the continuous features, the continuous features can be discretized to obtain discretized features, and then the feature vector table is queried to obtain the feature vectors corresponding to the discretized features. Here, the discretization processing can be equal-frequency partitioning of the continuous features using a specific equal-frequency partition interval to obtain a plurality of discretized features.
[0066] In the embodiments of the present application, the feature vector table can be pre-constructed for feature vector query. The pre-constructed feature vector table can be stored in a preset storage unit, and when performing vectorization processing, the feature vector table is obtained from the preset storage unit for feature vector query. In some embodiments, the feature vector table can also be updated according to the update of the video recall model and the update of the feature information. For example, when there is new feature information, the feature vector of the feature information is obtained, and the feature vector is updated to the feature vector table.
[0067] The historical play sequence refers to a video sequence played by a target object (for example, a user) in a preset historical time period. The historical play sequence includes the video identifier of the historical play video and the play duration of each historical play video.
[0068] The to-be-recommended video library includes a plurality of to-be-recommended videos. The to-be-recommended videos include videos that a user can be interested in and videos that the user is not interested in. In the to-be-recommended video library, there are a large number of candidate videos. The video recommendation method of the present application is to accurately select the videos that the user is interested in from the large number of candidate videos as target recommended videos for video recommendation to the user.
[0069] Each to-be-recommended video has a video multi-target vector index, which is index information of the video multi-target vector used to query the video multi-target vector of the to-be-recommended video. In the embodiment of the application, the video multi-target vector of each to-be-recommended video can be generated in advance. After the video multi-target vector is generated, the video multi-target vectors of all to-be-recommended videos can be stored in a preset video multi-target vector storage unit. Moreover, when the video multi-target vector is stored, the index information corresponding to each video multi-target vector can also be generated, which is used to index the storage location of the video multi-target vector, so that the video multi-target vector can be obtained based on the video multi-target vector index.
[0070] In the embodiment of the application, the video multi-target vector of each to-be-recommended video can be generated before video recommendation, or the video multi-target vector of a to-be-recommended video can be generated simultaneously when the to-be-recommended video is generated, and the video multi-target vector index of the video multi-target vector can be created. The video multi-target vector index can be used to query the video multi-target vector of the to-be-recommended video in real time online, and the generation of the video multi-target vector is not required each time the video is recommended, that is, the video multi-target vector does not need to be repeatedly generated, thereby greatly reducing the data calculation amount during video recommendation and improving the video recommendation efficiency.
[0071] In step S102, the historical play sequence is vectorized to obtain the object enhancement vector of the target object.
[0072] Here, when the historical play sequence is vectorized, the preset feature vector table can be queried to obtain the object enhancement vector of the target object. In the preset feature vector table, the feature vector corresponding to each sequence information in the historical play sequence is queried. In the implementation process, since the historical play sequence includes multiple sequence information, each sequence information includes the video identifier of the historical play video and the play duration of each historical play video, therefore, the feature vector corresponding to the video identifier and the feature vector corresponding to the play duration can be queried.
[0073] In the embodiment of the present application, first, the feature vector table of each video identifier in the historical play sequence is retrieved, a video vector set can be generated, and the number of video vectors in the video vector set is consistent with the number of video identifiers in the historical play sequence. Then, the total duration of the historical play sequence is counted, the play duration in the entire sequence information is summed to obtain the total duration, and each play duration in the historical play sequence is divided by the total duration to obtain the normalized duration corresponding to each play duration, which is used as the video vector weight. The number of video vector weights is also consistent with the number of video ids in the sequence. Finally, each video vector in the video vector set is multiplied by the corresponding video vector weight to obtain a video weighted vector set, and the entire video weighted vector set in the video weighted vector set is merged to obtain the user enhancement vector. Here, merging the entire video weighted vector set in the video weighted vector set can mean that the entire video weighted vector set in the video weighted vector set is spliced to obtain a multi-dimensional user enhancement vector, wherein the dimension of the user enhancement vector is equal to the sum of the dimensions of the entire video weighted vector.
[0074] In step S103, the object feature vector and the object enhancement vector are sequentially subjected to vector splicing processing and multi-target feature learning to obtain the object multi-target vector of the target object.
[0075] Here, the object feature vector and the object enhancement vector are sequentially subjected to vector splicing processing to obtain the object splicing vector, which is a splicing vector in which the target object fuses the object feature vector and the object enhancement vector. The dimension of the object splicing vector is equal to the sum of the dimensions of the object feature vector and the object enhancement vector.
[0076] After the vector splicing processing, the object splicing vector is subjected to multi-target feature learning. Here, the multi-target feature learning means learning the object target vector of the object splicing vector under different target dimensions through the pre-trained multi-target neural network. The different target dimensions include but are not limited to the click dimension related to the user click behavior and the duration dimension related to the user browsing duration. In the embodiment of the present application, the click target vector and the duration target vector of the target object can be learned through the multi-target neural network, so as to obtain the object multi-target vector of the target object.
[0077] In some embodiments, the multi-target neural network can be implemented as a PLE network, which mainly includes: an expert network for learning multiple targets, a shared network for learning common information between different expert networks, and a gate network for calculating the weight corresponding to each vector when fusing the output vectors of multiple networks. For example, if two targets of click and duration need to be learned, two sets of expert networks are needed. The shared network is fixed as one regardless of the number of targets to be learned. The length of the last layer output vector of the gate network is the same as the number of weights to be determined.
[0078] In step S104, the target recommended video is determined from the recommended video library based on the object multi-target vector and the video multi-target vector index of each recommended video.
[0079] Here, the video multi-target vector of the recommended video can be obtained based on the video multi-target vector index of the recommended video, and the inner product between the object multi-target vector and the video multi-target vector is calculated, and the calculated inner product is determined as the similarity score between the target object and the corresponding recommended video. The target recommended video is determined from the recommended video library based on the similarity score.
[0080] In determining the target recommended video, in one implementation, the recommended video with a similarity score greater than a score threshold can be selected as the target recommended video; in another implementation, the recommended videos in the recommended video library can be sorted based on the similarity score to form a recommended video sequence, and then the first N recommended videos in the recommended video sequence are selected as the target recommended video.
[0081] After the server obtains the target recommended video, the target recommended video can be sent to the terminal, and the target recommended video is recommended to the target object through the terminal.
[0082] In the embodiments of the present application, the target recommended video can be displayed on the terminal of the target object, for example, the target recommended video can be displayed on the client of the video application.
[0083] The video recommendation method provided in the embodiments of the present application performs vectorization processing on the historical play sequence of the target object to obtain the object enhanced vector of the target object, and then obtains the object multi-target vector of the target object based on the object enhanced vector of the target object. The object multi-target vector is an object feature vector that fuses the object enhanced vector. In this way, when the target recommended video is determined from the recommended video library based on the object multi-target vector and the video multi-target vector index of each recommended video, the target object can be accurately analyzed in combination with the information of the target object in multiple dimensions, so that the video recall can be accurately performed. Moreover, since the object enhanced vector is generated based on the historical play sequence of the target object, and the historical play sequence is the play record of the target object to the video, the number of the play record will obviously decrease compared to the number of the target objects in the video application, so the data calculation amount in the video recall can be greatly reduced, thereby greatly improving the efficiency of the video recommendation.
[0084] In some embodiments, the video recommendation system includes at least a terminal and a server, and a video application is installed on the terminal. When a user performs a pull-to-refresh operation and a page pull-down operation in the video application, a target recommendation video can be recalled by using the method of the embodiments of the present application, and the target recommendation video is displayed on a current interface of the video application, thereby achieving video recommendation for the user.
[0085] Figure 6 is another optional flowchart of the video recommendation method provided by the embodiments of the present application, as shown in Figure 6 The method includes the following steps S201 to S210.
[0086] In step S201, the terminal receives a browsing operation of a target object.
[0087] Here, the browsing operation can be a pull-down operation in any vertical channel of the video application. The client of the video application can receive the pull-down operation of the user to obtain the browsing operation.
[0088] In step S202, the terminal obtains object features and a historical play sequence of the target object in response to the browsing operation.
[0089] Here, when the client obtains the browsing operation, the object features and the historical play sequence of the target object are obtained. The object features can be information input by the user when the user registers and uses the video application, and the video application stores the information as the object features of the target object. During use of the video application by the user, the video application collects play records of the user, and each play record records a video identifier of a played video, a play time, a play duration, and the like. The play records in a preset historical time period can be selected based on the play time to form the historical play sequence.
[0090] The preset historical time period can be a specific time period before the current time, for example, a preset historical time period of one month, half a year, or the like before the current time.
[0091] In step S203, the terminal encapsulates the object features and the historical play sequence into a video recommendation request.
[0092] In step S204, the terminal sends the video recommendation request to the server.
[0093] In step S205, the server obtains an object feature vector based on the object features, and obtains a historical play sequence in a preset historical time period and a video multi-target vector index of each to-be-recommended video in a to-be-recommended video library in response to the video recommendation request.
[0094] In some embodiments, before the video multi-target vector index of each to-be-recommended video in the to-be-recommended video library is acquired in step S205, a video multi-target vector of each to-be-recommended video in the to-be-recommended video library can also be generated in advance, and a video multi-target vector index of each to-be-recommended video is created and stored, so that when a target recommended video is recalled later, the video multi-target vector can be queried based on the video multi-target vector index, without the need to generate the video multi-target vector of the to-be-recommended video again, thereby greatly improving the efficiency of target recommended video recall. The embodiment of the present application provides a method for creating a video multi-target vector index, Figure 7 is a flowchart of a method for creating a video multi-target vector index provided by the embodiment of the present application, as shown in Figure 7 The method for creating a video multi-target vector index can be executed by a server, and the method comprises the following steps S301 to S304.
[0095] Step S301: Based on the video identifier of each to-be-recommended video, a preset feature vector table is retrieved to obtain a video enhanced vector of each to-be-recommended video.
[0096] Here, the video enhanced vector of each to-be-recommended video can be obtained by retrieving the preset feature vector table based on the video identifier of each to-be-recommended video.
[0097] The feature vector table comprises two dimensions, the first dimension is a feature identifier, and the second dimension is a vector corresponding to each feature. The vectors of different features are independent, that is, for a target object (for example, a user), an object feature vector table can be provided, and for a video, a video feature vector table can be provided, and the object feature vector of the target object and the video feature vector of the to-be-recommended video can be queried based on the object feature vector table and the video feature vector table, respectively.
[0098] Step S302: The video feature vector and the video enhanced vector of each to-be-recommended video are subjected to vector splicing processing to obtain a video splicing vector of each to-be-recommended video.
[0099] In the embodiment of the present application, the video feature vector is generated in the same way as the object feature vector of the target object, and can be queried based on the video feature vector table to obtain the video feature vector of the to-be-recommended video.
[0100] Here, the video feature vector and the video enhanced vector can be subjected to vector splicing processing, and when the vector splicing processing is performed, the video feature vector and the video enhanced vector can be connected into a vector with a higher dimension, that is, a video splicing vector. The dimension of the video splicing vector is equal to the sum of the dimensions of the video feature vector and the video enhanced vector.
[0101] Step S303, multi-target feature learning is performed on the video concatenation vector of each video to be recommended, and a video multi-target vector of each video to be recommended is obtained.
[0102] In some embodiments, when performing multi-target feature learning on the video concatenation vector of each video to be recommended, the following method can be used: first, for each video to be recommended, multi-target feature learning is performed on the video concatenation vector of the video to be recommended by using a multi-target neural network to obtain a video target vector of the video to be recommended in multiple target dimensions; then, a target weight in each target dimension is obtained; the video target vector in each target dimension is weighted and calculated respectively by using the target weight to obtain a weighted video target vector; and finally, the weighted video target vectors in the multiple target dimensions are concatenated to obtain the video multi-target vector of the video to be recommended.
[0103] Here, the click dimension and the duration dimension are taken as examples. In the embodiments of the present application, the multi-target neural network can output a video click target vector of the video to be recommended in the click dimension and a video duration target vector of the video to be recommended in the duration dimension (wherein the video click target vector and the video duration target vector constitute the video target vector), and the video to be recommended has a click target weight in the click dimension and a duration target weight in the duration dimension. When performing the concatenation processing, the product of the click target weight and the video click target vector and the product of the duration target weight and the video duration target vector are calculated respectively, and then the two products are added to obtain the video multi-target vector of the video to be recommended. That is, the video click target vector and the video duration target vector are weighted and summed by using the click target weight and the duration target weight to obtain the video multi-target vector.
[0104] It should be noted that the click target weight and the duration target weight are both parameters in the video recall model, and the updating method of the click target weight and the duration target weight will be described below.
[0105] Step S304, a video multi-target vector index corresponding to the video multi-target vector of each video to be recommended is created.
[0106] In the embodiments of the present application, the video multi-target vector index is index information used to query the video multi-target vector of the video to be recommended. After obtaining the video multi-target vector of each video to be recommended, the video multi-target vectors of all the videos to be recommended can be stored in a preset video multi-target vector storage unit. When storing the video multi-target vectors, index information corresponding to each video multi-target vector can also be generated, and the index information is used to index the storage location of the video multi-target vector, so that the video multi-target vector can be obtained based on the video multi-target vector index.
[0107] In the embodiments of the present application, the video multi-target vector of the video to be recommended can be queried in real time online through the video multi-target vector index, and the generation of the video multi-target vector is not required each time the video is recommended, that is, the video multi-target vector is not required to be repeatedly generated, thereby greatly reducing the data calculation amount during video recommendation and improving the video recommendation efficiency.
[0108] In step S206, the server vectorizes the historical play sequence to obtain the object enhancement vector of the target object.
[0109] In some embodiments, referring to Figure 8 , Figure 8 It is shown that step S206 can be implemented through the following steps S2061 to S2066:
[0110] In step S2061, the historical video identifier and the historical play duration of each historical play video in the historical play sequence are obtained.
[0111] In step S2062, the preset feature vector table is searched based on each historical video identifier to obtain a historical video vector set.
[0112] The number of historical video vectors in the historical video vector set is the same as the number of historical video identifiers in the historical play sequence.
[0113] In step S2063, the historical play durations in the historical play sequence are counted to obtain a total historical play duration.
[0114] Here, the sum of the historical play durations of all the historical play videos in the historical play sequence can be calculated to obtain the total historical play duration.
[0115] In step S2064, the historical play duration of each historical play video is normalized based on the total historical play duration to obtain a normalized play duration of each historical play video, and the normalized play duration is determined as the video vector weight of the corresponding historical play video.
[0116] Here, the normalization processing can be normalization processing of each historical play duration by the total historical play duration. In the implementation process, each historical play duration can be divided by the total historical play duration, and the quotient value obtained by the calculation is determined as the normalized play duration of each historical play video. After each historical play video obtains the corresponding normalized play duration, the normalized play duration is determined as the video vector weight of the historical play video.
[0117] In step S2065, each historical video vector in the historical video vector set is weighted based on the video vector weight to obtain a video weighted vector set.
[0118] The historical video vector set includes historical video vectors corresponding to all historical played videos. Each historical video vector in the historical video vector set is multiplied by a corresponding video vector weight to obtain a plurality of video weighted vectors, thereby forming a video weighted vector set.
[0119] In step S2066, the video weighted vectors in the video weighted vector set are merged to obtain an object enhancement vector of the target object.
[0120] Here, the merging refers to splicing all the video weighted vectors in the video weighted vector set into one vector with higher dimensions, i.e., the object enhancement vector. The dimensions of the object enhancement vector are equal to the sum of the dimensions of all the video weighted vectors.
[0121] In step S207, the server sequentially performs vector splicing processing and multi-target feature learning on the object feature vector and the object enhancement vector to obtain an object multi-target vector of the target object.
[0122] In some embodiments, referring to Figure 9 , Figure 9 It is shown that step S207 can be implemented by steps S2071 to S2073 as follows:
[0123] In step S2071, the object feature vector and the object enhancement vector are spliced to obtain an object splicing vector.
[0124] The object splicing vector refers to a splicing vector in which the target object fuses the object feature vector and the object enhancement vector. The dimensions of the object splicing vector are equal to the sum of the dimensions of the object feature vector and the object enhancement vector.
[0125] In step S2072, the object splicing vector is learned by a multi-target neural network to obtain object target vectors of the target object in multiple target dimensions.
[0126] The multi-target feature learning refers to learning the object target vectors of the object splicing vector in different target dimensions by a pre-trained multi-target neural network. The different target dimensions include but are not limited to a click dimension related to the user click behavior and a duration dimension related to the user browsing duration.
[0127] In step S2073, the object target vectors in the multiple target dimensions are spliced to obtain an object multi-target vector of the target object.
[0128] In the embodiments of the present application, the click target vector and the duration target vector of the target object can be learned by the multi-target neural network, and then the click target vector and the duration target vector are spliced to obtain the object multi-target vector of the target object.
[0129] Step S208, the server determines the target recommended video from the recommended video library based on the object multi-target vector and the video multi-target vector index of each recommended video.
[0130] In some embodiments, referring to Figure 10 , Figure 10 It is shown that step S208 can be implemented by the following steps S2081 to S2084:
[0131] Step S2081, the video multi-target vector of each recommended video is obtained based on the video multi-target vector index.
[0132] Here, the storage location of the video multi-target vector of each recommended video can be determined based on the video multi-target vector index, and then the stored video multi-target vector is obtained from the storage location.
[0133] Step S2082, the inner product between the object multi-target vector and the video multi-target vector of each recommended video is determined, and the inner product is determined as the similarity score between the target object and the recommended video.
[0134] In the embodiments of the present application, the inner product between the object multi-target vector and the video multi-target vector of each recommended video in the recommended video library can be calculated, thereby obtaining the similarity score between the target object and each recommended video.
[0135] Step S2083, a certain number of recommended videos are selected from the recommended video library according to the similarity score.
[0136] Step S2084, the selected certain number of recommended videos are determined as the target recommended video corresponding to the target object.
[0137] Step S209, the server recommends the target recommended video to the terminal.
[0138] Step S210, the terminal displays the target recommended video on the current interface.
[0139] The video recommendation method provided by the embodiments of the present application can accurately analyze the target object in combination with the information of the target object in multiple dimensions when determining the target recommended video from the recommended video library based on the object multi-target vector and the video multi-target vector index of each recommended video, thereby accurately performing video recall. Moreover, since the object enhancement vector is generated based on the historical playback sequence of the target object, the historical playback sequence is the playback record of the target object to the video, and the number of playback records will significantly decrease compared to the number of target objects in the video application, so the data calculation amount during video recall can be greatly reduced, thereby greatly improving the efficiency of video recommendation.
[0140] In some embodiments, the video recommendation method described above can be implemented using a video recall model; the video recall model includes an object tower and a video tower. The object tower refers to a neural network structure used to determine multi-object vectors (i.e., user multi-object vectors), and the video tower refers to a neural network structure used to determine multi-video vectors.
[0141] Figure 11 This is a flowchart illustrating the training method of the video recall model provided in this application embodiment. The training method of the video recall model can be executed by a model training device. The model training device can be a device within a video recommendation device (i.e., an electronic device), meaning the model training device can be a server or a terminal; or it can be a separate device independent of the video recommendation device, meaning the model training device is an electronic device other than the server and terminal used to implement the video recommendation method. Figure 11 As shown, the training method for the video recall model includes the following steps S401 to S405:
[0142] Step S401: The model training device acquires sample data.
[0143] Here, the sample data includes: sample object features, sample video features, and target parameters under multiple target dimensions. Among them, sample object features and sample video features include, but are not limited to, user identifiers and request identifiers corresponding to user video recommendation requests; sample video features include, but are not limited to, video identifiers; and target parameters under multiple target dimensions include, but are not limited to, whether the user clicked on the sample video and the playback duration of the sample video.
[0144] In some embodiments, see Figure 12 , Figure 12 Step S401 can be achieved through the following steps S4011 to S4014:
[0145] Step S4011: Obtain the original sample data.
[0146] Here, the original sample data includes real positive examples and real negative examples. Real positive examples refer to the sample data corresponding to "real exposure and playback behavior data", while real negative examples refer to the sample data corresponding to "real exposure but no playback behavior data".
[0147] Step S4012: Construct random negative sample samples based on real positive sample samples, and reduce the number of real negative sample samples.
[0148] Here, when constructing random negative samples, we can extract the user identifier and request identifier from each positive sample in the entire video pool, and then randomly select n video identifiers to splice them into negative samples, thus obtaining random negative samples.
[0149] In reducing the number of real negative example samples, part of the real negative example samples can be randomly deleted, or part of the real negative example samples can be randomly selected from all real negative example samples.
[0150] In the embodiments of the present application, after constructing the random negative example samples and reducing the number of real negative example samples, it is necessary to ensure that the real positive example samples, the real negative example samples after reducing the number and the random negative example samples have a preset proportion relationship. Here, the preset proportion relationship can be determined according to the model parameters of the video recall model. For example, the preset proportion relationship can be 1:1:4, that is, the number of real negative examples after random sampling is the same as the number of real positive examples, and 4 videos are randomly selected for each positive example sample as random negative example samples.
[0151] Step S4013, the real positive example samples are determined as positive example samples, and the real negative example samples after reducing the number and the random negative example samples are determined as negative example samples.
[0152] Here, the real negative example samples after reducing the number and the random negative example samples together constitute the negative example samples for model training.
[0153] Step S4014, based on the object identifier and the video identifier, the positive example samples and the negative example samples are associated with features to obtain sample data.
[0154] Here, according to the selected positive example samples and negative example samples, the object features are associated through the user identifier, and the video features are associated through the video identifier, so as to obtain sample object features and sample video features. In the subsequent model training process, the sample object features are input into the object tower (i.e. the user tower), and the sample video features are input into the video tower. It should be noted that the constructed sample object features include both positive example samples and negative example samples; the constructed sample video features include both positive example samples and negative example samples.
[0155] Step S402, the model training device inputs the sample object features into the object tower of the video recall model, and predicts the sample object target vector of the sample object in multiple target dimensions through the object tower.
[0156] Here, the object tower can perform vectorization processing on the sample object features to obtain sample object feature vectors. The object tower can also generate sample object enhancement vectors, and sequentially perform vector splicing processing and multi-target feature learning on the sample object feature vectors and the sample object enhancement vectors to obtain the sample object target vector of the sample object in multiple target dimensions. In this way, by splicing the sample object target vector of the sample object in multiple target dimensions, the sample object multi-target vector of the sample object can be obtained.
[0157] In step S403, the model training apparatus inputs the sample video feature into a video tower of the video recall model, and predicts a sample video target vector of the sample video in multiple target dimensions through the video tower.
[0158] Here, the video tower can perform vectorization processing on the sample video feature to obtain a sample video feature vector. The video tower can further generate a sample video enhancement vector, and sequentially perform vector splicing processing and multi-target feature learning on the sample video feature vector and the sample video enhancement vector to obtain a sample video target vector of the sample video in multiple target dimensions. In this way, by splicing the sample video target vector of the sample video in multiple target dimensions, a sample video multi-target vector of the sample video can be obtained.
[0159] Then, by calculating the inner product between the sample object multi-target vector and the sample video multi-target vector, a sample similarity score between the sample object and the sample video can be determined.
[0160] In step S404, the model training apparatus inputs the sample object target vector, the sample video target vector, and the target parameter into a target loss model to obtain a target loss result.
[0161] In an implementation manner, the sample object target vector includes an object click target vector; the sample video target vector includes a video click target vector; and the target parameter includes a click target value. See Figure 13 , Figure 13 It is shown that step S404 can be implemented through the following steps S4041a to S4044a:
[0162] In step S4041a, the vector inner product between the object click target vector and the video click target vector is determined through the target loss model.
[0163] In step S4042a, a predicted value in a click dimension is determined based on the vector inner product and a preset activation function.
[0164] In step S4043a, a logarithmic loss between the predicted value in the click dimension and the click target value is determined through a logarithmic loss function.
[0165] In step S4044a, the logarithmic loss is determined as the target loss result.
[0166] In another implementation manner, the sample object target vector includes an object duration target vector; the sample video target vector includes a video duration target vector; and the target parameter includes a duration target value. See Figure 14 , Figure 14 It is shown that step S404 can be implemented through the following steps S4041b to S4047b:
[0167] In step S4041b, the time length target value is truncated according to the preset number of truncation intervals, to obtain a time length truncated value with the number of truncation intervals.
[0168] In step S4042b, the target truncated value is determined based on the time length truncated value with the number of truncation intervals.
[0169] In step S4043b, the target truncated value is used to normalize each time length truncated value, to obtain a normalized time length truncated value.
[0170] In step S4044b, a vector inner product between the object time length target vector and the video time length target vector is determined.
[0171] In step S4045b, a prediction value in the time length dimension is determined based on the vector inner product and a preset activation function.
[0172] In step S4046b, a mean square error loss between the prediction value in the time length dimension and the normalized time length truncated value is determined by using a mean square error loss function.
[0173] In step S4047b, the mean square error loss is determined as the target loss result.
[0174] In some embodiments, the video recall model further includes a multi-target network, and the object enhancement loss of the sample object and the video enhancement loss of the sample video can be calculated by using the multi-target network. Figure 15 is a flowchart of a process for determining an object enhancement loss and a video enhancement loss based on a multi-target network provided by an embodiment of the present application, as shown in Figure 15 includes the following steps S501 to S503.
[0175] In step S501, when the sample data is a positive sample, the model training device outputs a target enhancement vector corresponding to the object tower and the video tower in a plurality of target dimensions by using the multi-target network.
[0176] In step S502, in each target dimension, the model training device determines a first mean square error between the target enhancement vector of the object tower and the sample video target vector output by the video tower, or determines a second mean square error between the target enhancement vector of the video tower and the sample object target vector output by the object tower.
[0177] In step S503, the model training device determines the first mean square error and the second mean square error as the object enhancement loss of the sample object and the video enhancement loss of the sample video, respectively.
[0178] Here, the object enhancement loss and the video enhancement loss constitute part of the loss results in the target loss result.
[0179] In the embodiments of the present application, the target loss result includes the logarithmic loss in the click dimension, the mean square error loss in the time length dimension, the object enhancement loss in the click dimension, the video enhancement loss in the click dimension, the object enhancement loss in the time length dimension, and the video enhancement loss in the time length dimension. In some embodiments, the multiple losses can also be subjected to loss fusion processing, and the video retrieval model is retrained and the model parameters are corrected based on the fusion loss result after the loss fusion processing.
[0180] In the implementation process, the loss weights corresponding to the logarithmic loss in the click dimension, the mean square error loss in the time length dimension, the object enhancement loss in the click dimension, the video enhancement loss in the click dimension, the object enhancement loss in the time length dimension, and the video enhancement loss in the time length dimension are obtained; and the preset regularization term is obtained; then, based on the loss weights and the regularization term, the logarithmic loss in the click dimension, the mean square error loss in the time length dimension, the object enhancement loss in the click dimension, the video enhancement loss in the click dimension, the object enhancement loss in the time length dimension, and the video enhancement loss in the time length dimension are subjected to loss fusion processing to obtain a fusion loss result; finally, the parameters in the object tower and the video tower are corrected based on the fusion loss result to obtain the trained video retrieval model.
[0181] In step S405, the model training device corrects the parameters in the object tower and the video tower based on the target loss result to obtain the trained video retrieval model.
[0182] In some embodiments, when the video splicing vector of each video to be recommended is subjected to multi-target feature learning, the target weight in each target dimension is obtained, and the video target vector in each target dimension is subjected to weighted calculation by using the target weight. Here, the process of obtaining the above target weight is described.
[0183] In the implementation process, the sample object target vector and the sample video target vector can be input into the recommendation prediction layer of the video retrieval model, and the click parameter and the video time length parameter of the sample object to the sample video are determined through the recommendation prediction layer; then, the performance index value of the video retrieval model is determined according to the click parameter; the average head length of the video retrieval model is determined according to the video time length parameter; finally, the performance index value and the average head length are subjected to cyclic multi-round testing to obtain the target weight in the click dimension and the target weight in the video time length dimension.
[0184] In the embodiments of the present application, the performance index value is an index value for measuring the pros and cons of the video recall model, and the performance index value can be an AUC value of the video recall model. Here, AUC (Area Under Curve) is defined as the area under the curve of the receiver operating characteristic curve (ROC). AUC is a performance index for measuring the pros and cons of the video recall model. AUC can be obtained by summing the areas of each part under the ROC curve.
[0185] In the following, an exemplary application of the embodiments of the present application in an actual application scenario will be described.
[0186] The video recommendation method provided by the embodiments of the present application can optimize the initialization mode of the user enhancement vector, generate the user enhancement vector according to the user play sequence, and the user play sequence is the play record of the user to the content, which includes content ID and time length and other information. Because the content ID in the user play sequence is only in the order of millions, which is 100 times smaller than the user order, the model size is significantly reduced. Moreover, most of the content played by the user has different time lengths, which can also realize the differentiation of different users. On the other hand, the structure of each tower is optimized, and a multi-target neural network is used to output multiple vectors corresponding to multiple targets. On the other hand, the way of fitting the target vector by the enhancement vector is optimized, and by adding a multi-gate mixture-of-experts (MMOE) network in the fitting process, the use of one enhancement vector to fit multiple target vectors is realized.
[0187] In the video recommendation method of the embodiment of the application, a multi-target recall model (i.e., a video recall model) based on a dual-enhanced double-tower structure is redesigned. The multi-target network is used as a tower structure, and the enhanced vector multi-target information is dynamically extracted, to solve the problems of the original structure, such as the large parameter size of the user enhanced vector, the tower structure only being applicable to a single target, and the enhanced vector being unable to fit multi-target information. In order to further simultaneously learn and predict multiple targets, on the one hand, in the training stage, the target value and the predicted value are processed by truncation and normalization, the calculation method of each target loss is optimized, and the weight of each target loss is adaptively learned to optimize the fusion method of multiple target losses. On the other hand, in the application stage, the evaluation formula is defined, the measurement scores of the similarity of each target under different weight combinations are calculated, and the best combination that simultaneously satisfies multiple targets is explored offline to optimize the fusion method of the similarity of multiple targets. After a series of optimizations, the video recall model of the embodiment of the application finally has the ability to increase the cross opportunities of users and content (i.e., the video to be recommended) in the offline training stage and quickly search for content that can meet multiple targets in the online application stage while considering the click rate and the average play time of each user.
[0188] In addition to normal vectorization of the object features and the content features, the user tower and the content tower of the video recall model of the embodiment of the application each splice an enhanced vector carrying multi-target information of the other tower. After the spliced vectors are calculated by the multi-target tower, four vectors are output in total, which are the click target vector and the time target vector of the user and the content, the two target vectors of the user are directly spliced as the user multi-target vector, and the two target vectors of the content are multiplied by their respective weights and then spliced together as the content multi-target vector. The inner product of the user multi-target vector and the content multi-target vector is calculated in real time online, as the similarity score. The higher the score is, the more interested the user is. The top score result searched by the video recommendation system is combined with the results of other recalls, and then is de-duplicated, and then is subjected to logic such as fine arrangement and mixed arrangement, and finally is recommended to the user.
[0189] The application scenario of the embodiment of the application can be a material card recommendation waterfall in a purposeless area of each channel of a video application home page. Figure 16 The interface diagram of the video application home page includes multiple channels, mainly a selected page and each vertical channel. The selected page can comprehensively display multiple types of content (for example, the multiple types can be types such as TV series, movies, variety shows, and animation). Each vertical channel only displays content of a corresponding type, such as a TV series channel that only displays TV series. The purposeless area that the user sees after scrolling down in each channel is, for example, Figure 17As shown, the main content type is a material card 171, and the user's interested video is personalized displayed through the material card 171. In the scenario of the embodiment of the present application, whether the user finally clicks is affected by various factors, such as: current time, long-term interest, and recent hot spots, etc., so the technical difficulty of the embodiment of the present application is how to retrieve the video that the user is really interested in according to limited information, and improve the click rate, average play time, etc. of the scenario. The main purpose of the embodiment of the present application is to retrieve the video that the user is interested in according to the characteristics, historical behavior, etc. of the target object (for example, the user) personalized information, and consider the click and time length two targets, display the video to the user through the recommendation service, attract the user to click, and drive the business index growth.
[0190] The core technology of the embodiment of the present application includes: a multi-target recall model-based calculation process (a process of calculating the similarity scores of the user and the video), a training process (a process of updating the model parameters using training data), and an application process (a process of online real-time retrieving the video that the user is interested in). The three processes will be described below.
[0191] The multi-target recall model-based calculation process will be described below.
[0192] When the user accesses the purposeless area of each channel of the video application, a request for obtaining the video (that is, a video recommendation request) is sent to the recommendation service, and the recommendation service returns the video that the user is interested in (that is, the target recommended video) through the logic of recall, precision arrangement, and mixed arrangement, etc. The video recall model of the embodiment of the present application is located in the recall layer, and the calculation process of the video recall model is as shown in the figure. Figure 18 The calculation process for retrieving the video includes: step S181, inputting the features and vectorizing; step S182, outputting the multi-target vector; and step S183, calculating the multi-target similarity.
[0193] In step S181, the features input into the model cannot directly participate in the calculation and need to be processed by vectorization. In addition to generating the feature vector, the enhancement vector for increasing the interaction opportunities between the user and the video is also generated in this stage.
[0194] In the embodiment of the present application, when the feature vector is generated, the generation of the feature vector adopts the method as shown in the figure. Figure 19The video recall model is generated in the illustrated manner. First, object features are input into the user tower, and video features are input into the video tower, and then vectorization processing is performed through a feature vector table. The feature vector table has two dimensions. The first dimension is the feature ID, and the second dimension is the vector corresponding to each feature ID. The vector tables of different features are independent. If it is a discrete feature, such as the discrete type of related information of the target object, the ID, category, and label of the video, etc., the corresponding vector table can be directly retrieved according to the ID; if it is a continuous feature, such as the number of hours since the last login of the user, the number of videos played in the last 30 days, the last playback time, etc., the length of the video, the number of days since the broadcast, the click rate, etc., must be discretized. For example, discretization processing can be to determine the interval according to the offline frequency distribution table, and then retrieve the corresponding vector table according to the interval ID. The frequency distribution statistics of each continuous feature are also independent. After the object features and the video features are vectorized, they are internally spliced together to generate object feature vectors and video feature vectors. The feature vector table belongs to part of the model parameters, and the updating method of the model parameters will be described in the training process below.
[0195] In the embodiment of the application, when the enhancement vector is generated, the enhancement vector includes a user enhancement vector and a video enhancement vector, wherein the video enhancement vector is obtained by retrieving the feature vector table through the video ID. The user enhancement vector is generated through the playback sequence (i.e., the historical playback sequence), as shown in the following formula: Figure 20 As shown, the playback sequence includes the video ID and the length of time that the user has played. Here, first, each video ID in the sequence is retrieved from the feature vector table to generate a video vector set. The number of video vectors in the video vector set is consistent with the number of video IDs in the playback sequence. Then, the total length of time of the playback sequence is calculated, and each length of time in the playback sequence is divided by the total length of time to obtain a normalized length of time, which is used as a video vector weight. The number of video vector weights is also consistent with the number of video IDs in the playback sequence. Finally, each vector in the video vector set is multiplied by the corresponding weight to obtain a video weighted vector set. The vector obtained by merging the vectors in the video weighted vector set is the user enhancement vector. The feature vector table in this stage also belongs to part of the model parameters, and the updating method of the model parameters will be described in the training process below.
[0196] In the embodiment of the present application, the user enhancement vector is generated using the play sequence. Since the video played by most users and the time length are different, and the play time length is used to weight the vector in the embodiment of the present application, the difference between different users can be processed without affecting the confidence of the user enhancement vector. The user enhancement vector generation method of the embodiment of the present application has the following two advantages: first, although the play sequences of most users are different, the number of video IDs covered is of the same order of magnitude, and compared with the hundreds of millions of users accumulated in the application scenario, the number is reduced by hundreds of times, so the calculation resources and storage space of the model can be obviously saved; second, under the premise that the number of samples is unchanged, because the number of video IDs in the play sequence is much less than the number of users, each video ID can get more sufficient training opportunities, thereby obtaining a more accurate user enhancement vector.
[0197] In the embodiment of the present application, when the vector splicing is performed, the model splices the generated feature vector and the enhancement vector in the input layer of the user tower and the video tower, respectively, to obtain the user splicing vector and the video splicing vector, and continues the subsequent process.
[0198] In step S182, compared with the original double enhancement double tower structure, the structure of the user tower and the video tower is modified from a multi-layer neural network to a multi-target neural network in the embodiment of the present application. For example, the multi-target neural network can be a progressive layered extraction network (PLE). Figure 21 As shown in the PLE network (such as Figure 21 As shown in the PLE network (such as
[0199] In step S183, the PLE network is proposed to optimize the precision model in the recommendation, and the click rate prediction value multiplied by the time length prediction value is used when calculating the score, which is equivalent to the time length expectation of the user. This method needs to be calculated multiple times and can be applied to the case where the number of candidate sets is small. However, the recall model faces a large number of candidate sets, and the nearest neighbor algorithm with higher retrieval efficiency is adopted. The score is generally an inner product that only needs to be calculated once. The original structure of the score calculation method cannot be applied to the recall model and needs to be redesigned.
[0200] The multi-target similarity based on the inner product is calculated. The most intuitive way is to first calculate the inner product of the user and video click target vectors, and the inner product of the user and video time length target vectors, and then weighted sum the two inner products, but this method also needs to be calculated multiple times. The method of the embodiment of the application is to first splice the click target vector and the time length target vector inside each tower. The difference is that in the user tower, the click target vector and the time length target vector are directly spliced as a user multi-target vector, and in the video tower, each bit of the click target vector is multiplied by the weight α and each bit of the time length target vector is multiplied by the weight β, and then spliced as a video multi-target vector. Finally, the inner product of the user multi-target vector and the video multi-target vector is calculated as the similarity score, as shown in the following formula (1). Figure 22 The greater the similarity score is, the more interested the user is. The embodiment of the application is equivalent to calculating the weighted sum of the click target inner product and the time length target inner product once, so as to adapt to the nearest neighbor algorithm. α and β belong to part of the model parameters, and the updating method of the model parameters will be described in the training process below.
[0201] Next, the training process will be described.
[0202] The video recall model for online real-time retrieval of videos interested by users in the embodiment of the application can be updated regularly offline through the training process as shown in the following formula (2). Figure 23 The training process includes the following steps: step S231 of constructing a training sample; step S232 of updating a model parameter; and step S233 of exploring a multi-target weight.
[0203] In step S231, the sample is used for offline training of the model, and the construction process includes two steps: screening positive and negative examples and associating features.
[0204] In screening positive and negative examples, the positive and negative examples are represented as:
user ID, video ID, whether clicked, playing time, request ID
user ID, video ID, 1, playing time, request ID
user ID, video ID, 0, 0, request ID
[0205] When increasing random negative examples, the recall model faces a candidate set of a million-level resource pool when searching for user interested videos online in real time, so unlike the fine arrangement sample which only uses real behavior data as the screening method of positive and negative examples, the recall sample needs to add randomly sampled negative examples, because the candidate set faced by the fine arrangement model has already been filtered by recall and coarse arrangement, and is relatively matched with user interest, the main purpose is to judge the more interesting part from it, but the video recall model also needs to have the ability to distinguish videos that users are completely not interested in the entire candidate set, that is, to maximize the isolation of user interested videos and uninterested videos.
[0206] The candidate set of random negative examples is the entire video pool, for each positive example, the user ID and request ID are extracted, and n video IDs are randomly selected to form a negative example, represented as:
user ID, video ID, 0, 0, request ID
[0207] In reducing real negative examples, the introduction of random negative examples can significantly increase the sample size, thus prolonging the training time, requiring more computing, storage resources, and affecting the update speed of the model, leading to insufficient learning of the user's behavior characteristics, so further optimization is needed. To reduce the number of samples, the method adopted by the embodiments of the present application is to randomly sample real negative examples. Real negative examples are user exposure but no playback behavior data, which are excessive data of user interested videos and uninterested videos. If they exist in excess in the training sample, they will mislead the model to learn this part of ambiguous behavior excessively, thus interfering with the model's ability to isolate interested videos and uninterested videos to the greatest extent. Through offline testing, in the embodiments of the present application, real positive examples: real negative examples: random negative examples = 1: 1: 4, which means that after random sampling, the number of real negative examples is the same as the number of real positive examples, and for each positive example, 4 videos are randomly selected as random negative examples.
[0208] In association features, object features can be associated through user ID and video features can be associated through video ID according to the filtered positive and negative examples, as shown in Figure 25 Because some features of the user, such as the playback sequence and the city, and some features of the video, such as the playback volume and the click rate, are in a state of change, if the access time of the same user is different, the corresponding request time is different, and these features will also be different, so the object features and the video features are generally stored in the recommendation service following the request ID of the user access, represented as:
object features, video features, request ID
object features, video features, whether clicked, playback duration
[0209] In step S232, the process of updating the model is the process of updating the parameters of the model. After the completed sample is input into the model, the corresponding loss needs to be calculated, and the model adjusts its parameters by reducing the loss. The loss is calculated by inputting the target value and the predicted value into the loss function, and is used to measure the difference between the target value and the predicted value. The smaller the loss, the smaller the difference, and the model continuously fits the target by continuously reducing the loss in the training stage. In the embodiment of the application, in addition to using the predicted value to fit the click target and the duration target, the enhanced vector of the current tower is also used to fit the two target vectors output by another tower. Each fitting process needs its own loss function. In order to adaptively fuse multiple losses together in the training process, the embodiment of the application also optimizes the fusion method using fixed loss weights, so that each predicted value is balanced and close to the target value. The following describes several loss calculations related to the embodiments of the application.
[0210] (1) Click target loss.
[0211] The click target is divided into two types according to "whether to click". Because the target is a discrete value, it belongs to binary classification prediction, so the logarithmic loss function is used in the embodiment of the application, as shown in the following formula (1). The calculation process of the loss is as follows: first, determine the target value, that is, y. If the exposure is not played, the target value is 0, and if the exposure is played, the target value is 1. Then, calculate the predicted value, that is, , first calculate the inner product of the user click target vector and the video click target vector , then pass through the sigmoid activation function ( ) output as the predicted value; finally, calculate the logarithmic loss, input the target value and the predicted value into the logarithmic loss function, and finally get the logarithmic loss.
[0212] (1).
[0213] (2) Duration target loss.
[0214] The duration target is the real play duration of the user, which is 0 if not clicked, and is a decimal greater than 0 if clicked. Because the target is a continuous value, it belongs to regression prediction, so the mean square error loss function is used in the embodiment of the application, as shown in the following formula (2). The calculation process of the loss is as follows: first, truncate the duration target, that is, , because there may be users who forget to exit the play, or the duration reporting has problems, so the duration target There are a few abnormal large values, in order to avoid interference recall model fitting long target, need to be cut off according to the specified cutoff value. In the embodiment of the application, the equal frequency distribution of the long target in the test sample randomly selected offline is divided into 100 intervals, and the minimum value of the 100th interval is taken as the specified cutoff value , the original value is retained when the long target is less than or equal to the cutoff value, and the cutoff value is replaced when the long target is greater than the cutoff value; then, the normalized long target, that is , because the span of the truncated long target is very large, ranging from 0 seconds to tens of thousands of seconds, resulting in a large fluctuation in the parameters learned by the model for different samples, and because of the existence of shared parameters in the PLE network, it may even interfere with the learning of the click target, so it is necessary to adjust the span interval. In order to not change the distribution of the long target in the sample, the MinMax function is used for normalization in the embodiment of the application, and the min in the function is 0 and the max is the specified maximum cutoff value , the output of the long target after the MinMax function is taken as the target value, and the corresponding interval is adjusted to [0, 1.0], and the span interval is significantly reduced, which facilitates model fitting; then, the predicted value is calculated, that is , in order to fit the target value, the predicted value needs to be consistent with the span interval, that is [0, 1.0], and the embodiment of the application first calculates the inner product of the user long target vector and the video long target vector , and then the output of the sigmoid activation function is taken as the predicted value; finally, the mean square error is calculated, and the target value and the predicted value are input into the mean square error loss function (2) to obtain the mean square error loss.
[0215] (2).
[0216] (3) Enhanced vector and target vector loss.
[0217] In order to solve the problem that the enhanced vector of the original double-enhanced double-tower structure cannot fit multiple target vectors at the same time, the embodiment of the application adds an MMOE network in the fitting process, as shown in Figure 26 . The MMOE network is a primary multi-target network that can output multiple vectors corresponding to multiple targets. Compared with the PLE network, MMOE only has an expert network and a gate network, and does not have a shared network. When the number of layers is configured to be small, the parameter size is also small, which will not cause the model to learn this part of the structure excessively. When the input sample is a positive example, the enhanced vector passes through the MMOE network, and the target enhanced vectors of clicks and lengths are output. The model calculates the mean square error (see formula (3) below, , where each bit of the target vector represents the target vector. Each bit of the target enhancement vector represents the target value of the corresponding target), a total of 4 losses, respectively: user enhancement loss under the click target, video enhancement loss; user enhancement loss under the time length target, video enhancement loss.
[0218] (3).
[0219] It should be noted that because the enhancement vector is the input of the current tower, the target vector to be fitted is the output of another tower, and the target vector needs the enhancement vector of another tower input in the calculation process, there is a dependency between each other, and if the enhancement vector is updated, the target vector needs to be fixed, otherwise there will be a problem that the model parameters cannot be updated.
[0220] (4) Fusion loss.
[0221] In the training process, when the model faces multiple target losses, it is common to sum the weights of each loss as a fusion loss, and to reduce the fusion loss to reduce each loss. The weight of each loss can be determined through offline testing, but in the training process, when different samples are input, due to the differences between the data, the fixed weight will inevitably have a problem of losing one and gaining another. Therefore, the embodiment of the present application uses an uncertainty weighting method to adaptively adjust the weight of each loss, so that each predicted value is balanced and close to the target value.
[0222] In the embodiment of the present application, the targets faced by the model include: click target loss, time length target loss, user enhancement loss under the click target, video enhancement loss under the click target, and user enhancement loss under the time length target, video enhancement loss under the time length target, a total of six. The corresponding original uncertainty weighting formula is formula (4) below, wherein 、 、 、 、 、 respectively correspond to the six target losses, 、 、 、 、 、 respectively correspond to the weights of the six target losses, as a regularization term to prevent the weight from learning too large. Because the weight changes dynamically in the training process, the may be negative, resulting in incorrect calculation of the fusion target loss, and thus training failure, so the embodiment of the present application adjusts the regularization term to formula (5) to ensure that the fusion target loss of each step of training is calculated correctly.
[0223] (4).
[0224] (5).
[0225] When the model of the embodiment of the present application is updated in time, the latest user behavior characteristics are continuously learned by incrementally inputting samples, calculating loss, and reducing loss, so as to ensure that the video retrieved online is more in line with the user's interest.
[0226] In step S233, since the model available online has been created and updated through the previous steps, the multi-target vector of the user and the video is outputted after the features of the user and the video are inputted. However, when calculating the similarity score of the user and the video, the click target weight and the duration target weight also need to be determined, that is, α and β in the calculation of the multi-target similarity in the above calculation process, which are determined by offline testing in the embodiment of the present application.
[0227] Firstly, the click target weight is explored. The click target belongs to binary classification prediction, and the AUC is used to determine α and β in the embodiment of the present application. The target value is 0 or 1 when calculating the AUC, and the prediction value is the similarity score under different α and β. The higher the AUC is, the more suitable α and β are.
[0228] Then, the duration target weight is explored. The duration target belongs to regression prediction, and the AD@K (AvgDurPerBatch@TopK) of the single test set can be used to determine α and β. Referring to formula (6) below: first, the test samples are screened, and the similarity scores under different α and β are calculated. The test set (batch) is randomly divided into n parts, and the number of samples in each part is m, so the total number of test samples is n*m; secondly, in each test set (batch), the samples are sorted in descending order of similarity scores. The head duration is obtained by summing the durations of the first k samples, and then the head duration of all test sets (batch) is summed. Finally, AD@K is obtained by dividing by n. The higher AD@K is, the more suitable α and β are.
[0229] (6).
[0230] Finally, the multi-objective weight is explored. Because the corresponding a, b when the AUC is the highest is generally not the same as the corresponding a, b when the AD@K is the highest, the most appropriate a, b that satisfies both objectives needs to be determined. In the embodiment of the application, multi-round exploration is adopted: in the first step, the value range of a, b for the first round of testing is determined, and the value range of the embodiment of the application is [1, 10], and the step length is 1. Because there are two weights, 100 times of exploration will be performed. For each set of a, b, the corresponding <AUC, AD@K> is calculated. However, the orders of magnitude of AUC and AD@K are different, which is not convenient for direct comparison. In the embodiment of the application, the MinMax function is used for normalization first, and then the difference between a and b in each set is compared. The closer the difference is to 0, the more appropriate a and b are. Finally, the a1 and b1 with the smallest difference in the first round are determined. In the subsequent exploration, a is fixed as a1, and only more accurate b is explored. In the second step, the value range of b for the second round of testing is determined. In the embodiment of the application, the value range of b is (b1-1, b1+1), the step length is 0.1, 19 times of exploration is performed, and finally the b2 with the smallest difference in the second round is determined. In the third step, the value range of b for the third round of testing is determined. In the embodiment of the application, the value range of b is (b2-0.1, b2+0.1), the step length is 0.01, 19 times of exploration is performed, and finally the b3 with the smallest difference in the third round is determined. In the fourth step, the above method is cycled. In the embodiment of the application, five rounds of y exploration are performed, and finally the a1 and b5 obtained are the target weights of clicks and durations, which are used for online calculation of the similarity scores of users and videos.
[0231] (7).
[0232] In the following, the application process will be described.
[0233] In the embodiment of the application, after the video recall model is updated each time, the features of the video candidate set are first batch-input into the video tower to generate the corresponding video click target vector and video duration target vector. Then, each bit of the two target vectors is multiplied by the respective weight and spliced together as a video multi-target vector. Finally, an index for online real-time query is created, and online generation is not repeated. After the index of the video multi-target vector is created each time, the model is deployed online to ensure that the user multi-target vector generated in real time and the video multi-target vector in the index correspond to the same model version. When the user slides to browse under each channel of the video application or refreshes the purposeless area, the features of the request user are input into the user tower in real time online to generate the corresponding user click target vector and user duration target vector, which are spliced as a user multi-target vector. Finally, the nearest neighbor algorithm is used to query the top videos with the highest similarity scores and return them. The queried videos are combined and de-duplicated with other recalled videos, and then logic such as fine arrangement and mixed arrangement is continued. Finally, the videos are recommended to the user in the form of material cards in the purposeless area.
[0234] The user enhancement vectors in this embodiment are initialized using playback sequences. While ensuring differentiation among different users, this approach significantly saves computational and storage resources by reducing the model parameter size and improves the accuracy of the enhancement vectors by increasing the training opportunities for each video ID in the playback sequence. Each tower uses a PLE network to output multiple vectors after inputting features, which are used to fit multiple targets such as clicks and duration, and can be adjusted according to business objectives. In this embodiment, when the enhancement vector input to the current tower fits the target vector output by another tower, an MMOE network is added to allow one enhancement vector to fit multiple target vectors simultaneously. This embodiment redesigns the calculation method of the target value and predicted value in the duration target loss function to obtain the duration target loss. After adding other losses such as click target loss and enhancement target loss, multiple losses are fused using a modified uncertainty weighting method to ensure that each predicted value is evenly close to the target value. In this embodiment, when calculating the multi-target similarity scores of users and videos in real time, the multi-target weights used can be determined through the exploration method designed in this embodiment, obtaining the most suitable weights that simultaneously satisfy multiple targets offline.
[0235] It should be noted that the user augmentation vector in this embodiment is initialized through a playback sequence. Since the playback sequence includes not only the video ID and playback duration but also the playback order, a sequence model can be used to introduce sequential information into the user augmentation vector. Examples include Long Short-Term Memory (LSTM), transformer models, and BERT. In this embodiment, the multi-objective network for each tower can use other structures to replace the PLE network, such as ResNet or parallel dual-tower configurations, to enhance the expressive power of the multi-objective vector. The video retrieval model in this embodiment can be used for retrieval of target-area content cards in any video application, and its optimization objectives can be customized according to the characteristics of different video application scenarios.
[0236] It is understood that in the embodiments of this application, if the content involves user information, such as object feature vectors, historical playback sequences, target recommended videos, etc., and if it involves data related to user information or enterprise information, user permission or consent is required when the embodiments of this application are applied to specific products or technologies, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0237] The following continues to describe the exemplary structure of the video recommendation device 354 provided in the embodiments of this application as a software module. In some embodiments, such as Figure 4As shown, the video recommendation apparatus 354 comprises: an acquisition module 3541 configured to acquire an object feature vector of a target object, a historical play sequence in a preset historical time period, and a video multi-target vector index of each to-be-recommended video in a to-be-recommended video library; a vectorization processing module 3542 configured to perform vectorization processing on the historical play sequence to obtain an object enhanced vector of the target object; a multi-target processing module 3543 configured to sequentially perform vector splicing processing and multi-target feature learning on the object feature vector and the object enhanced vector to obtain an object multi-target vector of the target object; and a determination module 3544 configured to determine, based on the object multi-target vector and the video multi-target vector index of each to-be-recommended video, a target recommended video corresponding to the target object from the to-be-recommended video library.
[0238] In some embodiments, the apparatus further comprises: a retrieval module configured to retrieve, based on a video identifier of each to-be-recommended video, a preset feature vector table to correspondingly obtain a video enhanced vector of each to-be-recommended video; a vector splicing module configured to perform vector splicing processing on a video feature vector and the video enhanced vector of each to-be-recommended video to correspondingly obtain a video splicing vector of each to-be-recommended video; a multi-target feature learning module configured to perform multi-target feature learning on the video splicing vector of each to-be-recommended video to correspondingly obtain a video multi-target vector of each to-be-recommended video; and a creation module configured to create a video multi-target vector index corresponding to the video multi-target vector of each to-be-recommended video.
[0239] In some embodiments, the vectorization processing module is further configured to: acquire a historical video identifier and a historical play duration of each historical play video in the historical play sequence; retrieve, based on each historical video identifier, a preset feature vector table to obtain a historical video vector set; the number of historical video vectors in the historical video vector set is the same as the number of historical video identifiers in the historical play sequence; count the historical play duration in the historical play sequence to obtain a total historical play duration; perform duration normalization processing on each historical play duration based on the total historical play duration to obtain a normalized play duration of each historical play video, and determine the normalized play duration as a video vector weight of the corresponding historical play video; perform weighting processing on each historical video vector in the historical video vector set based on the video vector weight to obtain a video weighted vector set; and perform merging processing on the video weighted vectors in the video weighted vector set to obtain the object enhanced vector of the target object.
[0240] In some embodiments, the multi-target processing module is further configured to: perform vector splicing processing on the object feature vector and the object enhancement vector to obtain an object splicing vector; perform multi-target feature learning on the object splicing vector by using a multi-target neural network to obtain an object target vector of the target object in multiple target dimensions; and perform splicing processing on the object target vectors in the multiple target dimensions to obtain an object multi-target vector of the target object.
[0241] In some embodiments, the multi-target feature learning module is further configured to: for each of the to-be-recommended videos, perform multi-target feature learning on a video splicing vector of the to-be-recommended video by using a multi-target neural network to obtain a video target vector of the to-be-recommended video in multiple target dimensions; obtain a target weight in each target dimension; perform weighted calculation on the video target vector in each target dimension respectively by using the target weight to obtain a weighted video target vector; and perform splicing processing on the weighted video target vectors in the multiple target dimensions to obtain a video multi-target vector of the to-be-recommended video.
[0242] In some embodiments, the determining module is further configured to: obtain the video multi-target vector of each to-be-recommended video based on the video multi-target vector index; determine an inner product between the object multi-target vector and the video multi-target vector of each to-be-recommended video, and determine the inner product as a similarity score between the target object and the to-be-recommended video; select a specific number of to-be-recommended videos from the to-be-recommended video library according to the similarity score; and determine the specific number of selected to-be-recommended videos as target recommended videos corresponding to the target object.
[0243] In some embodiments, the video recommendation method is implemented by using a video recall model; and the video recommendation device further includes a model training device, which is configured to: obtain sample data, the sample data including: sample object features, sample video features, and target parameters in multiple target dimensions; input the sample object features into an object tower of the video recall model to predict sample object target vectors of sample objects in multiple target dimensions by using the object tower; input the sample video features into a video tower of the video recall model to predict sample video target vectors of sample videos in multiple target dimensions by using the video tower; input the sample object target vectors, the sample video target vectors, and the target parameters into a target loss model to obtain a target loss result; and correct parameters in the object tower and the video tower based on the target loss result to obtain a trained video recall model.
[0244] In some embodiments, the model training apparatus is further configured to: obtain original sample data; the original sample data comprises real positive sample and real negative sample; construct random negative sample based on the real positive sample, and reduce the number of the real negative sample; wherein the real positive sample, the real negative sample after the number reduction, and the random negative sample have a preset proportional relationship; determine the real positive sample as positive sample, and determine the real negative sample after the number reduction and the random negative sample as negative sample; perform feature association on the positive sample and the negative sample based on object identifier and video identifier, to obtain the sample data.
[0245] In some embodiments, the sample object target vector comprises an object click target vector; the sample video target vector comprises a video click target vector; the target parameter comprises a click target value; the model training apparatus is further configured to: determine the vector inner product between the object click target vector and the video click target vector through the target loss model; determine the predicted value in the click dimension based on the vector inner product and a preset activation function; determine the logarithmic loss between the predicted value in the click dimension and the click target value through a logarithmic loss function; and determine the logarithmic loss as the target loss result.
[0246] In some embodiments, the sample object target vector comprises an object click target vector; the sample video target vector comprises a video click target vector; the target parameter comprises a click target value; the model training apparatus is further configured to: determine the vector inner product between the object click target vector and the video click target vector through the target loss model; determine the predicted value in the click dimension based on the vector inner product and a preset activation function; determine the logarithmic loss between the predicted value in the click dimension and the click target value through a logarithmic loss function; and determine the logarithmic loss as the target loss result.
[0247] In some embodiments, the video recall model further comprises a multi-target network; when the sample data is a positive sample, the model training apparatus is further configured to: output, by the multi-target network, a target enhancement vector corresponding to the object tower and the video tower in a plurality of target dimensions; in each target dimension, determine a first mean square error between the target enhancement vector of the object tower and a sample video target vector output by the video tower, or determine a second mean square error between the target enhancement vector of the video tower and a sample object target vector output by the object tower; determine the first mean square error and the second mean square error as an object enhancement loss of the sample object and a video enhancement loss of the sample video, respectively; and the object enhancement loss and the video enhancement loss constitute part of the target loss result.
[0248] In some embodiments, the target loss result comprises a log loss in a click dimension, a mean square error loss in a time length dimension, an object enhancement loss in the click dimension, a video enhancement loss in the click dimension, an object enhancement loss in the time length dimension, and a video enhancement loss in the time length dimension; the model training apparatus is further configured to: obtain loss weights corresponding to the log loss in the click dimension, the mean square error loss in the time length dimension, the object enhancement loss in the click dimension, the video enhancement loss in the click dimension, the object enhancement loss in the time length dimension, and the video enhancement loss in the time length dimension, respectively; obtain a preset regularization term; perform loss fusion processing on the log loss in the click dimension, the mean square error loss in the time length dimension, the object enhancement loss in the click dimension, the video enhancement loss in the click dimension, the object enhancement loss in the time length dimension, and the video enhancement loss in the time length dimension based on the loss weights and the regularization term, to obtain a fusion loss result; and correct parameters in the object tower and the video tower based on the fusion loss result, to obtain the trained video recall model.
[0249] In some embodiments, the model training apparatus is further configured to: input the sample object target vector and the sample video target vector into a recommendation prediction layer of the video recall model, and determine, by the recommendation prediction layer, a click parameter and a video time length parameter of the sample object with respect to the sample video; determine a performance index value of the video recall model according to the click parameter; determine an average head length of the video recall model according to the video time length parameter; and perform cyclic multi-round testing based on the performance index value and the average head length, to obtain a target weight in the click dimension and a target weight in the video time length dimension.
[0250] It should be noted that the description of the device embodiments of the present application is similar to the description of the method embodiments described above, and has similar beneficial effects as the method embodiments, and thus will not be described again. For technical details not disclosed in the device embodiments, please refer to the description of the method embodiments of the present application for understanding.
[0251] The computer program product provided by the embodiment of the present application includes executable instructions, which are computer instructions. The executable instructions are stored in a computer readable storage medium. When the processor of the electronic device reads the executable instructions from the computer readable storage medium, the processor executes the executable instructions, so that the electronic device executes the method provided by the embodiment of the present application.
[0252] The embodiment of the present application provides a storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by the processor, the processor will execute the method provided by the embodiment of the present application, for example, the method shown in the figure. Figure 5
[0253] In some embodiments, the storage medium can be a computer readable storage medium, such as ferroelectric memory (FRAM, Ferromagnetic Random Access Memory), read only memory (ROM, Read Only Memory), programmable read only memory (PROM, Programmable Read Only Memory), erasable programmable read only memory (EPROM, Erasable Programmable Read Only Memory), electrically erasable programmable read only memory (EEPROM, Electrically Erasable Programmable Read Only Memory), flash memory, magnetic surface memory, optical disc, or compact disc read only memory (CD-ROM, Compact Disk-Read Only Memory) and other memories; it can also be various devices including one or any combination of the above memories.
[0254] In some embodiments, the executable instructions can be in the form of programs, software, software modules, scripts or codes, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and can be deployed in any form, including being deployed as independent programs or being deployed as modules, components, subroutines or other units suitable for use in a computing environment.
[0255] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file containing other programs or data, for example, in one or more scripts within a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., files storing one or more modules, subroutines, or code sections). As an example, executable instructions may be deployed to execute on a single electronic device, or on multiple electronic devices located in one location, or on multiple electronic devices distributed across multiple locations and interconnected via a communication network.
[0256] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A video recommendation method, characterized in that, The method includes: Obtain the object feature vector of the target object, the historical playback sequence within a preset historical time period, and the video multi-object vector index of each video to be recommended in the video library to be recommended; Obtain the historical video identifier and historical playback duration for each historically played video in the historical playback sequence; Based on each historical video identifier, a preset feature vector table is retrieved to obtain a historical video vector set; the number of historical video vectors in the historical video vector set is the same as the number of historical video identifiers in the historical playback sequence. The total historical playback duration is obtained by calculating the historical playback duration in the historical playback sequence. Based on the total historical playback duration, each historical playback duration is normalized to obtain the normalized playback duration of each historical video, and the normalized playback duration is determined as the video vector weight of the corresponding historical video. Based on the video vector weights, each historical video vector in the historical video vector set is weighted to obtain a set of video weighted vectors. The video weighted vectors in the set of video weighted vectors are merged to obtain the object enhancement vector of the target object; The object feature vector and the object enhancement vector are sequentially processed by vector concatenation and multi-target feature learning to obtain the object multi-target vector of the target object. Based on the object's multi-objective vector and the video multi-objective vector index of each video to be recommended, the target recommended video corresponding to the target object is determined from the video library to be recommended.
2. The method according to claim 1, characterized in that, The method further includes: Based on the video identifier of each video to be recommended, a preset feature vector table is retrieved to obtain the corresponding video enhancement vector of each video to be recommended. The video feature vector and the video enhancement vector of each video to be recommended are concatenated to obtain the video concatenation vector of each video to be recommended. Multi-objective feature learning is performed on the video splicing vector of each video to be recommended to obtain the video multi-objective vector of each video to be recommended. Create a video multi-objective vector index corresponding to the video multi-objective vector of each of the videos to be recommended.
3. The method according to claim 1, characterized in that, The process of sequentially performing vector concatenation and multi-target feature learning on the object feature vector and the object augmentation vector to obtain the object multi-target vector of the target object includes: The object feature vector and the object enhancement vector are concatenated to obtain the object concatenated vector. By performing multi-objective feature learning on the object concatenation vector through a multi-objective neural network, the object target vector of the target object under multiple target dimensions is obtained. The object target vectors under the multiple target dimensions are concatenated to obtain the multi-target vector of the target object.
4. The method according to claim 2, characterized in that, The step of performing multi-objective feature learning on the video concatenation vector of each video to be recommended, to obtain the corresponding video multi-objective vector of each video to be recommended, includes: For each video to be recommended, a multi-objective feature learning method is used to learn the video splicing vector of the video to be recommended through a multi-objective neural network to obtain the video target vector of the video to be recommended under multiple target dimensions. Obtain the target weight for each target dimension; Using the aforementioned target weights, the video target vectors under each target dimension are weighted and calculated to obtain a weighted video target vector; The weighted video target vectors under multiple target dimensions are concatenated to obtain the video multi-target vector of the video to be recommended.
5. The method according to claim 1, characterized in that, The step of determining the target recommended video corresponding to the target object from the video library based on the object's multi-target vector and the video multi-target vector index of each video to be recommended includes: The video multi-objective vector of each video to be recommended is obtained based on the video multi-objective vector index. Determine the inner product between the multi-target vector of the target object and the video multi-target vector of each video to be recommended, and determine the inner product as the similarity score between the target object and the video to be recommended; Based on the similarity score, a specific number of videos to be recommended are selected from the video library to be recommended. The selected number of videos to be recommended are determined as target recommended videos corresponding to the target object.
6. The method according to claim 1, characterized in that, The video recommendation method is implemented through a video recall model; wherein, the video recall model is trained through the following steps: Acquire sample data, which includes: sample object features, sample video features, and target parameters under multiple target dimensions; The features of the sample object are input into the object tower of the video recall model, and the sample object target vector under multiple target dimensions is predicted through the object tower. The sample video features are input into the video tower of the video recall model, and the sample video target vector in multiple target dimensions is predicted by the video tower. The target vector of the sample object, the target vector of the sample video, and the target parameters are input into the target loss model to obtain the target loss result; Based on the target loss result, the parameters in the object tower and the video tower are corrected to obtain the trained video recall model.
7. The method according to claim 6, characterized in that, The acquisition of sample data includes: Obtain the original sample data; the original sample data includes real positive examples and real negative examples. Random negative examples are constructed based on the real positive examples, and the number of real negative examples is reduced; wherein, there is a preset ratio relationship between the real positive examples, the reduced number of real negative examples, and the random negative examples; The real positive sample is determined as a positive sample, and the real negative sample after the reduction in quantity and the random negative sample are determined as negative samples; Based on object identifiers and video identifiers, feature association is performed on the positive and negative samples to obtain the sample data.
8. The method according to claim 6, characterized in that, The target vector of the sample object includes the object click target vector; the target vector of the sample video includes the video click target vector; the target parameter includes the click target value; The step of inputting the target vector of the sample object, the target vector of the sample video, and the target parameters into the target loss model to obtain the target loss result includes: The dot product between the object click target vector and the video click target vector is determined using the target loss model. Based on the vector inner product and the preset activation function, the predicted value in the click dimension is determined; The log loss function is used to determine the log loss between the predicted value and the target value of the click in the click dimension. The logarithmic loss is determined as the target loss result.
9. The method according to claim 6, characterized in that, The target vector for the sample object includes a target vector for the object duration; the target vector for the sample video includes a target vector for the video duration; the target parameter includes a target value for duration. The step of inputting the target vector of the sample object, the target vector of the sample video, and the target parameters into the target loss model to obtain the target loss result includes: The target duration value is truncated according to the preset number of truncation intervals to obtain a duration truncated value with the preset number of truncation intervals; Based on the duration truncation value of the number of truncation intervals, determine the target truncation value; Based on the target cutoff value, each of the duration cutoff values is normalized to obtain a normalized duration cutoff value. Determine the dot product between the target vector of the object duration and the target vector of the video duration; Based on the vector inner product and the preset activation function, the predicted value in the time dimension is determined; The mean squared error loss is determined by the mean squared error loss function between the predicted value in the duration dimension and the normalized duration cutoff value. The mean squared error loss is determined as the target loss result.
10. The method according to claim 6, characterized in that, The video recall model further includes a multi-target network; the method further includes: When the sample data is a positive sample, the multi-target network outputs target enhancement vectors corresponding to the object tower and the video tower in multiple target dimensions; For each target dimension, determine the first mean squared error between the target augmentation vector of the object tower and the sample video target vector output by the video tower, or determine the second mean squared error between the target augmentation vector of the video tower and the sample object target vector output by the object tower. The first mean square error and the second mean square error are respectively determined as the object enhancement loss of the sample object and the video enhancement loss of the sample video; the object enhancement loss and the video enhancement loss constitute part of the loss result in the target loss result.
11. The method according to claim 6, characterized in that, The target loss results include log loss in the click dimension, mean squared error loss in the duration dimension, object enhancement loss in the click dimension, video enhancement loss in the click dimension, object enhancement loss in the duration dimension, and video enhancement loss in the duration dimension. The method further includes: Obtain the loss weights corresponding to the logarithmic loss under the click dimension, the mean squared error loss under the duration dimension, the object enhancement loss under the click dimension, the video enhancement loss under the click dimension, the object enhancement loss under the duration dimension, and the video enhancement loss under the duration dimension, respectively; Retrieves the preset regular expression terms; Based on the loss weights and the regularization terms, the logarithmic loss under the click dimension, the mean squared error loss under the duration dimension, the object enhancement loss under the click dimension, the video enhancement loss under the click dimension, the object enhancement loss under the duration dimension, and the video enhancement loss under the duration dimension are subjected to loss fusion processing to obtain the fused loss result. Based on the fusion loss result, the parameters in the object tower and the video tower are corrected to obtain the trained video recall model.
12. The method according to any one of claims 6 to 11, characterized in that, The method further includes: The target vector of the sample object and the target vector of the sample video are input into the recommendation prediction layer of the video recall model, and the click parameters and video duration parameters of the sample object to the sample video are determined by the recommendation prediction layer. Based on the click parameters, determine the performance index value of the video recall model; Based on the video duration parameter, the average head duration of the video recall model is determined; Based on the performance metric values and the average head duration, multiple rounds of testing are conducted to obtain the target weight in the click dimension and the target weight in the video duration dimension.
13. A video recommendation device, characterized in that, The device includes: The acquisition module is used to acquire the object feature vector of the target object, the historical playback sequence within a preset historical time period, and the video multi-object vector index of each video to be recommended in the video library to be recommended; A vectorization processing module is used to obtain the historical video identifier and historical playback duration of each historically played video in the historical playback sequence; retrieve a preset feature vector table based on each historical video identifier to obtain a historical video vector set; the number of historical video vectors in the historical video vector set is the same as the number of historical video identifiers in the historical playback sequence; count the historical playback durations in the historical playback sequence to obtain the total historical playback duration; perform duration normalization processing on each historical playback duration based on the total historical playback duration to obtain the normalized playback duration of each historically played video, and determine the normalized playback duration as the video vector weight of the corresponding historically played video; perform weighted processing on each historical video vector in the historical video vector set based on the video vector weight to obtain a video weighted vector set; and merge the video weighted vectors in the video weighted vector set to obtain the object enhancement vector of the target object. The multi-target processing module is used to sequentially perform vector concatenation processing and multi-target feature learning on the object feature vector and the object enhancement vector to obtain the object multi-target vector of the target object. The determination module is used to determine the target recommended video corresponding to the target object from the video library to be recommended based on the object's multi-target vector and the video multi-target vector index of each video to be recommended.
14. The apparatus according to claim 13, characterized in that, The device further includes: The retrieval module is used to retrieve a preset feature vector table based on the video identifier of each video to be recommended, and obtain the video enhancement vector of each video to be recommended. The video feature vector and the video enhancement vector of each video to be recommended are concatenated to obtain the video concatenation vector of each video to be recommended. Multi-objective feature learning is performed on the video splicing vector of each video to be recommended to obtain the video multi-objective vector of each video to be recommended. Create a video multi-objective vector index corresponding to the video multi-objective vector of each of the videos to be recommended.
15. The apparatus according to claim 13, characterized in that, The multi-target processing module is specifically used for: The object feature vector and the object enhancement vector are concatenated to obtain the object concatenated vector. By performing multi-objective feature learning on the object concatenation vector through a multi-objective neural network, the object target vector of the target object under multiple target dimensions is obtained. The object target vectors under the multiple target dimensions are concatenated to obtain the multi-target vector of the target object.
16. The apparatus according to claim 14, characterized in that, The retrieval module is specifically used for: For each video to be recommended, a multi-objective feature learning method is used to learn the video splicing vector of the video to be recommended through a multi-objective neural network to obtain the video target vector of the video to be recommended under multiple target dimensions. Obtain the target weight for each target dimension; Using the aforementioned target weights, the video target vectors under each target dimension are weighted and calculated to obtain a weighted video target vector; The weighted video target vectors under multiple target dimensions are concatenated to obtain the video multi-target vector of the video to be recommended.
17. The apparatus according to claim 13, characterized in that, The determining module is specifically used for: The video multi-objective vector of each video to be recommended is obtained based on the video multi-objective vector index. Determine the inner product between the multi-target vector of the target object and the video multi-target vector of each video to be recommended, and determine the inner product as the similarity score between the target object and the video to be recommended; Based on the similarity score, a specific number of videos to be recommended are selected from the video library to be recommended. The selected number of videos to be recommended are determined as target recommended videos corresponding to the target object.
18. An electronic device, characterized in that, include: Memory, used to store executable instructions; A processor, when executing executable instructions stored in the memory, implements the video recommendation method according to any one of claims 1 to 13.
19. A computer-readable storage medium, characterized in that, It stores executable instructions for implementing the video recommendation method according to any one of claims 1 to 13 when executed by a processor.
20. A computer program product comprising executable instructions, characterized in that, When the executable instructions are executed by the processor, they implement the video recommendation method according to any one of claims 1 to 13.
Citation Information
Patent Citations
Resource recall method and device, equipment and storage medium
CN114298182A
Recommended object determination method and device, electronic equipment and storage medium
CN114528474A
Multimedia data recommendation method and device and computer readable storage medium
CN115114461A