Knowledge graph construction method and object recommendation method based on knowledge graph

By constructing a knowledge graph and utilizing technologies such as the multi-head self-attention mechanism network, the problem of poor accuracy in abstracted demand recommendations in the existing technology is solved, the user experience and accuracy of recommendations are improved, and it is suitable for a variety of demand scenarios.

CN118585652APending Publication Date: 2024-09-03BEIJING JINGDONG TUOXIAN TECH CO LTD

Patent Information

Application Number
CN202410740830.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-07
Publication Date
2024-09-03

AI Technical Summary

Technical Problem

When the existing technology handles search scenarios with abstract needs, the accuracy of recommendations is poor and the user experience is poor. Especially when users enter vague or abstract search terms, it is difficult to accurately analyze user needs and extract effective product dimensions. Keywords.

Method used

By acquiring structured, semi-structured and unstructured data, we extract object entities and scene entities, determine their relationships, build a knowledge graph, and use technologies such as multi-head self-attention mechanism networks and convolutional neural networks to extract global and local Semantic features enhance the relationship extraction between scene entities and object class entities.

Benefits of technology

It improves the recommendation accuracy and user experience for abstract needs, expands the data acquisition scope and application scope of the knowledge graph, and can better handle object recommendation scenarios with clear needs and abstract needs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585652A
    Figure CN118585652A
Patent Text Reader

Abstract

The invention provides a knowledge graph construction method and an object recommendation method based on a knowledge graph, which can be applied to the technical fields of artificial intelligence and big data. The knowledge graph construction method comprises the steps that a first sample data set and a second sample data set are acquired, the first sample data set comprises multiple pieces of first sample data, the second sample data set comprises multiple pieces of second sample data, the first sample data comprises structured data or semi-structured data, and the second sample data comprises unstructured data; extracting a plurality of object class entities and relationships among the plurality of object class entities from the first sample data set; extracting a plurality of scene entities from the second sample data set; determining a relationship between the scene entities and the object class entities, and determining a relationship among the plurality of scene entities; and constructing the knowledge graph by taking the object class entities and the scene entities as nodes and taking the relationship among the object class entities, the relationship among the scene entities and the object class entities and the relationship among the scene entities as edges.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the fields of artificial intelligence and big data technology, and specifically to a method for constructing a knowledge graph and an object recommendation method based on the knowledge graph. Background Art

[0002] In object recommendation scenarios such as product recommendation, search result recommendation, and solution / strategy recommendation, keyword matching algorithms, knowledge graphs, and other methods can be used to recommend objects that meet user needs. Among them, the knowledge graph is a series of various graphs that show the development process and structural relationship of knowledge.

[0003] However, in the process of realizing the above technical concept, the inventors found that the prior art has the following technical problems: for search scenarios with abstract needs, such as "what to use for cervical discomfort", the recommendation accuracy is poor and the user experience is poor. Summary of the invention

[0004] In view of the above problems, the present disclosure provides a method for constructing a knowledge graph and an object recommendation method based on the knowledge graph.

[0005] According to a first aspect of the present disclosure, a method for constructing a knowledge graph is provided, comprising: obtaining a first sample data set and a second sample data set, wherein the first sample data set includes multiple first sample data, the second sample data set includes multiple second sample data, the first sample data includes structured data or semi-structured data, and the second sample data includes unstructured data; extracting multiple object class entities and the relationships between the multiple object class entities from the first sample data set; extracting multiple scene entities from the second sample data set, wherein the scene entities are used to describe the user's demand scenarios; determining the relationship between the scene entity and the object class entity, and determining the relationship between multiple scene entities; and constructing a knowledge graph with the object class entities and the scene entities as nodes and the relationships between the multiple object class entities, the relationships between the scene entities and the object class entities, and the relationships between the multiple scene entities as edges.

[0006] According to an embodiment of the present disclosure, the object class entity includes a first class object entity, and the first class object entity uniquely corresponds to a commodity object; wherein determining the relationship between the scene entity and the object class entity includes: for each scene entity, obtaining text description information related to the scene entity, wherein the text description information is used to supplement the scene requirements of the scene entity; fusing the text description information with the first class object entity and the scene entity respectively to obtain first fusion data and second fusion data; and determining the relationship between the scene entity and the first class object entity based on the first fusion data and the second fusion data.

[0007] According to an embodiment of the present disclosure, the object class entity further includes a second class object entity and a third class object entity, the second class object entity is used to characterize the type to which the first class object entity belongs, and the third class object entity is used to characterize the brand to which the first class object entity belongs;

[0008] Among them, determining the relationship between the scene entity and the object class entity also includes: determining the second relationship between the scene entity and the second class object entity based on the first relationship between the first class object entity and the second class object entity, and the relationship between the scene entity and the first class object entity; determining the fourth relationship between the scene entity and the third class object entity based on the third relationship between the first class object entity and the third class object entity, and the relationship between the scene entity and the first class object entity.

[0009] According to an embodiment of the present disclosure, the text description information is respectively fused with the first type of object entity and the scene entity to obtain the first fused data and the second fused data, including: performing word segmentation on the first type of object entity, the scene entity and the text description information to obtain the first word segmentation data corresponding to the first type of object entity, the second word segmentation data corresponding to the scene entity and the third word segmentation data corresponding to the text description information; encoding the data after the fusion of the first word segmentation data and the third word segmentation data to obtain the first embedded data of the fused text description information and the first type of object entity; encoding the data after the fusion of the second word segmentation data and the third word segmentation data to obtain the second embedded data of the fused text description information and the scene entity; performing feature extraction on the first embedded data to obtain the first fused data; and performing feature extraction on the second embedded data to obtain the second fused data.

[0010] According to an embodiment of the present disclosure, the relationship between the scene entity and the first category object entity is determined based on the first fusion data and the second fusion data, including: inputting the first fusion data into a multi-head self-attention mechanism network to obtain an output first global semantic feature; inputting the second fusion data into the multi-head self-attention mechanism network to obtain an output second global semantic feature; inputting the first fusion data into a convolutional neural network to obtain an output first local semantic feature; inputting the second fusion data into a convolutional neural network to obtain an output second local semantic feature; inputting the first global semantic feature and the first local semantic feature into a pooling layer to obtain an output first semantic feature result; inputting the second global semantic feature and the second local semantic feature into the pooling layer to obtain an output second semantic feature result; and determining the relationship between the scene entity and the first category object entity based on the first semantic feature result and the second semantic feature result.

[0011] According to an embodiment of the present disclosure, multiple scene entities are extracted from a second sample data set, including: inputting each second sample data in the second sample data set into an extraction model to obtain at least one scene entity as an output, and then obtaining a scene entity set for the second sample data set; and fusing at least two scene entities in the scene entity set that represent the same user demand scenario to obtain multiple scene entities.

[0012] According to an embodiment of the present disclosure, the extraction model includes an encoding layer, a bidirectional long short-term memory network layer and a conditional random field layer; wherein each second sample data in the second sample data set is input into the extraction model to output at least one scene entity, including: inputting the second sample data into the encoding layer to obtain an output sample semantic vector, wherein the sample semantic vector includes a vector representation of each word in the second sample data; inputting the sample semantic vector into the bidirectional long short-term memory network layer to obtain an output initial scene entity sequence; and inputting the initial scene entity sequence into the conditional random field layer to obtain an output final scene entity sequence, wherein the final scene entity sequence includes at least one scene entity.

[0013] According to an embodiment of the present disclosure, before obtaining the first sample data set and the second sample data set, it also includes: using a large model to learn data features of an initial sample data set, and using the learned large model to generate a second sample data set, wherein the initial sample data set includes multiple initial sample data, the data volume of the initial sample data set is smaller than the data volume of the second sample data set, and the initial sample data includes unstructured data.

[0014] The second aspect of the present disclosure provides an object recommendation method based on a knowledge graph, comprising: extracting target information from text information input by a user; determining a target node matching the target information based on a pre-constructed knowledge graph, wherein the knowledge graph is constructed according to the above-mentioned knowledge graph construction method; determining at least one recommended object related to the target node according to the node type of the target node; and determining a target recommended object according to attribute data of at least one recommended object.

[0015] According to an embodiment of the present disclosure, the knowledge graph includes scenario entities for characterizing user demand scenarios; wherein, based on the node type of the target node, at least one recommended object related to the target node is determined, including: in response to the node type being a scenario entity, determining at least one related scenario entity related to the target node, wherein the related scenario entity is a scenario entity connected to the target node through an edge in the knowledge graph; and determining at least one recommended object based on the target node and at least one related scenario entity.

[0016] According to an embodiment of the present disclosure, the knowledge graph includes object class entities, the object class entities include first-class object entities, and the first-class object entities uniquely correspond to a commodity object; wherein, based on the target node and at least one related scene entity, at least one recommended object is determined, including: based on the knowledge graph, determining at least one first-class object entity related to the target node and / or at least one related scene entity; and taking the commodity object corresponding to the first-class object entity as the recommended object.

[0017] According to an embodiment of the present disclosure, the object class entity includes a second class object entity, and the second class object entity is used to characterize the category to which the first class object entity belongs; the method also includes: based on the knowledge graph, determining at least one second class object entity related to at least one first class object entity; for each second class object entity, based on the knowledge graph, determining at least one supplementary first class object entity related to the second class object entity, wherein the supplementary first class object entity represents a first class object entity that belongs to the same category as at least one first class object entity and is different from the first class object entity; and taking the commodity objects corresponding to the at least one first class object entity and the at least one supplementary first class object entity respectively as at least one recommended object related to the target node.

[0018] According to an embodiment of the present disclosure, the attribute data includes at least one of the following: click popularity, sales volume, and evaluation; wherein, based on the attribute data of at least one recommendation object, a target recommendation object is determined, including: calculating a recommendation index value of each recommendation object based on the attribute data; and determining a target recommendation object from at least one recommendation object based on the recommendation index value.

[0019] The second aspect of the present disclosure provides a device for constructing a knowledge graph, including: an acquisition module, used to acquire a first sample data set and a second sample data set, wherein the first sample data set includes multiple first sample data, the second sample data set includes multiple second sample data, the first sample data includes structured data or semi-structured data, and the second sample data includes unstructured data; a first extraction module, used to extract multiple object class entities and the relationships between multiple object class entities from the first sample data set; a second extraction module, used to extract multiple scene entities from the second sample data set, wherein the scene entities are used to describe the user's demand scenarios; a third extraction module, used to determine the relationship between the scene entity and the object class entity, and the relationship between multiple scene entities; and a construction module, used to construct a knowledge graph with object class entities and scene entities as nodes, and the relationships between multiple object class entities, the relationships between scene entities and object class entities, and the relationships between multiple scene entities as edges.

[0020] The third aspect of the present disclosure provides an object recommendation device based on a knowledge graph, comprising: an information extraction module, used to extract target information from text information input by a user; a first determination module, used to determine a target node matching the target information based on a pre-constructed knowledge graph, wherein the knowledge graph is generated according to the above-mentioned knowledge graph construction method; a second determination module, used to determine at least one recommended object related to the target node according to the node type of the target node; and a recommendation module, used to determine a target recommended object according to attribute data of at least one recommended object.

