Commodity map vectorization method and device, electronic equipment and storage medium

By constructing a product graph that includes user, product, and category dimensions, and using a self-attention mechanism and word2vec model to learn the vector representation of the product graph, the problems of data noise and sparsity in the product domain are solved, thereby improving the accuracy of product recommendation and search.

CN114036246BActive Publication Date: 2025-10-24BEIJING GUODIAN UNITED BUSINESS NETWORK CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202111480886.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-06
Publication Date
2025-10-24
Estimated Expiration
2041-12-06

AI Technical Summary

Technical Problem

Existing knowledge graph embedding models perform poorly in recommendation and search tasks in the product domain, mainly due to noise and sparsity issues in product graph data.

Method used

We construct a product graph that includes user, product, and category dimensions. Utilizing e-commerce platform data and user interaction data, we learn the vector representation of the product graph through a self-attention mechanism and a word2vec model. We then optimize the model to adapt to product recommendation, search, and graph completion tasks.

Benefits of technology

It improves the accuracy of recommendations and searches in the product domain, solves the problems of data noise and sparsity, and enhances the application effect of product graphs in these tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114036246B_ABST
    Figure CN114036246B_ABST
Patent Text Reader

Abstract

The present disclosure provides a commodity graph vectorization method and device, electronic equipment and storage medium, and relates to the technical field of knowledge graph. The method comprises: constructing a commodity graph, wherein the commodity graph at least contains entity relationships in the following dimensions: user dimension, commodity dimension and category dimension; learning vector representation of entity relationships in the commodity graph according to commodity data and user interaction data collected from an e-commerce platform to obtain a commodity graph vectorization representation model. The present disclosure can obtain a commodity graph vectorization representation model suitable for the commodity field. Based on the commodity graph vectorization model, tasks such as commodity recommendation, commodity search and graph completion in the commodity field can be realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present disclosure relates to the technical field of knowledge graph, and particularly relates to a commodity graph vectorization method and device, electronic equipment and storage medium. BACKGROUND

[0002] A knowledge graph is a large-scale semantic network knowledge base, adopts a symbolic knowledge representation method, uses triples to describe specific knowledge, and represents and stores the knowledge in the form of a directed graph, and has advantages such as rich semantics, friendly structure, and easy understanding. Due to excellent characteristics in expressing human prior knowledge, the knowledge graph has achieved wide and successful applications in natural language processing, question answering systems, recommendation systems and many other fields in recent years. At present, the definition of triples of the knowledge graph is relatively simple, the relationship between entities is mainly an inheritance relationship or a combination relationship, and there is generally only a text modality, and the semantic relationship is relatively simple.

[0003] Knowledge graph embedding (KGE) learns vector representations of entity relationships in a knowledge base. The knowledge graph embedding model provided in the related art is mostly used in graph completion tasks, and there are two tasks of relationship extraction and intelligent question answering, and the application in the tasks of recommendation and search in the commodity field is less, because the commodity graph data has noise and data sparsity problems.

[0004] It should be noted that the information disclosed in the above background section is only used to strengthen the understanding of the background of the present disclosure, and therefore can include information that does not constitute prior art known to those of ordinary skill in the art. SUMMARY

[0005] The present disclosure provides a commodity graph vectorization method and device, electronic equipment and storage medium, which at least partially overcomes the technical problem that the knowledge graph embedding model provided in the related art is not applicable to commodity graph data.

[0006] Other characteristics and advantages of the present disclosure will become apparent from the following detailed description, or will be learned by practice of the present disclosure.

[0007] According to one aspect of the present disclosure, a commodity graph vectorization method is provided, the method comprising: constructing a commodity graph, wherein the commodity graph at least contains entity relationships in the following dimensions: a user dimension, a commodity dimension and a category dimension; learning vector representations of entity relationships in the commodity graph according to commodity data and user interaction data collected from an e-commerce platform, to obtain a commodity graph vectorization representation model.

[0008] In some embodiments, the entity relationship of the user dimension comprises: co-purchase and co-browsing; the entity relationship of the commodity dimension comprises: similar commodities and commodity description; and the entity relationship of the category dimension comprises: hierarchical relationship of commodity category.

[0009] In some embodiments, the vector representation of the entity relationship in the commodity graph is learned according to the commodity data and the user interaction data collected from the e-commerce platform, to obtain a commodity graph vectorization representation model, comprising: determining the vector representation of similar commodities according to the collected commodity data; using a self-attention mechanism to extract the vector representation of co-purchase, co-browsing, commodity description and hierarchical relationship of commodity category from the collected commodity data and user interaction data.

[0010] In some embodiments, the vector representation of similar commodities is determined according to the collected commodity data, comprising: extracting the commodity title and / or commodity description information of each commodity from the collected commodity data; performing word segmentation on the commodity title and / or commodity description information of each commodity to obtain a word segmentation result; training the word segmentation result using a word2vec model training method to obtain a model file of the word2vec model on the commodity data set; generating the vector representation of each commodity according to the commodity title of each commodity using the model file of the word2vec model on the commodity data set; calculating the similarity between each commodity according to the vector representation of each commodity; and determining similar commodities according to the similarity between each commodity to generate the vector representation of similar commodities.

[0011] In some embodiments, the commodity graph vectorization method provided by the present disclosure further comprises: taking the labeled data of the to-be-executed task as the model output data, and optimizing the parameters of the commodity graph vectorization representation model to obtain a commodity graph vectorization representation model suitable for the to-be-executed task.

[0012] In some embodiments, the to-be-executed task is any one of the following: a commodity knowledge graph completion task, a commodity search ranking task or a commodity recommendation task.

[0013] In some embodiments, the commodity graph vectorization method provided by the present disclosure further comprises: collecting commodity data of the following multiple modalities: text, picture or video.

