Patent Description:
With the advancement of science and technology and the popularization of Internet, more and more users like to socialize on application software such as video application software and chat application software.

<CIT> discloses: an image display device includes: a display; a memory storing one or more instructions; and a processor executing the one or more instructions stored in the memory, wherein the processor executes the one or more instructions: to determine whether it is a recommended time for outputting advertisement content, from a user's log data, based on a first trained model using one or more neural networks; to determine a recommended attribute of an advertisement display region from the user's log data, based on a second trained model using the one or more neural networks, when it is determined that it is the recommended time for outputting the advertisement content; and to adjust an attribute of the advertisement display region based on the determined recommended attribute and control the display to output the advertisement content in the attribute-adjusted advertisement display region.

<CIT> provides a new recommendation scheme, whereby a user enters various criteria for what he/she would like to be recommended. For example, the system may receive a user preference for content recommendations from a user. The system may retrieve a user profile for the user. The system may compare the user preference to the user profile to determine a criterion for content recommendations for the user. The system may receive a content attribute for content provided by a content provider. The system may match the criterion to the content attribute. The system may, in response to matching the criterion to the content attribute, generate for display a recommendation to the user for the content.

<CIT> discloses: a method and apparatus for recommending a content, a device, and a medium are provided. The method may include: determining, based on historical behavior data of a user using a product and a feature of a structure of a to-be-recommended content, a target structural preference of the user, the structure being determined by classifying the to-be-recommended content based on any classifying method of a content tag system; and determining each recommendation result of the user based on the target structural preference, the recommendation result including at least two structures and a recommendation content corresponding to each structure.

<CIT> discloses an AI-based recommendation content processing method, apparatus, and storage medium, involving machine learning. The method includes: converting user comments on recommended content into semantic vectors; extracting temporal features (via transfer learning-based multi-layer BiLSTM) and local features (via pre-trained multi-layer CNN) from the vectors; determining comment-level sentiment attributes through combined features; aggregating sentiments to derive content-level attributes; and dynamically adjusting recommendations accordingly. This dual-model approach enhances sentiment analysis accuracy and recommendation quality in AI-driven systems.

<CIT> discloses systems and methods herein for providing content item recommendations based on a video. Using feature vectors corresponding to at least one frame of a video (e.g., generated based on texture and shape intensity of a frame), a recommendation system improves content recommendation using analytic and quantitative characteristics derived from a frame of a content item rather than merely manually labeled bibliographic data (e.g., a genre or producer). The recommendation system may generate a feature vector based on a texture, a shape intensity (e.g., generated from a Generalized Hough Transform), and temporal data corresponding to at least one frame of a video. The feature vector is analyzed using a machine learning model (e.g., a neural network) to produce a machine learning model output. The recommendation system causes a recommended content item to be provided based on the machine learning model output.

At present, when a user uses a kind of application software to socialize, some software will actively recommend videos. A traditional manual recommendation method is as follows: A system recommends a target video by means of manual review, manual scoring, and manual weighting. Gradually, the way of recommending the target video by a terminal device has transitioned from the traditional manual video recommendation method to a traditional machine learning method. In the traditional machine learning method, the process of video learning recommendation is relatively complex, but processing methods for different videos are the same. Both the traditional manual video recommendation method and the traditional machine learning method may cause poor accuracy of the terminal device in recommending the target video.

Embodiments of the present disclosure provide a video commendation method, a terminal device, and a computer-readable storage medium, which are used for improving the accuracy of a terminal device in recommending a target video.

It can be seen from the above technical solutions that the embodiments of the present disclosure have the following advantages:.

In the embodiments of the present disclosure, identifier information of a watched video, position information of the watched video, identifier information of a current video, and position information of the current video are acquired; the identifier information of the watched video and the position information of the watched video are input to a first model to obtain a preference vector of the watched video; the preference vector of the watched video, the identifier information of the current video, and the position information of the current video are input to a second model to obtain a preference vector of the current video; and a target video is determined according to the preference vector of the current video. That is, the terminal device completes recommendation of the target video by modeling the watched video and the current video. This method can improve the accuracy of the target video recommended by the terminal device.