[0021] The fourth aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein, when the one or more programs are executed by the one or more processors, the one or more processors execute the above-mentioned knowledge graph construction method and / or the object recommendation method based on the knowledge graph.

[0022] The fifth aspect of the present disclosure also provides a computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the above-mentioned knowledge graph construction method and / or object recommendation method based on the knowledge graph.

[0023] The sixth aspect of the present disclosure also provides a computer program product, including a computer program, which, when executed by a processor, implements the above-mentioned knowledge graph construction method and / or object recommendation method based on the knowledge graph.

[0024] In the embodiments of the present disclosure, the knowledge graph not only includes object-class entities of commodity dimensions and commodity-related dimensions, but also includes scenario entities that characterize user needs, so that the constructed knowledge graph is not only applicable to object recommendation scenarios with clear needs, but also applicable to object recommendation scenarios with abstract needs, which improves the application scope of recommendations and the accuracy of abstract demand recommendations, while improving the user experience. In addition, in the process of constructing the knowledge graph, the use of structured, semi-structured and unstructured data can expand the data acquisition scope of the knowledge graph, build a more complete knowledge graph that integrates more features, and then expand the accuracy and application scope of the knowledge graph, which helps to improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] The above contents and other objects, features and advantages of the present disclosure will become more apparent through the following description of the embodiments of the present disclosure with reference to the accompanying drawings, in which:

[0026] Figure 1 The application scenarios of the knowledge graph construction method and the object recommendation method based on the knowledge graph according to the embodiments of the present disclosure are schematically shown;

[0027] Figure 2 A flowchart of a method for constructing a knowledge graph according to an embodiment of the present disclosure is schematically shown;

[0028] Figure 3 A schematic diagram of a knowledge graph according to an embodiment of the present disclosure is schematically shown;

[0029] Figure 4A A flow chart schematically illustrates a method for determining a relationship between a scene entity and a first type of object entity;

[0030] Figure 4B A flow chart schematically shows a method for determining a relationship between a scene entity and a first type of object entity according to first fused data and second fused data;

[0031] Figure 5 The structure diagram of the relationship extraction model according to the embodiment of the present disclosure is schematically shown;

[0032] Figure 6 The schematic diagram of the structure of the extraction model according to the embodiment of the present disclosure is shown;

[0033] Figure 7 A flowchart of a method for object recommendation based on a knowledge graph according to an embodiment of the present disclosure is schematically shown;

[0034] Figure 8 A flowchart of a method for determining a commodity recommendation object according to an embodiment of the present disclosure is schematically shown;

[0035] Fig. 9 Schematically shows a structural block diagram of a knowledge graph construction device according to an embodiment of the present disclosure

[0036] Fig.10 A structural block diagram of a knowledge graph-based object recommendation device according to an embodiment of the present disclosure is schematically shown; and

[0037] Fig.11 A block diagram of an electronic device suitable for a method for constructing a knowledge graph and an object recommendation method based on a knowledge graph according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION

[0038] Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. However, it should be understood that these descriptions are exemplary only and are not intended to limit the scope of the present disclosure. In the following detailed description, for ease of explanation, many specific details are set forth to provide a comprehensive understanding of the embodiments of the present disclosure. However, it is apparent that one or more embodiments may also be implemented without these specific details. In addition, in the following description, descriptions of known structures and technologies are omitted to avoid unnecessary confusion of the concepts of the present disclosure.

[0039] The terms used herein are only for describing specific embodiments and are not intended to limit the present disclosure. The terms "comprise", "include", etc. used herein indicate the existence of the features, steps, operations and / or components, but do not exclude the existence or addition of one or more other features, steps, operations or components.

[0040] All terms (including technical and scientific terms) used herein have the meanings commonly understood by those skilled in the art unless otherwise defined. It should be noted that the terms used herein should be interpreted as having a meaning consistent with the context of this specification and should not be interpreted in an idealized or overly rigid manner.

[0041] When using expressions such as "at least one of A, B, and C, etc.", they should generally be interpreted according to the meaning of the expression commonly understood by those skilled in the art (for example, "a system having at least one of A, B, and C" should include but is not limited to a system having A alone, B alone, C alone, A and B, A and C, B and C, and / or A, B, C, etc.).

[0042] In the technical solution of the present invention, the user information (including but not limited to user personal information, user image information, user device information, such as location information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0043] At present, the commonly used recommendation methods in the field of e-commerce search are mainly keyword matching algorithms and knowledge graphs. Recommendation methods based on keyword matching algorithms include: fuzzy matching of input search terms through fuzzy matching algorithms such as edit distance algorithm and n-gram algorithm, and finding similar product results. Alternatively, the search terms input by the user are split into multiple keywords through a split matching algorithm, and the split keywords are matched. Alternatively, the search terms input by the user are matched with the features of the product through a feature matching algorithm. The method of recommending products through a knowledge graph includes: constructing a knowledge graph in the product dimension, the nodes in the knowledge graph are generally product entities determined based on experience or rules, and then using the above knowledge graph to search and match search terms or keywords.

[0044] In the object recommendation scenario, for search terms or keywords with clear needs, such as "massage chair", the above keyword search algorithm and knowledge graph method can be used to recommend a variety of massage chair products. However, when users are not familiar with the products in the current field, it is difficult to enter search terms with clear needs. Usually, the search terms entered are abstract and vague, such as "what to use for cervical discomfort". For abstract and vague search terms, due to the semantic gap between the search terms and the products, the above keyword matching algorithm and knowledge graph method find it difficult to parse the user's real needs from the abstract needs, and it is also difficult to extract effective keywords in the product dimension from the semantics expressed by the search terms, resulting in poor matching accuracy, which in turn leads to technical problems such as poor recommendation effect based on abstract needs and poor user experience.

[0045] Therefore, in order to at least partially solve the above technical problems, the present disclosure provides a method for constructing a knowledge graph and an object recommendation method based on the knowledge graph. The method for constructing a knowledge graph includes: obtaining a first sample data set and a second sample data set, wherein the first sample data set includes multiple first sample data, the second sample data set includes multiple second sample data, the first sample data includes structured data or semi-structured data, and the second sample data includes unstructured data; extracting multiple object class entities and the relationship between multiple object class entities from the first sample data set; extracting multiple scene entities from the second sample data set, wherein the scene entity is used to describe the user's demand scenario; determining the relationship between the scene entity and the object class entity, and determining the relationship between multiple scene entities; and constructing a knowledge graph with object class entities and scene entities as nodes, and with the relationship between multiple object class entities, the relationship between scene entities and object class entities, and the relationship between multiple scene entities as edges.

[0046] Figure 1 The application scenarios of the knowledge graph construction method and the object recommendation method based on the knowledge graph according to the embodiments of the present disclosure are schematically illustrated.

[0047] like Figure 1 As shown, the application scenario 100 according to this embodiment may include a first terminal device 101, a second terminal device 102, a third terminal device 103, a network 104, and a server 105. The network 104 is used to provide a medium for a communication link between the first terminal device 101, the second terminal device 102, the third terminal device 103, and the server 105. The network 104 may include various connection types, such as wired, wireless communication links, or optical fiber cables, etc.

[0048] The user may use at least one of the first terminal device 101, the second terminal device 102, and the third terminal device 103 to interact with the server 105 through the network 104 to receive or send messages, etc. Various communication client applications may be installed on the first terminal device 101, the second terminal device 102, and the third terminal device 103, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only for example).

[0049] The first terminal device 101, the second terminal device 102, and the third terminal device 103 may be various electronic devices having display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0050] The server 105 may be a server that provides various services, such as a background management server (only as an example) that provides support for websites browsed by users using the first terminal device 101, the second terminal device 102, and the third terminal device 103. The background management server may analyze and process the received data such as user requests, and feed back the processing results (such as web pages, information, or data obtained or generated according to user requests) to the terminal device.

[0051] It should be noted that the knowledge graph construction method and the object recommendation method based on the knowledge graph provided in the embodiment of the present disclosure can generally be executed by the server 105. Accordingly, the knowledge graph construction device and the object recommendation device based on the knowledge graph provided in the embodiment of the present disclosure can generally be set in the server 105. The knowledge graph construction method and the object recommendation method based on the knowledge graph provided in the embodiment of the present disclosure can also be executed by one of the first terminal device 101, the second terminal device 102, and the third terminal device 103. Accordingly, the knowledge graph construction device and the object recommendation device based on the knowledge graph provided in the embodiment of the present disclosure can generally be set in one of the first terminal device 101, the second terminal device 102, and the third terminal device 103. Alternatively, the knowledge graph construction method can be executed by the server 105, and the object recommendation based on the knowledge graph is executed by one of the first terminal device 101, the second terminal device 102, and the third terminal device 103. Accordingly, the knowledge graph construction device is set in the server 105, and the object recommendation device based on the knowledge graph is set in one of the first terminal device 101, the second terminal device 102, and the third terminal device 103.

[0052] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0053] The following will be passed Figure 2~Figure 6 The knowledge graph construction method of the disclosed embodiment is described in detail.

[0054] Figure 2 A flowchart of a method for constructing a knowledge graph according to an embodiment of the present disclosure is schematically shown.

[0055] like Figure 2 As shown, the knowledge graph construction method 200 includes operations S210~S250.

[0056] In operation S210 , a first sample data set and a second sample data set are acquired.

[0057] According to an embodiment of the present disclosure, the first sample data set includes a plurality of first sample data, and the second sample data set includes a plurality of second sample data. The first sample data is structured data or semi-structured data, and the second sample data includes unstructured data. It is understood that the first sample data set may include a plurality of structured data and / or a plurality of semi-structured data at the same time.

[0058] According to an embodiment of the present disclosure, semi-structured data represents data having a partially preset data format, for example, different information is distinguished only by " / ", but the arrangement order of information types is not limited. Structured data or semi-structured data can be understood as data having a preset data format, but the corresponding data formats are different, and the format restrictions of semi-structured data are less than those of structured data.

[0059] According to an embodiment of the present disclosure, structured data represents data without a preset data format. For example, when the recommended object is a product, the unstructured data includes: question-answer pairs collected from user search purchase behavior and product reviews, product detail page information, product title information, query log, product reviews, third-party related knowledge, etc.

[0060] In the embodiments of the present disclosure, the user's authorization or consent is obtained before obtaining or collecting the user's semi-structured data and unstructured data about the goods. After collecting the semi-structured data and unstructured data, we will de-identify the data through technical means. In order to count the usage of our products / services, we will summarize, analyze and use the technically processed user data, and share the processed statistical information with third parties. We will use secure encryption technical processing methods and other methods to ensure that the recipient of the information cannot re-identify a specific individual.

[0061] In operation S220, a plurality of object class entities and relations between the plurality of object class entities are extracted from the first sample data set.