[0014] According to another aspect of the present disclosure, a commodity graph vectorization device is also provided, comprising: a commodity graph construction module for constructing a commodity graph, wherein the commodity graph at least contains the entity relationship of the following dimensions: user dimension, commodity dimension and category dimension; and a commodity graph vectorization module for learning the vector representation of the entity relationship in the commodity graph according to the commodity data and the user interaction data collected from the e-commerce platform, to obtain a commodity graph vectorization representation model.

[0015] In some embodiments, the entity relationship of the user dimension comprises: co-purchase and co-browsing; the entity relationship of the commodity dimension comprises: similar commodities and commodity descriptions; and the entity relationship of the category dimension comprises: hierarchical relationship of the category to which the commodity belongs.

[0016] In some embodiments, the commodity graph vectorization module is further configured to: determine vector representations of similar commodities based on the collected commodity data; and extract vector representations of co-purchase, co-browsing, commodity descriptions, and hierarchical relationship of the category to which the commodity belongs from the collected commodity data and user interaction data using a self-attention mechanism.

[0017] In some embodiments, the commodity graph vectorization module is further configured to: extract commodity title and / or commodity description information of each commodity from the collected commodity data; perform word segmentation on the commodity title and / or commodity description information of each commodity to obtain a word segmentation result; train the word segmentation result using a word2vec model training method to obtain a model file of the word2vec model on a commodity data set; generate vector representations of each commodity based on the commodity title of each commodity using the model file of the word2vec model on the commodity data set; calculate the similarity between each commodity based on the vector representations of each commodity; and determine similar commodities based on the similarity between each commodity to generate vector representations of the similar commodities.

[0018] In some embodiments, the commodity graph vectorization apparatus provided in the embodiments of the present disclosure further comprises a model optimization module configured to perform parameter optimization on the commodity graph vectorization representation model using labeled data of a to-be-executed task as model output data to obtain a commodity graph vectorization representation model suitable for the to-be-executed task.

[0019] In some embodiments, the to-be-executed task is any one of the following: a commodity knowledge graph completion task, a commodity search ranking task, or a commodity recommendation task.

[0020] In some embodiments, the commodity graph vectorization apparatus provided in the present disclosure further comprises a data collection module configured to collect commodity data in multiple modalities, such as text, pictures, or videos.

[0021] According to another aspect of the present disclosure, an electronic device is also provided, which comprises: a processor; and a memory configured to store executable instructions of the processor; wherein the processor is configured to execute any one of the commodity graph vectorization methods described above by executing the executable instructions.

[0022] According to another aspect of the present disclosure, a computer readable storage medium is also provided, which stores a computer program. The computer program, when executed by a processor, implements the commodity graph vectorization method described above.

[0023] The commodity graph vectorization method, device, electronic device and storage medium provided by the embodiments of the present disclosure can construct a commodity graph containing entity relationships such as user dimension, commodity dimension and category dimension, and then learn vector representations of the entity relationships in the commodity graph according to commodity data and user interaction data collected from an e-commerce platform, so as to obtain a commodity graph vectorization representation model suitable for the commodity field. Based on the commodity graph vectorization model, commodity recommendation, commodity search, graph completion and other tasks in the commodity field can be implemented.

[0024] It should be understood that the foregoing general description and the following detailed description are only exemplary and explanatory, and are not limiting to the present disclosure. BRIEF DESCRIPTION OF DRAWINGS

[0025] The accompanying drawings, which are incorporated into and form part of the specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure. Obviously, the drawings in the following description are only some embodiments of the present disclosure, and other drawings can be obtained according to these drawings without creative labor for those skilled in the art.

[0026] Figure 1 A flowchart of a commodity graph vectorization method in an embodiment of the present disclosure is shown;

[0027] Figure 2 A flowchart of a commodity graph vectorization method in an embodiment of the present disclosure is shown;

[0028] Figure 3 A flowchart of a commodity graph vectorization method in an embodiment of the present disclosure is shown;

[0029] Figure 4 A commodity graph schematic diagram in an embodiment of the present disclosure is shown;

[0030] Figure 5 A flowchart of a commodity graph vectorization method in an embodiment of the present disclosure is shown;

[0031] Figure 6 A flowchart of a commodity graph vectorization method in an embodiment of the present disclosure is shown;

[0032] Figure 7 A flowchart of a commodity graph vectorization method in an embodiment of the present disclosure is shown;

[0033] Figure 8Fig. 1 shows a schematic diagram of a commodity graph vectorization device according to an embodiment of the present disclosure;

[0034] Figure 9 Fig. 2 shows a structural block diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION

[0035] Example implementations are now described with reference to the drawings; however, these implementations are merely examples of implementations and are not intended to limit example implementations in any way. In fact, example implementations described and / or illustrated herein can have multiple possible implementations and can be used in a variety of contexts. Therefore, the specific details outlined in the description below are merely intended to describe example implementations and are not intended to limit example implementations in any way. Other implementations can have many different structures and can be used for many different purposes. Therefore, example implementations described and / or illustrated herein should not be construed as limiting example implementations in any way.

[0036] In addition, the drawings are merely schematic and are not intended to portray proportionality. The same reference numbers in different drawings represent the same or similar elements, and thus their repetitive description will be omitted. Some of the block diagrams shown in the drawings are functional entities, which do not necessarily have to correspond to physically or logically independent entities. These functional entities can be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.

[0037] Freebase: an open-domain knowledge base, including more than 40 million entities, more than 10,000 attribute relationships, and more than 2.4 billion fact triples;

[0038] DBpedia: an open-domain knowledge base, including more than 4 million entities, 48293 attribute relationships, and 1 billion fact triples;

[0039] YAGO: an open-domain knowledge base, including more than 9.8 million entities, more than 100 attribute relationships, and more than 100 million fact triples;

[0040] NLP: English full name for Natural Language Processing, translated as "Natural Language Processing";

[0041] Word2vec: a simple neural network text embedding model;