In order to explain the technical solutions of the embodiments of the present disclosure more clearly, the following will briefly introduce the accompanying drawings used in the embodiments. Apparently, the drawings in the following description are only some embodiments of the present disclosure.

Embodiments of the present disclosure provide a video commendation method, a terminal device, and a computer-readable storage medium, which are used for improving the accuracy of a terminal device in recommending a target video.

In order to make a person skilled in the art to better understand the solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure are described below with reference to the accompanying drawings in the embodiments of the present disclosure the described embodiments are merely some rather than all of the embodiments of the present disclosure. The embodiments in the present disclosure shall all fall within the protection scope of the present disclosure.

It can be understood that the terminal devices involved in the embodiments of the present disclosure may include a general handheld electronic terminal device with a screen, such as a mobile phone, a smartphone, a portable terminal, a terminal, a Personal Digital Assistant (PDA), a Personal Media Player (PMP) apparatus, a laptop, a Note Pad, a Wireless Broadband (Wibro) terminal, a Personal Computer (PC), a smart PC, a Point of Sales (POS), and a car computer.

The terminal device can also include a wearable device. The wearable device is a portable electronic device that can be directly worn by a user or integrated into clothes or an accessory of the user. The wearable device is not just a hardware device, but can also achieve powerful intelligent functions through software support, data exchange, and cloud interaction, such as a computing function, a positioning function, and an alarm function. It can also be connected to a mobile phone and various terminals. The wearable device can include but is not limited to watch products supported by the wrist (such as a watch and a wristband), shoe products supported by the feet (such as shoes, socks, or other products worn on the legs), glass products supported by the head (such as glasses, helmets, and headband), and all kinds of non-mainstream product forms such as smart clothing, backpacks, crutches, and accessories.

It should be noted that the terminal device involved in the embodiments of the present disclosure is provided with a Transformer model. The Transformer model has a complete Encoder-Decoder frame and is used for determining a target video. A first model is arranged in an encoder. The first model is used for modeling a preference vector of a user for a watched video. A second model is arranged in the decoder. The second model is used for modeling a preference vector of the user for a current video.

The technical solutions of the present disclosure will be further explained below by the embodiments. <FIG> shows a schematic diagram of an embodiment in the embodiments of the present disclosure, which can include:
<FIG> is a schematic diagram of an embodiment of a video recommendation method in the embodiments of the present disclosure. The video recommendation method can include:
<NUM>, identifier information of a watched video, position information of the watched video, identifier information of a current video, and position information of the current video are acquired.

It can be understood that the identifier information of the watched video may include but is not limited to an Identity Document (ID) of the watched video. The ID of the watched video can be referred to as a serial number of the watched video or a watched video account. The identifier information of the watched video is a relatively unique number in the watched video.

The position information of the watched video refers to position information of the watched video on a display page and/or a display page where the watched video is located. Optionally, the position information of the watched video can include a page position and page number of the watched video.

The identifier information of the current video can include but is not limited to an ID of the current video, and the ID of the current video can be referred to as a serial number of the current video or a current video account. The identifier information of the current video is a relatively unique number in the current video.

The position information of the current video refers to position information of the current video on a display page and/or a display page where the watched video is located. Optionally, the position information of the current video can include a page position and page number of the current video.

Optionally, the watched video can be, but is not limited to, a video that has been played for <NUM> seconds (s), a video that has been played for <NUM>, a video that has been played by <NUM>%. The current video can be, but is not limited to, a video that has been played for <NUM> seconds (s), a video that has been played for <NUM>, a video that has been played by <NUM>%.

Optionally, the watched video can include a watched video sequence (seq). The current video includes a current video sequence. For example, the identifier information of the watched video includes identifier information of the watched video sequence.

<NUM>, the identifier information of the watched video and the position information of the watched video are input to a first model to obtain a preference vector of the watched video.

Optionally, the terminal device inputs the identifier information of the watched video and the position information of the watched video to a first model to obtain a preference vector of the watched video, which can include: the terminal device inputs the identifier information of the watched video and the position information of the watched video to a first target model to obtain an interest preference vector of the watched video; and the terminal device inputs the interest preference vector of the watched video to a second target model to obtain the preference vector (feat) of the watched video.

The first model can include the first target model and the second target model.