[0062] According to an embodiment of the present disclosure, an object-class entity representation refers to an object entity pointing to a specific product, a category of products, or a category of users, such as products of a certain brand, a certain type of products, products favored by a certain category of users, a certain category of users with the same preferences, etc.

[0063] According to an embodiment of the present disclosure, the data in the first sample data set has a preset data format, and thus, a rule model related to the preset data format can be manually constructed and used to extract multiple object class entities from the first sample data set using the rule model.

[0064] According to an embodiment of the present disclosure, an object class entity may include one or more classes of object entities, and the relationships between multiple object class entities include: relationships between object entities of the same class, and relationships between object entities of different classes.

[0065] In operation S230, a plurality of scenario entities are extracted from the second sample data set, wherein the scenario entities are used to describe the user's demand scenarios.

[0066] According to an embodiment of the present disclosure, the data in the second sample data set has a non-preset data format, and it is difficult to extract the scene entity used to characterize the user's needs from the second sample data in multiple data forms through rules. Therefore, the extraction model can be constructed using natural language processing (Natural Language Processing, NLP) technology, and the scene entity can be extracted from the second sample data set using the extraction model.

[0067] For example, the second sample data may include "what to use for headache" obtained from the search log, "this product is used to treat headache XXXXX" obtained from the product details page information, "good effect, but has XX defects", "bad effect" and other information obtained from the product review question and answer pairs. The second sample data is input into the extraction model, and the scenario entities of "XX symptom headache" and "XY symptom headache" are extracted from it.

[0068] In operation S240 , a relationship between a scene entity and an object class entity is determined, and a relationship between a plurality of scene entities is determined.

[0069] According to the embodiments of the present disclosure, since the scenario entity is used to describe the user's abstract demand scenario and the object-class entity is used to specifically describe the commodity dimension, commodity-related categories, brands, users and other dimensions, it is possible to overcome the semantic barrier between the scenario entity and the commodity dimension by establishing a relationship between the scenario entity and the object-class entity.

[0070] According to an embodiment of the present disclosure, a relation extraction model can be constructed by using natural language processing (NLP) technology, and the same or similar features between scene entities and object entities can be extracted using the relation extraction model, and the relationship between the scene entities and the object entities can be determined based on the extracted same or similar features. The relation extraction model can be the same as or different from the extraction model.

[0071] According to an embodiment of the present disclosure, a relationship extraction model may be used to extract the same or similar features between multiple scene entities, and the relationship between the multiple scene entities may be determined based on the extracted same or similar features.

[0072] In operation S250, a knowledge graph is constructed with object class entities and scene entities as nodes, and with relationships between multiple object class entities, relationships between scene entities and object class entities, and relationships between multiple scene entities as edges.

[0073] According to an embodiment of the present disclosure, a knowledge graph is composed of multiple nodes and edges between multiple nodes. In the process of constructing a knowledge graph, both object class entities and scene entities are used as nodes in the knowledge graph, and edges are generated between object class entities that have relationships, between object class entities and scene entities, and between multiple scene entities. Thus, a knowledge graph containing object class entities, scene entities, and overcoming the semantic gap between demand scenarios and commodities is obtained.

[0074] According to an embodiment of the present disclosure, knowledge graph construction software, such as Neo4j graph database, may be used to create nodes and edges to construct a knowledge graph.

[0075] According to an embodiment of the present disclosure, after constructing the knowledge graph, the knowledge graph can be stored in a server so as to implement object recommendation based on the knowledge graph on the server side. Alternatively, the knowledge graph can also be sent to a terminal device so as to implement object recommendation based on the knowledge graph on the terminal device side.

[0076] According to an embodiment of the present disclosure, in the process of extracting object class entities and scene entities, attribute data of the object class entities and scene entities can also be extracted from the first sample data set and the second sample data set respectively, so as to add attribute data to each node in the process of constructing the knowledge graph.

[0077] In the embodiments of the present disclosure, the knowledge graph not only includes object-class entities of commodity dimensions and commodity-related dimensions, but also includes scenario entities that characterize user needs, so that the constructed knowledge graph is not only applicable to object recommendation scenarios with clear needs, but also applicable to object recommendation scenarios with abstract needs, which improves the application scope of recommendations and the accuracy of abstract demand recommendations, while improving the user experience. In addition, in the process of constructing the knowledge graph, the use of structured, semi-structured and unstructured data can expand the data acquisition scope of the knowledge graph, build a more complete knowledge graph that integrates more features, and then expand the accuracy and application scope of the knowledge graph, which helps to improve the user experience.

[0078] Figure 3 A schematic diagram of a knowledge graph according to an embodiment of the present disclosure is schematically shown.

[0079] like Figure 3 As shown, the nodes in the knowledge graph include first-category object entities, second-category object entities, third-category object entities A, third-category object entities B, scene entities A, scene entities B, and scene entities C.

[0080] There are edges between the first-class object entity, the second-class object entity, and the scene entity A, that is, there is a relationship between the first-class object entity, the second-class object entity, and the scene entity A. There is a relationship between the third-class object entity A, the third-class object entity B, and the scene entity B, and there is a relationship between the scene entity B and the first-class object entity and the third-class object entity B. There is a relationship between the scene entity A and the scene entity C.

[0081] For example, for an object recommendation scenario with abstract requirements, after matching scene entity A according to the user's search term, the recommended object can be determined as a first-category object entity based on the knowledge graph. After matching scene entity C according to the user's search term, the recommended object can be indirectly determined as a first-category object entity based on the relationship between scene entity C and scene entity A.

[0082] According to an embodiment of the present disclosure, the object class entity includes a first class object entity, and the first class object entity uniquely corresponds to a commodity object. Determining the relationship between the scene entity and the object class entity includes: for each scene entity, obtaining text description information related to the scene entity, wherein the text description information is used to supplement the scene requirements of the scene entity; fusing the text description information with the first class object entity and the scene entity respectively to obtain first fusion data and second fusion data; and determining the relationship between the scene entity and the first class object entity based on the first fusion data and the second fusion data.

[0083] According to the embodiments of the present disclosure, the first type of object entity uniquely corresponds to a commodity object, and therefore, the first type of object entity can be regarded as an object entity of the commodity dimension. The object entity can also include other types of object entities of commodity-related dimensions, such as the second type of object entity, the third type of object entity, etc. The second type of object entity is used to characterize the type to which the first type of object entity belongs, and the third type of object entity is used to characterize the brand to which the first type of object entity belongs.

[0084] According to an embodiment of the present disclosure, the relationship between the scene entity and the first-class object entity of the commodity dimension can be determined first, and then based on the relationship between the first-class object entity and other-class object entities, the relationship between the scene entity and other-class object entities can be indirectly determined to determine the relationship between the scene entity and the object-class entity.

[0085] According to an embodiment of the present disclosure, the text description information may be a description text of the scene entity obtained from a third-party platform. For example, for a knowledge graph in the health field, description text of health symptoms and product treatment effects may be obtained from a third-party platform.

[0086] According to an embodiment of the present disclosure, after determining the text description information related to the scene, the text description information can be fused with the first type of object entity and the scene entity to obtain first fused data and second fused data. For example, the text description information can be directly concatenated with the first type of object entity and the scene entity to obtain first fused data and second fused data.

[0087] At this time, since the first fused data and the second fused data have added external text description information, they can more specifically indicate the user needs indicated by the scene entity and the user needs applicable to the first type of object entity through the external description information, thereby achieving semantic enhancement.

[0088] According to an embodiment of the present disclosure, the relationship between the scene entity and the first type of object entity may be determined by extracting and comparing similar features between the first fused data and the second fused data.

[0089] Since text information such as scene entities and object-like entities has the characteristics of complex semantics, and scene entities are usually relatively short, directly matching scene entities with first-class object entities to achieve relationship extraction is not effective. Therefore, the embodiment of the present disclosure obtains text description data related to scene entities from outside the second sample data to make up for the problem of poor relationship extraction caused by complex semantics and short scene entities, and enhances the semantics of scene entities and object-like entities by semantic enhancement, which can improve the model's ability to understand the relationship between words, better realize the relationship extraction between scene entities and first-class object entities, and improve the accuracy of relationship extraction.

[0090] According to an embodiment of the present disclosure, the process of determining the relationship between a scene entity and other types of object entities includes the following steps: determining the second relationship between the scene entity and the second type of object entity based on the first relationship between the first type of object entity and the second type of object entity and the relationship between the scene entity and the first type of object entity; determining the fourth relationship between the scene entity and the third type of object entity based on the third relationship between the first type of object entity and the third type of object entity and the relationship between the scene entity and the first type of object entity.

[0091] According to the embodiments of the present disclosure, since the second-category object entity and the third-category object entity are both object entities of commodity-related dimensions, there is no semantic barrier between the second-category object entity and the third-category object entity and the first-category object entity. The first relationship between the first-category object entity and the second-category object entity can be directly extracted based on the rule model, and the third relationship between the first-category object entity and the third-category object entity can be extracted based on the rule model.

[0092] According to an embodiment of the present disclosure, after the relationship extraction between the scene entity and the first category object entity has been completed, the second relationship between the scene entity and the second category object entity is determined based on the first relationship and the relationship between the scene entity and the first category object entity; and the fourth relationship between the scene entity and the third category object entity is determined based on the third relationship and the relationship between the scene entity and the third category object entity.

[0093] For example, the commodity object of the first type of object entity is "XX medicine", the second type of object entity is "painkillers", and the third type of object entity is "Brand C". The relationship between the above three types of object entities is: "XX medicine" is "painkillers" of "Brand C". After determining the relationship between "XX medicine" and the scene entity "unbearable headache", the relationship between the scene entity and "Brand C" and "painkillers" can be established respectively based on the relationship between the three types of object entities.

[0094] In the embodiments of the present disclosure, the relationships between scene entities and object class entities, as well as the relationships between object class entities, are indirectly determined, which not only overcomes the problem of semantic barriers between commodity-related dimensions and scene entities, but also reduces the workload of relationship extraction, improves the efficiency of constructing knowledge graphs, and reduces construction costs.

[0095] According to an embodiment of the present disclosure, the object class entity also includes a fourth class object entity for pointing to a user. The relationship between the fourth class object entity and the first class object entity, the second class object entity, and the third class object entity can be extracted through a rule model. Afterwards, the sixth relationship between the scene entity and the fourth class object entity can be determined based on the fifth relationship between the fourth class object entity and the first class object entity and the relationship between the scene entity and the first class object entity.

[0096] As a specific embodiment of the present disclosure, the relationship between scene entities includes relationship type and relationship strength, the relationship type includes highly associated scene, upstream scene, downstream scene, etc., and the relationship strength is determined based on the user's purchase, add-to-cart, browse, favorite, etc. behavior data. The relationship between the scene entity and each type of object entity in the object class entity includes the relationship strength.

