Article recommendation method and device, electronic equipment and storage medium

By encoding and similarity calculation of user history interaction information, efficient item identifiers are generated, which solves the problem of low item recommendation efficiency and realizes a faster item recommendation process.

CN119415751APending Publication Date: 2025-02-11PENG CHENG LAB
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411454364.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-17
Publication Date
2025-02-11

AI Technical Summary

Technical Problem

When the number of items is too large, unreasonable object identifiers in the prior art occupy a large amount of storage space, resulting in an increase in the calculation time of item similarity, thereby reducing the efficiency of item recommendation.

Method used

By obtaining the user's historical interaction information, using a pre-trained word segmenter for encoding processing, calculating the similarity between the encoding features and the codebook vector, generating map codewords, and determining the item identifier based on the codeword information and prefix information to improve the Recommended efficiency.

Benefits of technology

The generated item identifiers take up less storage space and enable the positioning of specific item identifiers faster, especially when processing large amounts of historical interaction information, significantly improving the efficiency of item recommendations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119415751A_ABST
    Figure CN119415751A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an article recommendation method and device, electronic equipment and a storage medium, and belongs to the technical field of computers. The method comprises the following steps: inputting a plurality of pieces of obtained historical interaction information into a pre-trained word segmentation device, and encoding each piece of historical interaction information to obtain a corresponding encoding feature; calculating the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determining a mapping codeword corresponding to the coding feature based on the similarity score; decoding the mapping code word, determining code word information of the corresponding article according to a decoded result, and determining prefix information corresponding to the code word information; determining an article identifier corresponding to each article according to the code word information and the prefix information; and based on the similarity score, selecting a target identifier from the plurality of article identifiers, and determining an article corresponding to the target identifier as a target recommended article. According to the invention, the item recommendation efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to an item recommendation method, device, electronic device and storage medium. Background Art

[0002] Item recommendation refers to the process of selecting and recommending items that may be of interest to users from a database based on data such as their historical behavior. This process aims to help users quickly discover items that meet their personalized needs, thereby improving user satisfaction and experience.

[0003] In the related art, different object identifiers are assigned to different items, and the similarity between each item in the database and the historical items of interest is calculated based on the object identifier to determine the recommended items. However, when the number of items is too large, the object identifiers under unreasonable representation will occupy a large amount of storage space. In this way, the related art needs more time to calculate the similarity of items, which leads to the problem of low efficiency of item recommendation in the related art. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to propose an item recommendation method, device, electronic device and storage medium, aiming to improve the efficiency of item recommendation.

[0005] To achieve the above-mentioned purpose, a first aspect of an embodiment of the present application proposes an item recommendation method, the method comprising:

[0006] Acquire multiple historical interaction information, where the historical interaction information is used to represent relevant data of items that interact with the user;

[0007] Input multiple historical interaction information into the pre-trained word segmenter, encode each historical interaction information, and obtain the corresponding encoding feature;

[0008] Calculate the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determine a mapping codeword corresponding to the coding feature based on the similarity score;

[0009] Decoding the mapped codeword, determining the codeword information of the corresponding item according to the decoding result, and determining the prefix information corresponding to the codeword information;

[0010] Determine the item identifier corresponding to each item according to the codeword information and the prefix information;

[0011] Based on the similarity score, a target identifier is selected from multiple item identifiers, and an item corresponding to the target identifier is determined as a target recommended item.

[0012] In some embodiments, after obtaining a plurality of historical interaction information, the method further includes:

[0013] If there is historical interaction information of different modalities, each historical interaction information is input into the pre-trained word segmenter under the corresponding modality, and each historical interaction information is encoded to obtain the encoding features under the corresponding modality;

[0014] Calculate the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determine a mapping codeword corresponding to the coding feature based on the similarity score;

[0015] Decoding the mapped codeword, determining the codeword information of the corresponding item according to the decoding result, and determining the prefix information corresponding to the codeword information;

[0016] Determine the item identifier of each item in the corresponding mode according to the codeword information and prefix information;

[0017] Based on the similarity score, a target identifier is selected from item identifiers under multiple different modalities, and an item corresponding to the target identifier is determined as a target recommended item.

[0018] In some embodiments, the modality includes a first modality and a second modality, the first modality and the second modality being different;

[0019] Based on the similarity scores, the target identifier is selected from multiple item identifiers in different modalities, including:

[0020] If the item identifiers of different modalities all indicate the same item, updating the second similarity score in the second modality according to the first similarity score in the first modality to obtain an updated second similarity score;

[0021] Updating the first similarity score in the first modality according to the second similarity score in the second modality to obtain an updated first similarity score;

[0022] A target identifier is selected from the item identifiers in a plurality of different modalities based on the updated first similarity score and the updated second similarity score.

[0023] In some embodiments, calculating the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determining a mapping codeword corresponding to the coding feature based on the similarity score includes:

[0024] If the preset multiple codebook vectors belong to different vector levels respectively, calculate the similarity between the coding feature and the codebook vector belonging to the first vector level to obtain a third similarity score, and determine the first mapping codeword corresponding to the coding feature based on the third similarity score;

[0025] Calculating a similarity between the coding feature and a codebook vector belonging to a second vector level to obtain a fourth similarity score, and determining a second mapping codeword corresponding to the coding feature based on the fourth similarity score;

[0026] The first mapping codeword and the second mapping codeword are superimposed to obtain a mapping codeword corresponding to the encoding feature.

[0027] In some embodiments, after determining the item identifier corresponding to each item, the method further includes:

[0028] If there are multiple identical item identifiers, determine the updated second mapping codeword in order of the fourth similarity scores;

[0029] If the updated second mapping codewords are still the same, determining the updated first mapping codewords according to the order of magnitude of the third similarity scores;

[0030] The reallocation of the identifiers of the items is completed according to the updated first mapping codeword and the updated second mapping codeword.

[0031] In some embodiments, the word segmenter is trained by the following steps, comprising:

[0032] Acquire multiple sample interaction information and verification code information corresponding to the sample interaction information, where the sample interaction information is used to represent relevant data of the sample item interacting with the user;

[0033] Input multiple sample interaction information into the pre-built word segmenter, encode each sample interaction information, and obtain the corresponding sample encoding feature;

[0034] Calculate the similarity between the sample coding feature and a plurality of preset codebook vectors to obtain a sample similarity score, and determine a sample mapping codeword corresponding to the sample coding feature based on the sample similarity score;

[0035] Decoding the sample mapping codeword, and determining the sample codeword information corresponding to the sample object according to the decoding result;

[0036] According to the sample codeword information and the verification codeword information, the codeword loss value is calculated, and the parameters of the word segmenter are adjusted based on the codeword loss value to obtain the trained word segmenter.

[0037] In some embodiments, the codeword loss value is calculated based on the sample codeword information and the verification codeword information, including:

[0038] Calculate the similarity between the sample codeword information and the verification codeword information to obtain a first loss value;

[0039] According to the preset loss parameter, the similarity between the sample coding feature and each preset codebook vector is calculated to obtain a second loss value;

[0040] The first loss value and the second loss value are superimposed to obtain a codeword loss value.