[0042] Skip-gram: a network structure used to predict subsequent words in the word2vec model;

[0043] KGE: English full name for Knowledge Graph Embedding, translated as "Knowledge Graph Embedding", a vector generation technology based on a knowledge graph;

[0044] BERT: a pre-training language model based on large-scale language information;

[0045] GCN: Graph convolution Network, which means "graph convolution neural network";

[0046] MAP@10: average accuracy of the top 10 results;

[0047] HIT@10: accuracy of all outputs when there is a correct result in the top 10 results;

[0048] NDCG@10: Normalized Discounted cumulative gain, where results with higher relevance scores are given higher scores;

[0049] Pair-wise: set the hinge loss function to calculate the score difference m between correct and incorrect answers, and construct a ranking model to make the loss function output greater than m, and sort the final results.

[0050] Point-wise: treat the ranking problem as a binary classification problem, and sort all results by the highest score.

[0051] KBQA: knowledge graph-based question answering technology;

[0052] TransE / TransR / TransD / TransH: graph vectorization technology, all based on the premise assumption of d = ||h+r-t|| or its derivative form.

[0053] Transformer: an encoder-decoder model based on Attention mechanism, widely used in many NLP tasks including machine translation, and has achieved good results.

[0054] Softmax: a function that normalizes the input features while preserving them.

[0055] The present example embodiment will be described in detail below in conjunction with the accompanying drawings and examples.

[0056] Existing graph embedding technology mostly relies on public graph datasets such as Freebase, DBpedia, and YAGO, and has many applications in NLP tasks such as information extraction, semantic analysis, and intelligent question answering. For general knowledge graph embedding technology, h and t are used to represent the head and tail entities of a triple, and r is used to represent the relationship. It can be summarized as follows:

[0057] In TransE, a distance function is used to learn the relation of triplets:

[0058] d r (h,t)=∑||h+r-t||;

[0059] where ||.|| denotes L1 or L2 norm.

[0060] In TransH, further consider the relation-based entity embedding, for example, to and defined as the entity projection of h and t on the relation hyperplane. The distance on triplets can be defined as:

[0061]

[0062] TransR and TransH have similar ideas, but the difference is that TransR considers the linear subspace of relation constraints. TransD adds more constraints to the linear subspace of relation constraints to achieve higher efficiency.

[0063] Based on the distributed representation of word2vec. W2V uses the Skip-gram model to learn the distributed representation of words, and the score function is defined as the sum of the logarithmic probability on the text S:

[0064] S=∑ i ∑ j∈context(i,c) log p(e i |e j );

[0065] where Context(i,c) represents the neighbor set of entity i in the c window size. Each probability will be calculated by the Softmax function.

[0066] The core idea of self-attention mechanism is based on the assumption that only part of the information in the input sequence is related to the output. Self-attention mechanism is widely used in image recognition, machine translation field, and recently it has achieved the best evaluation in various Transformer-based models.

[0067] The data source of the general graph is relatively simple, and the definition of triplets is relatively simple. Most of the relations are defined by isA, hasA, etc., and the modalities are relatively few, usually only text modalities; The semantic relationship is also relatively poor. The existing knowledge graph embedding technology cannot achieve good results in the tasks of commodity field recommendation, search, entity alignment, etc., mainly because it cannot well handle the noise and data sparsity problems encountered in the commodity field or commodity knowledge graph.

[0068] In order to overcome the noise and sparsity of the data in the commodity field, the embodiment of the present disclosure adds data features in the commodity field on the basis of the traditional graph embedding technology, and provides a commodity graph vectorization model in the commodity field according to the data organization form in the commodity field, so as to be suitable for commodity recommendation, commodity search and commodity graph completion and other tasks in the commodity field.

[0069] Firstly, the embodiment of the present disclosure provides a commodity graph vectorization method, which can be executed by any electronic device with computing processing capability.

[0070] Figure 1 A flowchart of a commodity graph vectorization method in the embodiment of the present disclosure is shown as follows. Figure 1 As shown in the figure, the commodity graph vectorization method provided in the embodiment of the present disclosure includes the following steps:

[0071] S102, constructing a commodity graph, wherein the commodity graph at least contains entity relationships in the following dimensions: user dimension, commodity dimension and category dimension.

[0072] It should be noted that the commodity graph in the embodiment of the present disclosure refers to the knowledge graph in the commodity field, which can be applied to but not limited to the tasks such as commodity recommendation and commodity search in the commodity field.

[0073] In some embodiments, the entity relationship in the user dimension includes but is not limited to: co-purchase and co-browsing; the entity relationship in the commodity dimension includes but is not limited to: similar commodities and commodity descriptions; and the entity relationship in the category dimension includes but is not limited to: the hierarchical relationship of the category to which the commodity belongs. It should be noted that the co-purchase and co-browsing in the embodiment of the present disclosure can be the user relationship of co-purchasing or co-browsing the same commodity, or the user relationship of co-purchasing or co-browsing similar commodities.

[0074] The commodity graph constructed in the embodiment of the present disclosure can provide a knowledge input and a knowledge superposition calculation mode for commodity knowledge graph embedding, provide a test standard for the downstream knowledge completion task, and provide verification data for similar commodity representation.

[0075] S104, learning the vector representation of the entity relationship in the commodity graph according to the commodity data and user interaction data collected from the e-commerce platform, and obtaining a commodity graph vectorization representation model.

[0076] In addition, the commodity purchase data, commodity browsing data, commodity alternative record, commodity search data, commodity click data, commodity description information, and commodity category label information of each user can be collected from the e-commerce platform. The commodity graph constructed by using the data can be learned, and a commodity graph embedding model that is relatively universal and accurate in the commodity field can be obtained. In addition, the commodity data collected by the e-commerce platform includes data of multiple modalities. The commodity graph constructed by learning the commodity data collected from the e-commerce platform can be learned, and the commodity graph embedding model obtained can still work normally when commodity data of one or more modalities fails.