[0097] As a specific embodiment of the present disclosure, the relationship between the first type of object entity and the first type of object entity, between the second type of object entity and the second type of object entity, between the third type of object entity and the third type of object entity, and between the fourth type of object entity and the fourth type of object entity all include relationship type and relationship strength. The relationship type between the first type of object entity and the first type of object entity includes high association, upstream goods and downstream goods; the relationship type between the second type of object entity and the first type of object entity includes high association category, upstream category and downstream category; the relationship type between the third type of object entity and the third type of object entity includes competitive brand, associated brand and included brand; the relationship type between the fourth type of object entity and the fourth type of object entity includes similar users, friends, relatives, etc.

[0098] As a specific embodiment of the present disclosure, the relationship between the first type of object entity and the fourth type of object entity includes the purchase frequency and activity of the product, and the relationship between the third type of object entity and the fourth type of object entity includes the purchase frequency and activity of the brand. The relationship between other object class entities is a containment relationship, such as a product belongs to a certain brand, a brand includes certain categories, etc.

[0099] According to an embodiment of the present disclosure, the text description information is fused with the first type of object entity and the scene entity respectively to obtain the first fused data and the second fused data, including: performing word segmentation on the first type of object entity, the scene entity and the text description information to obtain the first word segmentation data corresponding to the first type of object entity, the second word segmentation data corresponding to the scene entity and the third word segmentation data corresponding to the text description information; encoding the data after the fusion of the first word segmentation data and the third word segmentation data to obtain the first embedded data of the fused text description information and the first type of object entity; encoding the data after the fusion of the second word segmentation data and the third word segmentation data to obtain the second embedded data of the fused text description information and the scene entity; performing feature extraction on the first embedded data to obtain the first fused data; and performing feature extraction on the second embedded data to obtain the second fused data.

[0100] According to the embodiments of the present disclosure, the first-class object entity, the scene entity and the text description information can be segmented using a segmentation algorithm, for example, the Jieba algorithm, the Hidden Markov Model (HMM), the Conditional Random Field (CRF) model, etc. The present disclosure does not limit the segmentation technology, and any algorithm that can be used for segmentation can be used.

[0101] According to an embodiment of the present disclosure, the first word segmentation data, the second word segmentation data and the third word segmentation data all take words as the minimum granularity.

[0102] According to an embodiment of the present disclosure, encoding the data after the fusion of the second word segmentation data and the third word segmentation data to obtain the second embedded data that fuses the text description information and the scene entity includes: splicing the second word segmentation data and the third word segmentation data, and converting the spliced ​​data into the first embedded data in the form of a vector. Similarly, splicing the first word segmentation data and the third word segmentation data, and converting the spliced ​​data into the second embedded data in the form of a vector.

[0103] According to an embodiment of the present disclosure, the concatenated data may be converted into first embedded data and second embedded data in the form of Embeddings through an embedding model.

[0104] According to an embodiment of the present disclosure, the feature extraction operation can be implemented through a feature extraction layer. The feature extraction layer includes a gate recurrent unit (GRU) and a bidirectional gate recurrent unit (BiGRU). After the first embedded data is input into the GRU, preliminary feature extraction can be performed on the first embedded data through the hidden layer in the GRU, and the first embedded data and the output of the GRU are also input into the BiGRU for further feature extraction. Finally, the output vector of the GRU and the output vector of the BiGRU are concatenated to obtain the first fused data. Similarly, the second embedded data is also subjected to the above-mentioned feature extraction operation to generate the second fused data, which will not be repeated here.

[0105] In the embodiments of the present disclosure, by utilizing GRU and BiGRU, by fusing GRU and the first embedded data at the input of BiGRU and fusing GRU and BiGRU at the output stage of BiGRU, it is possible to capture the semantic information hidden in the text of the first category object entities and scene entities and perform feature extraction, thereby avoiding the problem of insufficient feature extraction due to the semantic complexity of the first category object entities and scene entities.

[0106] Figure 4A The flowchart of the method for determining the relationship between the scene entity and the first type of object entity is schematically shown.

[0107] like Figure 4A As shown, the method 400 for determining the relationship between a scene entity and a first-category object entity takes a first-category object entity 401 and a scene entity 407 as inputs, and outputs a relationship 411 between the scene entity and the first-category object entity.

[0108] For the first type of object entity 401, after determining the text description information 402 related to the first type of object entity 401, the text description information 402 can be segmented to obtain third segmented data 403; at the same time, the first type of object entity 401 can also be segmented to obtain first segmented data 404. The third segmented data 403 is fused with the first segmented data 404 and the fused data is encoded to obtain first embedded data 405, and then the first embedded data 405 is feature extracted to obtain first fused data 406.

[0109] For the scene entity 407, after the second segmentation data 408 is obtained through segmentation, the third segmentation data 403 of the text description information 402 related to the first type of object entity 401 can also be fused, and the fused data is encoded to obtain the second embedded data 409. Similar to determining the first fused data 406, after feature extraction is performed on the second embedded data 409, the second fused data 410 is obtained.

[0110] By continuing to extract features from the first fused data 406 and the second fused data 410 , a relationship 411 between the scene entity and the first type of object entity is output.

[0111] According to an embodiment of the present disclosure, the relationship between the scene entity and the first category object entity is determined based on the first fusion data and the second fusion data, including: inputting the first fusion data into a multi-head self-attention mechanism network to obtain an output first global semantic feature; inputting the second fusion data into the multi-head self-attention mechanism network to obtain an output second global semantic feature; inputting the first fusion data into a convolutional neural network to obtain an output first local semantic feature; inputting the second fusion data into a convolutional neural network to obtain an output second local semantic feature; inputting the first global semantic feature and the first local semantic feature into a pooling layer to obtain an output first semantic feature result; inputting the second global semantic feature and the second local semantic feature into a pooling layer to obtain an output second semantic feature result; and determining the relationship between the scene entity and the first category object entity based on the first semantic feature result and the second semantic feature result.

[0112] According to an embodiment of the present disclosure, a multi-headed self-attention (MSA) network includes multiple parallel self-attention networks, each of which is used to extract features of different dimensions through different linear transformations. The input of each self-attention network in the multi-headed self-attention network is the first fusion data, and the output of the multi-headed self-attention network is the output of the combined multiple self-attention networks, that is, the first global semantic feature.

[0113] According to an embodiment of the present disclosure, in each self-attention mechanism network, by performing inter-sentence crossover on the first fusion data, the hidden semantic relationship and cross-information between each word and the context in the first fusion data are obtained, and the relationship between the sentence context is cross-extracted, thereby obtaining richer global semantic features.

[0114] According to an embodiment of the present disclosure, while a multi-head self-attention mechanism network is used to extract global semantic features, a convolutional neural network (CNN) is used to extract local features of the first fused data. For example, multiple convolution kernels with the same dimension as the word vector of the first fused data can be used to perform multiple convolutions on the first fused data, and multiple local semantic features with the same number of convolution kernels, such as N-gram features, can be output; then, the first local semantic feature is obtained by fusing the multiple local semantic features.

[0115] According to an embodiment of the present disclosure, the processing of the second fused data using the MSA network and the CNN is similar to the processing of the first fused data, which will not be repeated here.

[0116] According to an embodiment of the present disclosure, the pooling layer includes an average pooling layer and a maximum pooling layer. The first semantic feature result includes a first sub-feature and a second sub-feature, which are respectively used to characterize the global information and key information of the first fused data; the second semantic feature result includes a third sub-feature and a fourth sub-feature, which are respectively used to characterize the global information and key information of the second fused data.

[0117] Specifically, taking the first fused data as an example, the first global semantic feature and the first local semantic feature are concatenated and input into the average pooling layer and the maximum pooling layer respectively to extract global information and key information for the first fused data.

[0118] According to an embodiment of the present disclosure, a first similarity between the first sub-feature and the third sub-feature is calculated, and a second similarity between the second sub-feature and the fourth sub-feature is calculated. The first similarity and the second similarity are weightedly added and normalized to obtain a prediction result characterizing the relationship between the scene entity and the first category object entity.

[0119] In the embodiments of the present disclosure, a multi-head self-attention mechanism network and a convolutional neural network are used respectively to realize global semantic feature extraction and local semantic feature extraction of the first fusion data / second fusion data, and fully extract the features between the first type of object entity and the scene entity; the global information and key information are extracted again through the pooling layer, so as to jointly determine the relationship between the scene entity and the first type of object entity from both global and local perspectives. Through the above feature extraction process, the technical problem of poor relationship extraction effect caused by the complex semantics of scene entities and object-class entities and the brevity of scene entities can be further overcome.

[0120] Figure 4B The flowchart of the method for determining the relationship between the scene entity and the first type of object entity according to the first fusion data and the second fusion data is schematically shown.

[0121] like Figure 4B As shown, the method 400B for determining the relationship between the scene entity and the first type of object entity based on the first fused data and the second fused data schematically shows the process of feature extraction. The solid line part represents the feature extraction process for the first fused data 406, and the dotted line part represents the feature extraction process for the second fused data 410.

[0122] For the first fused data 406, the first fused data 406 is respectively input into the multi-head self-attention mechanism network 412 and the convolutional neural network 414 to obtain the output first global semantic feature and the first local semantic feature respectively; after the first global semantic feature and the first local semantic feature are input into the pooling layer, the output first semantic feature result 413 is obtained.

[0123] For the second fused data 410, the second fused data 410 is respectively input into the multi-head self-attention mechanism network 412 and the convolutional neural network 414 to obtain the output second global semantic features and second local semantic features respectively; after the second global semantic features and the second local semantic features are input into the pooling layer, the output second semantic feature result 415 is obtained.

[0124] According to the first semantic feature result 413 and the second semantic feature result 415 , a relationship 411 between the scene entity and the first type of object entity may be determined.

[0125] Figure 5 The structural diagram of the relationship extraction model according to the embodiment of the present disclosure is schematically shown.

[0126] like Figure 5 As shown in the figure, for the product recommendation scenario in the health field, the relationship extraction model includes an embedding layer that incorporates external health knowledge, a feature extraction layer, a global-local cross fusion layer, and a prediction layer.

[0127] For scenario A, in the embedding layer that incorporates external health knowledge, scenario A can be segmented to obtain "A word", and the segmentation data of external health knowledge can be integrated into the segmentation data of scenario A to obtain "A' word". Embedding encoding is performed on "A' word" to obtain embedded data. Feature extraction is performed on the embedded data of "A' word" in the feature extraction layer to obtain the corresponding fused data.

[0128] The operation on product B is similar to that of scenario A. In the embedding layer that integrates external health knowledge, product B is segmented to obtain "B word". After the segmentation data of external health knowledge is integrated into the segmentation data of product B, "B' word" is obtained. Then, "B' word" is embedded and encoded to obtain embedded data. After that, feature extraction is performed on the embedded data of "B' word" in the feature extraction layer to obtain the corresponding fused data.

[0129] The global-local cross-fusion layer includes a multi-head self-attention mechanism network and a convolutional neural network. The global-local cross-fusion layer extracts global semantic features and local semantic features from scene A and product B. The prediction layer calculates similar features of global semantic features and local semantic features, and outputs the prediction results that represent the relationship between scene A and product B.