[0041] In some embodiments, the target identifier is obtained by processing the item identifier using a pre-trained recommendation model, and the recommendation model is trained by the following steps, including:

[0042] obtaining a sample item identifier and a verification item identifier;

[0043] Based on the preset task prompt word, the sample item identifier is updated to obtain an updated sample item identifier;

[0044] Input the updated sample item identifier into the pre-built recommendation model to obtain the sample target identifier;

[0045] Based on the sample item identifier and the sample target identifier, the model loss value is calculated, and the parameters of the recommendation model are adjusted according to the model loss value to obtain the trained recommendation model.

[0046] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides an item recommendation device, the device comprising:

[0047] An acquisition module, used to acquire a plurality of historical interaction information, where the historical interaction information is used to represent relevant data of items interacting with the user;

[0048] The encoding module is used to input multiple historical interaction information into a pre-trained word segmenter, encode each historical interaction information, and obtain corresponding encoding features;

[0049] A mapping module, used to calculate the similarity between the coding feature and a plurality of preset codebook vectors, obtain a similarity score, and determine a mapping codeword corresponding to the coding feature based on the similarity score;

[0050] A decoding module, used to decode the mapped codeword, determine the codeword information of the corresponding item according to the decoding result, and determine the prefix information corresponding to the codeword information;

[0051] A prefix module, used by the identifier determination module to determine the item identifier corresponding to each item according to the codeword information and the prefix information;

[0052] The target recommendation module is used to select a target identifier from multiple item identifiers based on the similarity score, and determine the item corresponding to the target identifier as the target recommended item.

[0053] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, the electronic device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the method of the above-mentioned first aspect when executing the computer program.

[0054] To achieve the above objectives, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the method of the first aspect is implemented.

[0055] The article recommendation method, device, electronic device and storage medium proposed in the present application obtain multiple historical interaction information, which is used to characterize the relevant data of the article that interacts with the user; input the multiple historical interaction information into the pre-trained word segmenter, encode each historical interaction information, and obtain the corresponding encoding feature; calculate the similarity between the encoding feature and the preset multiple codebook vectors to obtain the similarity score, and determine the mapping codeword corresponding to the encoding feature based on the similarity score; decode the mapping codeword, determine the codeword information of the corresponding article according to the decoded result, and determine the prefix information corresponding to the codeword information; determine the article identifier corresponding to each article according to the codeword information and the prefix information; in this way, the present application can represent a large number of articles with a small number of characters, which greatly saves storage space; finally, based on the similarity score, select the target identifier from the multiple article identifiers, and determine the article corresponding to the target identifier as the target recommended article. Since the article identifier generated by the present application occupies less storage space, the present application can locate the specific article identifier more quickly when recommending articles, especially when processing a large amount of historical interaction information, which can improve the recommendation efficiency of articles. BRIEF DESCRIPTION OF THE DRAWINGS

[0056] Figure 1 This is a schematic diagram of an optional application scenario of the item recommendation device provided in an embodiment of the present application;

[0057] Figure 2 is an optional flow chart of the item recommendation method provided in an embodiment of the present application;

[0058] Figure 3 This is an optional flow chart of generating an item identifier of the item recommendation method provided in the embodiment of the present application;

[0059] Figure 4 yes Figure 2 A flowchart of an implementation of step 103 in FIG.

[0060] Figure 5 yes Figure 2 An implementation flow chart after step 101 in FIG. 1 ;

[0061] Figure 6 is an optional coding flow chart of the item recommendation method provided in the embodiment of the present application;

[0062] Figure 7 yes Figure 5 A flowchart of an implementation of step 305 in FIG.

[0063] Figure 8 yes Figure 2 An implementation flow chart after step 105 in FIG. 1 ;

[0064] Fig. 9 is another optional flow chart of the item recommendation method provided in an embodiment of the present application;

[0065] Fig.10 yes Fig. 9 A flowchart of an implementation of step 605 in FIG.

[0066] Fig.11 This is another optional flow chart of the item recommendation method provided in the embodiment of the present application;

[0067] Fig.12 This is an optional flow chart of the item recommendation device provided in the embodiment of the present application;

[0068] Fig.13 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0069] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0070] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0071] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0072] First, some nouns involved in this application are analyzed:

[0073] Natural language processing (NLP): NLP uses computers to process, understand and apply human languages ​​(such as Chinese, English, etc.). NLP is a branch of artificial intelligence and an interdisciplinary subject between computer science and linguistics. It is often referred to as computational linguistics. Natural language processing includes grammatical analysis, semantic analysis, and text understanding. Natural language processing is often used in technical fields such as machine translation, handwritten and printed character recognition, speech recognition and text-to-speech conversion, information intent recognition, information extraction and filtering, text classification and clustering, public opinion analysis and opinion mining. It involves data mining related to language processing, machine learning, knowledge acquisition, knowledge engineering, artificial intelligence research, and linguistic research related to language computing.

[0074] Artificial intelligence (AI) is a new technical science that studies and develops theories, methods, technologies and application systems for simulating, extending and expanding human intelligence. AI is a branch of computer science that attempts to understand the essence of intelligence and produce a new type of intelligent machine that can respond in a similar way to human intelligence. Research in this field includes robotics, speech recognition, image recognition, natural language processing and expert systems. AI can simulate the information process of human consciousness and thinking. AI is also a theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0075] Item recommendation refers to the process of selecting and recommending items that may be of interest to users from a database based on data such as their historical behavior. This process aims to help users quickly discover items that meet their personalized needs, thereby improving user satisfaction and experience.

[0076] In the related art, different object identifiers are assigned to different items, and the similarity between each item in the database and the historical items of interest is calculated based on the object identifier to determine the recommended items. However, when the number of items is too large, the object identifiers under unreasonable representation will occupy a large amount of storage space. In this way, the related art needs more time to calculate the similarity of items, which leads to the problem of low efficiency of item recommendation in the related art.

[0077] Based on this, the embodiments of the present application provide an item recommendation method, device, electronic device and storage medium, which can improve the efficiency of item recommendation.

[0078] It should be noted that in the embodiments of the present application, when it comes to information related to user characteristics such as user basic information or user identity, the user's permission or consent will be obtained first, and the collection, use and processing of these data will comply with relevant laws, regulations and standards. In addition, when the embodiments of the present application need to obtain sensitive personal information of the user, the user's separate permission or consent will be obtained first. After the user's separate permission or consent is clearly obtained, the necessary data for the normal operation of the embodiments of the present application will be obtained. For example, before obtaining the historical interaction information of the relevant data used to characterize the items that interact with the user, the embodiments of the present application will first obtain the user's authorization or consent, otherwise the historical interaction information of the embodiments of the present application cannot be applied. In addition, the other relevant data obtained by the item recommendation device of the present application are all legal data, which will not be repeated here.