Optionally, the terminal device inputs the identifier information of the watched video and the position information of the watched video to a first target model to obtain an interest preference vector of the watched video, which can include: the terminal device obtains a first interest preference parameter according to the identifier information of the watched video and the position information of the watched video; the terminal device obtains a second interest preference parameter according to the first interest preference parameter; and the terminal device obtains the interest preference vector of the watched video according to the second interest preference parameter.

Optionally, the terminal device obtains a first interest preference parameter according to the identifier information of the watched video and the position information of the watched video, which can include: the terminal device obtains the first interest preference parameter according to a first formula.

The first formula is <MAT>; Q<NUM>=WiQ1(x<NUM>+p<NUM>); K<NUM>=WiK1(x<NUM>+p<NUM>); Vi=WiV1 (x<NUM>+p<NUM>);.

It can be understood that p<NUM> is the position information Positional_Encoding of the watched video.

It should be noted that a result obtained by performing dot product operation on Q<NUM> and K<NUM>T will become larger and larger. Therefore, the terminal device will multiply this result by <MAT> to reduce the result, where <MAT> is a first scaling factor. The first scaling factor is used for normalization, so that the result will not become too large.

It can be understood that Q<NUM> can be considered as being formed by concatenating A vectors with a dimension dQ1; K<NUM> can be considered as being concatenating B vectors with a dimension dk1; and dQ1 can be equal to dk1, both of which represent the first input dimension, where A and B are integers greater than or equal to <NUM>.

Dimensions of Q<NUM> and K<NUM> are the same, and dimensions of Q<NUM> and V<NUM> can be the same or different. Lengths of K<NUM> and V<NUM> are the same, and lengths of Q<NUM> and K<NUM> can be the same or different. Dimensions of Attention (Q<NUM>, K<NUM>, V<NUM>) and V<NUM> are the same, and lengths of Attention (Q<NUM>, K<NUM>, V<NUM>) and Q<NUM> are the same.

Q<NUM>, K<NUM>, and V<NUM> can be the same.

WiQ1, WiK1, and WiV1 are linear transformation matrices in an encoder.

Optionally, the terminal device obtains a second interest preference parameter according to the first interest preference parameter, which can include: the terminal device obtains the second interest preference parameter according to a second formula.

The second formula is headi=Attention (Q<NUM>WiQ1, K<NUM>WiK1, V<NUM>WiV1); headi represents the second interest preference parameter.

Optionally, the terminal device obtains the interest preference vector of the watched video according to the second interest preference parameter, which can include: the terminal device obtains the interest preference vector of the watched video according to a third formula.

The third formula is MultiHead (Q<NUM>, K<NUM>, V<NUM>)=Concat (head<NUM>, head<NUM>,. headi)WO1; MultiHead (Q<NUM>, K<NUM>, V<NUM>) represents the interest preference vector of the watched video; Concat (head<NUM>, head<NUM>,. headi) represents a first concatenate function; and WO1 represents a weight matrix of a first MultiHead layer.

It can be understood that the first formula, the second formula, and the third formula are formulas in the first target model. The first formula, the second formula, and the third formula are completed in a multi-head attention layer of the encoder.

Optionally, the terminal device inputs the interest preference vector of the watched video to a second target model to obtain the preference vector of the watched video, which can include: the terminal device inputs the interest preference vector of the watched video to a first feed forward neural network to obtain the preference vector of the watched video.

It can be understood that H<NUM> and H<NUM> can be the same or different, and b<NUM> and b<NUM> can be the same or different. No specific limitations are made on this.

<NUM>, the preference vector of the watched video, the identifier information of the current video, and the position information of the current video are input to a second model to obtain a preference vector of the current video.

Optionally, the terminal device inputs the preference vector of the watched video, the identifier information of the current video, and the position information of the current video are input to a second model to obtain a preference vector of the current video, which can include: the terminal device obtains a third interest preference parameter according to the preference vector of the watched video, the identifier information of the current video, and the position information of the current video; the terminal device obtains a fourth interest preference parameter according to the third interest preference parameter; the terminal device obtains an interest preference vector of the current video according to the fourth interest preference parameter; and the terminal device inputs the interest preference vector of the current video to a third target model to obtain the preference vector of the current video.

The second model includes the third target model.