[0130] According to an embodiment of the present disclosure, multiple scene entities are extracted from a second sample data set, including: inputting each second sample data in the second sample data set into an extraction model to obtain at least one scene entity as an output, thereby obtaining a scene entity set for the second sample data set; and fusing at least two scene entities in the scene entity set that represent the same user demand scenario to obtain multiple scene entities.

[0131] According to the embodiments of the present disclosure, since the data in the first sample data set and the second sample data set come from one or more data sources, there are scene entities or object-class entities with different text descriptions but the same actual needs or actual objects, which further leads to duplication of relationships between scene entities, relationships between object-class entities, and relationships between scene entities and object-class entities. Therefore, in the entity extraction stage, at least two scene entities representing the same user demand scene in the scene entity set can be fused to obtain multiple scene entities; similarly, at least two object-class entities representing the same object entity in the object-class entity set can be fused to obtain multiple object-class entities.

[0132] In both the relationship extraction stage and the attribute data extraction stage, repeated relationship and attribute data are fused.

[0133] According to an embodiment of the present disclosure, at least two scene entities representing the same user demand scenario in a scene entity set can be fused according to entity disambiguation and entity alignment technology to obtain multiple scene entities; at least two object class entities representing the same object entity in an object class entity set can be fused to obtain multiple object class entities.

[0134] For example, for scene entities, the semantic similarity of multiple scene entities can be calculated, and two scene entities with similarity greater than or equal to a certain threshold are merged; two scene entities with similarity less than a certain threshold are retained. In the relationship extraction stage, when two scene entities are merged, the relationship between the two merged scene entities is deduplicated and merged to achieve relationship fusion.

[0135] According to an embodiment of the present disclosure, the storage form of attribute data is key-value, where key is the attribute name of the attribute data and value is the attribute value. In the attribute data extraction stage, the attribute name similarity between the attribute data is calculated according to the vector form of the attribute name, and the attribute value similarity between the attribute data is calculated according to the vector form of the attribute value. The similarity between the attribute data is obtained by weighted summation of the attribute value similarity and the attribute name similarity. The attribute name similarity can be reflected by string distance or word vector distance. Different attribute value categories correspond to different attribute value similarity calculation methods, such as string categories can be reflected by string distance; numerical categories and Boolean categories can be reflected by 0 / 1 to represent whether the attribute values ​​are the same or not. Similarly, the fusion of attribute data can also be achieved based on threshold judgment.

[0136] According to the embodiments of the present disclosure, entity fusion, attribute data fusion and relationship fusion of object-type entities are similar to those of scene entities, and are not described in detail here.

[0137] Since the same abstract user demand usually has multiple ways of expression from a textual perspective, the embodiments of the present disclosure can further fuse similar or repeated abstract user demands by performing entity fusion on the extracted scene entities, so that the scene entities constructed in the knowledge graph can more accurately reflect user demands, thereby improving the accuracy of the constructed knowledge graph, reducing the construction of repeated scene entities and their relationships in the knowledge graph, and reducing the scale and construction cost of the knowledge graph.

[0138] According to an embodiment of the present disclosure, the extraction model includes an encoding layer, a bidirectional long short-term memory network layer and a conditional random field layer; each second sample data in the second sample data set is input into the extraction model, and at least one scene entity is output, including: the second sample data is input into the encoding layer to obtain an output sample semantic vector, wherein the sample semantic vector includes a vector representation of each word in the second sample data; the sample semantic vector is input into the bidirectional long short-term memory network layer to obtain an output initial scene entity sequence; and the initial scene entity sequence is input into the conditional random field layer to obtain an output final scene entity sequence, wherein the final scene entity sequence includes at least one scene entity.

[0139] According to an embodiment of the present disclosure, the encoding layer may be a word-granularity pre-trained model RoBERTa-wwm, which is used to extract semantic and positional features of the second sample data and convert the text data into a sample semantic vector.

[0140] The bidirectional long short-term memory network layer includes a bidirectional long short-term memory network (Bi Long Short-Term Memory, BiLSTM), which is used to learn the position relationship of the word vector in the second sample data in the entire second sample data and the context relationship of the word vector from the forward propagation process and the backward propagation process, and concatenate the two parts of the features to obtain the initial scene entity sequence.

[0141] The Conditional Random Field (CRF) layer is used to restrict the sequence relationship between the initial scene entities in the initial scene entity sequence to obtain one or more scene entities with a higher probability of output.

[0142] Figure 6 The structural diagram of the extraction model according to the embodiment of the present disclosure is schematically shown.

[0143] like Figure 6 As shown in the figure, for the second sample data "cervical discomfort" input, RoBERTa-wwm converts "cervical discomfort" into a sample semantic vector of word granularity and outputs it to the BiLSTM layer. The BiLSTM layer outputs the initial scene entity sequence through learning in a bidirectional propagation process, where the initial scene entity sequence is still a scene entity representation with words as the minimum granularity. The CRF layer calculates the conditional probability of each word appearing in the initial scene entity sequence and obtains the output sequence [O, O, B-LOC, I-LOC].

[0144] In the embodiments of the present disclosure, based on the RoBERTa-wwm-BiLSTM-CRF extraction model, entity extraction and accurate semantic parsing at the semantic level can be achieved in unstructured text, thereby improving the accuracy of the extracted scene entities.

[0145] According to an embodiment of the present disclosure, before obtaining the first sample data set and the second sample data set, it also includes: using a large model to learn data features of an initial sample data set, and using the learned large model to generate a second sample data set, wherein the initial sample data set includes multiple initial sample data, the data volume of the initial sample data set is smaller than the data volume of the second sample data set, and the initial sample data includes unstructured data.

[0146] In the embodiments of the present disclosure, a high-quality initial sample data set is first artificially constructed, and the parameters of the large model are tuned so that the large model learns the features of a small number of initial sample data sets. Then, data enhancement is performed using the learned large model to automatically generate a second sample data set. For the generated second sample data set, the training set and the validation set are divided based on a ratio of 3:1 to train the constructed extraction model. The use of a large model can effectively reduce the labor cost of constructing a training data set.

[0147] According to an embodiment of the present disclosure, the knowledge graph construction method based on the above-mentioned knowledge graph construction can realize the construction of the knowledge graph including scene entities. Afterwards, the knowledge graph including scene entities can realize object recommendation.

[0148] Figure 7 The flowchart of the object recommendation method based on the knowledge graph according to an embodiment of the present disclosure is schematically shown.

[0149] like Figure 7 As shown, the knowledge graph-based object recommendation method 700 includes operations S710 to S740.

[0150] In operation S710, target information is extracted from text information input by a user.

[0151] In operation S720, based on the pre-constructed knowledge graph, a target node matching the target information is determined.

[0152] In operation S730, at least one recommended object related to the target node is determined according to the node type of the target node.

[0153] In operation S740, a target recommended object is determined based on the attribute data of at least one recommended object.

[0154] According to an embodiment of the present disclosure, the text information may be a search term input through various operations such as voice, touch screen, typing, etc. The target information represents information extracted from the text information.

[0155] For example, if the text information is “Headache is unbearable, how to relieve headache”, the target information extracted from the text information may be “headache”.

[0156] According to an embodiment of the present disclosure, text data can be input into an extraction model constructed using NLP technology, or other extraction models, to extract target information. It should be noted that the extraction model adopted by the object recommendation method based on the knowledge graph can be the same as or different from the extraction model adopted by the above-mentioned knowledge graph construction method.

[0157] According to an embodiment of the present disclosure, the target information may be keywords, brands, categories related to commodities, or may be scenario information used to describe user needs.

[0158] For example, the target information may be the name of the product "AA capsules", the brand name "XX company", the type "cough medicine", or the scenario information describing the user's needs, such as "sore throat" or "cough relief".

[0159] According to an embodiment of the present disclosure, a knowledge graph is pre-constructed based on a plurality of object class entities extracted from a first sample data set, the relationship between the plurality of object class entities, a plurality of scene entities extracted from a second sample data set, the relationship between the scene entities; and the relationship between the scene entities and the object class entities. The first sample data set includes a plurality of first sample data, and the second sample data set includes a plurality of second sample data. The construction method refers to the construction method of the knowledge graph described above, which will not be repeated here.

[0160] According to an embodiment of the present disclosure, after determining the target information, the similarity between the word vector of the target information and the word vectors of all nodes in the knowledge graph can be calculated, and the node with the highest similarity can be determined as the target node that matches the target information.

[0161] According to an embodiment of the present disclosure, the node type of the target node can be: a scene entity, or an object-type entity, such as a first-type object entity, a second-type object entity, a third-type object entity, etc. Since the scene entity is used to characterize the user's demand scenario, the object-type entity can point to a certain commodity object or a certain class / type of commodity objects with the same characteristics. Therefore, for target nodes of different node types, different recommendation strategies are required to determine at least one recommended object related to the target node based on the recommendation strategy corresponding to the node type.

[0162] For example, the recommendation strategy may be related to quantity, and different node types may point to different numbers of recommended objects. According to the node type of the target node, determining at least one recommended object related to the target node includes: determining the number of candidates corresponding to the node type. Then, based on the order of similarity from high to low, determining at least one recommended object corresponding to the above number of candidates. Alternatively, in other embodiments, the recommendation strategy may also be related to the recommended path, etc.

[0163] According to an embodiment of the present disclosure, the recommended object is the commodity object pointed to by the first-category object entity in the knowledge graph, and the first-category object entity is a node in the knowledge graph, and each node in the knowledge graph includes attribute data. Therefore, after determining the recommended object, the attribute data of each recommended object can be obtained from the knowledge graph.

[0164] According to an embodiment of the present disclosure, after obtaining attribute data of at least one recommended object from the knowledge graph, a target recommended object is determined from the at least one recommended object according to the attribute data. For example, the attribute data may be a selection weight obtained by analyzing historical information, and the target recommended object is determined according to the size of the selection weight. The target recommended object may be one or more.

[0165] In the embodiments of the present disclosure, since the target information extracted from the text information input by the user may be an object class description with clear requirements or a scene description with abstract requirements, by utilizing a knowledge graph including scene entities and object class entities, it is possible to simultaneously recommend text information with abstract requirements and clear requirements, thereby improving the scope of application of the recommended scenarios and the accuracy of the recommendations for abstract requirements, while also improving the user experience.

[0166] According to an embodiment of the present disclosure, the knowledge graph includes scenario entities for characterizing user demand scenarios; according to the node type of the target node, at least one recommended object related to the target node is determined, including: in response to the node type being a scenario entity, at least one related scenario entity related to the target node is determined, wherein the related scenario entity is a scenario entity connected to the target node through an edge in the knowledge graph; and according to the target node and at least one related scenario entity, at least one recommended object is determined.

[0167] According to the embodiments of the present disclosure, since the user's scenario requirements are relatively abstract, when the node type of the target node is a scene entity, the selection range of the scene entity is expanded, and recommended objects are selected not only based on the target node, but also based on related scene entities related to the target node.

