Artificial intelligence-based accurate recommendation method, device, equipment and storage medium
By constructing a relative importance table and a preference matrix, and combining matrix decomposition to obtain product features, the accuracy problem of insurance product recommendations in the financial insurance field is solved, and more accurate recommendation results are achieved.
Patent Information
- Application Number
- CN202211430135.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-15
- Publication Date
- 2025-12-09
- Estimated Expiration
- 2042-11-15
AI Technical Summary
In the financial and insurance field, existing technologies use overly subjective weighting of user behavior types, resulting in low accuracy in insurance product recommendations.
By collecting behavioral data between users and products to be recommended, a relative importance table is constructed and weight values are calculated. A preference matrix is constructed and matrix decomposition is performed to obtain product features. Finally, recommendations are made based on the similarity of product features.
This improves the accuracy of insurance product recommendations and ensures the precision of the recommendations.
Smart Images

Figure CN115730995B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of artificial intelligence, and particularly relates to a precise recommendation method and device based on artificial intelligence, an electronic device and a storage medium. BACKGROUND
[0002] The purpose of precise recommendation is to identify users with high matching degrees for specific behaviors or specific products, and recommend the behaviors or products to the users with high matching degrees. Precise recommendation is widely used in product marketing and task assignment scenarios. The prerequisite for precise recommendation is available user information data, and then the user information data is analyzed by rules or models to determine the matching degrees of the users and specific behaviors or specific products.
[0003] In the field of finance and insurance, the behavior types of users for different insurance products are diversified, such as clicking, browsing and collecting. At present, different weight values are set for different behavior types according to subjective experience to construct user information data, and insurance product recommendation is realized according to the user information data. However, this method has strong subjectivity and randomness, and cannot accurately obtain the influence degree of different behavior types on the recommendation result, so the accuracy of the recommendation result is low. SUMMARY
[0004] In view of the above, it is necessary to propose a precise recommendation method based on artificial intelligence and related devices to solve the technical problem of how to improve the accuracy of the recommendation result, wherein the related devices include a precise recommendation device based on artificial intelligence, an electronic device and a storage medium.
[0005] The present application provides a precise recommendation method based on artificial intelligence, which comprises:
[0006] Collecting behavior data between each user and each product to be recommended in a preset time period, wherein the behavior data comprises the execution times of at least one behavior type;
[0007] Calculating the frequencies of different behavior types in the behavior data to construct a relative importance table;
[0008] Performing consistency verification on the relative importance table. If the consistency verification is passed, the weight values of each behavior type are calculated based on the relative importance table. If the consistency verification is not passed, the preset time period is adjusted and the behavior data is collected again until the consistency verification is passed;
[0009] Constructing a preference matrix based on the behavior data and the weight values of the behavior types, wherein the preference matrix is used to represent the preference degrees between each user and each product to be recommended;
[0010] Perform matrix decomposition on the preference matrix to obtain the product characteristics of each product to be recommended;
[0011] Recommendation results for any user are obtained based on the similarity between the product features of the products to be recommended.
[0012] In some embodiments, the behavior type includes at least one of clicking, adding to favorites, querying, and purchasing, and the collection of behavioral data between each user and each product to be recommended within a preset time period includes:
[0013] Take any one of all users as the target user, and any one of all products to be recommended as the target product to be recommended.
[0014] Based on pre-set data points, the number of times each behavior type is executed between the target user and the target product to be recommended within a preset time period is collected and stored to obtain the behavioral data between the target user and the target product to be recommended.
[0015] Iterate through all products to be recommended to obtain behavioral data between the target user and each product to be recommended.
[0016] Iterate through all users to obtain behavioral data between each user and each product to be recommended.
[0017] In some embodiments, calculating the frequency of different behavior types in the behavior data to construct a relative importance table includes:
[0018] Calculate the sum of the number of times the same behavior type is executed in all behavior data to serve as a statistic for each behavior type;
[0019] Calculate the ratio of the statistic for any behavior type to the sum of the statistics for all behavior types to obtain the frequency of each behavior type;
[0020] The relative importance between any two behavior types is calculated based on the frequency of the aforementioned behavior types, and the relative importance satisfies the following relationship:
[0021] α(i,j)=P i / P j
[0022] Among them, P i P represents the frequency of behavior type i. j Let be the frequency of behavior type j; α(i,j) represents the relative importance of behavior type i relative to behavior type j.
[0023] Create a preset template and write the relative importance between any two behavior types into the preset template to construct a relative importance table. The rows and columns of the preset template correspond one-to-one with the behavior types.
[0024] In some embodiments, the adjusting the preset time period comprises lengthening or shortening the preset time period, and the calculating the weight value of each behavior type based on the relative importance table comprises:
[0025] calculating a feature vector corresponding to a maximum eigenvalue of the relative importance table;
[0026] normalizing the feature vector to obtain a normalized feature vector, the normalized feature vector comprising a plurality of normalized parameters, the normalized parameters one-to-one corresponding to the behavior types;
[0027] taking the normalized parameters as the weight values of the corresponding behavior types.
[0028] In some embodiments, the constructing a preference matrix based on the behavior data and the weight values of the behavior types comprises:
[0029] creating an initial matrix of M rows and N columns, M being the number of all users and N being the number of all products to be recommended;
[0030] obtaining behavior data between a user m and a product n to be recommended, and performing weighted summation on the behavior data based on the weight values of the different behavior types to obtain a preference value between the user m and the product n to be recommended, the preference value satisfying a relationship:
[0031]
[0032] wherein Q represents the number of all behavior types, w i represents the weight value of behavior type i, C i represents the number of times of execution of behavior type i in the behavior data, and β(m, n) represents the preference value between the user m and the product n to be recommended;
[0033] writing the preference value between the user m and the product n to be recommended into the mth row and the nth column of the initial matrix to update the initial matrix;
[0034] calculating the preference values between all users and each product to be recommended, and constantly updating the initial matrix until the behavior data between each user and each product to be recommended is traversed, to obtain a preference matrix.
[0035] In some embodiments, the performing matrix decomposition on the preference matrix to obtain product features of each product to be recommended comprises:
[0036] splitting the preference matrix into a user matrix U and a product matrix V, the user matrix U comprising user features of each user, and the product matrix V comprising product features of each product to be recommended.
[0037] computing a cost function based on the user matrix U and the product matrix V, the cost function satisfying a relationship:
[0038]
[0039] wherein M and N are respectively a row and a column of the preference matrix, β(m,n) represents a value of the mth row and the nth column in the preference matrix; u m represents a user feature of the user m in the user matrix U, v n is a product feature of the product n to be recommended in the product matrix V, and J(U,V) is a value of the cost function;
[0040] updating the user matrix U and the product matrix V based on an alternating least squares method to reduce the value of the cost function until the value of the cost function is less than a preset value;
[0041] extracting the product feature of each product to be recommended from the updated product matrix V.
[0042] In some embodiments, the obtaining of the recommendation result of any user based on the similarity between the product features of the products to be recommended comprises:
[0043] taking a product to be recommended corresponding to any behavior type performed by any user as a target product;
[0044] computing the similarity between the product feature of the target product and the product features of all products to be recommended:
[0045] arranging all the similarities in descending order, and selecting the products to be recommended corresponding to the top Z similarities as the recommendation result of the user.
[0046] Embodiments of the present application also provide an accurate recommendation device based on artificial intelligence, which comprises:
[0047] a collection unit configured to collect behavior data between each user and each product to be recommended within a preset time period, the behavior data comprising the execution frequency of at least one behavior type;
[0048] a first construction unit configured to compute the frequency of different behavior types in the behavior data to construct a relative importance table;
[0049] a consistency verification unit configured to perform consistency verification on the relative importance table, and if the consistency verification is passed, computing the weight value of each behavior type based on the relative importance table, and if the consistency verification is not passed, adjusting the preset time period and re-collecting the behavior data until the consistency verification is passed.
[0050] a second constructing unit configured to construct a preference matrix based on the behavior data and the weight values of the behavior types, the preference matrix being used to represent a degree of preference between each user and each product to be recommended;
[0051] a decomposing unit configured to perform matrix decomposition on the preference matrix to obtain product features of each product to be recommended;
[0052] a recommending unit configured to obtain a recommendation result of any user based on a similarity between the product features of the products to be recommended.
[0053] Embodiments of the present application further provide an electronic device, which comprises:
[0054] a memory configured to store at least one instruction;
[0055] a processor configured to execute the instruction stored in the memory to implement the AI-based accurate recommendation method.
[0056] Embodiments of the present application further provide a computer readable storage medium, which stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the AI-based accurate recommendation method.
[0057] To sum up, the present application constructs a table of relative importance between different behavior types by collecting behavior data between each user and each product to be recommended, and further obtains weight values of different behavior types, which reflect the importance of different behavior types to accurate recommendation; constructs a preference matrix based on the weight values of different behavior types to ensure the accuracy of product features of each product to be recommended; finally, obtains a recommendation result according to the similarity between product features of the products to be recommended, thereby improving the accuracy of the recommendation result. BRIEF DESCRIPTION OF DRAWINGS
[0058] Figure 1 is a flowchart of a preferred embodiment of the AI-based accurate recommendation method involved in the present application.
[0059] Figure 2 is a functional module diagram of a preferred embodiment of the AI-based accurate recommendation device involved in the present application.
[0060] Figure 3 is a structural schematic diagram of an electronic device of a preferred embodiment of the AI-based accurate recommendation method involved in the present application. DETAILED DESCRIPTION
[0061] In order to more clearly understand the objects, features and advantages of the present application, the present application will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict. In the following description, a large number of specific details are set forth in order to facilitate a thorough understanding of the present application, and the described embodiments are only some of the embodiments of the present application, but not all the embodiments.
[0062] In addition, the terms "first", "second" are only for descriptive purposes, and cannot be understood as indicating or implying relative importance or implicitly indicating the number of indicated technical features. Therefore, the features defined with "first", "second" can explicitly or implicitly include one or more of the features. In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly and specifically limited.
[0063] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used in the specification of the present application are only for the purpose of describing the specific embodiments of the present application, and are not intended to limit the present application. The term "and / or" used herein includes any and all combinations of one or more related listed items.
[0064] The embodiments of the present application provide a precision recommendation method based on artificial intelligence, which can be applied to one or more electronic devices. The electronic device is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions. The hardware thereof includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0065] The electronic device can be any electronic product that can interact with the customer, such as a personal computer, a tablet computer, a smart phone, a personal digital assistant (PDA), a game console, an interactive Internet Protocol Television (IPTV), a smart wearable device, etc.
[0066] Electronic devices may also include network devices and / or client devices. The network devices include, but are not limited to, a single network server, a server group consisting of multiple network servers, or a cloud based on cloud computing consisting of a large number of hosts or network servers.
[0067] The networks in which electronic devices are located include, but are not limited to, the Internet, wide area networks, metropolitan area networks, local area networks, and virtual private networks (VPNs).
[0068] like Figure 1 The diagram shown is a flowchart of a preferred embodiment of the AI-based accurate recommendation method of this application. The order of steps in the flowchart can be changed, and some steps can be omitted, depending on different needs. The AI-based accurate recommendation method provided in this application can be applied to any scenario requiring accurate recommendations, and this method can be applied to products in these scenarios, such as insurance product recommendations and task allocation in the financial insurance field.
[0069] S10, collect behavioral data between each user and each product to be recommended within a preset time period, wherein the behavioral data includes the number of times at least one type of behavior is executed.
[0070] In an optional embodiment, the behavior type includes at least one of clicking, adding to favorites, querying, and purchasing, and the collection of behavioral data between each user and each product to be recommended within a preset time period includes:
[0071] Take any one of all users as the target user, and any one of all products to be recommended as the target product to be recommended.
[0072] Based on pre-set data points, the number of times each behavior type is executed between the target user and the target product to be recommended within a preset time period is collected and stored to obtain the behavioral data between the target user and the target product to be recommended.
[0073] Iterate through all products to be recommended to obtain behavioral data between the target user and each product to be recommended.
[0074] Iterate through all users to obtain behavioral data between each user and each product to be recommended.
[0075] The data tracking points are related technologies for capturing, processing, and sending specific user behaviors or events, and are a commonly used data collection method; the preset time period is the most recent month; the number of products to be recommended is at least one, which can be different products in the online mall, or online assignments or positions, and this application does not impose any restrictions.
[0076] In the optional embodiment, the number of users is denoted as M, the number of products to be recommended is denoted as N, and the application collects the behavior data of all users and each product to be recommended, thereby collecting MxN behavior data.
[0077] For example, it is assumed that the products to be recommended include three products to be recommended A, B and C, the behavior types include four types of clicking, inquiring, collecting and purchasing, and within a preset time period, user 1 clicks product A for 5 times, inquires product A for 7 times, collects product A for 1 time and purchases product A for 3 times, and the behavior data between user 1 and product A is shown in Table 1. The behavior data between user 1 and each product to be recommended can be obtained by the same method, and one user corresponds to three different behavior data.
[0078] Table 1. Behavior data between user 1 and product A
[0079]
[0080] In this way, the behavior data between each user and each product to be recommended within a preset time period is collected, thereby providing a data basis for accurate recommendation of the products to be recommended.
[0081] S11, calculating the frequency of different behavior types in the behavior data to construct a relative importance table.
[0082] In an optional embodiment, the calculation of the frequency of different behavior types in the behavior data to construct a relative importance table includes:
[0083] calculating the sum of the execution times of the same behavior type in all behavior data as the statistical quantity of each behavior type;
[0084] calculating the ratio of the statistical quantity of any behavior type to the sum of the statistical quantities of all behavior types to obtain the frequency of each behavior type;
[0085] calculating the relative importance between any two behavior types based on the frequency of the behavior types, and the relative importance satisfies the relationship:
[0086] α(i,j)=P i / P j
[0087] wherein P i is the frequency of behavior type i, P j is the frequency of behavior type j, and α(i,j) represents the relative importance of behavior type i relative to behavior type j.
[0088] create a preset template, and write the relative importance between any two behavior types into the preset template to build a relative importance table, the rows and columns of the preset template correspond to the behavior types one by one.
[0089] wherein the relative importance table is a QxQ square matrix, Q is the number of all behavior types; the value of the i-th row and the j-th column in the relative importance table is the relative importance of behavior type i to behavior type j, and the greater the value of a(i,j) is, the more important behavior type i is to behavior type j.
[0090] In the optional embodiment, for behavior type i, the sum of the execution times of behavior type i in all behavior data is obtained as the statistical quantity of behavior type i, denoted as Sum i ; the statistical quantities of the Q behavior types are obtained in the same way, and are sequentially denoted as Sum1, Sum2, …, Sum i , …, Sum Q ; the frequency P i of behavior type i satisfies the following relationship:
[0091]
[0092] The frequencies of the Q behavior types are obtained in the same way, and based on the frequencies of the behavior types, the relative importance between any two behavior types can be calculated. It should be noted that the relative importance of behavior type i to behavior type j a(i,j) and the relative importance of behavior type j to behavior type i a(j,i) are inverses of each other.
[0093] For example, assuming that the behavior types include clicking, querying, collecting, and purchasing, and the frequencies of the behavior types are 0.4, 0.35, 0.15, and 0.1, respectively, the corresponding relative importance table is shown in Table 2. In the relative importance table, the value of the 1st row and the 3rd column is the relative importance of behavior type “clicking” to behavior type “collecting” a(clicking, collecting) satisfies the relationship:
[0094]
[0095] Table 2. Relative importance table
[0096] Click Query Favor Purchase Click 1 8 / 7 8 / 3 4 Query 7 / 8 1 7 / 3 7 / 2 Favor 3 / 8 3 / 7 1 3 / 2 Purchase 3 / 7 2 / 7 2 / 3 1
[0097] In this way, the construction of the relative importance table is completed according to the behavior data of all users and each product to be recommended, and the accurate quantification of the relative importance between different behavior types is realized.
[0098] S12, verifying consistency of the relative importance table, if the consistency verification passes, calculating weight values of each behavior type based on the relative importance table, if the consistency verification fails, adjusting the preset time period and re-collecting the behavior data until the consistency verification passes.
[0099] In an optional embodiment, the relative importance reflects the relative importance between different behavior types, in order to avoid the contradiction such as "A is more important than B, B is more important than C, but C is more important than A", the relative importance table needs to be verified for consistency, when the consistency verification passes, the relative importance table satisfies the relationship:
[0100] α(i,j) x α(j,k) = α(i,k), 1≤i,i,k≤Q
[0101] Wherein, α(i,k) is the value of the relative importance table in the i-th row and the k-th column, Q is the number of all behavior types, indicating that the relative importance table conforms to the actual situation.
[0102] In an optional embodiment, the consistency verification of the relative importance table comprises:
[0103] Calculating the maximum eigenvalue of the relative importance table, and calculating a consistency index based on the maximum eigenvalue, the consistency index satisfies the relationship:
[0104]
[0105] Wherein, λ is the maximum eigenvalue, Q is the number of rows and columns of the relative importance table, CI is the consistency index;
[0106] Querying a preset table to obtain a random consistency index corresponding to Q;
[0107] Calculating a consistency ratio based on the consistency index and the random consistency index, the consistency ratio satisfies the relationship:
[0108]
[0109] Wherein, CI is the consistency index, RI is the random consistency index, and CR is the consistency ratio;
[0110] Comparing the consistency ratio with a preset threshold, if the consistency ratio is less than the preset threshold, it means that the consistency verification passes, if the consistency ratio is not less than the preset threshold, it means that the consistency verification fails. Wherein, the preset threshold is 0.1, and the preset table is shown in Table 3.
[0111] Table 3. Preset table
[0112] Q 1 2 3 4 5 6 7 8 9 10 11 RI 0 0 0.58 0.90 1.12 1.24 1.32 1.41 1.45 1.49 1.51
[0113] In the optional embodiment, if the consistency verification passes, the calculating the weight value of each behavior type based on the relative importance table comprises:
[0114] calculating a feature vector corresponding to a maximum eigenvalue of the relative importance table;
[0115] performing a normalization operation on the feature vector to obtain a normalized feature vector, the normalized feature vector comprising a plurality of normalized parameters, the normalized parameters corresponding to the behavior types one by one;
[0116] taking the normalized parameters as the weight values of the corresponding behavior types.
[0117] wherein the size of the feature vector and the normalized feature vector are both Q rows and 1 column, and the sum of all normalized parameters in the normalized feature vector is 1.
[0118] For example, if the consistency verification passes, taking the relative importance table shown in Table 2 as an example, the maximum eigenvalue of the relative importance table is 4.17, and the feature vector corresponding to the maximum eigenvalue is [0.71, 0.62, 0.27, 0.21] T , the normalized feature vector obtained by normalizing the feature vector is [0.39, 0.34, 0.15, 0.12] T ; the normalized parameters in the normalized feature vector correspond to the behavior types one by one, so the weight values of the four behavior types of clicking, querying, collecting and purchasing are 0.39, 0.34, 0.15 and 0.12 respectively.
[0119] In the optional embodiment, if the consistency verification fails, the preset time period is adjusted and the behavior data is re-collected until the consistency verification passes, and the weight value of each behavior type is calculated after the consistency verification passes. The adjustment of the preset time period comprises lengthening or shortening the preset time period. For example, the preset time period is adjusted from the last month to the last two months, or the preset time period is adjusted from the last month to the last week.
[0120] In this way, after passing the consistency verification, the weight value of each behavior type is obtained through the relative importance table, and the weight value reflects the importance of the behavior type to the accurate recommendation.
[0121] S13, constructing a preference matrix based on the behavior data and the weight value of the behavior type, the preference matrix being used to represent the preference degree between each user and each product to be recommended.
[0122] In an optional embodiment, constructing the preference matrix based on the behavior data and the weight values of the behavior types comprises:
[0123] An initial matrix of M rows and N columns is created, M being the number of all users and N being the number of all products to be recommended;
[0124] The behavior data between a user m and a product n to be recommended is obtained, and the behavior data is weighted and summed based on the weight values of different behavior types to obtain a preference value between the user m and the product n to be recommended, the preference value satisfying the relationship:
[0125]
[0126] wherein Q represents the number of all behavior types, w i represents the weight value of behavior type i, C i represents the number of times of execution of behavior type i in the behavior data, and β(m, n) represents the preference value between the user m and the product n to be recommended;
[0127] The preference value between the user m and the product n to be recommended is written into the mth row and the nth column of the initial matrix to update the initial matrix;
[0128] The preference values between all users and each product to be recommended are calculated, and the initial matrix is constantly updated until the behavior data between each user and each product to be recommended is traversed, and a preference matrix is obtained.
[0129] It should be noted that the preference value between the user m and the product n to be recommended reflects the preference degree of the user m to the product n to be recommended.
[0130] For example, taking the behavior data between user 1 and product A to be recommended shown in Table 1 as an example, assuming that the weight values of four behavior types of clicking, querying, collecting and purchasing are 0.39, 0.34, 0.15 and 0.12 respectively, then the preference value between user 1 and product A to be recommended is:
[0131] β(1, A) = 0.39 x 5 + 0.34 x 7 + 0.15 x 1 + 0.12 x 3 = 4.84
[0132] In this way, the construction of the preference matrix is completed, and the preference matrix reflects the preference degree between each user and each product to be recommended.
[0133] S14, performing matrix decomposition on the preference matrix to obtain product features of each product to be recommended.
[0134] In an optional embodiment, the matrix decomposition of the preference matrix to obtain the product feature of each product to be recommended comprises:
[0135] splitting the preference matrix into a user matrix U and a product matrix V, the user matrix U comprising a user feature of each user, and the product matrix V comprising a product feature of each product to be recommended;
[0136] calculating a cost function based on the user matrix U and the product matrix V, the cost function satisfying a relationship:
[0137]
[0138] wherein M and N are respectively a row and a column of the preference matrix, β(m,n) represents a value of the mth row and the nth column in the preference matrix; u m represents the user feature of the mth user in the user matrix U, v n is the product feature of the nth product to be recommended in the product matrix V, and J(U,V) is a value of the cost function;
[0139] updating the user matrix U and the product matrix V based on an alternating least squares method to reduce the value of the cost function until the value of the cost function is less than a preset value;
[0140] extracting the product feature of each product to be recommended from the updated product matrix V.
[0141] wherein the preset value is 0.01.
[0142] In the optional embodiment, the preference matrix has a size of M rows and N columns, the M rows correspond to M users one by one, and the N columns correspond to N products to be recommended one by one, reflecting the preference degree between each user and each product to be recommended; the user matrix U has a size of M rows and g columns, each row corresponding to a user feature of a user, and the user feature has a size of 1 row and g columns; the product matrix V has a size of N rows and g columns, each row corresponding to a product feature of a product to be recommended, and the product feature has a size of 1 row and g columns, wherein g is preset.
[0143] In the optional embodiment, the updating of the user matrix U and the product matrix V based on the alternating least squares method comprises:
[0144] A1, fixing the value of the user matrix U, updating the product matrix V based on a gradient descent method to reduce the value of the cost function;
[0145] A2, fixing the value of the product matrix V, updating the user matrix U based on a gradient descent method to reduce the value of the cost function;
[0146] A3, repeating step A1 and step A2, constantly updating the user matrix U and the product matrix V, until the value of the cost function is less than a preset value.
[0147] In this way, the product features of each product to be recommended are obtained, providing a data basis for precise recommendation.
[0148] S15, obtaining a recommendation result of any user based on the similarity between the product features of the product to be recommended.
[0149] In an optional embodiment, the obtaining of the recommendation result of any user based on the similarity between the product features of the product to be recommended comprises:
[0150] taking the product to be recommended corresponding to any behavior type of any user as a target product;
[0151] calculating the similarity between the product features of the target product and the product features of all products to be recommended;
[0152] arranging all the similarities in descending order, and selecting the products to be recommended corresponding to the top Z similarities as the recommendation result of the user.
[0153] wherein Z is a preset integer. In an optional embodiment, the similarity between the product features of the target product and the product features of all products to be recommended can be calculated based on a vector retrieval library, the vector retrieval library being a Faiss library (Facebook AI Similarity Search), the Faiss library providing an efficient and reliable retrieval method for a large amount of data in a high-dimensional space, and the Faiss library being capable of calculating the similarity between any two vectors.
[0154] For example, when any user clicks on a product to be recommended A, the product to be recommended A is the target product, the similarity between the product features of the product to be recommended A and the product features of all products to be recommended is calculated based on the vector retrieval library (Faiss library), and the top Z products to be recommended with the largest similarity are selected as the recommendation result.
[0155] In this way, the product to be recommended corresponding to any behavior type is taken as the target product, the similarity between the product features of all products to be recommended and the target product is calculated based on the vector retrieval library (Faiss library), and the recommendation result is obtained.
[0156] From the above technical solutions can be seen, the application constructs the relative importance table between different behavior types by collecting the behavior data between each user and each product to be recommended, and further obtains the weight values of different behavior types, which reflect the importance of different behavior types to the accurate recommendation; the preference matrix is constructed based on the weight values of different behavior types to ensure the accuracy of the product features of each product to be recommended; finally, the recommendation result is obtained according to the similarity between the product features of the recommended products, which improves the accuracy of the recommendation result.
[0157] Please refer to Figure 2 , Figure 2 is a functional module diagram of a preferred embodiment of the application. The intelligent recommendation device 11 based on artificial intelligence includes an acquisition unit 110, a first construction unit 111, a consistency verification unit 112, a second construction unit 113, a decomposition unit 114, and a recommendation unit 115. The module / unit referred to in the application refers to a series of computer readable instruction segments that can be executed by the processor 13 and can complete a fixed function, which is stored in the memory 12. In this embodiment, the functions of each module / unit will be described in detail in the subsequent embodiments.
[0158] In an optional embodiment, the acquisition unit 110 is configured to collect behavior data between each user and each product to be recommended within a preset time period, the behavior data including the execution times of at least one behavior type.
[0159] In an optional embodiment, the behavior type includes at least one of clicking, collecting, querying, and purchasing, and the collection of the behavior data between each user and each product to be recommended within a preset time period includes:
[0160] Taking any one of all users as a target user and taking any one of all products to be recommended as a target product to be recommended;
[0161] According to the pre-set data burying point, the execution times of each behavior type between the target user and the target product to be recommended within a preset time period are collected and stored to obtain the behavior data between the target user and the target product to be recommended;
[0162] All products to be recommended are traversed to obtain the behavior data between the target user and each product to be recommended;
[0163] All users are traversed to obtain the behavior data between each user and each product to be recommended.
[0164] In an optional embodiment, the first construction unit 111 is configured to calculate the frequencies of different behavior types in the behavior data to construct a relative importance table.
[0165] In an optional embodiment, the calculating the frequency of different behavior types in the behavior data to construct a relative importance table comprises:
[0166] calculating the sum of the execution times of the same behavior type in all behavior data as the statistic of each behavior type;
[0167] calculating the ratio of the statistic of any behavior type to the sum of the statistics of all behavior types to obtain the frequency of each behavior type;
[0168] calculating the relative importance between any two behavior types based on the frequency of the behavior types, the relative importance satisfying the relationship:
[0169] α(i,j) = P i / P j
[0170] wherein P i is the frequency of behavior type i, P j is the frequency of behavior type j; and α(i,j) represents the relative importance of behavior type i relative to behavior type j;
[0171] creating a preset template and writing the relative importance between any two behavior types into the preset template to construct a relative importance table, the rows and columns of the preset template corresponding to the behavior types one by one.
[0172] In an optional embodiment, the consistency verification unit 112 is configured to verify the consistency of the relative importance table, and if the consistency verification passes, calculate the weight value of each behavior type based on the relative importance table, and if the consistency verification fails, adjust the preset time period and re-collect the behavior data until the consistency verification passes.
[0173] In an optional embodiment, the consistency verification of the relative importance table comprises:
[0174] calculating the maximum eigenvalue of the relative importance table, and calculating a consistency index based on the maximum eigenvalue, the consistency index satisfying the relationship:
[0175]
[0176] wherein λ is the maximum eigenvalue, Q is the number of rows and columns of the relative importance table, and CI is the consistency index;
[0177] querying a preset table to obtain a random consistency index corresponding to Q;
[0178] calculating a consistency ratio based on the consistency index and the random consistency index, the consistency ratio satisfying a relationship:
[0179]
[0180] wherein CI is the consistency index, RI is the random consistency index, and CR is the consistency ratio;
[0181] comparing the consistency ratio with a preset threshold value, if the consistency ratio is less than the preset threshold value, it indicates that the consistency verification passes, and if the consistency ratio is not less than the preset threshold value, it indicates that the consistency verification fails.
[0182] In an optional embodiment, the adjusting the preset time period includes extending or shortening the preset time period, and the calculating the weight value of each behavior type based on the relative importance table includes:
[0183] calculating a feature vector corresponding to a maximum eigenvalue of the relative importance table;
[0184] performing a normalization operation on the feature vector to obtain a normalized feature vector, the normalized feature vector including a plurality of normalized parameters, the normalized parameters one-to-one corresponding to the behavior types;
[0185] taking the normalized parameters as the weight values of the corresponding behavior types.
[0186] In an optional embodiment, the second constructing unit 113 is configured to construct a preference matrix based on the behavior data and the weight values of the behavior types, the preference matrix being used to represent the preference degrees between each user and each product to be recommended.
[0187] In an optional embodiment, the constructing the preference matrix based on the behavior data and the weight values of the behavior types includes:
[0188] creating an initial matrix of M rows and N columns, M being the number of all users and N being the number of all products to be recommended;
[0189] obtaining the behavior data between user m and product n to be recommended, and performing weighted summation on the behavior data based on the weight values of different behavior types to obtain a preference value between the user m and the product n to be recommended, the preference value satisfying a relationship:
[0190]
[0191] wherein Q represents the number of all behavior types, w i represents the weight value of behavior type i, C irepresents the number of times of execution of behavior type i in the behavior data, and β(m, n) represents the preference value between the user m and the product n to be recommended;
[0192] The preference value between the user m and the product n to be recommended is written into the mth row and the nth column in the initial matrix to update the initial matrix.
[0193] The preference values between all users and each product to be recommended are calculated, and the initial matrix is updated until the behavior data between each user and each product to be recommended is traversed, and a preference matrix is obtained.
[0194] In an optional embodiment, the decomposition unit 114 is configured to perform matrix decomposition on the preference matrix to obtain product features of each product to be recommended.
[0195] In an optional embodiment, the matrix decomposition on the preference matrix to obtain product features of each product to be recommended comprises:
[0196] The preference matrix is split into a user matrix U and a product matrix V, the user matrix U includes user features of each user, and the product matrix V includes product features of each product to be recommended;
[0197] A cost function is calculated based on the user matrix U and the product matrix V, and the cost function satisfies the following relationship:
[0198]
[0199] wherein M and N are the number of rows and columns of the preference matrix respectively, β(m, n) represents a value in the mth row and the nth column of the preference matrix; u m represents user features of the user m in the user matrix U, v n represents product features of the product n to be recommended in the product matrix V, and J(U, V) is a value of the cost function;
[0200] The user matrix U and the product matrix V are updated based on an alternating least squares method to reduce the value of the cost function until the value of the cost function is less than a preset value.
[0201] The product features of each product to be recommended are extracted from the updated product matrix V.
[0202] In an optional embodiment, the recommendation unit 115 is configured to obtain a recommendation result of any user based on similarities between product features of the products to be recommended.
[0203] In an optional embodiment, the obtaining of the recommendation result of any user based on the similarities between the product features of the products to be recommended comprises:
[0204] taking the target product corresponding to any behavior type performed by any user as a target product;
[0205] calculating the similarity between the product features of the target product and the product features of all the target products;
[0206] arranging all the similarities in descending order, and taking the target products corresponding to the top Z similarities as the recommendation results of the user.
[0207] From the above technical solutions, it can be seen that the present application constructs the relative importance table between different behavior types by collecting the behavior data between each user and each target product, and further obtains the weight values of different behavior types, which reflect the importance of different behavior types for accurate recommendation. A preference matrix is constructed based on the weight values of different behavior types to ensure the accuracy of the product features of each target product. Finally, the recommendation results are obtained according to the similarity between the product features of the target products, which improves the accuracy of the recommendation results.
[0208] Please refer to Figure 3 is a structural schematic diagram of an electronic device provided by an embodiment of the present application. The electronic device 1 comprises a memory 12 and a processor 13. The memory 12 is used to store computer readable instructions, and the processor 13 is used to execute the computer readable instructions stored in the memory to implement the artificial intelligence-based accurate recommendation method described in any of the above embodiments.
[0209] In an optional embodiment, the electronic device 1 further comprises a bus, a computer program stored in the memory 12 and executable on the processor 13, such as an artificial intelligence-based accurate recommendation program.
[0210] Figure 3 Only the electronic device 1 with the memory 12 and the processor 13 is shown, and those skilled in the art can understand that Figure 3 The structure shown does not constitute a limitation on the electronic device 1, and can include fewer or more components than shown, or combine certain components, or different component arrangements.
[0211] In combination with Figure 1 The memory 12 in the electronic device 1 stores a plurality of computer readable instructions to implement an artificial intelligence-based accurate recommendation method, and the processor 13 can execute the plurality of instructions to implement:
[0212] Collecting behavior data between each user and each target product within a preset time period, the behavior data including the number of executions of at least one behavior type;
[0213] Calculate the frequency of different behavior types in the behavioral data to construct a relative importance table;
[0214] The relative importance table is subjected to consistency verification. If the consistency verification passes, the weight value of each behavior type is calculated based on the relative importance table. If the consistency verification fails, the preset time period is adjusted and the behavior data is collected again until the consistency verification passes.
[0215] A preference matrix is constructed based on the behavioral data and the weight values of the behavioral types. The preference matrix is used to characterize the degree of preference between each user and each product to be recommended.
[0216] Perform matrix decomposition on the preference matrix to obtain the product characteristics of each product to be recommended;
[0217] Recommendation results for any user are obtained based on the similarity between the product features of the products to be recommended.
[0218] Specifically, the processor 13's implementation method for the above instructions can be found in [reference needed]. Figure 1 The descriptions of the relevant steps in the corresponding embodiments are not repeated here.
[0219] Those skilled in the art will understand that the schematic diagram is merely an example of electronic device 1 and does not constitute a limitation on electronic device 1. Electronic device 1 can be a bus-type structure or a star-type structure. Electronic device 1 may also include more or fewer other hardware or software than shown in the diagram, or different component arrangements. For example, electronic device 1 may also include input / output devices, network access devices, etc.
[0220] It should be noted that electronic device 1 is only an example. Other existing or future electronic products that are suitable for this application should also be included within the scope of protection of this application and are incorporated herein by reference.
[0221] The memory 12 includes at least one type of readable storage medium, which can be non-volatile or volatile. The readable storage medium includes a flash memory, a mobile hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a magnetic memory, a magnetic disk, an optical disk, etc. The memory 12 can be an internal storage unit of the electronic device 1 in some embodiments, such as a mobile hard disk of the electronic device 1. The memory 12 can also be an external storage device of the electronic device 1 in other embodiments, such as a plug-in mobile hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. The memory 12 can be used to store application software and various data installed in the electronic device 1, such as the code of the artificial intelligence-based accurate recommendation program, and can also be used to temporarily store data that has been output or will be output.
[0222] The processor 13 can be composed of an integrated circuit in some embodiments, such as a single packaged integrated circuit or a plurality of packaged integrated circuits with the same or different functions, including one or more combinations of a central processing unit (CPU), a microprocessor, a digital processing chip, a graphics processor, and various control chips, etc. The processor 13 is the control unit of the electronic device 1, which connects all components of the electronic device 1 through various interfaces and lines, executes programs or modules stored in the memory 12 (such as the artificial intelligence-based accurate recommendation program, etc.), and calls data stored in the memory 12 to perform various functions and process data of the electronic device 1.
[0223] The processor 13 executes the operating system and various application programs installed in the electronic device 1. The processor 13 executes the application programs to implement the steps in each of the above artificial intelligence-based accurate recommendation method embodiments, such as Figure 1 the steps shown.
[0224] The computer program can be divided into one or more modules / units, which are stored in the memory 12 and executed by the processor 13 to complete the present application. The one or more modules / units can be a series of computer-readable instruction segments capable of completing a specific function, which are used to describe the execution process of the computer program in the electronic device 1. For example, the computer program can be divided into an acquisition unit 110, a first construction unit 111, a consistency verification unit 112, a second construction unit 113, a decomposition unit 114, and a recommendation unit 115.
[0225] The integrated units implemented in the form of software functional modules can be stored in a computer-readable storage medium. The software functional modules stored in the storage medium include a plurality of instructions for causing a computer device (which can be a personal computer, a computer device, or a network device, etc.) or a processor to execute part of the precision recommendation method based on artificial intelligence described in the embodiments of the present application.
[0226] The modules / units integrated in the electronic device 1, if implemented in the form of software functional units and sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the above-mentioned embodiments can also be completed by a computer program to instruct related hardware devices, and the computer program can be stored in a computer-readable storage medium and executed by a processor to implement the steps of each method embodiment.
[0227] The computer program includes computer program code, which can be in the form of source code, object code, executable files, or some intermediate forms, etc. The computer-readable medium can include any entity or device capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory, and other memories, etc.
[0228] Further, the computer-readable storage medium can mainly include a program storage area and a data storage area, wherein the program storage area can store an operating system, at least one application required for a function, etc.; and the data storage area can store data created according to the use of the blockchain node, etc.
[0229] The blockchain referred to in the present application is a new application mode of distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm and other computer technologies. The blockchain is essentially a decentralized database, which is a series of data blocks associated using cryptographic methods, each data block containing information of a batch of network transactions, used to verify the validity (anti-fake) of the information and generate the next block. The blockchain can include a blockchain underlying platform, a platform product service layer, and an application service layer, etc.
[0230] The bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one arrow is used in Figure 3 , but it does not mean that there is only one bus or one type of bus. The bus is arranged to realize the connection and communication between the memory 12, the at least one processor 13, etc.
[0231] The embodiment of the present application also provides a computer readable storage medium (not shown in the figure), which stores computer readable instructions. The computer readable instructions are executed by a processor in an electronic device to realize the artificial intelligence-based accurate recommendation method described in any of the above embodiments.
[0232] In several embodiments provided in the present application, it should be understood that the disclosed system, device and method can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the modules is only a logical function division. There can be another division way in actual implementation.
[0233] The modules described as separate components can or can not be physically separated, and the components displayed as modules can or can not be physical units, i.e. they can be located in one place or distributed on multiple network units. Part or all of the modules can be selected according to actual needs to achieve the purpose of the present embodiment.
[0234] In addition, each functional module in each embodiment of the present application can be integrated in one processing unit, or each unit can exist physically, or two or more units can be integrated in one unit. The integrated unit can be realized in the form of hardware or in the form of hardware plus software functional modules.
[0235] Furthermore, the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural and vice-versa, unless the context clearly requires these exclusions. The description set forth herein illustrates the technical solution of the present application by means of examples, but the present application is not limited to these examples.
[0236] Finally, it should be noted that the above-mentioned embodiments illustrate rather than limit the application, since the skilled person, having regard to the above description, will be able to carry out the application with modifications or equivalent arrangements without departing from the spirit and scope of the application.
Claims
1. An artificial intelligence-based precision recommendation method, characterized in that, The method comprises: collecting behavior data between each user and each product to be recommended within a preset time period, the behavior data comprising the number of executions of at least one behavior type; calculating frequencies of different behavior types in the behavior data to build a relative importance table, comprising: calculating a sum of execution times of the same behavior type in all behavior data as a statistic of each behavior type; calculating a ratio of the statistic of any behavior type to the sum of statistics of all behavior types to obtain a frequency of each behavior type; calculating a relative importance between any two behavior types based on the frequency of the behavior type, the relative importance satisfying a relationship: wherein, is the frequency of behavior type i, is the frequency of behavior type j; represents the relative importance of behavior type i relative to behavior type j; creating a preset template and writing the relative importance between any two behavior types into the preset template to build a relative importance table, the rows and columns of the preset template corresponding to the behavior types one by one; performing consistency verification on the relative importance table, if the consistency verification passes, calculating the weight value of each behavior type based on the relative importance table, if the consistency verification fails, adjusting the preset time period and re-collecting the behavior data until the consistency verification passes; constructing a preference matrix based on the behavior data and the weight value of the behavior type, the preference matrix being used to represent the preference degree between each user and each product to be recommended; performing matrix decomposition on the preference matrix to obtain the product feature of each product to be recommended; obtaining the recommendation result of any user based on the similarity between the product features of the products to be recommended. 2.The AI-based precision recommendation method of claim 1, wherein, The behavior type at least comprises at least one of clicking, collecting, inquiring and purchasing, and the collecting of the behavior data between each user and each product to be recommended within a preset time period comprises: taking any one of all users as a target user and taking any one of all products to be recommended as a target product to be recommended; collecting and storing the number of executions of each behavior type between the target user and the target product to be recommended within a preset time period according to a pre-set data burying point to obtain the behavior data between the target user and the target product to be recommended; traversing all products to be recommended to obtain the behavior data between the target user and each product to be recommended; traversing all users to obtain the behavior data between each user and each product to be recommended. 3.The AI-based precision recommendation method of claim 1, wherein, The adjusting of the preset time period comprises lengthening or shortening the preset time period, and the calculating of the weight value of each behavior type based on the relative importance table comprises: calculating the eigenvector corresponding to the maximum eigenvalue of the relative importance table; performing a normalization operation on the eigenvector to obtain a normalized eigenvector, the normalized eigenvector comprising a plurality of normalized parameters, the normalized parameters corresponding to the behavior types one by one; taking the normalized parameters as the weight values of the corresponding behavior types. 4.The AI-based precision recommendation method of claim 1, wherein, The constructing of the preference matrix based on the behavior data and the weight value of the behavior type comprises: creating an initial matrix of M rows and N columns, M being the number of all users and N being the number of all products to be recommended; obtaining the behavior data between user m and product n to be recommended, and performing weighted summation on the behavior data based on the weight values of different behavior types to obtain the preference value between the user m and the product n to be recommended, the preference value satisfying the relationship: wherein Q represents the number of all behavior types, represents a weight value of the behavior type i, represents the number of times of execution of the behavior type i in the behavior data, represents a preference value between the user m and the product n to be recommended. writing the preference value between the user m and the product n to be recommended in the mth row and the nth column of the initial matrix to update the initial matrix; calculating the preference value between all users and each product to be recommended, and constantly updating the initial matrix until the behavior data between each user and each product to be recommended is traversed, to obtain a preference matrix. 5.The AI-based precision recommendation method of claim 4, wherein, The matrix decomposition on the preference matrix to obtain the product feature of each product to be recommended comprises: splitting the preference matrix into a user matrix U and a product matrix V, the user matrix U comprising user features of each user, and the product matrix V comprising product features of each product to be recommended; calculating a cost function based on the user matrix U and the product matrix V, the cost function satisfying a relationship: where M and N are the number of rows and columns of the preference matrix, respectively, denotes the value in the mth row and nth column of the preference matrix; denotes the user feature of user m in the user matrix U, denotes the product feature of product n to be recommended in the product matrix V, is the value of the cost function; updating the user matrix U and the product matrix V based on an alternating least squares method to reduce a value of the cost function until the value of the cost function is less than a preset value; extracting the product features of each product to be recommended from the updated product matrix V. 6.The AI-based precision recommendation method of claim 1, wherein, The obtaining of the recommendation result of any user based on the similarity between the product features of the products to be recommended comprises: taking a product to be recommended corresponding to any behavior type performed by any user as a target product; calculating the similarity between the product features of the target product and the product features of all products to be recommended; arranging all the similarities in descending order, and selecting the products to be recommended corresponding to the top Z similarities as the recommendation result of the user.
7. An artificial intelligence-based precision recommendation device for implementing the method of claim 1, characterized by, The apparatus comprises: a collection unit configured to collect behavior data between each user and each product to be recommended within a preset time period, the behavior data comprising the number of times of performing at least one behavior type; a first construction unit configured to calculate the frequency of different behavior types in the behavior data to construct a relative importance table; a consistency verification unit configured to verify the consistency of the relative importance table, and if the consistency verification passes, calculate the weight value of each behavior type based on the relative importance table, and if the consistency verification fails, adjust the preset time period and re-collect the behavior data until the consistency verification passes; a second construction unit configured to construct a preference matrix based on the behavior data and the weight value of the behavior type, the preference matrix being used to represent the preference degree between each user and each product to be recommended; a decomposition unit configured to perform matrix decomposition on the preference matrix to obtain the product features of each product to be recommended; a recommendation unit configured to obtain the recommendation result of any user based on the similarity between the product features of the products to be recommended.
8. An electronic device, comprising: The electronic device comprises: a memory storing computer readable instructions; and a processor executing the computer readable instructions stored in the memory to implement the precise recommendation method based on artificial intelligence according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by a processor to implement the precise recommendation method based on artificial intelligence according to any one of claims 1 to 6.
Citation Information
Patent Citations
Content recommendation method and device and equipment
CN107391680A
Vector shift-based recommendation method, apparatus, computer device, and non-volatile readable storage medium
WO2021051515A1