Optionally, the preference vector of the watched video includes a feature vector of the current video on a second Key layer and a feature vector of the current video on a second Value layer.

Optionally, the terminal device obtains a third interest preference parameter according to the preference vector of the watched video, the identifier information of the current video, and the position information of the current video, which can include: the terminal device obtains the third interest preference parameter according to a fourth formula.

It can be understood that p<NUM> is the position information Positional_Encoding of the current video.

It can be understood that Q<NUM> can be considered as being formed by concatenating A vectors with a dimension dQ2; K<NUM> can be considered as being concatenating B vectors with a dimension dk2; and dQ2 can be equal to dk2, both of which represent the first input dimension, where A and B are integers greater than or equal to <NUM>.

WiQ2, WiK2, and WiV2 are linear transformation matrices in a decoder.

Optionally, the terminal device obtains a fourth interest preference parameter according to the third interest preference parameter, which can include: the terminal device obtains the fourth interest preference parameter according to a fifth formula.

The fifth formula is head'i=Attention (Q<NUM>WiO2, K<NUM>WiK2, V<NUM>WiV2); head'i represents the fourth interest preference parameter.

Optionally, the terminal device obtains the interest preference vector of the current video according to the fourth interest preference parameter, which can include: the terminal device obtains the interest preference vector of the current video according to a sixth formula.

The sixth formula is MultiHead (Q<NUM>, K<NUM>, V<NUM>)=Concat (head'<NUM>, head'<NUM>,. head'i)WO2; MultiHead (Q<NUM>, K<NUM>, V<NUM>) represents the interest preference vector of the current video; Concat (head'<NUM>, head'<NUM>,. head'i) represents a second concatenate function; and WO2 represents a weight matrix of a second MultiHead layer.

It can be understood that the fourth formula, the fifth formula, and the sixth formula are formulas in the second target model. The fourth formula, the fifth formula, and the sixth formula are completed in a multi-head attention layer of the decoder.

Optionally, the terminal device inputs the interest preference vector of the current video to a third target model to obtain the preference vector of the current video, which can include: the terminal device inputs the interest preference vector of the current video to a second feed forward neural network to obtain the preference vector of the current video.

It can be understood that H<NUM> and H<NUM> can be the same or different, and b<NUM> and b<NUM> can be the same or different. H<NUM> and H<NUM> can be the same or different, and b<NUM> and b<NUM> can be the same or different. No specific limitations are made on this.

Exemplarily, <FIG> is a schematic diagram of an embodiment of an Encoder-Decoder frame in the embodiments of the present disclosure. In <FIG>, the watched video is a video that has been played by <NUM>%, and the current video is a video that has been played by <NUM>%.

It can be understood that the Encoder-Decoder frame in <FIG> can be referred to as an interest extraction network structure of the current video.

<NUM>, a target video is determined according to the preference vector of the current video.

The terminal device determines a target video according to the preference vector of the current video, which includes: the terminal device inputs a preference vector corresponding to a first current video to each of N expert networks, wherein a proportion of the preference vector corresponding to the first current video in each expert network is different, a being-selected weight corresponding to each expert network is different, and N is a positive integer greater than or equal to <NUM>; the terminal device outputs a target preference vector corresponding to the first current video according to the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network; the terminal device obtains N target preference vectors corresponding to N current videos; and the terminal device determines N target videos according to the N target preference vectors.

It can be understood that the being-selected weight corresponding to the expert network can be referred to as a gate.

Optionally, the terminal device outputs a target preference vector corresponding to the first current video according to the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network, which can include: the terminal device performs weighted summation on the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network, and outputs a target preference vector corresponding to the first current video.

Optionally, the terminal device performs weighted summation on the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network, and outputs a target preference vector corresponding to the first current video, which can include but is not limited to the following implementations:
Implementation <NUM>: The terminal device obtains the target preference vector corresponding to the first current video according to a seventh formula.

The seventh formula is <MAT>
where fk(z) represents the target preference vector corresponding to the first current video; <MAT> represents the being-selected weight corresponding to an ith expert network; and fi(z) represents the proportion of the preference vector corresponding to an ith video in the first current video in the ith expert network.