[0079] The item recommendation method, device, electronic device, and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the application scenario of the item recommendation device in the embodiments of the present application is described. Figure 1 As shown, Figure 1 This is a schematic diagram of an optional application scenario of the item recommendation device provided in an embodiment of the present application. First, multiple historical interaction information (for example, historical interaction information 1 to historical interaction information n, n = 2, 3, 4...) are obtained and input into a pre-trained word segmenter; then, each historical interaction information is encoded to obtain a corresponding encoding feature; the similarity between the encoding feature and a plurality of preset codebook vectors is calculated to obtain a similarity score, and a mapping codeword corresponding to the encoding feature is determined based on the similarity score; the mapping codeword is decoded, and the codeword information of the corresponding item is determined according to the decoding result, and the prefix information corresponding to the codeword information is determined; the item identifier corresponding to each item is determined according to the codeword information and the prefix information; based on the codeword information and the prefix information, a target identifier is selected from the multiple item identifiers based on the similarity score, and the item corresponding to the target identifier is determined as the target recommended item. It can be understood that the item recommendation method proposed in the embodiment of the present application can be applied to historical interaction information in different information-carrying forms, and by converting complex item information representation into concise codeword information, the item identifier corresponding to the item with which the user has interacted is determined. The storage consumption of the item identifier generated by the embodiment of the present application is small, so it is possible to quickly recommend items from multiple items, thereby improving the efficiency of item recommendation.

[0080] After understanding the example application scenarios of the item recommendation device proposed in the present application, the item recommendation method proposed in the embodiment of the present application is described next.

[0081] In the embodiment of the present application, the description will be made from the dimension of an item recommendation device, which can be integrated into a computer device, such as a server. Figure 2 As shown, Figure 2 is an optional flowchart of the item recommendation method provided in the embodiment of the present application. Figure 2 The method in the embodiment may include but is not limited to the following steps 101 to 106. When the item recommendation device executes the prediction method, the specific process is as follows. It should be noted that the present embodiment Figure 2 The order of step 101 to step 106 is not specifically limited, and the order of steps can be adjusted or some steps can be reduced or added according to actual needs.

[0082] Step 101 : Acquire a plurality of historical interaction information, where the historical interaction information is used to characterize relevant data of items interacting with the user.

[0083] The following is a detailed description of step 101.

[0084] Among them, historical interaction information can be obtained through user behavior logs, for example, records of user clicks, browsing, purchases, etc. on related websites or applications; or, historical interaction information can be obtained through third-party data sources, for example, the item recommendation device can be connected to a third-party application and obtain the user's browsing, purchase and other historical records from the third-party application; of course, the historical interaction information page can be obtained through other legal channels, and the embodiments of the present application will obtain the user's consent before obtaining the relevant historical interaction information. The specific acquisition method can be set according to the actual situation, and the embodiments of the present application do not limit the method for obtaining historical interaction information.

[0085] Furthermore, the sources of multiple historical interaction information may be different. For example, the item recommendation device is connected to multiple websites and obtains the first historical interaction information from website A and the second historical interaction information from website B, and determines that the union of the first historical interaction information and the second historical interaction information is the multiple historical interaction information obtained by the item recommendation device.

[0086] Furthermore, "items that interact with users" can be defined according to actual conditions, and the present application embodiment does not limit this. For example, items that users click on on relevant websites are defined as interactive items, or items that users browse on relevant websites for more than a preset time are defined as interactive items. When a user interacts with an item in the database under a predefined interaction behavior, the item recommendation device will obtain the relevant data of the item and use it as historical interaction information.

[0087] Furthermore, the acquired multiple historical interaction information are arranged in chronological order to obtain updated multiple historical interaction information, so that the subsequent item recommendation device can gradually mine items of interest to the user in chronological order from early to late, thereby improving the efficiency of item recommendation and increasing the interpretability of the output results.

[0088] Step 102: input multiple historical interaction information into a pre-trained word segmenter, encode each historical interaction information, and obtain corresponding encoding features.

[0089] The following is a detailed description of step 102.

[0090] In some embodiments, based on a pre-trained word segmenter set in the item recommendation device, multiple input historical interaction information are encoded, so that multiple historical interaction information in different formats and from different sources are converted into a unified encoding feature, so as to subsequently determine the target recommended item from multiple items based on the encoding feature in a unified data representation form.

[0091] Among them, the tokenizer is a very important component in natural language processing. It can divide continuous input information into independent vocabulary units (tokens). These vocabulary units can be words, punctuation marks, numbers, etc., depending on the design and application scenario of the tokenizer. The vocabulary is the basis for the tokenizer to segment information.

[0092] Furthermore, if Figure 3 As shown, Figure 3 It is an optional flow chart for generating an item identifier of the item recommendation method provided in an embodiment of the present application. The acquired historical interaction information is input into a modality encoder (Modality Encoder, ME). The modality encoder can encode the input historical interaction information to obtain the corresponding encoding feature h.

[0093] Among them, the modal encoder varies with the modality of the input historical interaction information. If the input historical interaction information is text information, then ME is a text encoder; if the input historical interaction information is image information, then ME is an image encoder; ME can be adaptively adjusted according to actual conditions, and the embodiments of the present application do not limit this.

[0094] Step 103, calculating the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determining a mapping codeword corresponding to the coding feature based on the similarity score.

[0095] The following is a detailed description of step 103.

[0096] In some embodiments, Figure 3 As shown, the encoding feature h corresponding to the historical interaction information is input into the word segmenter, wherein the word segmenter includes an encoder (Encoder, E) and a decoder (Decoder, D). The encoder further encodes the encoding feature h to obtain a potential representation z; then, the potential representation z is processed by a residual vector based on the vector quantizer in the word segmenter to obtain a residual vector r, and the similarity between r and a plurality of preset codebook vectors is calculated; and then the similarity score is obtained to determine the mapping codeword corresponding to the encoding feature.

[0097] Furthermore, when the word segmenter includes only one level of vector quantizer, the vector quantizer first obtains the residual vector r1 of the potential representation z; then, the similarity between multiple codebook vectors preset by r1 is calculated, and the codebook vector with the highest similarity score is selected as the mapping codeword corresponding to the encoding feature h. Figure 3 In the example, the first-level vector quantizer of the word segmenter includes multiple preset codebook vectors: 1, 2, 3, 4, 5, 6; among them, the similarity score corresponding to codebook vector 2 is the highest, so the mapping codeword is 2.

[0098] The codebook vector is used to represent vectors of different categories or cluster centers. Multiple codebook vectors constitute a finite vector list, namely a codebook. The codebook is used to map the input vector to the closest codebook vector, thereby achieving data compression, representation and classification. Where l represents the lth level vector quantizer, K is the number of codebook vectors in the codebook, and each codebook vector is a learnable cluster center.

[0099] In some embodiments, Figure 4 As shown, Figure 4 yes Figure 2 A flowchart for implementing step 103 in the embodiment of the present invention is provided, wherein the similarity between the coding feature and a plurality of preset codebook vectors is calculated to obtain a similarity score, and a mapping codeword corresponding to the coding feature is determined based on the similarity score, including the following steps 201 to 203:

[0100] Step 201: If the preset multiple codebook vectors belong to different vector levels respectively, calculate the similarity between the coding feature and the codebook vector belonging to the first vector level to obtain a third similarity score, and determine the first mapping codeword corresponding to the coding feature based on the third similarity score.