[0168] According to an embodiment of the present disclosure, after determining the target node, multiple nodes directly connected to the target node through edges may be determined first; and then, based on the node types of the multiple nodes, at least one related scene entity related to the target node may be selected.

[0169] In the embodiments of the present disclosure, considering that scene entities are abstract, vague, short in length, and have complex semantics, by determining at least one related scene entity related to the target node, the recommendation scope can be expanded to further improve the recommendation accuracy.

[0170] According to an embodiment of the present disclosure, at least one recommended object related to the target node is determined according to the node type of the target node, and further includes: in response to the node type being a first-class object entity, taking the commodity object uniquely corresponding to the first-class object entity as the recommended object. That is, in the case where the target node matching the target information itself points to a commodity object, the commodity object corresponding to the first-class object entity is directly taken as the recommended object.

[0171] According to an embodiment of the present disclosure, it also includes: in response to the node type being a second-class object entity or a third-class object entity, determining at least one first-class object entity related to the second-class object entity or the third-class object entity, and taking the commodity object corresponding to the at least one first-class object entity as at least one recommended object related to the target node, wherein the third-class object entity is used to characterize the brand to which the first-class object entity belongs. That is, in the case where the target node matching the target information points to a category or brand, the commodity objects corresponding to all directly related first-class object nodes under the brand or category are taken as recommended objects.

[0172] Figure 8 The flowchart of the method for determining commodity recommendation objects according to an embodiment of the present disclosure is schematically shown.

[0173] like Figure 8 As shown, in the method 800 for determining a commodity recommendation object, the node type of the target node 801 may be a scene entity 802 , a first type object entity 804 , a second type object entity 806 , or a third type object entity 807 .

[0174] When the node type of the target node 801 is the scene entity 802, the related scene entity 803 related to the scene entity 802 is determined, and then the first-category object entity 804 related to the scene entity 802 and / or the related scene entity 803 is determined, and the commodity object 805 corresponding to the first-category object entity 804 is used as a recommended object.

[0175] When the node type of the target node 801 is the first-category object entity 804 , the commodity object 805 corresponding to the first-category object entity 804 is directly used as the recommended object.

[0176] When the node type of the target node 801 is the second-type object entity 806 , the first-type object entity 804 related to the second-type object entity 806 is determined, and the commodity object 805 corresponding to the first-type object entity 804 is used as a recommendation object.

[0177] When the node type of the target node 801 is the third-type object entity 807 , the first-type object entity 804 related to the third-type object entity 807 is determined, and the commodity object 805 corresponding to the first-type object entity 804 is used as a recommendation object.

[0178] According to an embodiment of the present disclosure, the node type of the target node 801 may also be a fourth type of object entity for pointing to the user, which is not shown in the figure. In the case where the node type of the target node is a fourth type of object entity, a first type of object entity related to the fourth type of object entity is determined, and the commodity object corresponding to the first type of object entity is used as a recommended object.

[0179] According to an embodiment of the present disclosure, the node types in the knowledge graph include object class entities, the object class entities include first-class object entities, and the first-class object entities uniquely correspond to a commodity object; according to the target node and at least one related scene entity, at least one recommended object is determined, including: based on the knowledge graph, determining at least one first-class object entity related to the target node and / or at least one related scene entity; and taking the commodity object corresponding to the first-class object entity as the recommended object.

[0180] According to the embodiments of the present disclosure, since the scene entity can only represent the needs of the user and cannot directly determine the recommended object, and the first-category object entity uniquely corresponds to a commodity object, the recommended object can be indirectly determined through the first-category object entity related to the scene entity in the knowledge graph.

[0181] According to the embodiments of the present disclosure, at least one node connected to the target node through an edge and at least one node connected to each related scene entity through an edge can be determined in the knowledge graph; at least one first-category object entity can be determined from at least one node obtained from the above two directions according to the node type. The commodity object corresponding to the at least one first-category object entity can be directly used as at least one recommended object.

[0182] According to the embodiments of the present disclosure, through the relationship between the scene entity and the first-category object entity in the knowledge graph, the recommended object in the abstract demand scenario can be indirectly determined, and the object recommendation in the abstract demand scenario can be realized with a simple process.

[0183] According to an embodiment of the present disclosure, an object class entity includes a second class object entity, and the second class object entity is used to characterize the category to which the first class object entity belongs; the method also includes: based on the knowledge graph, determining at least one second class object entity related to at least one first class object entity; for each second class object entity, based on the knowledge graph, determining at least one supplementary first class object entity related to the second class object entity, wherein the supplementary first class object entity represents a first class object entity that belongs to the same category as at least one first class object entity and is different from the first class object entity; and taking the commodity objects corresponding to the at least one first class object entity and the at least one supplementary first class object entity respectively as at least one recommended object related to the target node.

[0184] According to an embodiment of the present disclosure, when the number of first-category object entities related to a target node and / or at least one related scene entity is greater than a preset threshold, in order to expand the number of recommended objects, at least one second-category object entity related to each first-category object entity may be determined from the knowledge graph, and then a supplementary first-category object entity related to each second-category object entity may be obtained. At this time, the number of recommended objects can be expanded in the dimension of categories by supplementing the first-category object entities.

[0185] According to an embodiment of the present disclosure, in the case where there is no first-category object entity directly connected to the target node and / or at least one related scene entity in the knowledge graph, at least one second-category object entity related to the target node and at least one related scene entity can also be determined, and a commodity object uniquely corresponding to at least one first-category object entity connected to at least one second-category object entity can be used as a recommended object.

[0186] According to an embodiment of the present disclosure, the object class entity also includes: a third class object entity used to characterize the brand to which the first class object entity belongs. The second class object entity can also be used to determine and supplement the first class object entity. The operation process is similar to the above-mentioned determination of supplementing the first class object entity using the second class object entity, and will not be repeated here. The third class object entity can achieve the expansion of the number of recommended objects in the dimension of brand.

[0187] According to an embodiment of the present disclosure, the attribute data includes at least one of the following: click popularity, sales volume, and evaluation; determining the target recommendation object based on the attribute data of at least one recommendation object includes: calculating the recommendation index value of each recommendation object based on the attribute data; and determining the target recommendation object from at least one recommendation object based on the recommendation index value.

[0188] Since the embodiments of the present disclosure use the commodity objects corresponding to the first-category object entities as recommendation objects, the attribute data of the recommendation objects can be understood as the attribute data of the first-category object entities. Sales volume and evaluation are used to characterize the sales volume and evaluation of the commodity objects uniquely corresponding to the first-category object entities in a certain period of time, respectively. Click popularity is determined based on the above sales volume and the user's activity in a certain period of time. Activity can be obtained by weighted calculation of user purchase, add to cart, browse, favorite and other behaviors.

[0189] According to an embodiment of the present disclosure, the node type may also exist as attribute data.

[0190] According to the embodiments of the present disclosure, for commodity objects in different fields, the attribute data of the first type of object entity may also include other information. For example, for the health e-commerce field, the attribute data may also include commodity name, price, discount information, applicable population, main diseases, applicable symptoms, ingredients and usage methods, etc.

[0191] According to an embodiment of the present disclosure, all items in the attribute data may be weighted and summed to obtain a recommendation index value for each recommended object; and one or more target recommended objects with the highest recommendation index value may be determined from at least one recommended object.

[0192] In an embodiment of the present disclosure, determining a target recommended object from at least one recommended object through attribute data can select an optimal target recommended object from multiple recommended objects to improve recommendation accuracy.

[0193] According to an embodiment of the present disclosure, multiple node types in a knowledge graph may have different attribute data. The attribute data of a scene entity may include a scene name, click heat, and heat level. The click heat of a scene entity may be determined by the following operation: taking the sum of the click heats of multiple first-class object entities related to the scene entity as the initial heat value, normalizing the initial heat values ​​of all scene entities, and obtaining the click heat of the scene entity. The heat level may be determined based on the click heat.

[0194] According to an embodiment of the present disclosure, the attribute data of the second-category object entity may include a category name and category heat, and the category heat may be determined by calculating the sum of click heats of multiple first-category object entities related to the second-category object entity, and a normalization operation. The attribute data of the third-category object entity may include a brand name and brand heat, and the brand heat may be determined by calculating the sum of click heats of multiple first-category object entities related to the third-category object entity, and a normalization operation. The attribute data of the fourth-category object entity may include gender, age, city level, purchasing power, and importance level.

[0195] Fig. 9 The structural block diagram of the knowledge graph construction device according to the embodiment of the present disclosure is schematically shown.

[0196] like Fig. 9 As shown, the knowledge graph construction device 900 of this embodiment includes an acquisition module 910, a first extraction module 920, a second extraction module 930, a third extraction module 940 and a construction module 950.

[0197] The acquisition module 910 is used to acquire a first sample data set and a second sample data set, wherein the first sample data set includes multiple first sample data, the second sample data set includes multiple second sample data, the first sample data includes structured data or semi-structured data, and the second sample data includes unstructured data.

[0198] The first extraction module 920 is used to extract multiple object class entities and the relationships between the multiple object class entities from the first sample data set.

[0199] The second extraction module 930 is used to extract multiple scene entities from the second sample data set, wherein the scene entities are used to describe the user's demand scenarios.

[0200] The third extraction module 940 is used to determine the relationship between the scene entity and the object class entity, and determine the relationship between multiple scene entities.

[0201] Construction module 950 is used to construct a knowledge graph with object class entities and scene entities as nodes, and relationships between multiple object class entities, relationships between scene entities and object class entities, and relationships between multiple scene entities as edges.

[0202] According to an embodiment of the present disclosure, the object class entity includes a first class object entity, and the first class object entity uniquely corresponds to a commodity object. The third extraction module 940 includes an acquisition submodule, a fusion submodule and a first relationship determination submodule.

[0203] The acquisition submodule is used to acquire text description information related to each scene entity, wherein the text description information is used to supplement the scene requirements of the scene entity.

[0204] The fusion submodule is used to fuse the text description information with the first type of object entity and the scene entity respectively to obtain first fused data and second fused data.

[0205] The first relationship determination submodule is used to determine the relationship between the scene entity and the first type of object entity according to the first fusion data and the second fusion data.

[0206] According to an embodiment of the present disclosure, the object class entity also includes a second class object entity and a third class object entity, the second class object entity is used to characterize the type to which the first class object entity belongs, and the third class object entity is used to characterize the brand to which the first class object entity belongs. The third extraction module 940 also includes a second relationship determination submodule and a third relationship determination submodule.

[0207] The second relationship determination submodule is used to determine the second relationship between the scene entity and the second type of object entity according to the first relationship between the first type of object entity and the second type of object entity and the relationship between the scene entity and the first type of object entity.

[0208] The third relationship determination submodule is used to determine the fourth relationship between the scene entity and the third type of object entity according to the third relationship between the first type of object entity and the third type of object entity and the relationship between the scene entity and the first type of object entity.