It can be understood that different expert networks can process different subtasks, and there is a coupling relationship between different subtasks, so that processed subtasks are more accurate. The subtask can be a watched video; and the processed subtask can be a target video (Task).

Implementation <NUM>: The terminal device performs weighted summation on the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network, and outputs a preference vector parameter corresponding to the first current video; and the terminal device outputs, in a case that a value of the preference vector parameter is greater than a preset parameter threshold, the target preference vector corresponding to the first current video.

It should be noted that the preset parameter threshold can be set by the terminal device before delivery or customized by a user. No specific limitations will be made on this.

The preset parameter threshold can be defined by a Tower model. The Tower model is used for determining whether to output the target preference vector corresponding to the first current video.

Optionally, the terminal device outputs, in a case that a value of the preference vector parameter is greater than a preset parameter threshold, the target preference vector corresponding to the first current video, which can include: the terminal device obtains a first parameter in a case that the value of the preference vector parameter is greater than the preset parameter threshold; and the terminal device adds a result output by a bias deep neural network (Bias DNN) to the first parameter to obtain the target preference vector corresponding to the first current video.

It can be understood that the Bias DNN can be referred to as a bias network. The bias network is used for adjusting a preference vector parameter, which can improve the flexibility of the Tower model.

Exemplarily, <FIG> is a schematic diagram of another embodiment of a video recommendation method in the embodiments of the present disclosure. In <FIG>, the watched video is a video that has been played for <NUM>, a video that has been played for <NUM>, and a video that has been played by <NUM>%. A target video Task is prediction of the video that has been played for <NUM>, prediction of the video that has been played for <NUM>, and prediction of the video that has been played by <NUM>%.

<FIG> is a schematic diagram of an embodiment of a terminal device in the embodiments of the present disclosure, which can include: an acquisition module <NUM> and a processing module <NUM>.

The acquisition module <NUM> is configured to acquire identifier information of a watched video, position information of the watched video, identifier information of a current video, and position information of the current video.

The processing module <NUM> is configured to: input the identifier information of the watched video and the position information of the watched video to a first model to obtain a preference vector of the watched video, input the preference vector of the watched video, the identifier information of the current video, and the position information of the current video to a second model to obtain a preference vector of the current video, and determine a target video according to the preference vector of the current video.

Optionally, in some embodiments of the present disclosure,
the processing module <NUM> is specifically configured to: input the identifier information of the watched video and the position information of the watched video to a first target model to obtain an interest preference vector of the watched video; and input the interest preference vector of the watched video to a second target model to obtain a preference vector of the watched vector. The first model includes the first target model and the second target model.

Optionally, in some embodiments of the present disclosure,
the processing module <NUM> is specifically configured to: obtain a first interest preference parameter according to the identifier information of the watched video and the position information of the watched video; obtain a second interest preference parameter according to the first interest preference parameter; and obtain the interest preference vector of the watched video according to the second interest preference parameter.

Optionally, in some embodiments of the present disclosure,
the processing module <NUM> is specifically configured to obtain the first interest preference parameter according to a first formula, wherein the first formula is <MAT> ; Q<NUM>=WiQ1(x<NUM>+p<NUM>); K<NUM>=WiK1(x<NUM>+p<NUM>); V<NUM>=WiV1 (x<NUM>+p<NUM>); Attention (Q<NUM>, K<NUM>, V<NUM>) represents the first interest preference parameter; <MAT> represents a first normalized index softmax function; Q<NUM> represents a feature vector of the watched video in a first Query layer; K<NUM> represents a feature vector of the watched video in a first Key layer; V<NUM> represents a feature vector of the watched video in a first Value layer; WiQ1 represents a weight matrix of the first Query layer; WiK1 represents a weight matrix of the first Key layer; WiV1 represents a weight matrix of the first Value layer; x<NUM> represents the identifier information of the watched video; p<NUM> represents the position information of the watched video; the position information of the watched video comprises position information of the watched video on a display page and/or a display page where the watched video is located; and dk1 represents a first input dimension.

Optionally, in some embodiments of the present disclosure,.

