Product recommendation test set generation method and device, computer device, and medium
By classifying and generalizing the product descriptions by feature categories, a product feature relationship matrix is generated, which solves the problem of incomplete test set coverage and achieves efficient test set generation and improved product recommendation quality.
Patent Information
- Application Number
- CN202411197760.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2026-02-06
- Estimated Expiration
- 2044-08-29
AI Technical Summary
In existing algorithm model testing methods, the problem of incomplete test set coverage leads to inaccurate product recommendations after deployment, and the cost of manually covering all product features is high.
By classifying product descriptions into feature categories, extracting feature keywords and performing generalization processing, a product feature relationship matrix is generated, and a test set is automatically generated in combination with preset rules.
It reduced labor costs, expanded the coverage of the test set, increased the diversity of test cases, and improved the recommendation quality of the product recommendation model.
Smart Images

Figure CN119127693B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of artificial intelligence and big data, and particularly relates to a product recommendation test set generation method and device, computer equipment and a medium. BACKGROUND
[0002] With the development of science and technology, it is very common to acquire data and use data modeling to solve corresponding problems. For example, each e-commerce platform collects user's product browsing records and other data, and builds a product recommendation model according to the collected data to recommend products to users. For a smart recommendation, smart search and other systems, the product recommendation quality directly affects user use and experience, and users have different questions. How to improve the algorithm model test quality before going online and ensure the algorithm recommendation effect has become a technical difficulty.
[0003] The existing algorithm model test method often uses a test set divided from a data set as a test case to verify the algorithm model effect. In the entire data set, the test set often accounts for a small proportion, and if the division is uneven, the test data itself is limited, and there may be a situation that the test set does not cover comprehensively, and accurate products cannot be recommended according to user questions after going online.
[0004] Each product generally has its own characteristics, and the product recommendation model often recommends products according to these characteristics. If the number of products is large and the characteristic values are more, it is difficult and time-consuming for a person to cover completely. SUMMARY
[0005] The purpose of the embodiments of the present application is to provide a product recommendation test set generation method and device, and the main purpose is to automatically generate a test set to expand the coverage of the test set.
[0006] In order to solve the above technical problems, the embodiments of the present application provide a product recommendation test set generation method, which adopts the following technical scheme:
[0007] A product recommendation test set generation method includes the following steps:
[0008] Obtaining a product description of a product;
[0009] Dividing a feature category to which the product description belongs, and generating a product category corresponding relationship about the product description and the feature category;
[0010] Based on the feature category, extracting a feature keyword from the product description, and generating a category feature corresponding relationship about the feature category and the feature keyword;
[0011] generalize the feature keywords to obtain generalized feature keywords, and update the category-feature correspondence relationship based on the generalized feature keywords;
[0012] generate a product-feature relationship matrix related to the product and the feature keywords based on the product category correspondence relationship and the updated category-feature correspondence relationship;
[0013] generate a test set based on the product-feature relationship matrix in combination with a preset rule.
[0014] Further, the generalization of the feature keywords includes the following steps:
[0015] obtain a preset generalization threshold parameter;
[0016] generalize the feature keywords based on the generalization threshold parameter.
[0017] Further, the generation of the product-feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship includes the following steps:
[0018] generate a single-feature product-feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship;
[0019] obtain a preset number parameter of feature combinations;
[0020] combine the feature keywords based on the number parameter to obtain multi-feature keywords;
[0021] convert the single-feature product-feature relationship matrix into a multi-feature product-feature relationship matrix based on the multi-feature keywords;
[0022] obtain the product-feature relationship matrix in combination with the single-feature product-feature relationship matrix and the multi-feature product-feature relationship matrix.
[0023] Further, the generation of the product-feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship includes the following steps:
[0024] extract at least one feature category corresponding to each product based on the product category correspondence relationship;
[0025] extract at least one generalized feature keyword corresponding to each feature category based on the updated category-feature correspondence relationship;
[0026] construct a single-feature product-feature relationship matrix of each generalized feature keyword and at least one product based on the feature category.
[0027] The product feature relationship matrix of the single feature is taken as the product feature relationship matrix.
[0028] Further, when the feature category is a description class feature, the extracting of the feature keyword from the product description based on the feature category comprises the following steps:
[0029] identifying the feature category;
[0030] When it is identified that the feature category is a description class feature, performing word segmentation on the product description to obtain a word segmentation list; and removing the word segmentation irrelevant to the product from the word segmentation list to obtain the feature keyword.
[0031] When it is identified that the feature category is an enumeration class feature, extracting an enumeration value from the product description as the feature keyword.
[0032] When it is identified that the feature category is a range class feature, summarizing all feature regions corresponding to the product description to obtain the feature keyword.
[0033] To solve the above technical problems, the embodiment of the present application further provides a product recommendation model testing method based on the test set generated by the product recommendation test set generation method described above, which adopts the following technical scheme:
[0034] Further, after the step of combining the preset rule and generating the test set based on the product feature relationship matrix, the method comprises:
[0035] obtaining a current test sample in the test set;
[0036] taking the current test sample as the input of the product recommendation model, and outputting a current recommended product;
[0037] traversing the product feature relationship matrix to determine whether the current recommended product meets the product feature relationship matrix;
[0038] If not, marking the current test.
[0039] Further, after the marking of the current test, the method further comprises the following steps:
[0040] updating the rule of the generalization processing based on the marked current test;
[0041] Repeat the generalization processing of at least part of the feature keywords based on the updated generalization processing rule to obtain generalized feature keywords; update the category-feature correspondence relationship based on the generalized feature keywords; generate a new product-feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship; and generate a test set based on the product-feature relationship matrix in combination with a preset rule to obtain an updated test set.
[0042] To solve the above technical problems, the embodiments of the present application also provide a product recommendation test set generation device, which adopts the following technical solution:
[0043] A product recommendation test set generation device comprises:
[0044] A description acquisition module is configured to acquire product descriptions of products.
[0045] A category division module is configured to divide feature categories to which the product descriptions belong, and generate a product category correspondence relationship about the product descriptions and the feature categories.
[0046] A feature extraction module is configured to extract feature keywords from the product descriptions based on the feature categories, and generate a category-feature correspondence relationship about the feature categories and the feature keywords.
[0047] A generalization processing module is configured to perform generalization processing on at least part of the feature keywords to obtain generalized feature keywords, and update the category-feature correspondence relationship based on the generalized feature keywords.
[0048] A matrix generation module is configured to generate a product-feature relationship matrix about the products and the updated feature keywords based on the product category correspondence relationship and the updated category-feature correspondence relationship.
[0049] A sample generation module is configured to generate a test set based on the product-feature relationship matrix in combination with a preset rule.
[0050] To solve the above technical problems, the embodiments of the present application also provide a product recommendation model testing device for testing sets generated by the product recommendation test set generation method, which adopts the following technical solution:
[0051] A product recommendation model testing device for testing sets generated by the product recommendation test set generation method comprises:
[0052] A sample acquisition module is configured to acquire a current test sample in the test set.
[0053] a product recommendation module, configured to input the current test sample into the product recommendation model as an input, and output a current recommended product;
[0054] a relationship judgment module, configured to traverse the product feature relationship matrix, and determine whether the current recommended product meets the product feature relationship matrix;
[0055] a test marking module, configured to mark the current test if the current recommended product does not meet the product feature relationship matrix.
[0056] To solve the above technical problems, the embodiment of the application further provides a computer device, which adopts the following technical scheme:
[0057] A computer device, comprising a memory and a processor, the memory stores computer readable instructions, and the processor executes the computer readable instructions to realize the steps of the product recommendation test set generation method of any one of the above.
[0058] To solve the above technical problems, the embodiment of the application further provides a computer readable storage medium, which adopts the following technical scheme:
[0059] A computer readable storage medium, the computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by the processor to realize the steps of the product recommendation test set generation method of any one of the above.
[0060] Compared with the prior art, the embodiment of the application has the following beneficial effects:
[0061] The embodiment of the application divides the feature categories of the product description, extracts feature keywords from the product description based on the feature categories, generalizes the feature keywords, obtains the product feature relationship matrix of the related product and the generalized feature keywords, automatically generates the test set based on the relationship matrix and in combination with the preset rules, reduces the labor cost, and in addition, generating the test set based on the product feature relationship matrix of the generalized feature keywords can expand the coverage range of the test set and improve the diversity of the test cases, which is beneficial to enhancing the recommendation quality of the product recommendation model tested based on the test set and improving the recommendation effect. BRIEF DESCRIPTION OF DRAWINGS
[0062] To more clearly illustrate the schemes in the application, the following will briefly introduce the drawings needed in the description of the embodiments of the application. Obviously, the drawings in the following description are some embodiments of the application, and other drawings can be obtained by those skilled in the art without any creative effort on the basis of these drawings.
[0063] Figure 1 is an exemplary system architecture diagram to which the application can be applied;
[0064] Figure 2 a flow chart of one embodiment of a product recommendation test set generation method according to the present application;
[0065] Figure 3 is Figure 2 a flow chart of one embodiment of a product recommendation test set generation method according to the present application;
[0066] Figure 4 is a structural diagram of one embodiment of a product recommendation test set generation apparatus according to the present application;
[0067] Figure 5 is a structural diagram of one embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0068] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs; the terminology used in the description herein is for describing particular embodiments only and is not intended to be limiting of the application; the description and claims herein and the above description of drawings herein utilize terms such as "including" and "having" and variations thereof that are intended to be broad and encompass the terms "consisting of" and "consisting essentially of." The terms "first," "second," and the like, as used herein do not denote any order, quantity, or importance, but rather are used to distinguish one element from another.
[0069] Reference herein to "an embodiment" means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the application. The appearances of the phrase "in an embodiment" in various places in the specification are not necessarily all referring to the same embodiment, nor are they necessarily all directed to the same embodiment, or to a single alternative embodiment.
[0070] For better understanding of the present application, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings.
[0071] As Figure 1 shown, the system architecture 100 can include terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 serves as a medium to provide communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 can include various connection types, such as wired, wireless communication links, or fiber optic cables, etc.
[0072] The user can use the terminal devices 101, 102, and 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 101, 102, and 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0073] The terminal devices 101, 102, and 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smartphones, tablet computers, e-book readers, MP3 (Moving Picture Experts Group Audio Layer III) players, MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0074] The server 105 can be a server providing various services, such as a background server providing support for pages displayed on the terminal devices 101, 102, and 103.
[0075] It should be noted that the product recommendation test set generation method provided by the embodiments of the present application is generally executed by a server / terminal device, and accordingly, the product recommendation test set generation apparatus is generally provided in a server / terminal device.
[0076] It should be understood that Figure 1 The number of terminal devices, networks, and servers in
[0077] With reference to Figure 2 , a flowchart of one embodiment of the product recommendation test set generation method according to the present application is shown. The product recommendation test set generation method of the embodiments of the present application includes the following steps:
[0078] Step S201: Obtain product description of a product.
[0079] In the present embodiment, the product recommendation test set generation method runs on an electronic device (for example, a server or a terminal device) as shown in Figure 1 Server / terminal device The preset product-related product descriptions can be obtained through wired connection or wireless connection. It should be noted that the wireless connection can include, but is not limited to, 3G / 4G / 5G connection, Wi-Fi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra-wideband) connection, and other now known or future developed wireless connection modes.
[0080] In an embodiment, the product content description document of each financial product (such as insurance or fund) feature, performance, price, and / or applicable population, etc. can be obtained from the memory or server according to a preset address. For example, product: student insurance; product description document content: affordable for students, cost 200 yuan / year.
[0081] In step S202, the feature categories to which the product descriptions belong are divided, and the product category corresponding relationship about the product descriptions and the feature categories is generated.
[0082] Specifically, the feature division can be based on a preset classification algorithm or various now available or future developed methods such as artificial intelligence, based on the product description related content.
[0083] Each product description can correspond to one feature category, or can correspond to multiple feature categories, all of which belong to the protection scope of the present application.
[0084] The feature categories can be pre-set as needed, for example, the feature categories can be pre-set to include description category features, enumeration category features, range category features, etc.
[0085] In the embodiments of the present application, the product category relationship list can be constructed based on each product and the feature category to which the product belongs.
[0086] According to the above description, it is assumed that there are three products product 1, product 2, and product 3, and three features feature 1, feature 2, and feature 3 are respectively description category features, enumeration category features, and range category features (feature 3 is empty in this example, indicating no range limitation). The above category feature corresponding relationship can be shown in Table 1:
[0087]
[0088] Table 1
[0089] In step S203, the feature keywords are extracted from the product descriptions based on the feature categories, and the category feature corresponding relationship about the feature categories and the feature keywords is generated.
[0090] In the embodiments of the present application, based on different feature categories, corresponding methods can be used to extract keywords. The following will take the description class feature, enumeration class feature, and range class feature as examples to describe the keyword extraction process.
[0091] In some optional implementations, when the feature category is a description class feature, the step 203 of extracting feature keywords from the product description based on the feature category can include the following steps:
[0092] identifying the feature category;
[0093] performing word segmentation on the product description to obtain a word segmentation list when the feature category is identified as a description class feature;
[0094] removing irrelevant words in the word segmentation list to obtain feature keywords.
[0095] In the embodiments of the present application, the product description can be segmented using a word segmentation technique to extract a word segmentation list: [key1, key2, key3,..], and data cleaning is performed to remove irrelevant words. For example, a product feature description is “200 yuan / year, affordable price for students”, using the word segmentation technique, the feature keyword list is obtained: [‘00 yuan / year’, ‘student’], and in this type of feature, the product has one or more feature keywords.
[0096] extracting enumeration values as feature keywords when the feature category is identified as an enumeration class feature.
[0097] In the embodiments of the present application, enumeration values can be extracted as feature keywords to obtain a keyword list: [keyA, keyB, keyC,..]. For example, the product is classified as: finance, fund, and the feature list is [‘finance’, ‘fund’].
[0098] It should be noted that each product has at most one feature value, and when the feature value is empty, it means that the product does not have the feature.
[0099] summarizing all feature regions corresponding to the product description to obtain feature keywords when the feature category is identified as a range class feature.
[0100] In the embodiments of the present application, a certain product feature description can be a certain range. For range type features, all range intervals are summarized to obtain key values. For example, the applicable age range of product 1 is 20-60 years old, and the applicable age range of product 2 is 1-18 years old. The product feature table is obtained as [<1, [1, 18], (18, 20), [20, 60], >60]. For this type of feature, there are two cases when the feature value is empty. One is that all ranges are satisfied, that is, not limited by the range, and all feature values are possessed. The other case is that the value is empty, which means that all ranges are not satisfied. In the feature key extraction process, the actual product recommendation scene is combined.
[0101] In an optional embodiment, the category-feature correspondence relationship about the feature category and the feature key can be a category-feature list.
[0102] Continuing with the previous example, the feature keys corresponding to each feature category in Table 1 are summarized to obtain a category-feature list, as shown in Table 2:
[0103]
[0104] Table 2
[0105] In the embodiments of the present application, by identifying feature categories, feature keys are extracted from product descriptions for different categories of features. The long description language for a product can be effectively split into multiple feature keys. Subsequent generalization processing based on the feature keys can restore the description of the product with a wider range.
[0106] In step S204, at least part of the feature keys are subjected to generalization processing to obtain generalized feature keys, and the category-feature correspondence relationship is updated based on the generalized feature keys.
[0107] The generalization processing refers to the generalization of the meaning of each feature key (for range type features, generalization processing is usually not performed because they represent a certain range). Approximate feature keys with similar meanings are included to adapt to more user questions. For example, after generalization processing, “affordable price” can obtain “affordable price”, “low price” and “cheap price” and the like.
[0108] In an embodiment, the generalization processing of the feature keys in step S204 can include the following method steps:
[0109] A preset generalization threshold parameter is obtained.
[0110] At least part of the feature keys are subjected to generalization processing based on the generalization threshold parameter.
[0111] A range value threshold is set for controlling the number of generated generalized words. Assuming that the generalization threshold is set to 3, 3 generalized words are generated for each feature keyword, as shown in Table 3 below:
[0112]
[0113]
[0114] Table 3
[0115] The embodiments of the present application can enhance the verification effect by generalizing the meaning of at least part of the feature keywords based on the generalization threshold parameter, simulate the diversity of user questions, and help to enhance the recommendation quality of the product recommendation model tested based on the test set, and improve the recommendation effect.
[0116] In step S205, a product feature relationship matrix about products and feature keywords is generated based on the product category correspondence relationship and the updated category feature correspondence relationship.
[0117] In an optional embodiment, the step S205 of generating a product feature relationship matrix based on the product category correspondence relationship and the category feature correspondence relationship can include the following method steps:
[0118] Based on the product category correspondence relationship, at least one feature category corresponding to each product is extracted.
[0119] For example, as shown in Table 1, “product 1” corresponds to “feature1”, “feature2” and “feature3” three feature categories.
[0120] Based on the updated feature category correspondence relationship, at least one generalized feature keyword corresponding to each feature category is extracted.
[0121] For example, as shown in Table 1, “product 1” corresponds to “feature1”, “feature2” and “feature3” three feature categories.
[0122] Based on the feature category, a product feature relationship matrix of each generalized feature keyword and at least one single feature corresponding to the product is constructed.
[0123] For example, as shown in Table 4, “key1” corresponds to “product 1”, “key2” corresponds to “product2” and “product3”.
[0124] The single feature product feature relationship matrix is taken as the product feature relationship matrix.
[0125]
[0126] Table 4
[0127] In Table 4, "0" indicates that the feature keyword in each row does not correspond to one or more products listed in each column, while "1" indicates that the feature keyword in each row corresponds to one or more products listed in each column. For example, the feature keyword "key1" corresponds to "product1".
[0128] In this embodiment, based on feature categories, a correspondence is established between each generalized feature keyword and at least one product, thereby forming a single-feature product feature relationship matrix. In this single-feature product feature relationship matrix, each generalized feature keyword may correspond to one product, or it may correspond to different products.
[0129] This application embodiment constructs a single-feature product feature relationship matrix, and then reconstructs the user's actual questions based on the single-feature product feature relationship matrix. This helps to enhance the recommendation quality of the product recommendation model obtained from testing this test set and improve the recommendation effect.
[0130] like Figure 3 As shown, Figure 3 3 is Figure 2 A flowchart of a specific implementation of step S205.
[0131] In an optional embodiment, step S205, based on product category correspondence and category feature correspondence, generating a product feature relationship matrix related to products and feature keywords may include the following method steps:
[0132] Step S2052: Generate a single-feature product feature relationship matrix based on the product category correspondence and category feature correspondence.
[0133] Step S2054: Obtain the preset number of feature combinations.
[0134] Step S2056: Combine feature keywords based on quantity parameters to obtain multi-feature keywords.
[0135] For example, features can be automatically combined using the Cartesian product algorithm to obtain multi-feature keywords. Subsequently, a test set can be generated based on these multi-feature keywords to strengthen the validation of the product recommendation model.
[0136] Specifically, a parameter r can be specified as the number of feature combinations, and this parameter r can be set randomly according to the actual situation. For example, in feature classification, descriptive features can have multiple feature keywords at the same time, and different feature keywords under this feature category can also be combined.
[0137] Step S2058, converting the single-feature product feature relationship matrix into a multi-feature product feature relationship matrix based on the multi-feature keywords.
[0138] For example, set r = 2, and combine the feature keywords two by two to generate a product multi-feature relationship matrix (for example, only show the combination of key1 and keyA with other feature keywords), as shown in Table 5:
[0139]
[0140]
[0141] Table 5
[0142] Step 2060, combining the single-feature product feature relationship matrix and the multi-feature product feature relationship matrix to obtain the product feature relationship matrix.
[0143] The embodiments of the present application can further expand the coverage of the test set, improve the diversity of test cases, better restore the real user questions, and be beneficial to further enhance the recommendation quality of the product recommendation model tested based on the test set, and improve the recommendation effect.
[0144] Step 206 combines the preset rules to generate a test set based on the product feature relationship matrix.
[0145] In the embodiments of the present application, the test set generation template can be developed in combination with the preset rules (for example, adding subject-predicate-object and the like), and sentences can be generated according to the feature keywords and the generalized feature keywords to simulate real user questions and automatically produce a single-feature test set.
[0146] The embodiments of the present application divide the product description into feature categories, extract feature keywords from the product description based on the feature categories, and generalize the feature keywords to obtain a product feature relationship matrix related to the product and the generalized feature keywords. Based on the relationship matrix, the test set is automatically generated in combination with the preset rules to reduce the labor cost. In addition, the product feature relationship matrix based on the generalized feature keywords can expand the coverage of the test set, improve the diversity of test cases, and be beneficial to enhance the recommendation quality of the product recommendation model tested based on the test set, and improve the recommendation effect.
[0147] In an optional embodiment, after step 206 combines the preset rules to generate a test set based on the product feature relationship matrix, the product recommendation test set generation method of the embodiments of the present application can further include the following steps:
[0148] Obtain the current test sample in the test set.
[0149] taking the current test sample as an input of the product recommendation model, and outputting a current recommended product.
[0150] traversing the product feature relationship matrix to determine whether the current recommended product meets the product feature relationship matrix.
[0151] If not, marking the current test.
[0152] In the embodiments of the present application, the product feature relationship matrix is traversed to check whether the current recommended product meets the product feature corresponding relationship of Table 4 and / or Table 5. If not, it is marked. Subsequently, after the test is completed, the test results can be analyzed by manual and improved. For example, if it is analyzed that the product recommendation model may have a problem, the training samples can be further enriched to optimize the product recommendation model parameters; or the test set itself may have a problem, and the test set can be improved.
[0153] The embodiments of the present application divide the product description into feature categories, extract feature keywords from the product description based on the feature categories, and generalize the feature keywords to obtain a product feature relationship matrix about the product and the generalized feature keywords. Based on the relationship matrix, a test set is automatically generated in combination with a preset rule, thereby reducing the labor cost. In addition, the product feature relationship matrix based on the generalized feature keywords generates the test set, which can expand the coverage range of the test set and improve the diversity of the test cases. Using the test set for testing the product recommendation model is conducive to enhancing the recommendation quality of the product recommendation model tested based on the test set and improving the recommendation effect.
[0154] In an optional embodiment, after step 304, if the current test does not meet the requirements, the product recommendation test set generation method of the embodiments of the present application can further include the following steps:
[0155] Based on the marked current test, updating the generalization processing rule.
[0156] In the embodiments of the present application, the generalization processing rule can be improved based on the analysis result. For example, if the threshold parameter of the generalization preset is too small, more keywords with approximate word meaning can be included in the feature keywords by increasing the threshold parameter.
[0157] The method steps of repeating the generalization processing of at least part of the feature keywords based on the updated generalization processing rule to obtain generalized feature keywords, updating the category feature corresponding relationship based on the generalized feature keywords, generating a new product feature relationship matrix based on the product category corresponding relationship and the updated category feature corresponding relationship, and generating a test set based on the product feature relationship matrix in combination with a preset rule are performed to obtain an updated test set.
[0158] The embodiments of the present application update the generalization processing rules, and re-perform generalization processing on at least part of the feature keywords according to the updated generalization processing rules, so that the test set can better test the product recommendation model, thereby better improving the final recommendation effect.
[0159] The embodiments of the present application can acquire and process related data based on artificial intelligence technology. Artificial intelligence (AI) is the theory, method, technology and application system for simulating, extending and expanding human intelligence by using a digital computer or a machine controlled by a digital computer, perceiving the environment, acquiring knowledge and using the knowledge to obtain the best results.
[0160] The artificial intelligence basic technology generally includes technologies such as sensors, special artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction system, mechatronics, etc. The artificial intelligence software technology mainly includes computer vision technology, robot technology, biometric technology, speech processing technology, natural language processing technology, and machine learning / deep learning, etc.
[0161] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by computer readable instructions instructing related hardware, and the computer readable instructions can be stored in a computer readable storage medium. When the program is executed, it can include the processes of the above-mentioned embodiments of each method. The storage medium can be a non-volatile storage medium such as a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).
[0162] It should be understood that, although each step in the flowchart of the accompanying drawings is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and they can be executed in other orders. Moreover, at least part of the steps in the flowchart of the accompanying drawings can include multiple sub-steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence is not necessarily sequential, but can be alternately or alternately executed with at least part of other steps or sub-steps or stages of other steps.
[0163] Further reference Figure 4 , as to the above Figure 2The implementation of the method shown in this application provides an embodiment of a test set generation device for product recommendation, which is similar to... Figure 2 Corresponding to the method embodiments shown, this device can be specifically applied to various electronic devices.
[0164] like Figure 4 As shown, the product recommendation test set generation device 400 of this application embodiment includes: a description acquisition module 401, a category division module 402, a feature extraction module 403, a generalization processing module 404, a matrix generation module 405, and a sample generation module 406. Wherein:
[0165] Description acquisition module 401 is used to acquire the product description of the product;
[0166] The category segmentation module 402 is used to segment the feature categories to which the product description belongs and generate the product category correspondence between the product description and the feature category;
[0167] The feature extraction module 403 is used to extract feature keywords from the product description based on feature categories and generate a category feature correspondence between feature categories and feature keywords;
[0168] The generalization processing module 404 is used to perform generalization processing on at least some of the feature keywords to obtain generalized feature keywords, and update the category feature correspondence based on the generalized feature keywords.
[0169] The matrix generation module 405 is used to generate a product feature relationship matrix of products and feature keywords based on the product category correspondence and the updated category feature correspondence.
[0170] The sample generation module 406 is used to generate a test set based on the product feature relationship matrix by combining preset rules.
[0171] This application embodiment divides product descriptions into feature categories, extracts feature keywords from product descriptions based on feature categories, and then generalizes the feature keywords to obtain a product feature relationship matrix of related products and generalized feature keywords. Based on this relationship matrix, a test set is automatically generated in combination with preset rules, reducing manual costs. In addition, generating a test set based on the product feature relationship matrix of generalized feature keywords can expand the coverage of the test set, improve the diversity of test cases, and help enhance the recommendation quality of the product recommendation model obtained based on this test set, thereby improving the recommendation effect.
[0172] In some optional implementations of this embodiment, the generalization processing module 404 includes:
[0173] The parameter acquisition submodule is used to obtain the preset generalization threshold parameter;
[0174] The generalization processing submodule is configured to perform generalization processing on the feature keywords based on a generalization threshold parameter.
[0175] The keyword is generalized through generalization processing, which can enhance the verification effect, simulate user questioning diversity, and is conducive to enhancing the recommendation quality of the product recommendation model tested based on the test set and improving the recommendation effect.
[0176] In some optional implementations of the embodiment, the matrix generation module 405 includes:
[0177] The first generation submodule is configured to generate a single-feature product feature relationship matrix based on a product category correspondence and an updated category feature correspondence.
[0178] The parameter acquisition submodule is configured to acquire a preset quantity parameter of feature combinations.
[0179] The feature combination submodule is configured to combine feature keywords based on the quantity parameter to obtain multi-feature keywords.
[0180] The matrix conversion submodule is configured to convert the single-feature product feature relationship matrix into a multi-feature product feature relationship matrix based on the multi-feature keywords.
[0181] The matrix generation submodule is configured to combine the single-feature product feature relationship matrix and the multi-feature product feature relationship matrix to obtain a product feature relationship matrix.
[0182] The embodiment generates a multi-feature product feature relationship matrix based on multi-feature combinations, which is combined with a single-feature product feature relationship matrix, can further expand the coverage of the test set, improve the diversity of test cases, better restore real user questions, and is conducive to further enhancing the recommendation quality of the product recommendation model tested based on the test set and improving the recommendation effect.
[0183] In some optional implementations of the embodiment, the matrix generation module 405 includes:
[0184] The category extraction submodule is configured to extract at least one feature category corresponding to each product based on the product category correspondence.
[0185] The feature extraction submodule is configured to extract at least one generalized feature keyword corresponding to each feature category based on the updated feature category correspondence.
[0186] The matrix construction submodule is configured to construct a single-feature product feature relationship matrix corresponding to each generalized feature keyword and at least one product based on the feature category.
[0187] A matrix determination sub-module is configured to determine the product feature relationship matrix of the single feature as the product feature relationship matrix.
[0188] The product feature relationship matrix of the single feature is generated based on the combination of the single features, and the product feature relationship matrix of the single feature is combined, and then the real question of the user is restored based on the product feature relationship matrix of the single feature, which is beneficial to enhancing the recommendation quality of the product recommendation model obtained by testing the test set, and improving the recommendation effect.
[0189] In some optional implementation manners of the embodiment, the feature extraction module 403 comprises:
[0190] A category recognition sub-module is configured to recognize the feature category.
[0191] A word segmentation extraction sub-module is configured to, when the feature category is recognized as a description category feature, perform word segmentation extraction on the product description to obtain a word segmentation list, and remove the words irrelevant to the product in the word segmentation list to obtain the feature keyword.
[0192] A feature enumeration sub-module is configured to, when the feature category is recognized as an enumeration category feature, extract the enumeration value from the product description as the feature keyword.
[0193] A region extraction sub-module is configured to, when the feature category is recognized as a range category feature, aggregate all feature regions corresponding to the product description to obtain the feature keyword.
[0194] The embodiment of the application extracts the feature keyword from the product description according to different categories of features by recognizing the feature category, can effectively split the description language of a long product into multiple feature keywords, and can obtain a description of a wider product by generalization processing based on the feature keyword.
[0195] In some optional implementation manners of the embodiment, the product recommendation test set generation apparatus 400 can further comprise:
[0196] A sample acquisition module is configured to acquire a current test sample in the test set.
[0197] A product recommendation module is configured to take the current test sample as the input of the product recommendation model, and output a current recommended product.
[0198] A relationship judgment module is configured to traverse the product feature relationship matrix, and judge whether the current recommended product satisfies the product feature relationship matrix.
[0199] A test marking module is configured to mark the current test if the current recommended product does not satisfy the product feature relationship matrix.
[0200] The product feature relationship matrix about the product and the generalized feature keywords is obtained by dividing feature categories from the product description, extracting feature keywords from the product description based on the feature categories, and generalizing the feature keywords. Based on the relationship matrix, the test set is automatically generated combined with the preset rules, thereby reducing the labor cost. In addition, the test set generated based on the product feature relationship matrix of the generalized feature keywords can expand the coverage range of the test set and improve the diversity of the test cases. The test set is used for testing the product recommendation model, which is conducive to enhancing the recommendation quality of the product recommendation model tested based on the test set and improving the recommendation effect.
[0201] In some optional implementation manners of the embodiment, the product recommendation test set generation apparatus 400 can further include:
[0202] The generalization updating module is configured to update the generalization processing rule based on the labeled current test.
[0203] The step repeating module is configured to repeat the generalization processing of at least part of the feature keywords based on the updated generalization processing rule to obtain the generalized feature keywords, update the category-feature correspondence relationship based on the generalized feature keywords, generate a new product feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship, and generate the test set based on the product feature relationship matrix combined with the preset rule to obtain the updated test set.
[0204] The embodiment of the application updates the generalization processing rule, and re-generalizes at least part of the feature keywords based on the updated generalization processing rule, so that the test set is more applicable to the testing of the product recommendation model, thereby better improving the final recommendation effect.
[0205] To solve the above technical problems, the embodiment of the application further provides a computer device. For details, please refer to Figure 5 , Figure 5 The basic structure block diagram of the computer device of the embodiment is shown in FIG. 1.
[0206] The computer device 6 includes a memory 61, a processor 62, and a network interface 63, which are communicatively connected by a system bus. It should be noted that only the computer device 6 with components 61-63 is shown in the figure, but it should be understood that all the shown components are not required to be implemented, and more or fewer components can be alternatively implemented. Among them, those skilled in the art can understand that the computer device herein is a device capable of automatically performing numerical calculation and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), digital signal processors (DSPs), embedded devices, etc.
[0207] The computer device can be a desktop computer, a notebook computer, a palm computer, a cloud server, and the like. The computer device can interact with the user through a keyboard, a mouse, a remote controller, a touchpad, a voice control device, and the like.
[0208] The memory 61 includes at least one type of readable storage medium, which includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., an SD or DX memory, etc.), a random access memory (RAM), a static random access memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the memory 61 can be an internal storage unit of the computer device 6, such as a hard disk or a memory of the computer device 6. In other embodiments, the memory 61 can also be an external storage device of the computer device 6, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, and the like. Of course, the memory 61 can include both the internal storage unit and the external storage device of the computer device 6. In the present embodiment, the memory 61 is generally used to store an operating system and various application software installed in the computer device 6, such as computer readable instructions of the product recommendation test set generation method, and the like. In addition, the memory 61 can also be used to temporarily store various data that have been output or will be output.
[0209] The processor 62 may, in some embodiments, be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip. The processor 62 is generally used to control the overall operation of the computer device 6. In the present embodiment, the processor 62 is used to run computer readable instructions or process data stored in the memory 61, such as computer readable instructions of the test set generation method for product recommendation.
[0210] The network interface 63 can include a wireless network interface or a wired network interface, and is generally used to establish a communication connection between the computer device 6 and other electronic devices.
[0211] The embodiments of the present application divide the product description into feature categories, extract feature keywords from the product description based on the feature categories, and then generalize the feature keywords to obtain a product feature relationship matrix related to the product and the generalized feature keywords. Based on the relationship matrix, a test set is automatically generated in combination with a preset rule, which reduces the labor cost. In addition, the test set generated based on the product feature relationship matrix of the generalized feature keywords can expand the coverage range of the test set and improve the diversity of the test cases, which is conducive to enhancing the recommendation quality of the product recommendation model tested based on the test set and improving the recommendation effect.
[0212] The present application also provides another implementation, that is, a computer readable storage medium storing computer readable instructions, which can be executed by at least one processor to enable the at least one processor to perform the steps of the test set generation method for product recommendation as described above.
[0213] The embodiments of the present application divide the product description into feature categories, extract feature keywords from the product description based on the feature categories, and then generalize the feature keywords to obtain a product feature relationship matrix related to the product and the generalized feature keywords. Based on the relationship matrix, a test set is automatically generated in combination with a preset rule, which reduces the labor cost. In addition, the test set generated based on the product feature relationship matrix of the generalized feature keywords can expand the coverage range of the test set and improve the diversity of the test cases, which is conducive to enhancing the recommendation quality of the product recommendation model tested based on the test set and improving the recommendation effect.
[0214] Those skilled in the art can clearly understand the above-mentioned embodiment method can be realized by means of software and the necessary general hardware platform, of course, it can also be realized by hardware, but in many cases, the former is a better embodiment. Based on such understanding, the technical solutions of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes a plurality of instructions for making a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) execute the method of each embodiment of the present application.
[0215] Obviously, the above-described embodiments are only some of the embodiments of the present application, not all the embodiments, and the drawings show the preferred embodiments of the present application, but do not limit the patent scope of the present application. The present application can be implemented in many different forms, and conversely, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive. Although the present application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions recorded in the foregoing specific embodiments, or make equivalent replacements to some of the technical features. Any equivalent structure made by using the content of the specification and drawings, directly or indirectly applied to other related technical fields, is also within the scope of the patent protection of the present application.
Claims
1. A method for generating a test set for product recommendation, characterized in that, The method comprises the following steps: obtaining a product description of a product; dividing a feature category to which the product description belongs, and generating a product category correspondence relationship about the product description and the feature category; extracting a feature keyword from the product description based on the feature category, and generating a category-feature correspondence relationship about the feature category and the feature keyword; generating a product-feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship; generating a test set based on the product-feature relationship matrix in combination with a preset rule; wherein the generating of the product-feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship comprises the following steps: generating a single-feature product-feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship; obtaining a preset number parameter of feature combinations; combining feature keywords based on the number parameter to obtain multi-feature keywords; converting the single-feature product-feature relationship matrix into a multi-feature product-feature relationship matrix based on the multi-feature keywords; obtaining the product-feature relationship matrix in combination with the single-feature product-feature relationship matrix and the multi-feature product-feature relationship matrix; or, the generating of the product-feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship comprises the following steps: generating a single-feature product-feature relationship matrix based on the product category correspondence relationship and the updated category-feature correspondence relationship; extracting at least one feature category corresponding to each product based on the product category correspondence relationship; extracting at least one generalized feature keyword corresponding to each feature category based on the updated category-feature correspondence relationship; constructing a product-feature relationship matrix of the single feature corresponding to each generalized feature keyword and at least one product based on the feature category; taking the single-feature product-feature relationship matrix as the product-feature relationship matrix. The generalization processing of the feature keyword comprises the following steps:
2. The product recommendation test set generation method according to claim 1, wherein, obtaining a preset generalization threshold parameter; generalizing the feature keyword based on the generalization threshold parameter. The extracting of the feature keyword from the product description based on the feature category comprises the following steps:
3. The test set generation method of product recommendation according to claim 1 or 2, characterized in that, identifying the feature category; when it is identified that the feature category is a description category feature, performing word segmentation extraction on the product description to obtain a word segmentation list, and removing a word segmentation irrelevant to the product from the word segmentation list to obtain the feature keyword; when it is identified that the feature category is an enumeration category feature, extracting an enumeration value from the product description as the feature keyword; when it is identified that the feature category is a range category feature, summarizing all feature regions corresponding to the product description to obtain the feature keyword. After the step of generating the test set based on the product-feature relationship matrix in combination with the preset rule, the method further comprises:
4. The product recommendation test set generation method according to claim 1, characterized in that, Obtaining a current test sample in the test set; Taking the current test sample as an input of a product recommendation model, outputting a current recommended product; Traversing the product feature relationship matrix to determine whether the current recommended product meets the product feature relationship matrix; If not, marking the current test.
5. The product recommendation test set generation method according to claim 1, wherein, After marking the current test, the method further comprises the following steps: Based on the marked current test, updating the generalization processing rule; Using the updated generalization processing rule, repeating the generalization processing of at least part of the feature keywords to obtain the generalized feature keywords; updating the category-feature correspondence based on the generalized feature keywords, and regenerating a new product feature relationship matrix to obtain an updated test set. 6.A product recommendation test set generation device characterized by comprising: Comprise: A product description acquisition module is configured to acquire a product description of a product; A category division module is configured to divide a feature category to which the product description belongs; A product category correspondence generation module is configured to generate a product category correspondence related to the product description and the feature category; A feature extraction module is configured to extract a feature keyword from the product description based on the feature category; and a category-feature correspondence generation module is configured to generate a category-feature correspondence related to the feature category and the feature keyword; A generalization processing module is configured to perform generalization processing on at least part of the feature keywords to obtain generalized feature keywords, and update the category-feature correspondence based on the generalized feature keywords; A matrix generation module is configured to generate a product feature relationship matrix related to the product and the updated feature keywords based on the product category correspondence and the category-feature correspondence; A sample generation module is configured to generate a test set based on the product feature relationship matrix in combination with a preset rule; The matrix generation module comprises: A first generation sub-module is configured to generate a single-feature product feature relationship matrix based on the product category correspondence and the updated category-feature correspondence; A parameter acquisition sub-module is configured to acquire a preset number parameter of feature combinations; A feature combination sub-module is configured to combine feature keywords based on the number parameter to obtain multi-feature keywords; A matrix conversion sub-module is configured to convert the single-feature product feature relationship matrix into a multi-feature product feature relationship matrix based on the multi-feature keywords; A matrix generation sub-module is configured to combine the single-feature product feature relationship matrix and the multi-feature product feature relationship matrix to obtain the product feature relationship matrix. Alternatively, the matrix generation module further comprises: A first generation sub-module is configured to generate a single-feature product feature relationship matrix based on the product category correspondence and the updated category-feature correspondence; A category extraction sub-module is configured to extract at least one feature category corresponding to each product based on the product category correspondence; A feature extraction sub-module is configured to extract at least one generalized feature keyword corresponding to each feature category based on the updated category-feature correspondence; A matrix construction sub-module is configured to construct a product feature relationship matrix of at least one single feature corresponding to each generalized feature keyword and at least one product based on the feature category. A matrix determining submodule is configured to take the product feature relationship matrix of the single feature as the product feature relationship matrix.
7. A computer device, characterized by The product recommendation test set generation method comprises the steps of: a product feature relationship matrix is determined according to a product feature relationship matrix of a single feature; a product feature relationship matrix of a product is determined according to the product feature relationship matrix of the single feature; and a product recommendation test set is generated according to the product feature relationship matrix of the product.
8. 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 the processor to implement the steps of the product recommendation test set generation method according to any one of claims 1 to 5. The computer readable storage medium stores computer readable instructions, and the computer readable instructions are executed by the processor to implement the steps of the product recommendation test set generation method according to any one of claims 1 to 5.
Citation Information
Patent Citations
Product recommendation method and device, equipment and computer readable storage medium
CN113888265A