[0101] Step 202: Calculate the similarity between the coding feature and the codebook vector belonging to the second vector level to obtain a fourth similarity score, and determine the second mapping codeword corresponding to the coding feature based on the fourth similarity score.

[0102] Step 203: superimpose the first mapping codeword and the second mapping codeword to obtain a mapping codeword corresponding to the coding feature.

[0103] Steps 201 to 203 are described in detail below.

[0104] In some embodiments, the word segmenter may include multiple different vector quantizers. In this case, the preset multiple codebook vectors will belong to different vector levels (vector quantizers); first, the similarity between the coding feature and the codebook vector belonging to the first vector level is calculated to obtain a third similarity score, and the first mapping codeword corresponding to the coding feature is determined based on the third similarity score. This process can be expressed as the following formula (1):

[0105]

[0106] Among them, c i is the mapping codeword output by the i-th level vector quantizer, r i is the residual vector output by the i-th level vector quantizer, is the i-th one of the preset k codebook vectors. The interpretations of all parameters in the embodiments of the present application are the same, and the repeated parts are not repeated. When the vector quantizer is the first vector level, i=1, and the processing process of the vector quantizer on the input potential representation can refer to the example in step 103.

[0107] Further, the second mapping codeword corresponding to the coding feature is determined based on the vector quantizer of the second vector level. Specifically, the residual vector of the coding feature at the second vector level is first calculated according to the following formula (2):

[0108]

[0109] When i=1, the residual vector r2 corresponding to the vector quantizer of the coding feature at the second vector level is obtained. Then, the similarity between r2 and the codebook vector belonging to the second vector level is calculated using formula (1) to obtain a fourth similarity score. Based on the fourth similarity score, the second mapping codeword corresponding to the coding feature is determined. Figure 3 In the example, r2=r1-2 (2 is the first mapping codeword).

[0110] Furthermore, the first mapping codeword and the second mapping codeword are superimposed to obtain the mapping codeword corresponding to the encoding feature For example, if the first mapping codeword is 2 and the second mapping codeword is 3, then the mapping codeword corresponding to the encoding feature is (2,3). This process can be expressed as the following formula (3), where L represents the number of vector quantizers. When the vector level is 2, L is 2:

[0111]

[0112] Furthermore, the mapping codeword will vary with the number of vector quantizers in the tokenizer. Figure 3 As shown, for example, the word segmenter includes four vector quantizers, the first mapping codeword obtained by the first vector quantizer is 2, the second mapping codeword obtained by the second vector quantizer is 3, the third mapping codeword obtained by the third vector quantizer is 1, and the first mapping codeword obtained by the first vector quantizer is 6, then the mapping codeword corresponding to the encoding feature is (2, 3, 1, 6). For ease of understanding, what is shown here is the understandable form of the mapping codeword. It should be clear that in the actual processing process, the mapping code is usually output in the form of digital code, analog information or specific format content that can be understood by the word segmenter.

[0113] It should be noted that the number of vector levels, that is, the number of vector quantizers included in the word segmenter can be set according to actual conditions. When the number of vector levels is adjusted, the number of sub-codewords in the final mapping codeword will change accordingly. The embodiment of the present application does not limit the number of vector levels of the word segmenter.

[0114] Step 104, decoding the mapped codeword, determining the codeword information of the corresponding item according to the decoding result, and determining the prefix information corresponding to the codeword information.

[0115] Step 105: Determine the item identifier corresponding to each item according to the codeword information and the prefix information.

[0116] Steps 104 and 105 are described in detail below.

[0117] In some embodiments, after obtaining the mapping codeword corresponding to the coding feature, the mapping codeword is decoded using the word segmentation decoder (D) of the word segmenter to determine that the decoding result is the codeword information of the corresponding object; in order to improve the storage space utilization of the ultimately generated object identifier, prefix information is also added to the decoded codeword information.

[0118] Furthermore, the prefix information can be different lowercase letters, such as a, b, c, etc. By superimposing the codeword information and the prefix information, the item identifier corresponding to the item is obtained. For example, if the codeword information is (2, 3, 1, 6), different prefix information is added to it based on the vector level corresponding to each mapping codeword, and the item identifier is (a2, b3, c1, d6); or, the codeword information and the prefix information can be connected by a short underscore, and the item identifier is (a_2, b_3, c_1, d_6).

[0119] In this way, the readability of the final item identifier is enhanced, and the prefix information can be used as part of the item index, so that the item recommendation device can locate the specific item identifier more quickly when making item recommendations, especially when processing a large amount of historical interaction information, which can improve storage and retrieval efficiency.

[0120] Step 106 , based on the similarity score, a target identifier is selected from the multiple item identifiers, and the item corresponding to the target identifier is determined as the target recommended item.

[0121] Step 106 is described in detail below.

[0122] In some embodiments, before processing the multiple historical interaction information obtained, the item recommendation method proposed in the present application can be used to identify the items to be recommended in the database in the same way; then, when the word segmenter calculates the similarity between its encoding features and the preset codebook vector based on the multiple historical interaction information, different historical interaction information will correspond to different similarity scores, wherein a high similarity score indicates that the corresponding item is more matched with the preset codebook vector. Since the codebook vector exists in the word segmenter's vocabulary, and the vocabulary is obtained based on the items to be recommended in the database, the item recommendation device will select a target identifier from multiple item identifiers based on the similarity scores corresponding to different historical interaction information; and determine that the item to be recommended corresponding to the target identifier is the target recommended item.

[0123] Among them, the item identifier determined by the item recommendation method proposed in this application has the following beneficial effects: Compared with the item identification method of the related art, the embodiment of this application can use a small number of characters to represent a large number of items, which greatly saves storage space. For example, assuming that the word segmenter includes four vector quantizers, and the number of codebook vectors at each vector level is 100, then 100 can be represented 4 = 100 million items.

[0124] In some embodiments, Figure 5 As shown, Figure 5 yes Figure 2 An implementation flow chart after step 101 in the embodiment, after obtaining a plurality of historical interaction information, further includes the following steps 301 to 305:

[0125] Step 301: If there is historical interaction information of different modalities, each historical interaction information is input into a pre-trained word segmenter under the corresponding modality, and each historical interaction information is encoded to obtain the encoding features under the corresponding modality.

[0126] Step 302: Calculate the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determine a mapping codeword corresponding to the coding feature based on the similarity score.

[0127] Step 303: Decode the mapped codeword, determine the codeword information of the corresponding item according to the decoding result, and determine the prefix information corresponding to the codeword information.

[0128] Step 304: Determine the item identifier of each item in the corresponding mode according to the codeword information and the prefix information.

[0129] Step 305 , based on the similarity score, a target identifier is selected from the item identifiers under multiple different modalities, and the item corresponding to the target identifier is determined as the target recommended item.

[0130] Steps 301 to 305 are described in detail below.