Optionally, in some embodiments of the present disclosure,
the processing module <NUM> is specifically configured to input the interest preference vector of the watched video to a first feed forward neural network to obtain the preference vector of the watched video, wherein the first feed forward neural network is FFN (y<NUM>)=ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM>+b<NUM>; y<NUM>=MultiHead (Q<NUM>, K<NUM>, V<NUM>); y<NUM> represents the interest preference vector of the watched video; ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM> represents an activation function of a first layer in the first feed forward neural network; ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM>+b<NUM> represents a linear activation function of a second layer in the first feed forward neural network; H11 represents a weight matrix of the first layer in the first feed forward neural network; H<NUM> represents a weight matrix of the second layer in the first feed forward neural network; b<NUM> represents a bias term of the first layer in the first feed forward neural network; and b<NUM> represents a bias term of the second layer in the first feed forward neural network.

Optionally, in some embodiments of the present disclosure,
the processing module <NUM> is specifically configured to: obtain a third interest preference parameter according to the preference vector of the watched video, the identifier information of the current video, and the position information of the current video; obtain a fourth interest preference parameter according to the third interest preference parameter; obtain an interest preference vector of the current video according to the fourth interest preference parameter; and input the interest preference vector of the current video to a third target model to obtain the preference vector of the current video. The second model includes the third target model.

Optionally, in some embodiments of the present disclosure,
the preference vector of the watched video includes a feature vector of the current video in a second Key layer and a feature vector of the current video in a second Value layer; the processing module <NUM> is specifically configured to: obtain the third interest preference parameter according to a fourth formula, wherein the fourth formula is <MAT> ; Q<NUM>=WiQ2 (x<NUM>+p<NUM>), where Attention (Q<NUM>, K<NUM>, V<NUM>) represents the third interest preference parameter; <MAT> represents a second normalized index softmax function; Q<NUM> represents a feature vector of the current video in a second Query layer; K<NUM> represents the feature vector of the current video in the Key layer; V<NUM> represents the feature vector of the current video in a second Value layer; WiQ2 represents a weight matrix of the second Query layer; WiK2 represents a weight matrix of the second Key layer; WiV2 represents a weight matrix of the second Value layer; x<NUM> represents the identifier information of the current video; p<NUM> represents the position information of the current video; the position information of the current video comprises position information of the current video on a display page and/or a display page where the current video is located; and dk2 represents a second input dimension.

Optionally, in some embodiments of the present disclosure,
the processing module <NUM> is specifically configured to input the interest preference vector of the current video to a second feed forward neural network to obtain the preference vector of the current video, wherein the second feed forward neural network is FFN (y<NUM>)=ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM>+b<NUM>; y<NUM>=MultiHead (Q<NUM>, K<NUM>, V<NUM>); y2 represents the interest preference vector of the current video; ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM> represents an activation function of a first layer in the second feed forward neural network; ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM>+b<NUM> represents a linear activation function of a second layer in the second feed forward neural network; H<NUM> represents a weight matrix of the first layer in the second feed forward neural network; H<NUM> represents a weight matrix of the second layer in the second feed forward neural network; b<NUM> represents a bias term of the first layer in the second feed forward neural network; and b<NUM> represents a bias term of the second layer in the second feed forward neural network.

In the claimed embodiment,
the processing module <NUM> is specifically configured to: input a preference vector corresponding to a first current video to each of N expert networks, wherein a proportion of the preference vector corresponding to the first current video in each expert network is different, a being-selected weight corresponding to each expert network is different, and N is a positive integer greater than or equal to <NUM>; output a target preference vector corresponding to the first current video according to the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network; obtain N target preference vectors corresponding to N current videos; and determine N target videos according to the N target preference vectors.

Optionally, in some embodiments of the present disclosure,
the processing module <NUM> is specifically configured to: perform weighted summation on the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network, and output a target preference vector corresponding to the first current video.

Optionally, in some embodiments of the present disclosure,
the processing module <NUM> is specifically configured to: perform weighted summation on the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network, and output a preference vector parameter corresponding to the first current video; and output, in a case that a value of the preference vector parameter is greater than a preset parameter threshold, the target preference vector corresponding to the first current video.

<FIG> is a schematic diagram of another embodiment of a terminal device in the embodiments of the present disclosure, which can include: a memory <NUM> and a processor <NUM>. The memory <NUM> and the processor <NUM> are coupled to each other. The processor <NUM> can call executable program codes stored in the memory <NUM>.