[0077] In some embodiments, the commodity graph provided in the embodiments of the present disclosure and the commodity graph embedding model obtained by learning the commodity graph can be well applied to the commodity field such as procurement.

[0078] In some embodiments, the commodity graph vectorization method provided by the present disclosure further includes: taking the labeled data of the to-be-executed task as the model output data, optimizing the parameters of the commodity graph vectorization representation model, and obtaining a commodity graph vectorization representation model suitable for the to-be-executed task.

[0079] It should be noted that the to-be-executed task can be, but is not limited to, any one of the following: a commodity knowledge graph completion task (i.e., predicting unknown triples according to existing triples in the knowledge graph), a commodity search ranking task, or a commodity recommendation task.

[0080] Different downstream tasks use different evaluation indicators. For the knowledge completion task, the evaluation is mainly on link prediction, and therefore, in the evaluation of this task, whether the position of the predicted entity is accurate is mainly evaluated, and therefore, the Top-10 accuracy (HIT@10) is used as the evaluation indicator. For the search ranking task, whether the ranking result calculated according to the generated vector conforms to the search intention is mainly evaluated, and therefore, the recall rate and the average accuracy (MAP@10) of Top-10 are calculated; for the recommendation task, whether the ranking of the commodity recommendation result is reasonable is mainly evaluated, and therefore, the HIT@10 and NDCG@10 are used as the evaluation indicators.

[0081] In some embodiments, the commodity graph vectorization method provided by the present disclosure further includes the following steps: collecting commodity data of multiple modalities such as text, pictures, or videos. The commodity graph vectorization representation model can be constructed according to the commodity data of multiple modalities, so that the commodity graph vectorization representation model constructed can still work normally when commodity data of one or more modalities fails.

[0082] In some embodiments, as Figure 2As shown, the commodity graph vectorization method provided in the embodiments of the present disclosure can be used to vectorize the commodity graph through the following steps:

[0083] S202, determining the vector representation of similar commodities according to the collected commodity data;

[0084] S204, using the self-attention mechanism to extract the vector representation of common purchase, common browsing, commodity description and commodity category hierarchical relationship from the collected commodity data and user interaction data.

[0085] It should be noted that the commodity similarity relationship is the most widely used entity link in the commodity graph, and is applied in downstream tasks such as search and recommendation. When constructing the commodity graph embedding model, the commodity similarity relationship has a certain influence on various relationships. Therefore, in the embodiments of the present disclosure, first, the vector representation of similar commodities is determined according to the collected commodity data, and then the self-attention mechanism is used to extract the vector representation of common purchase, common browsing, commodity description and commodity category hierarchical relationship from the collected commodity data and user interaction data, and finally the commodity graph vectorization representation model is obtained.

[0086] In some embodiments, the vector generated based on BERT can be used as the input of the commodity similarity task, and GCN can also be used to output the vectorization representation in the commodity graph.

[0087] According to the distributed language embedding model assumption, words with similar meanings have similar representation methods. And the propagation rule shows that in the word2vec model output, there are indeed vectors with similar distances. Therefore, it can be inferred that commodities with similar relationships should also have similar properties, that is, they have vector representation methods with similar distances. Therefore, in some embodiments, as shown, Figure 3 As shown, the commodity graph vectorization method provided in the embodiments of the present disclosure can be used to vectorize the commodity graph through the following steps:

[0088] S302, extracting the commodity title and / or commodity description information of each commodity from the collected commodity data;

[0089] S304, performing word segmentation on the commodity title and / or commodity description information of each commodity to obtain a word segmentation result;

[0090] S306, training the word segmentation result using the word2vec model training method to obtain a model file of the word2vec model on the commodity data set;

[0091] S308, using the model file of the word2vec model on the commodity data set to generate the vector representation of each commodity according to the commodity title of each commodity;

[0092] S308, according to the vector representation of each commodity, the similarity between each commodity is calculated; according to the similarity between each commodity, similar commodities are determined, and the vector representation of similar commodities is generated.

[0093] Figure 4 An example of a commodity graph in the embodiments of the present disclosure is shown, as shown in the commodity graph, there are 3 dimensions and 11 relationships. Figure 2

[0094] The 3 dimensions are as follows:

[0095] 1) User dimension: username;

[0096] 2) Commodity dimension: commodity SKU, brand, commodity attribute / key attribute;

[0097] 3) Category dimension: primary category, secondary category, and tertiary category.

[0098] It should be noted that in principle, there can be more levels in the embodiments of the present disclosure regarding the category to which the commodity belongs, and the present disclosure does not limit this. In the embodiments, the tertiary category is taken as an example for illustration.

[0099] The 11 relationships are as follows:

[0100] 1) Primary category-contains-secondary category, wherein the primary category is the highest level of commodity classification, and the secondary category is a subcategory of the primary category;

[0101] 2) Secondary category-contains-tertiary category, wherein the tertiary category is a subcategory of the secondary category and is also the lowest level of commodity classification;

[0102] 3) Primary category-contains-tertiary category;

[0103] 4) Category-contains-brand;

[0104] 5) SKU-attribute X-attribute value;

[0105] 6) Category-contains-category attribute;

[0106] 7) Commodity-similar-commodity;

[0107] 8) User-purchased-commodity;

[0108] 9) User-browsed-commodity;

[0109] 10) User-purchased similar commodities-user;

[0110] 11) User-browsed similar commodities-user.

[0111] Figure 5 ​A flowchart of modeling the similarity relationship of commodities in an embodiment of the present disclosure is shown as follows: Figure 5 Specifically, the flowchart comprises the following steps:

[0112] S502, data processing:

[0113] Collect commodity and user data sets, design commodity graph ontology structure according to the commodity graph structure shown in Figure 4 Process the structured data, semi-structured data, unstructured data and noise data in the commodity and user data sets so that the processed data can be read by the model to generate the triple result of constructing the graph. The processing operation includes but is not limited to:

[0114] ①json data escaping;

[0115] ②Unstructured data segmentation / sentence segmentation: according to the existing punctuation, carriage return and space characters in the paragraph, the paragraph, sentence and phrase are separated;

[0116] ②English / punctuation processing: separate English words and remove punctuation marks;

[0117] ④Special character cleaning: remove special characters in the text or convert them into machine recognizable form.

[0118] S504, constructing a graph:

[0119] S506, constructing a model, which can be realized by S5061, S5062, S5063, S5064 and S5065.

[0120] In S5061, the word segmentation processing is performed on the commodity title and / or commodity description information using the word segmentation processing methods such as jieba, hanlp, ictclas and thulac, the dictionary is added in combination with the artificial annotation method, the verification data set is constructed by the artificial review and correction method using the user's commodity candidate data set.

[0121] In S5062, the word segmentation result in S5061 is additionally trained using the word2vec.train method, for example, if the data quantity is sufficient, the model can be retrained, if not, the data set output by S5061 is added on the basis of the public data set, and finally the model file of word2vec on the commodity data set is obtained.

[0122] In S5063, the model parameters are optimized according to the verification result, for example, skip-gram / c-bow, dimension size, iteration number, etc.

[0123] In S5064, the commodity title of each commodity in the commodity data set is input into the constructed model, and the commodity vector of each commodity is output. The distance between each commodity vector and other commodity vectors is calculated using the cosine similarity, and the calculation result is normalized to the interval of 0-1, and sorted according to the score.

[0124] For vectors u, v, the cosine similarity calculation formula is as follows:

[0125]

[0126] In S5065, the model output is verified to obtain a verification result.

[0127] S508, index evaluation:

[0128] The accuracy of the Top-5 result is calculated, the model is optimized until the model accuracy no longer changes, and the generated commodity graph and the word2vec model file on the commodity data set are output, so as to generate a vectorized representation of similar commodity relationships using the model file.

[0129] Figure 6 The specific implementation schematic diagram of the commodity graph vectorization method in the embodiment of the present disclosure is shown as follows: Figure 6 As shown in the figure, in the embodiment of the present disclosure, the commodity information and the user interaction information are used as the original data, and Z_input is the core. The goal is to establish a graph vector suitable for enterprise procurement commodity knowledge graph. Wherein Z_input represents the vectorized representation of commodity input, and is used as the core commodity graph embedding method, and the vectors of embedding layer and self-attention layer are input to each downstream task.

[0130] As shown in the figure, Figure 6 In the embodiment of the present disclosure, the knowledge completion, search sorting, commodity similarity and commodity recommendation of the commodity graph are selected as the downstream tasks of the commodity graph embedding representation, and the vector construction effect is detected. After setting the downstream task, the output of the trainer is according to the annotation data of the downstream task, and the Z I is fine-tuned on, and the vector construction result for a specific task can be obtained.

[0131] In order to extract common purchase, common browsing and commodity description relationships from customer orders, browsing and search behaviors, a specific self-attention model is used in the embodiment of the present disclosure. Here, Z^O is used to represent the output vector of the commodity. Similarly, the sequence length 1 will also change with the task.

[0132] ① The embedding layer of self-attention: using an ordered entity sequence as input. In order to model the position information, the self-attention mechanism uses the position k to correspond to the vector P k ∈R dposition encodings. The entity sequence length is trimmed to the maximum length l, denoted by e = (e1,...,el). The embedding layer computes the entity vector Z I or Z O and the corresponding position encodings P, the output is denoted by the following formula:

[0133]

[0134]

[0135] where Z O is the vector output of the commodity co-purchase relationship or co-browsing relationship, and Z I is the commodity vector input.

[0136] ②Self-attention layer: use the attention mechanism based on dot product expansion as the basis, which is defined as follows:

[0137]

[0138] where Q T represents the transpose matrix of all query sequences Q, K represents all the keywords of the query key, V represents the values of all the keywords, and d represents the dimension of the vector. Since each row of Q, K and V corresponds to an entity, the dot product attention layer will output the sum of all entity vectors in V with weights, where the weight reflects the pair-wise relationship of "query-key" in the entity sequence.

[0139] According to the distributed representation setting in the embodiments of the present disclosure, it can be naturally considered that the query sequence Q is E I , and the keyword K of the query key is E O , and they also contain the text information and position information input of the entity pair. Similarly, E I is used as the value V of the keyword. Therefore, the output of the attention layer can be defined as H = Attention (E I , E O , E I ). As for how the attention layer allocates weights to all entities, the H function can be decomposed as

[0140]

[0141] where the weight is used to capture the relationship between the text and position information of the elements e I , e O in the input E i , E j .

[0142] However, directly calculating E I , EO The inner product between them cannot contain the interaction information between different implicit dimensions. This will weaken the representation ability of the attention layer. Therefore, two layers of point-wise feedforward networks are added to the input and output of the entity before the dot product attention layer.

[0143] ③ Prediction layer: When modeling the user's purchase and browsing data, the previous purchase or browsing product input can be directly used to predict the product to be purchased or browsed. Similar to word2vec, p(e l+1 |e1…, e l ) as output, where e can take the value of a word token or a product.

[0144] ③ Scoring function: The output of the prediction layer can be directly used to calculate the product score, that is:

[0145]

[0146] Where PD is the data set of product search, purchase, browsing, and description information.

[0147] The product graph vectorization method provided in the embodiments of the present disclosure includes the following steps in its specific implementation process:

[0148] 1) Data processing:

[0149] Common purchase: Users with common purchase behavior are divided into a group, and the division rule is that they have purchased two or more same products within the past six months. SKUID or product keywords are used as grouping tags.

[0150] Common browsing: Users with common purchase behavior are divided into a group, and the division rule is that they have browsed three or more same products within the past six months. SKUID or product keywords are used as grouping tags.