[0209] According to an embodiment of the present disclosure, the fusion submodule includes a word segmentation unit, a first encoding unit, a second encoding unit, a first feature extraction unit and a second feature extraction unit.

[0210] The word segmentation unit is used to segment the first type of object entity, the scene entity and the text description information to obtain first word segmentation data corresponding to the first type of object entity, second word segmentation data corresponding to the scene entity and third word segmentation data corresponding to the text description information.

[0211] The first encoding unit is used to encode the data obtained by fusing the first word segmentation data and the third word segmentation data to obtain first embedded data fusing the text description information and the first type of object entity.

[0212] The second encoding unit is used to encode the data obtained by fusing the second word segmentation data and the third word segmentation data to obtain second embedded data that fuses the text description information and the scene entity.

[0213] The first feature extraction unit is used to extract features from the first embedded data to obtain first fused data.

[0214] The second feature extraction unit is used to extract features from the second embedded data to obtain second fused data.

[0215] According to an embodiment of the present disclosure, the first relationship determination submodule includes a global semantic extraction unit, a local semantic extraction unit, a pooling unit and a relationship determination unit.

[0216] The global semantic extraction unit is used to input the first fused data into the multi-head self-attention mechanism network to obtain the output first global semantic feature; and input the second fused data into the multi-head self-attention mechanism network to obtain the output second global semantic feature.

[0217] The local semantic extraction unit is used to input the first fused data into the convolutional neural network to obtain the output first local semantic features; and input the second fused data into the convolutional neural network to obtain the output second local semantic features.

[0218] The pooling unit is used to input the first global semantic feature and the first local semantic feature into the pooling layer to obtain the output first semantic feature result; and input the second global semantic feature and the second local semantic feature into the pooling layer to obtain the output second semantic feature result.

[0219] The relationship determination unit is used to determine the relationship between the scene entity and the first type of object entity according to the first semantic feature result and the second semantic feature result.

[0220] According to an embodiment of the present disclosure, the second extraction module 930 includes a scene entity extraction submodule and an entity fusion submodule.

[0221] The scene entity extraction submodule is used to input each second sample data in the second sample data set into the extraction model to obtain at least one scene entity as output, and further obtain a scene entity set for the second sample data set.

[0222] The entity fusion submodule is used to fuse at least two scene entities representing the same user demand scene in the scene entity set to obtain multiple scene entities.

[0223] According to an embodiment of the present disclosure, the extraction model includes a coding layer, a bidirectional long short-term memory network layer and a conditional random field layer. The scene entity extraction submodule includes a first extraction unit, a second extraction unit and a third extraction unit.

[0224] The first extraction unit is used to input the second sample data into the encoding layer to obtain an output sample semantic vector, wherein the sample semantic vector includes a vector representation of each word in the second sample data.

[0225] The second extraction unit is used to input the sample semantic vector into the bidirectional long short-term memory network layer to obtain an output initial scene entity sequence.

[0226] The third extraction unit is used to input the initial scene entity sequence into the conditional random field layer to obtain an output final scene entity sequence, wherein the final scene entity sequence includes at least one scene entity.

[0227] According to an embodiment of the present disclosure, the knowledge graph construction device 900 also includes a training module, which is used to use a large model to learn data features of an initial sample data set before obtaining the first sample data set and the second sample data set, and use the learned large model to generate a second sample data set, wherein the initial sample data set includes multiple initial sample data, the data volume of the initial sample data set is smaller than the data volume of the second sample data set, and the initial sample data includes unstructured data.

[0228] Fig.10 The structural block diagram of the object recommendation device based on the knowledge graph according to an embodiment of the present disclosure is schematically shown.

[0229] like Fig.10 As shown, the object recommendation device 1000 based on the knowledge graph includes an information extraction module 1010 , a first determination module 1020 , a second determination module 1030 and a recommendation module 1040 .

[0230] The information extraction module 1010 is used to extract target information from the text information input by the user.

[0231] The first determination module 1020 is used to determine a target node that matches the target information based on a pre-constructed knowledge graph, wherein the knowledge graph is generated according to a knowledge graph construction method.

[0232] A second determination module 1030 is configured to determine at least one recommended object related to the target node according to the node type of the target node; and

[0233] The recommendation module 1040 is used to determine a target recommendation object according to the attribute data of at least one recommendation object.

[0234] According to an embodiment of the present disclosure, the knowledge graph includes scenario entities for characterizing user demand scenarios. The second determination module 1030 includes a first determination submodule and a second determination submodule.

[0235] The first determination submodule is used to determine at least one related scene entity related to the target node in response to the node type being a scene entity, wherein the related scene entity is a scene entity connected to the target node through an edge in the knowledge graph.

[0236] The second determination submodule is used to determine at least one recommended object according to the target node and at least one related scene entity.

[0237] According to an embodiment of the present disclosure, the knowledge graph includes object-type entities, the object-type entities include first-type object entities, and the first-type object entities uniquely correspond to a commodity object. The second determination submodule includes a first determination unit and a second determination unit.

[0238] The first determination unit is used to determine at least one first-category object entity related to the target node and / or at least one related scene entity based on the knowledge graph.

[0239] The second determining unit is configured to use the commodity object corresponding to at least one first-category object entity as at least one recommended object.

[0240] According to an embodiment of the present disclosure, the object class entity includes a second class object entity, and the second class object entity is used to characterize the category to which the first class object entity belongs. The second determining unit also includes a third determining unit, a fourth determining unit and a fifth determining unit.

[0241] The third determination unit is used to determine at least one second-category object entity related to at least one first-category object entity based on the knowledge graph.

[0242] The fourth determination unit is used to determine, for each second-category object entity, at least one supplementary first-category object entity related to the second-category object entity based on the knowledge graph, wherein the supplementary first-category object entity represents a first-category object entity that belongs to the same category as at least one first-category object entity and is different from the first-category object entity.

[0243] The fifth determining unit is used to use the commodity objects respectively corresponding to the at least one first-category object entity and the at least one supplementary first-category object entity as at least one recommended object related to the target node.

[0244] According to an embodiment of the present disclosure, the recommendation module 1040 includes a first recommendation submodule and a second recommendation submodule.

[0245] The first recommendation submodule is used to calculate the recommendation index value of each recommended object according to the attribute data.

[0246] The second recommendation submodule is used to determine a target recommendation object from at least one recommendation object according to the recommendation index value.

[0247] According to an embodiment of the present disclosure, any multiple modules among the acquisition module 910, the first extraction module 920, the second extraction module 930, the third extraction module 940 and the construction module 950 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module. Similarly, any multiple modules among the information extraction module 1010, the first determination module 1020, the second determination module 1030 and the recommendation module 1040 can be combined into one module for implementation, or any one of the modules can be split into multiple modules. Alternatively, at least part of the functions of one or more of these modules can be combined with at least part of the functions of other modules and implemented in one module.

[0248] According to an embodiment of the present disclosure, at least one of the acquisition module 910, the first extraction module 920, the second extraction module 930, the third extraction module 940 and the construction module 950 can be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application-specific integrated circuit (ASIC), or can be implemented by hardware or firmware such as any other reasonable way of integrating or packaging the circuit, or implemented in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, at least one of the acquisition module 910, the first extraction module 920, the second extraction module 930, the third extraction module 940 and the construction module 950 can be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function can be performed.

[0249] At least one of the information extraction module 1010, the first determination module 1020, the second determination module 1030 and the recommendation module 1040 may be at least partially implemented as a hardware circuit, such as a field programmable gate array (FPGA), a programmable logic array (PLA), a system on a chip, a system on a substrate, a system on a package, an application specific integrated circuit (ASIC), or may be implemented by hardware or firmware in any other reasonable way of integrating or packaging the circuit, or in any one of the three implementation methods of software, hardware and firmware or in an appropriate combination of any of them. Alternatively, at least one of the acquisition module 910, the first extraction module 920, the second extraction module 930, the third extraction module 940 and the construction module 950 may be at least partially implemented as a computer program module, and when the computer program module is run, the corresponding function may be performed.

[0250] It should be noted that the device part in the embodiments of the present disclosure corresponds to the method part in the embodiments of the present disclosure, and the specific method part of the description of the device part will not be repeated here.

[0251] Fig.11 A block diagram of an electronic device suitable for a method for constructing a knowledge graph and an object recommendation method based on a knowledge graph according to an embodiment of the present disclosure is schematically shown.

[0252] like Fig.11 As shown, the electronic device 1100 according to an embodiment of the present disclosure includes a processor 1101, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1102 or a program loaded from a storage part 1108 to a random access memory (RAM) 1103. The processor 1101 may include, for example, a general-purpose microprocessor (such as a CPU), an instruction set processor and / or a related chipset and / or a special-purpose microprocessor (for example, an application-specific integrated circuit (ASIC)), etc. The processor 1101 may also include an onboard memory for caching purposes. The processor 1101 may include a single processing unit or multiple processing units for performing different actions of the method flow according to an embodiment of the present disclosure.

[0253] In RAM 1103, various programs and data required for the operation of electronic device 1100 are stored. Processor 1101, ROM 1102 and RAM 1103 are connected to each other through bus 1104. Processor 1101 performs various operations of the method flow according to the embodiment of the present disclosure by executing the program in ROM 1102 and / or RAM 1103. It should be noted that the program can also be stored in one or more memories other than ROM 1102 and RAM 1103. Processor 1101 can also perform various operations of the method flow according to the embodiment of the present disclosure by executing the program stored in the one or more memories.

[0254] According to an embodiment of the present disclosure, the electronic device 1100 may further include an input / output (I / O) interface 1105, which is also connected to the bus 1104. The electronic device 1100 may further include one or more of the following components connected to the input / output I / O interface 1105: an input portion 1106 including a keyboard, a mouse, etc.; an output portion 1107 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage portion 1108 including a hard disk, etc.; and a communication portion 1109 including a network interface card such as a LAN card, a modem, etc. The communication portion 1109 performs communication processing via a network such as the Internet. A drive 1110 is also connected to the I / O interface 1105 as needed. A removable medium 1111, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 1110 as needed, so that a computer program read therefrom is installed into the storage portion 1108 as needed.

[0255] The present disclosure also provides a computer-readable storage medium, which may be included in the device / apparatus / system described in the above embodiments; or may exist independently without being assembled into the device / apparatus / system. The above computer-readable storage medium carries one or more programs, and when the above one or more programs are executed, the method according to the embodiment of the present disclosure is implemented.

[0256] According to an embodiment of the present disclosure, a computer-readable storage medium may be a non-volatile computer-readable storage medium, for example, may include but is not limited to: a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, an apparatus, or a device. For example, according to an embodiment of the present disclosure, a computer-readable storage medium may include the ROM 1102 and / or RAM 1103 described above and / or one or more memories other than ROM 1102 and RAM 1103.

[0257] The embodiment of the present disclosure also includes a computer program product, which includes a computer program, and the computer program contains program code for executing the method shown in the flowchart. When the computer program product is run in a computer system, the program code is used to enable the computer system to implement the above method provided by the embodiment of the present disclosure.