In the embodiments of the present disclosure, the processor <NUM> included in the terminal device also has the following functions:.

Optionally, the processor <NUM> also has the following functions:
inputting the identifier information of the watched video and the position information of the watched video to a first target model to obtain an interest preference vector of the watched video; and inputting the interest preference vector of the watched video to a second target model to obtain a preference vector of the watched vector. The first model includes the first target model and the second target model.

Optionally, the processor <NUM> also has the following functions:
obtaining a first interest preference parameter according to the identifier information of the watched video and the position information of the watched video; obtaining a second interest preference parameter according to the first interest preference parameter; and obtaining the interest preference vector of the watched video according to the second interest preference parameter.

Optionally, the processor <NUM> also has the following functions:
obtaining the first interest preference parameter according to a first formula, wherein the first formula is <MAT>; Q<NUM>=WiQ1(x<NUM>+p<NUM>); K<NUM>=WiK1(x<NUM>+p<NUM>); V<NUM>=WiV1 (x<NUM>+p<NUM>); Attention (Q<NUM>, K<NUM>, V<NUM>) represents the first interest preference parameter; <MAT> represents a first normalized index softmax function; Q<NUM> represents a feature vector of the watched video in a first Query layer; K<NUM> represents a feature vector of the watched video in a first Key layer; V<NUM> represents a feature vector of the watched video in a first Value layer; WiQ1 represents a weight matrix of the first Query layer; WiK1 represents a weight matrix of the first Key layer; WiV1 represents a weight matrix of the first Value layer; x<NUM> represents the identifier information of the watched video; p<NUM> represents the position information of the watched video; the position information of the watched video comprises position information of the watched video on a display page and/or a display page where the watched video is located; and dk1 represents a first input dimension.

Optionally, the processor <NUM> also has the following functions:.

Optionally, the processor <NUM> also has the following functions:
inputting the interest preference vector of the watched video to a first feed forward neural network to obtain the preference vector of the watched video, wherein the first feed forward neural network is FFN (y<NUM>)=ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM>+b<NUM>; y<NUM>=MultiHead (Q<NUM>, K<NUM>, V<NUM>); y<NUM> represents the interest preference vector of the watched video; ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM> represents an activation function of a first layer in the first feed forward neural network; ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM>+b<NUM> represents a linear activation function of a second layer in the first feed forward neural network; H11 represents a weight matrix of the first layer in the first feed forward neural network; H<NUM> represents a weight matrix of the second layer in the first feed forward neural network; b<NUM> represents a bias term of the first layer in the first feed forward neural network; and b<NUM> represents a bias term of the second layer in the first feed forward neural network.

Optionally, the processor <NUM> also has the following functions:
obtaining a third interest preference parameter according to the preference vector of the watched video, the identifier information of the current video, and the position information of the current video; obtaining a fourth interest preference parameter according to the third interest preference parameter; obtaining an interest preference vector of the current video according to the fourth interest preference parameter; and inputting the interest preference vector of the current video to a third target model to obtain the preference vector of the current video. The second model includes the third target model.

Optionally, the processor <NUM> also has the following functions:
in a case that the preference vector of the watched video includes a feature vector of the current video in a second Key layer and a feature vector of the current video in a second Value layer, obtaining the third interest preference parameter according to a fourth formula, wherein the fourth formula is <MAT>; Q<NUM>=WiQ2 (x<NUM>+p<NUM>); Attention (Q<NUM>, K<NUM>, V<NUM>) represents the third interest preference parameter; <MAT> represents a second normalized index softmax function; Q<NUM> represents a feature vector of the current video in a second Query layer; K<NUM> represents the feature vector of the current video in the Key layer; V<NUM> represents the feature vector of the current video in a second Value layer; WiQ2 represents a weight matrix of the second Query layer; WiK2 represents a weight matrix of the second Key layer; WiV2 represents a weight matrix of the second Value layer; x<NUM> represents the identifier information of the current video; p<NUM> represents the position information of the current video; the position information of the current video comprises position information of the current video on a display page and/or a display page where the current video is located; and dk2 represents a second input dimension.