[0151] Product description: Product description contains various modal information, including but not limited to product video, product main image, product basic description, product details, product attributes (basic attributes, specification packaging, sales attributes, special attributes, etc.).

[0152] The processing method of the video is mainly to identify the key frame, and then convert the information of the key frame into text using image recognition.

[0153] The product main image is also processed using image recognition. First, it is converted into an image segmentation problem, identifying the boundaries of the main areas of the picture, and then classifying the objects or main elements in these areas and converting them into text information.

[0154] The commodity details are mostly displayed in the form of pictures, and the OCR technology needs to be used to identify the text information therein, and the alignment is corrected according to the word segmentation rules, and meaningless words and symbols are removed.

[0155] The commodity attributes can be directly segmented according to the attribute name and attribute value.

[0156] Commodity level: The commodity one-two-three category structure information is regarded as one of the attributes of the commodity and is processed in the same way as above.

[0157] 2) Build a self-attention layer, as shown in Figure 7 , including:

[0158] ① Build an input vector, and the vector dimension is always 128. Because the number of modalities and the number of attributes of each commodity are different, after stacking these vectors, the average vector needs to be calculated according to the stacking number n, that is

[0159]

[0160] ② Build QKV:

[0161] Where the Attention(Q, K, V) function can be converted into the H=Attention(E I , E O , E I ) function to calculate the corresponding values of the converted QKV respectively;

[0162] ③ Calculate the score of each vector:

[0163] In the first stage, the product of the query input sequence Q and its corresponding key K is calculated in the form of dot product s[].

[0164] In the second stage, the calculation result s[] of F(Q, K) is normalized and its features are highlighted, and the Softmax function is used to complete this work, and the output is denoted as a[].

[0165] ④ Weighted sum to get the Attention value:

[0166] The product of the value of each a[] and the value of Value is calculated, that is, the value of Attention is obtained.

[0167] 3) Use the Attention mechanism to generate the vector of the above four kinds of data

[0168] Classify and assign values to QKV in Attention, and assign different K values to the common purchase relationship and the common browsing relationship, that is, E O, then calculate its Attention output according to the method in step 3, and take the attention vector as the output.

[0169] 4) Set evaluation indicators and knowledge graph:

[0170] according to Figure 4 The knowledge graph is constructed based on the product ontology shown in the figure, and the application effect of the knowledge graph on each task is evaluated according to the evaluation indicators of different downstream tasks. The knowledge graph is mainly used to verify the accuracy of procurement knowledge completion in tasks such as joint purchase and browsing.

[0171] 5) Apply vectors to evaluation indicators and graphs, verify the vector effect, and output the best model

[0172] In the knowledge completion task, we mainly construct a node and relationship prediction task. Based on d = ||h + rt||, we use the vector generated in step 4) to calculate the distance or similarity of the candidate nodes and evaluate their prediction accuracy.

[0173] In the product search task, use the vector generated in step 4) to calculate the cosine distance between it and the input vector or other result vectors to enhance recall and evaluate the top-10 accuracy (sort the top 10 results from high to low similarity calculated by cosine distance, and manually evaluate the number of correct answers among these 10 results).

[0174] In the product recommendation task, use the vector generated in step 4) in the two-tower model or collaborative filtering model to enhance the recall effect and evaluate the HIT@10 indicator (take the first 10 results returned by the task and manually evaluate the number of correct results among these 10 results).

[0175] 6) Based on the above indicator evaluation results, optimize the parameters in steps 2) and 3) until the task evaluation indicators tend to stabilize, take the output in step 3) as the final output, and encapsulate the above steps into an end-to-end model file as the engineering method of the embodiment of the present disclosure.

[0176] In summary, the commodity graph vectorization method provided in the embodiments of the present disclosure can achieve the following technical effects, but is not limited to: ① modeling the learning object as a discrete event sequence learning problem, similar to a neural network language translation model, which can avoid data noise problems in the commodity graph; ② constructing multi-modal data can solve the problem of data sparsity; ③ by constructing a commodity knowledge graph and learning an embedding representation based on the commodity graph, the application effect of entity completion in the graph, such as commodities, can be improved; ④ by using the vector representation of the commodity graph embedding to enrich the search ranking results, the application effect of the commodity graph in commodity search can be improved; ⑤ calculating the commodity graph embedding vector increases the dimension of the recalled commodities in the recommendation, which can improve the application effect of the commodity graph in commodity recommendation.

[0177] Based on the same inventive concept, the present disclosure also provides a commodity graph vectorization device, as follows. Since the principles of the device embodiments solve problems similar to the above-mentioned method embodiments, the implementation of the device embodiments can be referred to the implementation of the above-mentioned method embodiments, and the repeated parts will not be repeated.

[0178] Figure 8 A schematic diagram of a commodity graph vectorization device in an embodiment of the present disclosure is shown, as shown in the figure, the device includes a commodity graph construction module 81 and a commodity graph vectorization module 82. Figure 8

[0179] The commodity graph construction module 81 is configured to construct a commodity graph, wherein the commodity graph includes at least the following dimension entity relationships: user dimension, commodity dimension and category dimension; the commodity graph vectorization module 82 is configured to learn the vector representation of the entity relationship in the commodity graph according to the commodity data and user interaction data collected from the e-commerce platform, and obtain a commodity graph vectorization representation model.

[0180] In some embodiments, the above-mentioned entity relationship of the user dimension includes: common purchase and common browsing; the above-mentioned entity relationship of the commodity dimension includes: similar commodities and commodity descriptions; and the entity relationship of the category dimension includes: the hierarchical relationship of the category to which the commodity belongs.

[0181] In some embodiments, the commodity graph vectorization module 82 is further configured to determine the vector representation of similar commodities according to the collected commodity data; and use a self-attention mechanism to extract the vector representation of common purchase, common browsing, commodity description and commodity category hierarchical relationship from the collected commodity data and user interaction data.