[0258] The above functions defined in the system / device of the embodiment of the present disclosure are performed when the computer program is executed by the processor 1101. According to the embodiment of the present disclosure, the system, device, module, unit, etc. described above can be implemented by a computer program module.

[0259] In one embodiment, the computer program may rely on tangible storage media such as optical storage devices, magnetic storage devices, etc. In another embodiment, the computer program may also be transmitted and distributed in the form of signals on a network medium, and downloaded and installed through the communication part 1109, and / or installed from a removable medium 1111. The program code contained in the computer program may be transmitted using any appropriate network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the above.

[0260] In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 1109, and / or installed from the removable medium 1111. When the computer program is executed by the processor 1101, the above functions defined in the system of the embodiment of the present disclosure are performed. According to the embodiment of the present disclosure, the system, device, means, module, unit, etc. described above can be implemented by a computer program module.

[0261] According to an embodiment of the present disclosure, the program code for executing the computer program provided by the embodiment of the present disclosure can be written in any combination of one or more programming languages. Specifically, these computing programs can be implemented using high-level process and / or object-oriented programming languages, and / or assembly / machine languages. Programming languages ​​include, but are not limited to, Java, C++, python, "C" language or similar programming languages. The program code can be executed entirely on the user computing device, partially on the user device, partially on the remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device can be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computing device (for example, using an Internet service provider to connect through the Internet).

[0262] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0263] It will be appreciated by those skilled in the art that the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways, even if such combinations and / or combinations are not explicitly described in the present disclosure. In particular, the features described in the various embodiments and / or claims of the present disclosure may be combined and / or combined in a variety of ways without departing from the spirit and teachings of the present disclosure. All of these combinations and / or combinations fall within the scope of the present disclosure.

[0264] The specific embodiments described above further illustrate the purpose, technical solutions and beneficial effects of the present disclosure. It should be understood that the above description is only a specific embodiment of the present disclosure and is not intended to limit the present disclosure. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present disclosure should be included in the protection scope of the present disclosure.

Claims

1. A method for constructing a knowledge graph. include: Acquire a first sample data set and a second sample data set, wherein the first sample data set includes a plurality of first sample data, the second sample data set includes a plurality of second sample data, the first sample data includes structured data or semi-structured data, and the second sample data includes unstructured data; Extracting a plurality of object class entities and relations between the plurality of object class entities from the first sample data set; Extracting a plurality of scenario entities from the second sample data set, wherein the scenario entities are used to describe the user's demand scenarios; Determining the relationship between the scene entity and the object class entity, and determining the relationship between a plurality of the scene entities; and A knowledge graph is constructed with the object class entity and the scene entity as nodes, and with the relationship between multiple object class entities, the relationship between the scene entity and the object class entity, and the relationship between multiple scene entities as edges.

2. The method according to claim 1, in, The object class entity includes a first class object entity, and the first class object entity uniquely corresponds to a commodity object; Wherein, determining the relationship between the scene entity and the object class entity includes: For each of the scene entities, obtaining text description information related to the scene entity, wherein the text description information is used to supplement the scene requirements of the scene entity; Fusing the text description information with the first type of object entity and the scene entity to obtain first fused data and second fused data; and The relationship between the scene entity and the first-category object entity is determined according to the first fused data and the second fused data.

3. The method according to claim 2, in, The object class entity further includes a second class object entity and a third class object entity, wherein the second class object entity is used to represent the type to which the first class object entity belongs, and the third class object entity is used to represent the brand to which the first class object entity belongs; Wherein, the determining the relationship between the scene entity and the object class entity further includes: Determine a second relationship between the scene entity and the second-category object entity according to a first relationship between the first-category object entity and the second-category object entity and a relationship between the scene entity and the first-category object entity; According to the third relationship between the first-category object entity and the third-category object entity and the relationship between the scene entity and the first-category object entity, a fourth relationship between the scene entity and the third-category object entity is determined.

4. The method according to claim 2, in, The fusing the text description information with the first type of object entity and the scene entity to obtain first fused data and second fused data comprises: Performing word segmentation on the first-category object entity, the scene entity, and the text description information to obtain first word segmentation data corresponding to the first-category object entity, second word segmentation data corresponding to the scene entity, and third word segmentation data corresponding to the text description information; Encoding the data obtained by fusing the first word segmentation data and the third word segmentation data to obtain first embedded data fusing the text description information and the first type of object entity; Encoding the data obtained by fusing the second word segmentation data and the third word segmentation data to obtain second embedded data fusing the text description information and the scene entity; performing feature extraction on the first embedded data to obtain the first fused data; and Perform feature extraction on the second embedded data to obtain the second fused data.

5. The method according to claim 2, in, The determining, according to the first fusion data and the second fusion data, the relationship between the scene entity and the first type of object entity comprises: Inputting the first fused data into a multi-head self-attention mechanism network to obtain a first global semantic feature as an output; inputting the second fused data into the multi-head self-attention mechanism network to obtain a second global semantic feature as an output; Inputting the first fused data into a convolutional neural network to obtain a first local semantic feature as an output; inputting the second fused data into the convolutional neural network to obtain a second local semantic feature as an output; Inputting the first global semantic feature and the first local semantic feature into a pooling layer to obtain an output first semantic feature result; inputting the second global semantic feature and the second local semantic feature into the pooling layer to obtain an output second semantic feature result; and The relationship between the scene entity and the first type of object entity is determined according to the first semantic feature result and the second semantic feature result.

6. The method according to any one of claims 1 to 5, in, The extracting a plurality of scene entities from the second sample data set comprises: Inputting each second sample data in the second sample data set into the extraction model to obtain at least one scene entity as output, thereby obtaining a scene entity set for the second sample data set; and At least two scene entities representing the same user demand scene in the scene entity set are merged to obtain a plurality of the scene entities.

7. The method according to claim 6, in, The extraction model includes a coding layer, a bidirectional long short-term memory network layer and a conditional random field layer; wherein, inputting each second sample data in the second sample data set into the extraction model and outputting at least one scene entity includes: Inputting the second sample data into the encoding layer to obtain an output sample semantic vector, wherein the sample semantic vector includes a vector representation of each word in the second sample data; Inputting the sample semantic vector into the bidirectional long short-term memory network layer to obtain an output initial scene entity sequence; and The initial scene entity sequence is input into the conditional random field layer to obtain an output final scene entity sequence, wherein the final scene entity sequence includes the at least one scene entity.

8. The method according to any one of claims 1 to 5, in, Before obtaining the first sample data set and the second sample data set, the method further includes: The data features of an initial sample data set are learned using a large model, and the second sample data set is generated using the learned large model, wherein the initial sample data set includes multiple initial sample data, the data volume of the initial sample data set is smaller than the data volume of the second sample data set, and the initial sample data includes the unstructured data.

9. An object recommendation method based on knowledge graph, include: Extract target information from text information input by the user; Determining a target node matching the target information based on a pre-constructed knowledge graph, wherein the knowledge graph is constructed according to the method according to any one of claims 1 to 8; Determining at least one recommended object related to the target node according to the node type of the target node; and A target recommended object is determined based on the attribute data of at least one of the recommended objects.

10. The method according to claim 9, in, The knowledge graph includes scenario entities for representing user demand scenarios; The step of determining at least one recommended object related to the target node according to the node type of the target node includes: In response to the node type being the scene entity, determining at least one related scene entity related to the target node, wherein the related scene entity is a scene entity connected to the target node through an edge in the knowledge graph; and At least one of the recommended objects is determined according to the target node and at least one of the related scene entities.

11. The method according to claim 10, in, The knowledge graph includes object-type entities, the object-type entities include first-type object entities, and the first-type object entity uniquely corresponds to a commodity object; The step of determining the at least one recommended object according to the target node and at least one of the related scene entities includes: Based on the knowledge graph, determining at least one first-category object entity related to the target node and / or at least one of the related scene entities; and The commodity object corresponding to the first-category object entity is used as the recommended object.

12. The method according to claim 11, in, The object class entity includes a second class object entity, and the second class object entity is used to represent the category to which the first class object entity belongs; The method further comprises: Based on the knowledge graph, determining at least one second-category object entity related to at least one first-category object entity; For each second-category object entity, based on the knowledge graph, determining at least one supplementary first-category object entity related to the second-category object entity, wherein the supplementary first-category object entity represents a first-category object entity that belongs to the same category as at least one first-category object entity and is different from the first-category object entity; and The commodity objects respectively corresponding to at least one of the first-category object entities and at least one of the supplementary first-category object entities are collectively used as at least one recommended object related to the target node.

13. The method according to any one of claims 9 to 12, in, The attribute data includes at least one of the following: click popularity, sales volume, and evaluation; The step of determining a target recommended object according to the attribute data of at least one of the recommended objects comprises: Calculating a recommendation index value for each of the recommended objects according to the attribute data; and According to the recommendation index value, a target recommendation object is determined from at least one of the recommendation objects.

14. A knowledge graph construction device, include: An acquisition module, configured to acquire a first sample data set and a second sample data set, wherein the first sample data set includes a plurality of first sample data, the second sample data set includes a plurality of second sample data, the first sample data includes structured data or semi-structured data, and the second sample data includes unstructured data; A first extraction module, configured to extract a plurality of object class entities and relations between the plurality of object class entities from the first sample data set; A second extraction module, used to extract a plurality of scene entities from the second sample data set, wherein the scene entities are used to describe the user's demand scenes; A third extraction module, configured to determine the relationship between the scene entity and the object class entity, and determine the relationship between a plurality of the scene entities; and A construction module is used to construct a knowledge graph with the object class entity and the scene entity as nodes, and the relationship between multiple object class entities, the relationship between the scene entity and the object class entity, and the relationship between multiple scene entities as edges.

15. An object recommendation device based on knowledge graph, include: An information extraction module is used to extract target information from the text information input by the user; A first determination module is used to determine a target node matching the target information based on a pre-constructed knowledge graph, wherein the knowledge graph is generated according to the method according to any one of claims 1 to 8; A second determination module, configured to determine at least one recommended object related to the target node according to the node type of the target node; and The recommendation module is used to determine a target recommendation object based on the attribute data of at least one of the recommendation objects.

16. An electronic device, include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors execute the method according to any one of claims 1 to 13.

17. A computer-readable storage medium having executable instructions stored thereon, which, when executed by a processor, causes the processor to execute the method according to any one of claims 1 to 13.

18. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 13 is implemented.

Citation Information

Patent Citations

  • Entity relationship extraction method and device

    CN115169343A

  • Commodity data mining processing method and device, electronic equipment and readable medium

    CN116739626A

  • Scenic spot recommendation method and system based on knowledge graph

    CN116910364A

  • Data merging method and apparatus for knowledge graph

    WO2020135048A1

Cited By

  • Simulation software model recommendation method and system based on knowledge graph and medium

    CN119026199A

  • Commodity information query method based on knowledge graph and related equipment

    CN119782341A

  • Commodity information query method and related equipment based on knowledge graph

    CN119782341B