Optionally, the processor <NUM> also has the following functions:
inputting the interest preference vector of the current video to a second feed forward neural network to obtain the preference vector of the current video, wherein the second feed forward neural network is FFN (y<NUM>)=ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM>+b<NUM>; y<NUM>=MultiHead (Q<NUM>, K<NUM>, V<NUM>); y2 represents the interest preference vector of the current video; ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM> represents an activation function of a first layer in the second feed forward neural network; ReLU<NUM> (y<NUM>H<NUM>+b<NUM>) H<NUM>+b<NUM> represents a linear activation function of a second layer in the second feed forward neural network; H<NUM> represents a weight matrix of the first layer in the second feed forward neural network; H<NUM> represents a weight matrix of the second layer in the second feed forward neural network; b<NUM> represents a bias term of the first layer in the second feed forward neural network; and b<NUM> represents a bias term of the second layer in the second feed forward neural network.

The processor <NUM> also has the following functions:
inputting a preference vector corresponding to a first current video to each of N expert networks, wherein a proportion of the preference vector corresponding to the first current video in each expert network is different, a being-selected weight corresponding to each expert network is different, and N is a positive integer greater than or equal to <NUM>; outputting a target preference vector corresponding to the first current video according to the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network; obtaining N target preference vectors corresponding to N current videos; and determining N target videos according to the N target preference vectors.

Optionally, the processor <NUM> also has the following functions:
performing weighted summation on the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network, and outputting a target preference vector corresponding to the first current video.

Optionally, the processor <NUM> also has the following functions:
performing weighted summation on the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network, and outputting a preference vector parameter corresponding to the first current video; and outputting, in a case that a value of the preference vector parameter is greater than a preset parameter threshold, the target preference vector corresponding to the first current video.

All or some of the foregoing embodiments may be implemented by using software, hardware, firmware, or any combination thereof. When software is used to implement the embodiments, all or a part of the embodiments may be implemented in a form of a computer program product.

The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the procedure or functions according to the embodiments of the present disclosure are all or partially generated. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable apparatuses. The computer instructions may be stored in a computer-readable storage medium or may be transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, a computer, a server, or a data center to another website, computer, server, or data center in a wired manner (for example, by using a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or a wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium that can be stored by the computer, or a data storage device, for example, a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, DVD), a semiconductor medium (for example, Solid State Disk (SSD)), or the like.

A person skilled in the art can clearly understand that for convenience and conciseness of description, for specific working processes of the foregoing systems, devices, and units, refer to the corresponding processes in the foregoing method embodiments, and details are not described here again.

In the several embodiments provided in the present disclosure, it should be understood that the disclosed system, apparatuses, and methods may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative. For example, the division of the units is only one type of logical functional division, and other divisions is achieved in practice. For example, multiple units or components can be combined or integrated into another system, or some features can be omitted, or not executed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces. The indirect couplings or communication connections between the apparatuses or units may be implemented in electronic, mechanical or other forms.

Some or all of the units are selected according to actual needs to achieve the objective of the solution of this embodiment.

In addition, functional units in embodiments of the present disclosure may be integrated into one processing unit, or each of the units may exist alone physically, or two or more units are integrated into one unit.

Claim 1:
A video recommendation method, comprising:
acquiring identifier information of a watched video, position information of the watched video, identifier information of a current video, and position information of the current video;
inputting the identifier information of the watched video and the position information of the watched video to a first model to obtain a preference vector of the watched video, wherein the position information of the watched video refers to position information of the watched video on a display page and/or a display page where the watched video is located; and
inputting the preference vector of the watched video, the identifier information of the current video, and the position information of the current video to a second model to obtain a preference vector of the current video, wherein the position information of the current video refers to position information of the current video on a display page and/or a display page where the current video is located; and
determining a target video according to the preference vector of the current video, by:
inputting a preference vector corresponding to a first current video to each of N expert networks, wherein a proportion of the preference vector corresponding to the first current video in each expert network is different, a being-selected weight corresponding to each expert network is different, and N is a positive integer greater than or equal to <NUM>;
outputting a target preference vector corresponding to the first current video according to the proportion of the preference vector corresponding to the first current video in each expert network and the being-selected weight corresponding to each expert network;
obtaining N target preference vectors corresponding to N current videos; and
determining N target videos according to the N target preference vectors.