[0182] ​In some embodiments, the commodity graph vectorization module 82 is further configured to: extract commodity title and / or commodity description information of each commodity from the collected commodity data; perform word segmentation on the commodity title and / or commodity description information of each commodity to obtain a word segmentation result; train the word segmentation result using a word2vec model training method to obtain a model file of the word2vec model on the commodity data set; generate a vector representation of each commodity according to the commodity title of each commodity using the model file of the word2vec model on the commodity data set; calculate the similarity between each commodity according to the vector representation of each commodity; and determine similar commodities according to the similarity between each commodity, and generate a vector representation of the similar commodities.

[0183] In some embodiments, as shown in FIG. 8, the commodity graph vectorization apparatus provided in the embodiments of the present disclosure further includes a model optimization module 83 configured to perform parameter optimization on the commodity graph vectorization representation model using the labeled data of the to-be-executed task as the model output data, to obtain a commodity graph vectorization representation model suitable for the to-be-executed task. Figure 8

[0184] In some embodiments, the to-be-executed task is any one of the following: a commodity knowledge graph completion task, a commodity search ranking task, or a commodity recommendation task.

[0185] In some embodiments, the commodity graph vectorization apparatus provided in the embodiments of the present disclosure further includes a data collection module configured to collect commodity data in multiple modalities, such as text, pictures, or videos.

[0186] Those skilled in the art can understand that each aspect of the present disclosure can be implemented as a system, a method, or a program product. Therefore, each aspect of the present disclosure can be specifically implemented as follows: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software aspects, which can be collectively referred to as "circuitry", "module", or "system".

[0187] The electronic device 900 according to this embodiment of the present disclosure will be described below with reference to FIG. 9. Figure 9 The electronic device 900 shown is in the form of a general computing device. The components of the electronic device 900 can include, but are not limited to, the at least one processing unit 910, the at least one storage unit 920, and a bus 930 connecting different system components, including the storage unit 920 and the processing unit 910. Figure 9 As shown in FIG. 9, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 can include, but are not limited to, the at least one processing unit 910, the at least one storage unit 920, and a bus 930 connecting different system components, including the storage unit 920 and the processing unit 910.

[0188] Figure 9

[0189] ​​​The storage unit stores program codes which can be executed by the processing unit 910, so that the processing unit 910 performs the steps described in the above “Exemplary Method” section according to various exemplary embodiments of the present disclosure. For example, the processing unit 910 can perform the following steps of the above method embodiments: constructing a commodity graph, wherein the commodity graph at least contains entity relationships of the following dimensions: user dimension, commodity dimension, and category dimension; learning vector representations of the entity relationships in the commodity graph according to commodity data and user interaction data collected from an e-commerce platform, to obtain a commodity graph vectorization representation model.

[0190] The storage unit 920 can include a readable medium in the form of volatile storage unit, such as a random access memory (RAM) 9201 and / or a cache memory 9202, and can further include a read-only memory (ROM) 9203.

[0191] The storage unit 920 can further include a program / utility 9204 having a set of program modules 9205 such as an operating system, one or more application programs, other program modules, and program data, each of which can give the electronic device 900 its functionality, at least in part. Each of the above examples is a non-limiting example of a machine-readable storage medium.

[0192] The bus 930 can represent one or more of several types of bus structures, including a storage bus or bus controller, a peripheral bus, a graphics acceleration bus, a processor or local bus using any of a variety of bus architectures.

[0193] The electronic device 900 can also communicate with one or more external devices 940 such as a keyboard or pointing device, using one or more communication ports 950. Communication can also occur with one or more devices using the communication interface 950. For instance, in a networked environment, communication can occur with a display device, a printer, a scanner, a device that enables a user to interact with all of these and / or a removable storage device, such as a floppy disk drive, a flash drive, and the like. In a networked environment, communication can occur through the network 960, which can be a LAN, a WAN, or a combination of both. As depicted, the network 960 can include a wired and / or a wireless network that is implemented using a variety of technologies. Such communication can occur across the bus 930. It should be appreciated that various means of establishing communication between the electronic device 900 and one or more of the external devices 940 can be used. By way of example, such means include, but are not limited to, a communication port, a personal area network, an infrared link, a wireless link, a LAN, a WAN, Bluetooth, and / or the like.

[0194] Those skilled in the art can easily understand from the above description of the embodiments that the example embodiments described herein can be implemented by software or by software in combination with necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash disk, a mobile hard disk, or the like) or on a network, and includes a number of instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to perform the methods according to the embodiments of the present disclosure.

[0195] In the example embodiments of the present disclosure, a computer readable storage medium is also provided, which can be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible embodiments, various aspects of the present disclosure can also be implemented in the form of a program product, which includes program codes for causing a terminal device to perform the steps according to various example embodiments of the present disclosure described in the above "example method" section of the specification when the program product is run on the terminal device.

[0196] More specific examples of the computer readable storage medium in the present disclosure can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0197] In the present disclosure, the computer readable storage medium can include a data signal carried in a baseband or as a part of a carrier wave, in which readable program codes are borne. Such a propagated data signal can take multiple forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. The readable signal medium can also be any readable medium that is not a storage medium, which can send, propagate, or transmit programs for use by or in connection with an instruction execution system, apparatus, or device.

[0198] Optionally, the program codes contained on the computer readable storage medium can be transmitted by any suitable medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.

[0199] In particular embodiments, the program code utilized by the program code instructions can be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C++, or the like, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code can execute entirely on the user's computing device, partly on the user's computing device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device or entirely on the remote computing device or server. In the latter scenario, the remote computing device can be connected to the user's computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computing device, such as through the Internet using an Internet Service Provider. The application programming interface (API) server 106 can be used to facilitate the connection between the client device 102 and the remote computing device.

