Method, apparatus, processing device and storage medium for data processing
By constructing a multi-dimensional sequence of user search events and page behaviors, and using self-attention and multi-head self-attention mechanisms to process encoded information, the problem of inaccurate user preferences in existing technologies is solved, and more accurate determination of user preference information and ranking of exposure objects are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING XIAOMI MOBILE SOFTWARE CO LTD
- Filing Date
- 2022-12-02
- Publication Date
- 2026-04-17
AI Technical Summary
Existing technologies struggle to accurately represent current user preferences, especially when user interests are constantly changing. When modeling user behavior using neural networks, they cannot accurately reflect the user's current preferences.
Construct a first and second sequence of user behaviors based on search events and pre-selected pages of target users. Process the encoded vectors and matrices using self-attention and multi-head self-attention mechanisms, and fuse features to determine user preference information for the determination and display ranking of exposure objects.
By constructing multi-dimensional sequence relationships, the accuracy of user preference information is improved, making user preference information more consistent with current interests, and enhancing the accuracy of identifying and sorting exposure objects.
Smart Images

Figure CN115878881B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information technology, and in particular to a data processing method, apparatus, processing device, and storage medium. Background Technology
[0002] User behavior analysis is the process of statistically analyzing data obtained from online products such as websites or applications to understand users' behavioral habits when using those products. The user habits and interests discovered through user behavior analysis can be applied to various aspects of internet product design, improvement, and marketing, enabling internet products to provide personalized services and meet users' individual needs.
[0003] With the rapid development of deep learning technology, the use of neural networks in user behavior analysis is becoming increasingly accurate. By modeling user behavior sequences through neural networks, user preferences can be obtained.
[0004] In related technologies, a sequence is constructed based on a user's behavior or the characteristics of a user over a period of time. This sequence is then modeled using neural networks to determine user preferences. However, user interests are often constantly changing, and user actions on different pages frequently involve different user behaviors. Therefore, user preferences determined using existing technologies cannot accurately represent a user's current preferences. Summary of the Invention
[0005] In view of the above, this disclosure provides a data processing method, apparatus, processing device, and storage medium.
[0006] According to a first aspect of the present disclosure, a data processing method is provided, the method comprising:
[0007] Based on the exposure objects involved in the nth search event of the target user, a first sequence is constructed; wherein, the first sequence includes: information of the exposure objects and the search terms of the search event; wherein, n is any positive integer;
[0008] A second sequence is constructed based on user behavior acting on a predetermined page; wherein the second sequence includes: information about the exposure object affected by the user behavior and the search term; wherein the predetermined page includes at least: a landing page and / or a results page returned based on the search term;
[0009] Based on the first sequence, the second sequence, and the predetermined neural network, the preference information of the target user is determined; wherein, the preference information is used to determine the exposure objects involved in the (n+1)th search event and / or the display sorting of the exposure objects.
[0010] In one embodiment, the second sequence includes: a selection operation sequence generated based on the selection operation of the target user in the nth search event; and / or, a download operation sequence generated based on the download operation of the target user in the nth search event.
[0011] In one embodiment, the information of the exposed object includes: the name of the exposed object and / or the identifier of the exposed object.
[0012] In one embodiment, determining the target user's preference information based on the first sequence, the second sequence, and a predetermined neural network includes: encoding the first sequence to obtain a first encoding vector, and encoding the second sequence to obtain a second encoding vector; processing the first encoding vector based on a self-attention mechanism to obtain a first matrix, and processing the second encoding vector based on a self-attention mechanism to obtain a second matrix; fusing the first matrix and the second matrix to obtain a first fusion feature; and obtaining the target user's preference information based on the first fusion feature.
[0013] In one embodiment, the step of fusing the first matrix and the second matrix to obtain a first fused feature includes: concatenating the first matrix and the second matrix based on a multi-head self-attention mechanism to obtain a first fused matrix; and performing a linear transformation on the first fused matrix to obtain the first fused feature.
[0014] In one embodiment, the first encoded vector is processed based on a self-attention mechanism to obtain a first matrix, and the second encoded vector is processed based on a self-attention mechanism to obtain a second matrix, including: multiplying the first encoded vector by three preset weight matrices of different self-attention mechanisms to obtain three first weight feature matrices; and multiplying and normalizing the three first weight feature matrices to obtain the first matrix.
[0015] In one embodiment, the first encoded vector is processed based on a self-attention mechanism to obtain a first matrix, and the second encoded vector is processed based on a self-attention mechanism to obtain a second matrix, including: multiplying the second encoded vector by three preset weight matrices of different self-attention mechanisms to obtain three second weight feature matrices; and multiplying and normalizing the three second weight feature matrices to obtain the second matrix.
[0016] In one embodiment, encoding the first sequence to obtain a first encoding vector and encoding the second sequence to obtain a second encoding vector includes: performing embedding encoding on the first sequence; and performing sequence encoding on the encoding vector obtained by embedding encoding to obtain the first encoding vector.
[0017] In one embodiment, encoding the first sequence to obtain a first encoding vector and encoding the second sequence to obtain a second encoding vector includes: performing embedding encoding on the second sequence; and performing sequence encoding on the encoding vector obtained by embedding encoding to obtain the second encoding vector.
[0018] According to a second aspect of the present disclosure, a data processing apparatus is provided, the apparatus comprising:
[0019] A construction module is configured to: construct a first sequence based on the exposure objects involved in the nth search event of the target user; wherein the first sequence includes: information of the exposure objects and search terms of the search event; wherein n is any positive integer;
[0020] A second sequence is constructed based on user behavior acting on a predetermined page; wherein the second sequence includes: information about the exposed object affected by the user behavior and the search term, wherein the predetermined page includes at least: a landing page and / or a results page returned based on the search term;
[0021] The determining module is configured to: determine the target user's preference information based on the first sequence, the second sequence, and a predetermined neural network; the preference information is used to determine the exposure objects involved in the (n+1)th search event and / or the display sorting of the exposure objects.
[0022] In one embodiment, the apparatus further includes: an obtaining module; the obtaining module is configured to: encode the first sequence to obtain a first encoding vector, and encode the second sequence to obtain a second encoding vector; process the first encoding vector based on a self-attention mechanism to obtain a first matrix, and process the second encoding vector based on a self-attention mechanism to obtain a second matrix; perform fusion processing on the first matrix and the second matrix to obtain a first fusion feature; and obtain the target user's preference information based on the first fusion feature.
[0023] In one embodiment, the obtaining module is further configured to: concatenate the first matrix and the second matrix based on a multi-head self-attention mechanism to obtain a first fusion matrix; and perform a linear transformation on the first fusion matrix to obtain a first fusion feature.
[0024] In one embodiment, the obtaining module is further configured to: multiply the first encoding vector by preset weight matrices of three different self-attention mechanisms to obtain three first weight feature matrices; and multiply and normalize the three first weight feature matrices to obtain the first matrix.
[0025] In one embodiment, the obtaining module is further configured to: multiply the second encoding vector by preset weight matrices of three different self-attention mechanisms to obtain three second weight feature matrices; and multiply and normalize the three second weight feature matrices to obtain the second matrix.
[0026] In one embodiment, the obtaining module is further configured to: perform embedding encoding on the first sequence; and perform sequence encoding on the encoding vector obtained by embedding encoding to obtain the first encoding vector.
[0027] In one embodiment, the obtaining module is further configured to: perform embedding encoding on the second sequence; and perform sequence encoding on the encoding vector obtained by embedding encoding to obtain the second encoding vector.
[0028] According to a third aspect of the present disclosure, an electronic device is provided, the electronic device comprising:
[0029] processor;
[0030] Memory used to store the processor's executable instructions;
[0031] The processor is configured to implement the method described in any embodiment of this disclosure when running the executable instructions.
[0032] According to a fourth aspect of the present disclosure, a computer storage medium is provided, the computer storage medium storing a computer executable program, which, when executed by a processor, implements the methods described in any embodiment of the present disclosure.
[0033] The technical solutions provided by the embodiments of this disclosure may include the following beneficial effects:
[0034] In this embodiment of the disclosure, a first sequence is constructed based on the exposure objects involved in the nth search event of the target user; wherein the first sequence includes: information of the exposure objects and search terms of the search event; wherein n is any positive integer; a second sequence is constructed based on user behavior acting on a predetermined page; wherein the second sequence includes: information of the exposure objects affected by the user behavior and the search terms; wherein the predetermined page includes at least: a landing page and / or a results page returned based on the search terms; the target user's preference information is determined based on the first sequence, the second sequence, and a predetermined neural network; wherein the preference information is used to determine the exposure objects involved in the (n+1)th search event and / or the display sorting of the exposure objects.
[0035] In this embodiment, a first sequence and a second sequence are constructed based on the exposure objects, search terms, and user behavior effects on the predetermined page in a single search event. Compared to constructing only a sequence of user behavior, this can clearly represent the correlation between different user behaviors and different exposure objects in the operation event. The user preference information obtained by the neural network model based on the first and second sequences is more accurate and better matches the user's current interests. Attached Figure Description
[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0037] Figure 1 This is a flowchart illustrating a data processing method according to an exemplary embodiment;
[0038] Figure 2 This is a flowchart illustrating a data processing method according to an exemplary embodiment;
[0039] Figure 3 This is a flowchart illustrating a data processing method according to an exemplary embodiment;
[0040] Figure 4 This is a schematic diagram illustrating the display of a predetermined page according to an exemplary embodiment;
[0041] Figure 5 This is a schematic diagram illustrating a neural network according to an exemplary embodiment;
[0042] Figure 6 This is a schematic diagram illustrating a neural network according to an exemplary embodiment;
[0043] Figure 7 This is a schematic diagram illustrating a neural network according to an exemplary embodiment;
[0044] Figure 8 This is a schematic diagram illustrating the structure of a data processing apparatus according to an exemplary embodiment;
[0045] Figure 9 This is a schematic diagram illustrating the structure of an electronic device according to an exemplary embodiment. Detailed Implementation
[0046] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this invention. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.
[0047] In the following description, references are made to “some embodiments,” which describe a subset of all possible embodiments. However, it is understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.
[0048] In the following description, the terms "first, second, third" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first, second, third" may be interchanged in a specific order or sequence where permitted, so that the embodiments of the invention described herein can be implemented in an order other than that illustrated or described herein.
[0049] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing embodiments of the invention only and is not intended to limit the invention.
[0050] like Figure 1 As shown in the embodiments of this disclosure, a data processing method is provided, the method comprising:
[0051] Step 110: Construct a first sequence based on the exposure objects involved in the nth search event of the target user; wherein the first sequence includes: information of the exposure objects and the search terms of the search event; wherein n is any positive integer;
[0052] Step 120: Construct a second sequence based on user behavior acting on a predetermined page; wherein the second sequence includes: information about the exposure object affected by the user behavior and the search term; wherein the predetermined page includes at least: a landing page and / or a results page returned based on the search term;
[0053] Step 130: Determine the target user's preference information based on the first sequence, the second sequence, and the predetermined neural network; wherein the preference information is used to determine the exposure objects involved in the (n+1)th search event and / or the display sorting of the exposure objects.
[0054] In one embodiment, the search event may include an event of performing a target search based on search terms received from user input or based on search terms determined by a selection operation.
[0055] The target may include: objects in the search database that match the search term and / or objects related to the search term, such as applications, web pages and / or products.
[0056] In one embodiment, the search event may include: the user performing M user actions on N predetermined pages displayed by the application; wherein N is a positive integer greater than 1, and M is a positive integer; wherein the user actions include at least the search action.
[0057] In one embodiment, the user behavior may include one or more related behaviors of the user during the search event.
[0058] In one embodiment, the user behavior may include: search, selection, download, favorite, and / or share operations.
[0059] In one embodiment, the user behavior may include: determining that a user behavior has occurred when an operation is detected acting on a predetermined operation control or predetermined object on the predetermined page. For example, the search operation may include clicking and inputting on a search control on the predetermined page; the selection operation may include clicking on an object to be exposed on the predetermined page; and the download, favorite, and / or share operations may include clicking on a download control, favorite control, and / or share control on the predetermined page.
[0060] In one embodiment, the predetermined page includes at least: a landing page and / or a results page returned based on the search term.
[0061] In one embodiment, the onboarding page may include a search box, a category selection control, and / or an object to be displayed. The search box can be used by the user to enter search terms. The category selection control can be used to determine the type of search results.
[0062] In one embodiment, the results page returned based on the search term may include: a search suggestion page based on the search term, and / or, a search results page based on the search term, etc. The search results page may display the results returned based on the search term.
[0063] In one embodiment, the search suggestions page may display words associated with the search term. For example, the search suggestions page may display words that complete the search term, search terms that are semantically similar to the search term, and / or search terms that are related to the spelling of the search term.
[0064] For example, the reservation page can be as follows: Figure 4 As shown, the pre-defined pages may include: a landing page, a search suggestion page based on search terms, and a search results page.
[0065] In one embodiment, the exposure objects involved in the search event may include: all objects displayed on at least two predetermined pages in the search event; wherein, the exposure objects may be items.
[0066] In one embodiment, the first sequence and the second sequence can be arranged in chronological order according to the occurrence time of the search event.
[0067] In one embodiment, the first sequence and the second sequence can be arranged chronologically according to the occurrence time of different user behaviors in the search event and / or the occurrence time of different scheduled pages. The scheduled pages, displayed in chronological order, may include: a landing page, a search suggestion page, and a search results page. The information of the exposed objects and the search terms in the first and second sequences can be arranged according to their correspondence with the scheduled pages, in chronological order of the occurrence time of the scheduled pages.
[0068] Here, the first sequence and the second sequence are arranged according to the order of occurrence of the search events. Compared with other sequences, the time attribute of user behavior can be represented by the position of features in the sequence, and the user preference information obtained by the predetermined neural network is more accurate.
[0069] In one embodiment, the first sequence and the second sequence may include at least one first sequence and at least one second sequence.
[0070] In one embodiment, the first sequence and the second sequence can be constructed based on features; wherein the features may include: user features, exposure object features, scene features, cross features, and / or cascaded model features, etc. The user features may include: user attribute features, such as user age, gender, and / or membership; user behavior sequence features, such as the type of user behavior, the exposure object affected by the user behavior, the frequency of the user behavior, and / or the time of occurrence of the user behavior, etc.; and / or, search term features, etc. The exposure object features may include: information about the exposure object, such as the name of the exposure object, the identifier of the exposure object, and / or the type of the exposure object, etc. The scene features may include: the context features of the item, etc.
[0071] In one embodiment, the first sequence includes at least: features of information about the object being exposed on at least one predetermined page and features of search terms; the second sequence includes at least: features of information about the object being exposed on at least one predetermined page based on user behavior and features of search terms.
[0072] In one embodiment, step 110 may include: constructing the first sequence based on the exposure objects in all predetermined pages involved in the nth search event, using the information of the exposure objects and the search terms of the search event.
[0073] In one embodiment, step 110 may include: constructing at least one of the first sequences based on information about different exposed objects and search terms of the search event.
[0074] In one embodiment, step 120 may include: determining the predetermined page and exposure object on which the user behavior in the search event is applied, and constructing the second sequence based on the information of the exposure object on the predetermined page and the search terms entered by the user.
[0075] In one embodiment, step 120 may include: constructing at least one second sequence based on different user behaviors acting on a predetermined page in a search event. For example, this involves determining the exposure objects and search terms of the predetermined page affected by each user behavior in the search event; determining the type of user behavior; and constructing the second sequence based on the type of user behavior, using information about the exposure objects of the predetermined page affected by the same type of user behavior and the search terms.
[0076] For example, based on the user's click behavior on the pre-defined page, the exposure objects and search terms clicked by the user are obtained; based on the information of the exposure objects clicked by the user and the search terms, a first second sequence is constructed; and based on the user's download behavior on the pre-defined page, the exposure objects and search terms downloaded by the user are obtained; based on the information of the exposure objects downloaded by the user and the search terms, a second second sequence is constructed, etc.
[0077] In one embodiment, step 130 may include: forming a sequence group based on at least one first sequence and at least one second sequence; inputting the sequence group into a predetermined neural network; determining the target user's preference information based on the output of the neural network; wherein the preference information is used for determining the exposure objects involved in the (n+1)th search event and / or the display sorting of the exposure objects; wherein the preference information can be obtained jointly from the first sequence and the second sequence.
[0078] In one embodiment, the user preference information may be information such as at least the user's preferred behavior, the preferred reserved page, and / or the preferred exposure object.
[0079] In one embodiment, the predetermined neural network may include: a neural network based on a transformer neural network model, etc. In one embodiment, the structure of the transformer neural network model may be as follows: Figure 5 As shown.
[0080] Here, by inputting the first sequence and the second sequence into a predetermined neural network, compared to inputting only one sequence into the predetermined neural network, the correlation between the features of the operation event can be determined from multiple dimensions, and the obtained user preference vector is more accurate.
[0081] Here, compared to statistical sequences determined based on statistical characteristics, grouping the characteristics of a single operation event into multiple sequences allows us to obtain user preference information within that single operation event. Since user preferences are constantly changing, obtaining user preference information within a single operation event is closer to the user's current preferences, thus improving the accuracy of determining user preference information.
[0082] In some embodiments, the information of the exposed object includes: the name of the exposed object and / or the identifier of the exposed object.
[0083] In one embodiment, the identifier (ItemId) of the exposed object may include a unique identifier corresponding to the name of each exposed object.
[0084] In one embodiment, the first sequence is constructed based on the name and the identifier of the exposed object to obtain at least two first sequences, and the second sequence is constructed based on the name and the identifier of the exposed object to obtain at least two second sequences.
[0085] like Figure 2 As shown, this disclosure provides a data processing method, wherein determining the target user's preference information based on a first sequence, a second sequence, and a predetermined neural network includes:
[0086] Step 210: Encode the first sequence to obtain a first encoding vector, and encode the second sequence to obtain a second encoding vector;
[0087] Step 220: Process the first encoding vector based on the self-attention mechanism to obtain the first matrix, and process the second encoding vector based on the self-attention mechanism to obtain the second matrix;
[0088] Step 230: Perform a fusion process on the first matrix and the second matrix to obtain a first fusion feature;
[0089] Step 240: Based on the first fusion feature, obtain the preference information of the target user.
[0090] In one embodiment, the encoding method of the first sequence and the encoding method of the second sequence and / or the processing method based on the self-attention mechanism can be the same.
[0091] In one embodiment, step 210 may include: encoding the characters in the first sequence and the second sequence into numbers to obtain the first encoding vector and the second encoding vector, which include arrays.
[0092] In one embodiment, step 210 may include: encoding the exposure object information and the search term in the first sequence into a vector according to the encoding to obtain a first encoding vector; and encoding the exposure object information and the search term in the second sequence into a vector according to the encoding to obtain a second encoding vector.
[0093] In one embodiment, such as Figure 6 As shown, the method for processing based on the self-attention mechanism may include: dividing the first encoding vector by three preset different weight matrices W. K W Q With W v Multiplying these vectors yields a query (Q) vector, a key (K) vector, and a value (V) vector; wherein the weight matrix may include a weight matrix initialized based on random vectors; multiplying the Q vector by the transpose of the K vector yields QK. T Vector; the QK T The vector is normalized to obtain the self-attention coefficient matrix; the self-attention coefficient matrix is multiplied by the V vector to obtain the first matrix.
[0094] In one embodiment, the normalization process can be to process the data to limit it to a certain range. The normalization process can include: min-max normalization; z-score normalization; and / or, normalization exponential function (softmax), etc.
[0095] In one embodiment, the sequence group is input into the predetermined neural network. The sequence group includes h sequences, which include h1 first sequences and h2 second sequences. The h matrices obtained by combining the h1 first matrices obtained from the h1 first sequences and the h2 second matrices obtained from the h2 second sequences are fused to obtain a first fused feature.
[0096] In one embodiment, step 240 may include: normalizing the first fused feature, and processing the normalized first fused feature through a fully connected layer to obtain the target user's preference information for the predetermined page.
[0097] For example, the normalization process may include normalizing the first fused feature using layer normalization.
[0098] In one embodiment, step 240 may include: processing the first fusion feature through a fully connected layer to obtain the target user's preference information for the predetermined page.
[0099] In one embodiment, the fully connected layer can be a position-wise feedforward network, which may include a multilayer perceptron (MLP). The MLP may include an input layer, a hidden layer, and an output layer. The first fused feature is input to the input layer of the MLP, classified through the hidden layer, and the vector output by the output layer is used to predict whether there is user behavior on the predetermined page.
[0100] For example, if the predetermined page includes: a landing page, a suggestion page, and a search results page; the output vector is [1 00], predicting that the landing page has predetermined user behavior; if the output vector is [0 1 0], predicting that the suggestion page has predetermined user behavior; if the output vector is [0 01], predicting that the search results page has predetermined user behavior; wherein, the predetermined user behavior may include: selection operation and / or download operation, etc.
[0101] In one embodiment, the computational formula for the fully connected layer may include:
[0102] FFN(x)=max(0,xW1+b1)W2+b2;
[0103] Where x can be an input vector, such as a first fusion feature, W1 and W2 can be predetermined weight coefficients, and b1 and b2 can be predetermined bias coefficients; wherein the predetermined weight coefficients and the predetermined bias coefficients can be preset.
[0104] In one embodiment, step 240 may further include: obtaining a user preference vector based on the first fusion feature; wherein the user preference vector may include: a character vector of user preference and / or an identifier vector of the exposure object of user preference.
[0105] In one embodiment, the preference information is determined based on the user preference vector, wherein the preference information is used to determine the exposure objects involved in the (n+1)th search event and / or the display sorting of the exposure objects.
[0106] In one embodiment, the user's preference information is determined by performing calculations based on the user preference vector using a predetermined ranking model. The predetermined ranking model may include operations such as recall and / or ranking. The predetermined ranking model can be any ranking model, and its specific implementation is not limited.
[0107] In one embodiment, a recall operation is performed based on the user preference vector, which can determine the exposure objects involved in the (n+1)th search event.
[0108] For example, the recall operation may include: performing a similarity calculation based on the character vector and the name vector of an object in a predetermined database, and / or performing a similarity calculation based on the identifier vector of the exposed object and the identifier vector of an object in a predetermined database; and determining the object with a similarity within a predetermined similarity range as the exposed object involved in the (n+1)th search event.
[0109] In one embodiment, a sorting algorithm is used to sort the objects involved in the (n+1)th search event to obtain the display order of the objects.
[0110] In some embodiments, multiple first matrices are obtained by performing multiple operations on a sequence, and a first fusion feature is obtained based on the multiple first matrices. In this embodiment of the disclosure, the first fusion feature is obtained by using the first matrix and the second matrix, which can more comprehensively obtain the first fusion feature of a search event. The user preference information obtained based on the fusion feature is more in line with the user's current preferences.
[0111] like Figure 3 As shown, this disclosure provides a data processing method, wherein fusing the first matrix and the second matrix to obtain a first fusion feature includes:
[0112] Step 310: The first matrix and the second matrix are concatenated based on a multi-head self-attention mechanism to obtain a first fusion matrix;
[0113] Step 320: Perform a linear transformation on the first fusion matrix to obtain the first fusion feature.
[0114] In one embodiment, the method for fusing the first matrix and the second matrix according to the multi-head attention mechanism to obtain the first fused feature can be as follows: Figure 7 As shown.
[0115] In one embodiment, step 310 may include: concatenating the first matrix and the second matrix based on a multi-head self-attention mechanism to obtain a first fusion matrix; wherein, the formula of step 310 may include:
[0116]
[0117] In one embodiment, step 320 may include: performing a linear transformation on the first fusion matrix to obtain a first fusion feature; wherein the first fusion feature has the same dimension as the first sequence and the second sequence.
[0118] In one embodiment, the linear transformation process may include multiplying the first fusion matrix by a predetermined weight matrix to obtain a first fusion feature.
[0119] In some embodiments, the method further includes: processing the first encoding vector based on a self-attention mechanism to obtain a first matrix, and processing the second encoding vector based on a self-attention mechanism to obtain a second matrix, including:
[0120] The first encoded vector is multiplied by the preset weight matrices of three different self-attention mechanisms to obtain three first weight feature matrices;
[0121] The three first weight feature matrices are multiplied and normalized to obtain the first matrix.
[0122] In some embodiments, the method further includes: processing the first encoding vector based on a self-attention mechanism to obtain a first matrix, and processing the second encoding vector based on a self-attention mechanism to obtain a second matrix, including:
[0123] The second encoding vector is multiplied by the preset weight matrices of three different self-attention mechanisms to obtain three second weight feature matrices;
[0124] The three second weight feature matrices are multiplied and normalized to obtain the second matrix.
[0125] In one embodiment, the processing method based on the self-attention mechanism can be the same, and the processing method can include: multiplying a predetermined encoding vector by three different preset weight matrices to obtain three predetermined weight feature matrices; multiplying and normalizing the three predetermined weight feature matrices to obtain a predetermined matrix; wherein, the predetermined encoding vector can include the first encoding vector or the second encoding vector; the predetermined weight feature matrix can include the first weight feature matrix or the second weight feature matrix; and the predetermined matrix can include the first matrix or the second matrix.
[0126] In one embodiment, the predetermined encoding vector is respectively compared with three different preset weight matrices W. K W Q With W v Multiply them to obtain three pre-defined weighted feature moments: the query vector (Q, Query), the key vector (K, Key), and the value vector (V, Value).
[0127] In one embodiment, the formula for obtaining the predetermined matrix by multiplying and normalizing the Q vector, K vector, and V vector may include:
[0128]
[0129] Multiplying the Q vector by the transpose of the K vector yields QK. T Vector; the QK T Vector divided by vector dimension d k The square root of QK T The vector dot product is too large; the processed QK T The vector is normalized using the softmax function to obtain a self-attention coefficient matrix; this self-attention coefficient matrix is then multiplied by the V vector to obtain a predetermined matrix. The softmax function can be used to calculate the attention coefficient of each word in the vector for all other words; the d... k The vector dimension can be obtained from the number of columns in the Q matrix.
[0130] In some embodiments, encoding the first sequence to obtain a first encoding vector and encoding the second sequence to obtain a second encoding vector includes:
[0131] The first sequence is embedded and encoded;
[0132] The encoded vector obtained by embedding encoding is subjected to sequence encoding to obtain the first encoded vector.
[0133] In some embodiments, encoding the first sequence to obtain a first encoding vector and encoding the second sequence to obtain a second encoding vector includes:
[0134] The second sequence is embedded and encoded;
[0135] The encoded vector obtained by embedding encoding is subjected to sequence encoding to obtain the second encoded vector.
[0136] In one embodiment, the input embedding may include: segmenting the predetermined sequence; and embedding the segmented predetermined sequence. The segmentation may include: dividing the predetermined sequence by predetermined pages using semicolons, and separating the information of exposed objects within predetermined pages of the predetermined sequence using commas; wherein, if a predetermined page is empty, it is filled with the number 0; and wherein the predetermined sequence may include the first sequence and the second sequence.
[0137] In one embodiment, the embedding encoding may include: encoding each character in the predetermined sequence according to a predetermined vocabulary, converting each character into a mapping identifier (id), and obtaining an encoding vector composed of mapping identifiers; wherein, the vocabulary may include: a predetermined correspondence between each character and a unique mapping identifier, wherein the mapping identifier is a number.
[0138] For example, when the name of the exposed object is "Honor of Kings", each character is converted into a mapping identifier through a predetermined vocabulary, and the resulting array can be [10, 2, 1000, 327].
[0139] In one embodiment, the encoded vector obtained by embedding encoding is subjected to vector smoothing processing. Specifically, the encoded vector can be multiplied by the square root of the vector dimension. Perform vector smoothing.
[0140] In one embodiment, the sequence encoding may include positional encoding, which indicates the position of a word in the sequence.
[0141] In one embodiment, the predetermined sequence can be arranged according to the display time order of the predetermined page in the operation event. The exposure object information or the exposure object information and search terms in the predetermined sequence are also arranged in chronological order according to the predetermined page, so that the encoded vector after location encoding also has a chronological order.
[0142] In one embodiment, the position encoding function may include:
[0143]
[0144] Wherein, the d model The vector dimension is 512; for example, the vector dimension can be set to 512.
[0145] In one embodiment, the method may further include: obtaining a pre-trained neural network model according to the method; inputting the search term input by the user in the nth search event into the pre-trained neural network model to obtain a vector of the search term and a vector for predicting whether there is user behavior on the predetermined page.
[0146] Based on the vector predicting whether a pre-defined page contains user behavior, a pre-defined page containing user behavior can be identified when a user interacts with the page. Based on the search term vector, a pre-defined ranking model can be used to determine the exposure objects involved in the (n+1)th search event and the display order of those exposure objects.
[0147] In one embodiment, the method can be applied to a game search and recommendation scenario, and the method may include:
[0148] Based on the exposure objects involved in the nth search event of the target user, a first sequence is constructed; wherein, the first sequence may include: a sequence of the names (ItemName) of the exposure objects on the landing page, the search terms of the search event, a sequence of the exposure objects on the search association suggestion page, and a sequence of the names of the exposure objects on the search results page; and, a sequence of the identifiers (ItemId) of the exposure objects on the landing page, the search terms of the search event, a sequence of the exposure identifiers (ItemId) on the search association suggestion page, and a sequence of the identifiers (ItemId) of the exposure objects on the search results page;
[0149] Based on user behavior acting on a predetermined page, a second sequence is constructed; wherein the second sequence may include: a sequence of the names (ItemName) of the exposed objects affected by user behavior on the landing page, the search terms of the search event, a sequence of the exposed objects affected by user behavior on the search association suggestion page, and a sequence of the names of the exposed objects affected by user behavior on the search results page; and, a sequence of the identifiers (ItemId) of the exposed objects affected by user behavior on the landing page, the search terms of the search event, a sequence of the identifiers (ItemId) of the exposed objects affected by user behavior on the search association suggestion page, and a sequence of the identifiers (ItemId) of the exposed objects affected by user behavior on the search results page;
[0150] A predetermined sequence group consisting of the two first sequences and the four second sequences is input into the predetermined neural network; wherein the predetermined sequence group includes six sequences; the predetermined neural network can perform the embedding encoding on the six sequences respectively using the function tf.nn.embedding_lookup(); and multiply the encoded vector after embedding encoding by the square root of the predetermined vector dimension. The process involves processing the encoded vectors, where the predetermined vector dimension can be set to 512. The processed encoded vectors are then subjected to positional encoding to obtain six encoded vectors. These six encoded vectors are further processed using the self-attention mechanism to obtain six self-attention matrices. These six self-attention matrices are then concatenated and linearly transformed using a multi-head self-attention mechanism to obtain a first fusion feature. The first fusion feature is then normalized. Finally, the normalized first fusion feature is processed through a fully connected layer to obtain user preference information.
[0151] like Figure 8 As shown, this disclosure provides a data processing apparatus, the apparatus comprising:
[0152] Construction module 10 is configured to: construct a first sequence based on the exposure objects involved in the nth search event of the target user; wherein the first sequence includes: information of the exposure objects and search terms of the search event; wherein n is any positive integer;
[0153] A second sequence is constructed based on user behavior acting on a predetermined page; wherein the second sequence includes: information about the exposed object affected by the user behavior and the search term, wherein the predetermined page includes at least: a landing page and / or a results page returned based on the search term;
[0154] The determining module 20 is configured to: determine the preference information of the target user based on the first sequence, the second sequence, and the predetermined neural network; the preference information is used to determine the exposure objects involved in the (n+1)th search event and / or the display sorting of the exposure objects.
[0155] In one embodiment, the apparatus further includes: a obtaining module 30; the obtaining module 30 is configured to: encode the first sequence to obtain a first encoding vector, and encode the second sequence to obtain a second encoding vector; process the first encoding vector based on a self-attention mechanism to obtain a first matrix, and process the second encoding vector based on a self-attention mechanism to obtain a second matrix; perform fusion processing on the first matrix and the second matrix to obtain a first fusion feature; and obtain the target user's preference information based on the first fusion feature.
[0156] In one embodiment, the obtaining module 30 is further configured to: concatenate the first matrix and the second matrix based on a multi-head self-attention mechanism to obtain a first fusion matrix; and perform a linear transformation on the first fusion matrix to obtain a first fusion feature.
[0157] In one embodiment, the obtaining module 30 is further configured to: multiply the first encoding vector by preset weight matrices of three different self-attention mechanisms to obtain three first weight feature matrices; and multiply and normalize the three first weight feature matrices to obtain the first matrix.
[0158] In one embodiment, the obtaining module 30 is further configured to: multiply the second encoding vector by preset weight matrices of three different self-attention mechanisms to obtain three second weight feature matrices; and multiply and normalize the three second weight feature matrices to obtain the second matrix.
[0159] In one embodiment, the obtaining module 30 is further configured to: perform embedding encoding on the first sequence; and perform sequence encoding on the encoding vector obtained by embedding encoding to obtain the first encoding vector.
[0160] In one embodiment, the obtaining module 30 is further configured to: perform embedding encoding on the second sequence; and perform sequence encoding on the encoding vector obtained by embedding encoding to obtain the second encoding vector.
[0161] Figure 9 This is a block diagram illustrating an electronic device 900 according to an exemplary embodiment. The method disclosed herein can be applied to this electronic device.
[0162] Reference Figure 9 The electronic device 900 may include one or more of the following components: a processing component 902, a memory 904, a power supply component 906, a multimedia component 908, an audio component 910, an input / output (I / O) interface 912, a sensor component 914, and a communication component 916.
[0163] Processing component 902 typically controls the overall operation of electronic device 900, such as operations associated with display, telephone calls, data communication, camera operation, and recording operations. Processing component 902 may include one or more processors 950 to execute instructions to complete all or part of the steps of the methods described above. Furthermore, processing component 902 may include one or more modules to facilitate interaction between processing component 902 and other components. For example, processing component 902 may include a multimedia module to facilitate interaction between multimedia component 908 and processing component 902.
[0164] Memory 904 is configured to store various types of data to support the operation of device 900. Examples of this data include instructions for any application or method operating on electronic device 900, contact data, phonebook data, messages, pictures, videos, etc. Memory 904 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.
[0165] Power supply component 906 provides power to various components of electronic device 900. Power supply component 906 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to electronic device 900.
[0166] Multimedia component 908 includes a screen that provides an output interface between the electronic device 900 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touchscreen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensors may sense not only the boundaries of the touch or swipe action but also the duration and pressure associated with the touch or swipe operation. In some embodiments, multimedia component 908 includes a front-facing camera and / or a rear-facing camera. When the device 900 is in an operating mode, such as a shooting mode or a video mode, the front-facing camera and / or the rear-facing camera may receive external multimedia data. Each front-facing camera and rear-facing camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
[0167] Audio component 910 is configured to output and / or input audio signals. For example, audio component 910 includes a microphone (MIC) configured to receive external audio signals when electronic device 900 is in an operating mode, such as call mode, recording mode, and voice recognition mode. The received audio signals may be further stored in memory 904 or transmitted via communication component 919. In some embodiments, audio component 910 also includes a speaker for outputting audio signals.
[0168] I / O interface 912 provides an interface between processing component 902 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to, home buttons, volume buttons, power buttons, and lock buttons.
[0169] Sensor assembly 914 includes one or more sensors for providing state assessments of various aspects of electronic device 900. For example, sensor assembly 914 can detect the on / off state of device 900, the relative positioning of components such as the display and keypad of electronic device 900, changes in position of electronic device 900 or a component of electronic device 900, the presence or absence of user contact with electronic device 900, orientation or acceleration / deceleration of electronic device 900, and temperature changes of electronic device 900. Sensor assembly 914 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. Sensor assembly 914 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, sensor assembly 914 may also include an accelerometer, gyroscope, magnetometer, pressure sensor, or temperature sensor.
[0170] Communication component 916 is configured to facilitate wired or wireless communication between electronic device 900 and other devices. Electronic device 900 can access wireless networks based on communication standards, such as WiFi, 2G, or 3G, or combinations thereof. In one exemplary embodiment, communication component 916 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In one exemplary embodiment, communication component 916 also includes a near-field communication (NFC) module to facilitate short-range communication. For example, the NFC module may be implemented based on radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
[0171] In an exemplary embodiment, the electronic device 900 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the methods described above.
[0172] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 904 including instructions, which can be executed by a processor 950 of an electronic device 900 to perform any of the methods described above. For example, the non-transitory computer-readable storage medium may be a ROM, random access memory (RAM), CD-ROM, magnetic tape, floppy disk, and optical data storage device, etc.
[0173] Other embodiments of the invention will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention that follow the general principles of the invention and include common knowledge or customary techniques in the art not disclosed herein.
[0174] It should be understood that the present invention is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope.
Claims
1. A data processing method, characterized in that, The method includes: Based on the exposure objects involved in the nth search event of the target user, a first sequence is constructed; wherein, the first sequence includes: information of the exposure objects and the search terms of the search event; wherein, n is any positive integer; A second sequence is constructed based on user behavior acting on a predetermined page; wherein the second sequence includes: information about the exposure object affected by the user behavior and the search term; wherein the predetermined page includes at least: a landing page and / or a results page returned based on the search term, and the user behavior includes: the download operation of the target user in the nth search event; Based on the first sequence, the second sequence, and the predetermined neural network, the preference information of the target user is determined; wherein, the preference information is used to determine the exposure objects involved in the (n+1)th search event and / or the display sorting of the exposure objects.
2. The method according to claim 1, characterized in that, The second sequence includes: The selection operation sequence is generated based on the selection operation of the target user in the nth search event.
3. The method according to claim 1 or 2, characterized in that, The information of the exposed object includes: The name of the object to be exposed and / or the identifier of the object to be exposed.
4. The method according to claim 1 or 2, characterized in that, The step of determining the target user's preference information based on the first sequence, the second sequence, and the predetermined neural network includes: The first sequence is encoded to obtain a first encoding vector, and the second sequence is encoded to obtain a second encoding vector; The first encoding vector is processed using a self-attention mechanism to obtain a first matrix, and the second encoding vector is processed using the same mechanism to obtain a second matrix. The first matrix and the second matrix are fused to obtain a first fused feature; Based on the first fusion feature, the preference information of the target user is obtained.
5. The method according to claim 4, characterized in that, The process of fusing the first matrix and the second matrix to obtain the first fused feature includes: The first matrix and the second matrix are concatenated based on a multi-head self-attention mechanism to obtain the first fusion matrix; The first fusion matrix is subjected to a linear transformation to obtain the first fusion feature.
6. The method according to claim 4, characterized in that, The first encoded vector is processed using a self-attention mechanism to obtain a first matrix, and the second encoded vector is processed using the same mechanism to obtain a second matrix, comprising: The first encoded vector is multiplied by the preset weight matrices of three different self-attention mechanisms to obtain three first weight feature matrices; The three first weight feature matrices are multiplied and normalized to obtain the first matrix.
7. The method according to claim 4, characterized in that, The first encoded vector is processed using a self-attention mechanism to obtain a first matrix, and the second encoded vector is processed using the same mechanism to obtain a second matrix, comprising: The second encoding vector is multiplied by the preset weight matrices of three different self-attention mechanisms to obtain three second weight feature matrices; The three second weight feature matrices are multiplied and normalized to obtain the second matrix.
8. The method according to claim 4, characterized in that, The step of encoding the first sequence to obtain a first encoding vector and encoding the second sequence to obtain a second encoding vector includes: The first sequence is embedded and encoded; The encoded vector obtained by embedding encoding is subjected to sequence encoding to obtain the first encoded vector.
9. The method according to claim 4, characterized in that, The step of encoding the first sequence to obtain a first encoding vector and encoding the second sequence to obtain a second encoding vector includes: The second sequence is embedded and encoded; The encoded vector obtained by embedding encoding is subjected to sequence encoding to obtain the second encoded vector.
10. A data processing apparatus, characterized in that, The device includes: A construction module is configured to: construct a first sequence based on the exposure objects involved in the nth search event of the target user; wherein the first sequence includes: information of the exposure objects and search terms of the search event; wherein n is any positive integer; A second sequence is constructed based on user behavior acting on a predetermined page; wherein the second sequence includes: information about the exposure object affected by the user behavior and the search term; wherein the predetermined page includes at least: a landing page and / or a results page returned based on the search term, and the user behavior includes: the download operation of the target user in the nth search event; The determining module is configured to: determine the preference information of the target user based on the first sequence, the second sequence, and the predetermined neural network; wherein the preference information is used to determine the exposure objects involved in the (n+1)th search event and / or the display sorting of the exposure objects.
11. The apparatus according to claim 10, characterized in that, The device further includes: a receiving module; The obtaining module is configured to: encode the first sequence to obtain a first encoding vector, and encode the second sequence to obtain a second encoding vector; The first encoding vector is processed using a self-attention mechanism to obtain a first matrix, and the second encoding vector is processed using the same mechanism to obtain a second matrix. The first matrix and the second matrix are fused to obtain a first fused feature; Based on the first fusion feature, the preference information of the target user is obtained.
12. The apparatus according to claim 11, characterized in that, The obtaining module is further configured to: concatenate the first matrix and the second matrix based on a multi-head self-attention mechanism to obtain a first fusion matrix; and perform a linear transformation on the first fusion matrix to obtain a first fusion feature.
13. The apparatus according to claim 11, characterized in that, The obtaining module is further configured to: multiply the first encoding vector by preset weight matrices of three different self-attention mechanisms respectively to obtain three first weight feature matrices; The three first weight feature matrices are multiplied and normalized to obtain the first matrix.
14. The apparatus according to claim 11, characterized in that, The obtaining module is further configured to: multiply the second encoding vector by preset weight matrices of three different self-attention mechanisms respectively to obtain three second weight feature matrices; The three second weight feature matrices are multiplied and normalized to obtain the second matrix.
15. The apparatus according to claim 11, characterized in that, The obtaining module is further configured to: perform embedding encoding on the first sequence; The encoded vector obtained by embedding encoding is subjected to sequence encoding to obtain the first encoded vector.
16. The apparatus according to claim 11, characterized in that, The obtaining module is further configured to: perform embedding encoding on the second sequence; The encoded vector obtained by embedding encoding is subjected to sequence encoding to obtain the second encoded vector.
17. An electronic device, characterized in that, The electronic device includes: a processor and a memory for storing a computer program capable of running on the processor, wherein the processor, when running the computer program, implements the method according to any one of claims 1 to 9.
18. A storage medium, characterized in that, The storage medium contains computer-executable instructions, which are executed by a processor to implement the method according to any one of claims 1 to 9.
Citation Information
Patent Citations
Search result ordering method and device
CN105975639A
Data processing method and device and medium
CN112883295A