[0131] Among them, the historical interaction information can be in a single mode. For example, the multiple historical interaction information obtained by the item recommendation device are all text information, and the text information includes the item name and specific item description information of the corresponding item, and the language of the text information can be set according to actual conditions; or, the multiple historical interaction information can also be image information. For example, the user clicks on the two items "apple" and "banana", then the historical interaction information obtained by the recommendation device is the images of "apple" and "banana".

[0132] Furthermore, the historical interaction information may be in multiple modes. For example, the historical interaction information acquired by the item recommendation device may be in text form, image form, or audio form. The historical interaction information corresponding to an item may be in multiple modes, and the historical interaction information between different items may be the same or different. For example, the multiple historical interaction information acquired by the item recommendation device are: apple text information, apple image information, and banana text information.

[0133] It should be noted that the modal form corresponding to the historical interaction information can be set according to actual conditions. For example, in addition to the above-mentioned modes, the video data type can also be one of the modes. The specific content of the multi-modality in the embodiment of the present application is not limited.

[0134] Furthermore, the historical interaction information obtained in different modes is respectively input into the pre-trained word segmenter in the corresponding mode, so that the word segmenter encodes the input information to obtain the encoding features in the corresponding mode. For example, the historical interaction information obtained in the embodiment of the present application includes text information and image information, such as Figure 6 As shown, Figure 6It is an optional encoding flow chart of the item recommendation method provided in an embodiment of the present application, in which image information is input into a pre-trained image segmenter, and text information is input into a pre-trained text segmenter, and segmenters of different modalities can process the input historical interaction information separately based on the same vocabulary, thereby obtaining image encoding features and text encoding features.

[0135] That is to say, when word segmenters under different modalities process the input historical interaction information, they have a common reference frame or representation space at the semantic level. In this way, when the item recommendation device processes the historical interaction information under multimodality, the text information and image information can be mapped to a common vector space by the same method, so that they can be compared and matched in this vector space.

[0136] Furthermore, the word segmenter under each mode processes the input historical interaction information to obtain the item identifier under the corresponding mode in a method similar to steps 102 to 105, which will not be repeated here.

[0137] Furthermore, different prefix information is added to the codeword information corresponding to the historical interaction information in different modes to generate item identifiers in different modes. Figure 3 As shown in the figure, assuming that a 4-level vector quantizer is used, a set of codeword information can be assigned to the item text using the trained text segmenter: (2, 3, 1, 6). Then, a lowercase letter prefix is ​​added to the codeword information to obtain the text item identifier:<a_2><b_3><c_1><d_6> , where each <*> represents a character, that is, the identifier length is 4. Similarly, using the trained image tokenizer, a set of codeword information can be assigned to the object image: (1, 4, 2, 6), and then, a capital letter prefix is ​​added to the codeword information to obtain the object image identifier:<A_1><B_4><C_2><D_6> Each item consists of a textual item identifier and an image item identifier.

[0138] The beneficial effects of such identification include: 1) The item identifiers of similar items contain the same characters, which is conducive to the generation of subsequent identifiers and can improve the performance of item recommendations; 2) Item identifiers in multiple fields can share the same characters, thereby breaking the limitations of item labels (IDs) and realizing the transfer of recommendation knowledge; 3) Breaking down the barriers between different modalities and converting the content of different modalities into a unified identifier format helps to explore users' preferences in different aspects.

[0139] In particular, when the item recommendation device requires historical interaction information of different modalities, in some embodiments, such as Figure 7 As shown, Figure 7 yes Figure 5 A flowchart for implementing step 305 in the embodiment of the present invention, wherein a target identifier is selected from item identifiers in multiple different modalities based on a similarity score, comprising the following steps 401 to 403:

[0140] Step 401: If the item identifiers in different modes all indicate the same item, a second similarity score in the second mode is updated according to a first similarity score in the first mode to obtain an updated second similarity score.

[0141] Step 402: Update the first similarity score in the first modality according to the second similarity score in the second modality to obtain an updated first similarity score.

[0142] Step 403 : Selecting a target identifier from the item identifiers in multiple different modalities based on the updated first similarity score and the updated second similarity score.

[0143] Steps 401 to 403 are described in detail below.

[0144] In some embodiments, a list of identifiers under the corresponding modality is obtained based on word segmenters of different modalities, wherein each identifier list includes multiple item identifiers of the corresponding modality; then, a target identifier is determined based on the multiple identifier lists, so as to subsequently determine the corresponding target recommended item based on the target identifier.

[0145] Furthermore, when multiple historical interaction information includes text information and image information respectively, the first modality is text and the second modality is image; the similarity score corresponding to the text item identifier determined by the text information is the first similarity score, and the similarity score corresponding to the image item identifier determined by the image information is the second similarity score. If the text item identifier and the image item identifier obtained by the item recommendation device both indicate the same item, it means that the user not only interacts with the text information of the item, but also interacts with the image information of the item, which further means that the user is more interested in the item. Based on this, the second similarity score in the second modality can be updated according to the first similarity score in the first modality to obtain an updated second similarity score, and the first similarity score in the first modality can be updated according to the second similarity score in the second modality to obtain an updated first similarity score; and then based on the updated first similarity score and the updated second similarity score, a target identifier is selected from the item identifiers in multiple different modalities.

[0146] Among them, the method for updating the similarity score can be to superimpose multiple similarity scores of the same object in different modes; or, to perform weighted calculation on multiple similarity scores in different modes to obtain an updated similarity score in the corresponding mode; of course, the method for updating the similarity score can be set according to actual conditions, and the embodiments of the present application do not limit this.

[0147] Therefore, the item recommendation device can capture richer similarity features and more comprehensively determine the similarity between the to-be-recommended item and the expected recommended item, thereby improving the accuracy of item recommendation.

[0148] For better understanding, the following further examples are given. When generating item identifiers, beamsearch decoding is used to obtain a text identifier list R t and a list of image identifiers R v , and then update the similarity score S corresponding to each identifier in the identifier list based on the following formula (4). In addition to being obtained based on the word segmenter, the similarity score S can also be calculated by the preset confidence function S(·):

[0149]

[0150] Among them, s i (x) is the item x in list R i The scores in , i∈{t,v}, t is the text modality, v is the image modality; reorder the item identifiers in the list according to the similarity scores, so that if the text identifier list R t and a list of image identifiers R v If the same item appears in the same list, then the item should be ranked higher.

[0151] Furthermore, the similarity score may also be related to the number of interactions between the user and the corresponding item. The greater the number of interactions, the greater the number of item identifiers generated indicating the item, and the higher the corresponding similarity score, indicating that the user is more interested in the item.

[0152] Furthermore, the item identification symbol with the highest similarity score from multiple identifier lists can be selected as the target identifier; or, the item identification symbols with the highest similarity scores can be selected from multiple identifier lists as the target identifier; or, the item identification symbol corresponding to the similarity score exceeding a preset score threshold can be determined as the target identifier; the specific method for determining the target identifier can be adaptively adjusted according to actual conditions, and the embodiments of the present application do not limit this.

[0153] In some embodiments, Figure 8 As shown, Figure 8 yes Figure 2An implementation flow chart after step 105 in the embodiment of the present invention further includes the following steps 501 to 503 after determining the item identifier corresponding to each item:

[0154] Step 501: If there are multiple identical item identifiers, determine the updated second mapping codeword in order of the fourth similarity scores.

[0155] Step 502: If the updated second mapping codewords are still the same, determine the updated first mapping codewords in order of the third similarity scores.

[0156] Step 503: complete the reallocation of the item identifiers according to the updated first mapping codeword and the updated second mapping codeword.

[0157] Steps 501 to 503 are described in detail below.

[0158] In some embodiments, when determining the item identifiers corresponding to different items, since different items may have certain similarities, identifier conflicts may occur. In this case, it is necessary to re-determine the mapping codewords corresponding to different vector levels based on the word segmenter to complete the reallocation of the item identifiers to avoid misjudgment of the item recommendation device due to repeated allocation of item identifiers.

[0159] Exemplarily, if item identifier 1 (from item 1) and item identifier 2 (from item 2) are determined by a tokenizer, the tokenizer includes a first vector quantizer and a second vector quantizer, then the mapping codewords determined by item identifier 1 and item identifier 2 at the second vector level are second mapping codewords, and the second mapping codewords include the corresponding fourth similarity score; the mapping codewords determined by item identifier 1 and item identifier 2 at the first vector level are first mapping codewords, and the first mapping codewords include the corresponding third similarity score. Since the mapping codewords corresponding to the next vector level are determined by the output results of the previous vector level, when multiple item identifiers are reallocated, the mapping codewords of item 1 and item 2 are updated in the order of the vector levels from back to front.

[0160] Further, in the second vector level, the codebook vectors are sorted according to the fourth similarity scores between the coding features of item 1 and the codebook vectors, and the results are: 6 (95%), 5 (90%); the codebook vectors are sorted according to the fourth similarity scores between the coding features of item 2 and the codebook vectors, and the results are: 6 (92%), 5 (91%), where the similarity scores are in brackets; it can be determined that the fourth similarity score of item 1 is higher than that of item 2, so the updated second mapping codeword of item 1 is determined to be 6, and the updated second mapping codeword of item 2 is determined to be 5. If the fourth similarity scores of item 1 and item 2 are the same, then in the first vector level, the updated first mapping codeword is determined in the order of the size of the third similarity scores.

[0161] Furthermore, for a more general case, that is, the tokenizer contains L vector levels, for N conflicting items:

[0162] ①First, according to Calculate the distance D∈R from the residual vector r to the codebook vector at each vector level N×L×K ;

[0163] ② Then, sort by distance to get the index I = argsort(D, axis = 2) ∈ R N×L×K ; Then, sort according to the minimum distance from the conflicting items to the last level codebook vector, that is:

[0164] ③Finally, reassign identifiers to the sorted conflicting items according to index I.

[0165] The re-identifiers of conflicting items follow the following principles: 1) Starting from the last vector level, the nearest codeword is assigned to the item. If there is a conflict, the next closest codebook vector is assigned as the mapping codeword; 2) If the codebook vectors of the last vector level are not enough to be assigned, for the remaining conflicting items, the mapping codewords of the second-to-last vector level are first reallocated according to the distance, and then the mapping codewords of the last vector level are reallocated; and so on, until all conflicting items are processed.

[0166] In some embodiments, Fig. 9 As shown, Fig. 9 This is another optional flow chart of the item recommendation method provided in the embodiment of the present application. The word segmenter is trained by following steps 601 to 605:

[0167] Step 601, obtaining a plurality of sample interaction information and verification code information corresponding to the sample interaction information, wherein the sample interaction information is used to represent relevant data of the sample items interacting with the user.

[0168] Step 602: Input multiple sample interaction information into a pre-built word segmenter, encode each sample interaction information, and obtain corresponding sample encoding features.

[0169] Step 603: Calculate the similarity between the sample coding feature and a plurality of preset codebook vectors to obtain a sample similarity score, and determine a sample mapping codeword corresponding to the sample coding feature based on the sample similarity score.

[0170] Step 604: Decode the sample mapping codeword and determine the sample codeword information corresponding to the sample item according to the decoding result.

[0171] Step 605, according to the sample codeword information and the verification codeword information, the codeword loss value is calculated, and the parameters of the word segmenter are adjusted based on the codeword loss value to obtain a trained word segmenter.

[0172] Steps 601 to 605 are described in detail below.

[0173] In some embodiments, the sample historical interaction information can be obtained from an open Amazon dataset, which can be a pet supplies dataset (Pet Supplies), a cell phone and accessories dataset (Cell Phones and Accessories), an automotive supplies dataset (Automotive), a tools and home improvement dataset (Tools and Home Improvement), a toys and games dataset (Toys and Games), a sports and outdoor products dataset (Sports and Outdoors), etc. The specific Amazon dataset can be set according to actual conditions; and the sample historical interaction information can also be obtained in the same manner as the historical interaction information, and the embodiments of the present application do not limit this.

[0174] Furthermore, after obtaining the sample historical interaction information, the pre-built word segmenter is used to process each sample historical interaction information. The specific processing method is similar to step 102 to step 104 and will not be repeated here.

[0175] Furthermore, after obtaining the sample codeword information, the codeword loss value is calculated based on the sample codeword information and the verification codeword information, and the parameters of the word segmenter are adjusted based on the codeword loss value to obtain the trained word segmenter. The verification codeword information is used to represent the real codeword information expected to be output by the sample codeword information.

[0176] Among them, the adjusted parameters of the word segmenter can be the processing layer weight size, bias parameter, vocabulary size, word segmentation granularity, etc. of the word segmenter. The adjusted parameters of the word segmenter are set according to actual conditions, and the embodiments of the present application do not limit this.

[0177] In some embodiments, Fig.10 As shown, Fig.10 yes Fig. 9 A flowchart for implementing step 605 in the embodiment of the present invention is provided, wherein the code word loss value is calculated based on the sample code word information and the verification code word information, and includes the following steps 701 to 703:

[0178] Step 701, calculating the similarity between the sample codeword information and the verification codeword information to obtain a first loss value.

[0179] Step 702: Calculate the similarity between the sample coding feature and each preset codebook vector according to the preset loss parameter to obtain a second loss value.

[0180] Step 703: superimpose the first loss value and the second loss value to obtain a codeword loss value.

[0181] Steps 701 to 703 are described in detail below.

[0182] In some embodiments, the first loss value L is calculated based on the following formula (5): recon :

[0183]

[0184] Among them, h is the sample codeword information, Verification code information.

[0185] Furthermore, the second loss value L is calculated based on the following formula (6): rqvae

[0186]

[0187] Among them, sg[*] represents the gradient stop operation, and β is the loss function weight, which is usually set to 0.25.

[0188] Furthermore, based on the following formula (7), the first loss value and the second loss value are superimposed to obtain the codeword loss value L(h):

[0189] L(h)=L recon +L rqvae (7)

[0190] In some embodiments, Fig.11 As shown, Fig.11This is another optional flow chart of the item recommendation method provided in the embodiment of the present application. The target identifier is obtained by processing the item identifier through a pre-trained recommendation model. The recommendation model is trained through the following steps 801 to 804, and the steps include:

[0191] Step 801, obtaining a sample item identifier and a verification item identifier.

[0192] Step 802: based on the preset task prompt word, update the sample item identifier to obtain an updated sample item identifier.

[0193] Step 803: Input the updated sample item identifier into the pre-built recommendation model to obtain a sample target identifier.

[0194] Step 804, based on the sample item identifier and the sample target identifier, calculate the model loss value, adjust the parameters of the recommendation model according to the model loss value, and obtain the trained recommendation model.

[0195] Steps 801 to 803 are described in detail below.

[0196] In some embodiments, after determining and obtaining multiple sample item identifiers, the corresponding target identifier is determined based on a pre-trained recommendation model, and the trained recommendation model will be set in the item recommendation device. The recommendation model will be trained based on a preset task in advance, and different training schemes are set according to different tasks:

[0197] (1) Next item identifier generation task (Task1): The task of the item recommendation device is to recommend the next item that the user is interested in based on the user's historical interaction information. Therefore, the next item identifier generation task is the main optimization goal of the recommendation model. Since each item has two identifiers, text and image, this task contains two subtasks: 1) Next item text identifier generation task; 2) Next item image identifier generation task. For example, the user has interacted with three items before, and their text identifiers are<a_2><b_3><c_1><d_6> ,<a_4><b_3><c_8><d_6> and<a_3><b_7><c_1><d_5> , then during model training, the input (sample item identifier) ​​for the next item text identifier generation task is<a_2><b_3><c_1><d_6><a_4><b_3><c_8><d_6> , the expected output (verified item identifier) ​​is<a_3><b_7><c_1><d_5> ; Then, the model loss value is calculated according to the output sample target identifier and sample item identifier, and the parameters of the recommendation model are adjusted according to the model loss value to obtain the trained recommendation model;

[0198] (2) Asymmetric item identifier generation task (Task2): Task2 is a further optimization of Task1. In Task1, the input and output of the two subtasks are symmetric, that is, if the input is a text identifier, the output is also a text identifier, and if the input is an image identifier, the output is also an image identifier. In order to promote the recommendation knowledge transfer of the two modalities, the embodiment of the present application proposes Task2, which includes two subtasks: 1) an asymmetric item text identifier generation task; 2) an asymmetric item image identifier generation task. The input of the first subtask is the image identifier of the item sequence, and the output is the text identifier of the target item. For example, after obtaining the sample item prompt word, it is updated according to the preset task prompt word, and the first subtask input is the updated sample item identifier <*_1><*_2><*_3><a_2><b_3><c_1><d_6><a_4><b_3><c_8><d_6> , where the * character represents a special letter that can be learned, and <*_1><*_2><*_3> are the task prompts corresponding to Task2, which can be understood as: please predict the image identifier of the next item based on the text identifier of the item interaction sequence; the expected output of Task2 (verifying the item identifier) ​​is<A_3><B_7><C_1><D_5> ; Then, the model loss value is calculated according to the output sample target identifier and sample item identifier, and the parameters of the recommendation model are adjusted according to the model loss value to obtain the trained recommendation model;

[0199] (3) Item Identifier Alignment Task (Task3): Task3 is a further optimization of Task1. Each item has two identifiers, text and image, but the recommendation model does not know that these two identifiers represent the same item. Therefore, the present embodiment proposes Task3, which includes two subtasks: 1) text to image identifier alignment; 2) image to text identifier alignment. For example, the text and image item identifiers of an item are<a_2><b_3><c_1><d_6> and<A_3><B_7><C_1><D_5> , then the input of the first subtask is the updated sample item identifier <*_4><*_5><*_6><a_2><b_3><c_1><d_6> , where <*_4><*_5><*_6> are the task prompts for Task 2, which can be understood as: Please give the image identifier based on the item text identifier; the expected output of Task 3 (verifying the item identifier) ​​is<A_3><B_7><C_1><D_5> ; Then, the model loss value is calculated based on the output sample target identifier and sample item identifier, and the parameters of the recommendation model are adjusted according to the model loss value to obtain the trained recommendation model.

[0200] It should be noted that the specific tasks when training the recommendation model can be adaptively adjusted according to the actual situation, and the sample item identifier, task prompt word and verification item identifier under the corresponding task are obtained to achieve the training of the recommendation model. In addition, after completing the training of Task1, Task2, and Task3, fine-tuning tasks can also be added according to the actual situation, and the embodiment of the present application does not limit this.

[0201] Furthermore, the model loss value L corresponding to the recommended model is calculated based on the following formula (8): θ :

[0202]

[0203] Among them, θ is the parameter of the recommendation model, X is the historical interaction information, and Y j is the j-th character of the target identifier Y.

[0204] like Fig.12 As shown, Fig.12 This is an optional flow chart of the item recommendation device provided in the embodiment of the present application. The item recommendation device includes the following modules 901 to 906:

[0205] The acquisition module 901 is used to acquire a plurality of historical interaction information, where the historical interaction information is used to represent relevant data of items interacting with the user.

[0206] The encoding module 902 is used to input multiple historical interaction information into a pre-trained word segmenter, encode each historical interaction information, and obtain corresponding encoding features.

[0207] The mapping module 903 is used to calculate the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determine a mapping codeword corresponding to the coding feature based on the similarity score.

[0208] The decoding module 904 is used to decode the mapping codeword, determine the codeword information of the corresponding item according to the decoding result, and determine the prefix information corresponding to the codeword information.

[0209] The prefix module 905 is used for the identifier determination module to determine the item identifier corresponding to each item according to the codeword information and the prefix information.

[0210] The target recommendation module 906 is used to select a target identifier from multiple item identifiers based on the similarity score, and determine the item corresponding to the target identifier as the target recommended item.

[0211] The article recommendation method, device, electronic device and storage medium proposed in the present application obtain multiple historical interaction information, which is used to characterize the relevant data of the article that interacts with the user; input the multiple historical interaction information into the pre-trained word segmenter, encode each historical interaction information, and obtain the corresponding encoding feature; calculate the similarity between the encoding feature and the preset multiple codebook vectors to obtain the similarity score, and determine the mapping codeword corresponding to the encoding feature based on the similarity score; decode the mapping codeword, determine the codeword information of the corresponding article according to the decoded result, and determine the prefix information corresponding to the codeword information; determine the article identifier corresponding to each article according to the codeword information and the prefix information; in this way, the present application can represent a large number of articles with a small number of characters, which greatly saves storage space; finally, based on the similarity score, select the target identifier from the multiple article identifiers, and determine the article corresponding to the target identifier as the target recommended article. Since the article identifier generated by the present application occupies less storage space, the present application can locate the specific article identifier more quickly when recommending articles, especially when processing a large amount of historical interaction information, which can improve the recommendation efficiency of articles.

[0212] The specific implementation of the item recommendation device is basically the same as the specific implementation of the above-mentioned item recommendation method, and will not be repeated here.

[0213] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above-mentioned item recommendation method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0214] like Fig.13 As shown, Fig.13 : is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application, the electronic device includes:

[0215] The processor 1001 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application;