[0200] It should be noted that, although several modules or units of devices for action execution are mentioned in the foregoing detailed description, such division is not mandatory. Indeed, features and functionalities of two or more modules or units described above can be embodied in one module or unit according to embodiments of the present disclosure. Conversely, features and functionalities of one module or unit described above can be further divided into multiple modules or units.

[0201] Furthermore, although various steps of the methods in the present disclosure are described in a particular order in the accompanying drawings, this does not require or imply that the steps must be performed in that particular order, or that all of the steps must be performed to achieve the desired results. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into one step, one step can be split into multiple steps, and / or the like.

[0202] From the above description of the embodiments, those skilled in the art will readily perceive that the example embodiments described herein can be implemented by software and / or by hardware and / or by a combination of software and hardware. Accordingly, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product. The software product can be stored in a non-volatile storage medium, such as a CD-ROM, a USB flash drive, a mobile hard disk, or the like, or on a network, and includes a number of instructions for causing a computing device (such as a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the methods according to the embodiments of the present disclosure.

[0203] Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the features disclosed herein. It is intended that the disclosure be construed as including any patents, patent applications, publications, publications, or other disclosure of complementary subject matter that is within the scope of the disclosure. It is intended that the specification and examples be considered exemplary only, with the true scope and spirit of the disclosure being indicated by the following claims.

Claims

1. A commodity atlas vectorization method, characterized in that, The method comprises the following steps: constructing a commodity graph, wherein the commodity graph at least contains entity relationships of the following dimensions: user dimension, commodity dimension, and category dimension; learning vector representations of the entity relationships in the commodity graph according to commodity data and user interaction data collected from an e-commerce platform, to obtain a commodity graph vectorization representation model; wherein the commodity data and user interaction data collected from the e-commerce platform include: commodity purchase data, commodity browsing data, commodity alternative records, commodity search data, commodity click data, commodity description information, and hierarchical label information of a commodity category to which the commodity belongs; wherein learning vector representations of the entity relationships in the commodity graph according to commodity data and user interaction data collected from an e-commerce platform, to obtain a commodity graph vectorization representation model, comprises: determining vector representations of similar commodities according to the collected commodity data; extracting vector representations of common purchases, common browsing, commodity descriptions, and hierarchical relationships of commodity categories from the collected commodity data and user interaction data using a self-attention mechanism; wherein the method further comprises: using labeled data of a to-be-executed task as model output data to perform parameter optimization on the commodity graph vectorization representation model, to obtain a commodity graph vectorization representation model suitable for the to-be-executed task; wherein the to-be-executed task is any one of the following: a commodity knowledge graph completion task, a commodity search ranking task, or a commodity recommendation task; wherein performing parameter optimization on the commodity graph vectorization representation model comprises: setting different evaluation indexes for different tasks, and performing parameter optimization on the commodity graph vectorization representation model. 2.The merchandise map vectorization method of claim 1, wherein, The entity relationships of the user dimension include: common purchases and common browsing; the entity relationships of the commodity dimension include: similar commodities and commodity descriptions; and the entity relationships of the category dimension include: hierarchical relationships of commodity categories. 3.The merchandise map vectorization method of claim 2, wherein, Determining vector representations of similar commodities according to the collected commodity data comprises: extracting commodity titles and / or commodity description information of each commodity from the collected commodity data; performing word segmentation on the commodity titles and / or commodity description information of each commodity to obtain word segmentation results; training the word segmentation results using a word2vec model training method to obtain a model file of the word2vec model on a commodity data set; generating vector representations of each commodity according to the commodity titles of each commodity using the model file of the word2vec model on the commodity data set; calculating similarities between each commodity according to the vector representations of each commodity; determining similar commodities according to the similarities between each commodity, and generating vector representations of the similar commodities.

4. The merchandise map vectoring method according to any one of claims 1 to 3, characterized in that, The method further comprises: collecting commodity data in multiple modalities: text, pictures, or videos.

5. A merchandise map vectoring apparatus characterized by comprising: The method comprises the following steps: a commodity graph construction module, configured to construct a commodity graph, wherein the commodity graph at least contains entity relationships of the following dimensions: user dimension, commodity dimension, and category dimension; a commodity graph vectorization module, configured to learn vector representations of the entity relationships in the commodity graph according to commodity data and user interaction data collected from an e-commerce platform, to obtain a commodity graph vectorization representation model; The commodity data and the user interaction data collected from the e-commerce platform include commodity purchase data, commodity browsing data, commodity alternative record, commodity search data, commodity click data, commodity description information, and hierarchical label information of a commodity category to which the commodity belongs of each user; The commodity graph vectorization module is further configured to determine vector representations of similar commodities according to the collected commodity data, and extract vector representations of common purchase, common browsing, commodity description, and hierarchical relationships of a commodity category from the collected commodity data and the user interaction data using a self-attention mechanism. The apparatus is further configured to use the labeled data of the to-be-executed task as model output data to perform parameter optimization on the commodity graph vectorization representation model, and obtain a commodity graph vectorization representation model suitable for the to-be-executed task. The to-be-executed task is any one of a commodity knowledge graph completion task, a commodity search ranking task, or a commodity recommendation task. The parameter optimization on the commodity graph vectorization representation model includes setting different evaluation indexes for different tasks, and performing parameter optimization on the commodity graph vectorization representation model.

6. An electronic device, comprising: comprises: a processor; and a memory for storing executable instructions of the processor; The processor is configured to execute the commodity graph vectorization method of any one of claims 1-4 by executing the executable instructions.

7. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the commodity graph vectorization method of any one of claims 1-4.

Citation Information

Patent Citations

  • Recommendation method and system based on commodity knowledge graph feature learning

    CN111369318A

  • Method for carrying out personalized recommendation on commodities by fusing knowledge graph

    CN112232925A

  • Clothing matching recommendation method and system based on knowledge graph

    CN112396479A