[0216] The memory 1002 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1002 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 1002, and the processor 1001 calls and executes the item recommendation method of the embodiment of this application;

[0217] Input / output interface 1003, used to implement information input and output;

[0218] The communication interface 1004 is used to realize the communication interaction between the device and other devices. The communication can be realized through a wired manner (such as USB, network cable, etc.) or a wireless manner (such as mobile network, WIFI, Bluetooth, etc.);

[0219] A bus 1005 , which transmits information between various components of the device (e.g., the processor 1001 , the memory 1002 , the input / output interface 1003 , and the communication interface 1004 );

[0220] The processor 1001 , the memory 1002 , the input / output interface 1003 and the communication interface 1004 are connected to each other in communication within the device via the bus 1005 .

[0221] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the above-mentioned item recommendation method is implemented.

[0222] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0223] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0224] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0225] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0226] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0227] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0228] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0229] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0230] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0231] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0232] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including multiple instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, referred to as ROM), random access memory (Random Access Memory, referred to as RAM), disk or optical disk and other media that can store programs.

[0233] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. An item recommendation method, characterized in that: The method comprises: Acquire a plurality of historical interaction information, where the historical interaction information is used to represent relevant data of an item interacting with a user; Inputting the plurality of historical interaction information into a pre-trained word segmenter, encoding each of the historical interaction information to obtain a corresponding encoding feature; Calculating the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determining a mapping codeword corresponding to the coding feature based on the similarity score; Decoding the mapped codeword, determining the codeword information corresponding to the item according to the decoding result, and determining the prefix information corresponding to the codeword information; Determine an item identifier corresponding to each of the items according to the codeword information and the prefix information; Based on the similarity score, a target identifier is selected from the multiple item identifiers, and the item corresponding to the target identifier is determined as a target recommended item.

2. The method according to claim 1, characterized in that: After obtaining the plurality of historical interaction information, the method further includes: If there is the historical interaction information of different modalities, each of the historical interaction information is input into the pre-trained word segmenter under the corresponding modality, and each of the historical interaction information is encoded to obtain the encoding feature under the corresponding modality; Calculating the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determining a mapping codeword corresponding to the coding feature based on the similarity score; Decoding the mapped codeword, determining the codeword information corresponding to the item according to the decoding result, and determining the prefix information corresponding to the codeword information; Determine, according to the codeword information and the prefix information, an item identifier in a mode corresponding to each of the items; Based on the similarity score, a target identifier is selected from the item identifiers in multiple different modalities, and the item corresponding to the target identifier is determined as a target recommended item.

3. The method according to claim 2, characterized in that The modality includes a first modality and a second modality, the first modality and the second modality are different; The selecting a target identifier from the item identifiers in a plurality of different modalities based on the similarity score comprises: If the item identifiers in different modalities all indicate the same item, updating the second similarity score in the second modality according to the first similarity score in the first modality to obtain an updated second similarity score; updating the first similarity score in the first modality according to the second similarity score in the second modality to obtain an updated first similarity score; A target identifier is selected from the item identifiers in a plurality of different modalities based on the updated first similarity score and the updated second similarity score.

4. The method according to claim 1, characterized in that: The calculating the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determining a mapping codeword corresponding to the coding feature based on the similarity score, includes: If the preset multiple codebook vectors belong to different vector levels respectively, calculate the similarity between the coding feature and the codebook vector belonging to the first vector level to obtain a third similarity score, and determine the first mapping codeword corresponding to the coding feature based on the third similarity score; Calculating a similarity between the coding feature and the codebook vector belonging to the second vector level to obtain a fourth similarity score, and determining a second mapping codeword corresponding to the coding feature based on the fourth similarity score; The first mapping codeword and the second mapping codeword are superimposed to obtain a mapping codeword corresponding to the encoding feature.

5. The method according to claim 4, characterized in that After determining the item identifier corresponding to each item, the method further includes: If there are multiple identical item identifiers, determining the updated second mapping codeword in order of the fourth similarity scores; If the updated second mapping codewords are still the same, determining the updated first mapping codewords according to the order of magnitude of the third similarity scores; The reallocation of the item identifiers is completed according to the updated first mapping codeword and the updated second mapping codeword.

6. The method according to claim 1, characterized in that The word segmenter is trained by the following steps, which include: Acquire multiple sample interaction information and verification code word information corresponding to the sample interaction information, wherein the sample interaction information is used to represent relevant data of the sample item interacting with the user; Inputting the plurality of sample interaction information into a pre-built word segmenter, encoding each sample interaction information to obtain a corresponding sample encoding feature; Calculating the similarity between the sample coding feature and a plurality of preset codebook vectors to obtain a sample similarity score, and determining a sample mapping codeword corresponding to the sample coding feature based on the sample similarity score; Decoding the sample mapping codeword, and determining the sample codeword information corresponding to the sample object according to the decoding result; A codeword loss value is calculated according to the sample codeword information and the verification codeword information, and the parameters of the word segmenter are adjusted based on the codeword loss value to obtain the trained word segmenter.

7. The method according to claim 6, characterized in that The calculating the code word loss value according to the sample code word information and the verification code word information includes: Calculating the similarity between the sample codeword information and the verification codeword information to obtain a first loss value; According to a preset loss parameter, the similarity between the sample coding feature and each preset codebook vector is calculated to obtain a second loss value; The first loss value and the second loss value are superimposed to obtain a codeword loss value.

8. The method according to claim 1, characterized in that: The target identifier is obtained by processing the item identifier through a pre-trained recommendation model, and the recommendation model is trained through the following steps, which include: obtaining a sample item identifier and a verification item identifier; Based on a preset task prompt word, the sample item identifier is updated to obtain an updated sample item identifier; Inputting the updated sample item identifier into the pre-built recommendation model to obtain a sample target identifier; Based on the sample item identifier and the sample target identifier, a model loss value is calculated, and the parameters of the recommendation model are adjusted according to the model loss value to obtain the trained recommendation model.

9. An item recommendation device, characterized in that: The device comprises: An acquisition module, used to acquire a plurality of historical interaction information, wherein the historical interaction information is used to characterize relevant data of items interacting with the user; An encoding module, used for inputting the plurality of historical interaction information into a pre-trained word segmenter, encoding each of the historical interaction information to obtain a corresponding encoding feature; A mapping module, used to calculate the similarity between the coding feature and a plurality of preset codebook vectors to obtain a similarity score, and determine a mapping codeword corresponding to the coding feature based on the similarity score; A decoding module, used to decode the mapping codeword, determine the codeword information corresponding to the item according to the decoding result, and determine the prefix information corresponding to the codeword information; A prefix module, used for the identifier determination module to determine the item identifier corresponding to each of the items according to the code word information and the prefix information; The target recommendation module is used to select a target identifier from the multiple item identifiers based on the similarity score, and determine that the item corresponding to the target identifier is a target recommended item.

10. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the item recommendation method according to any one of claims 1 to 8 when executing the computer program.

11. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the item recommendation method according to any one of claims 1 to 8 is implemented.

Citation Information

Cited By

  • Mixed identifier generation type recommendation method and system based on local collaborative context

    CN121980091A