A method, apparatus, electronic device, and medium for generating knowledge graphs based on large models.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-26
- Publication Date
- 2026-08-14
AI Technical Summary
[0010]根据本公开的一个或多个实施例,通过使用相应的描述文本代替实体和关系的属性信息,即通过大语言模型实现挖掘实体和关系各自对应的属性标签之间存在的更高层次的关联关系,有助于基于该知识图谱可以实现更好的内容理解和用户理解;并且,在基于知识图谱进行信息抽取时,显著提高信息召回率。
Smart Images

Figure CN120764647B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of artificial intelligence, and in particular to the fields of large models, natural language processing, and knowledge graph technology. Specifically, it relates to a method, apparatus, electronic device, computer-readable storage medium, and computer program product for generating knowledge graphs based on large models. Background Technology
[0002] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies primarily include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.
[0003] Knowledge graphs are semantic networks based on graph structures used to model entities, concepts, and their relationships in the real world. Their core goal is to enable machines to understand and reason about complex semantics through structured knowledge representation. Summary of the Invention
[0004] This disclosure provides a method, apparatus, electronic device, computer-readable storage medium, and computer program product for generating knowledge graphs based on large models.
[0005] According to one aspect of this disclosure, a method for resource recommendation is provided, the method comprising: obtaining a first resource list viewed by a first user; obtaining a preset knowledge graph, wherein the knowledge graph includes multiple entities and at least one edge, the edge representing a relationship between two related entities, and wherein each of the multiple entities corresponds to a corresponding entity description text, and each of the at least one edge corresponds to a corresponding relationship description text; retrieving at least one first entity matching the first resource list from the knowledge graph based on the first resource list, the entity description text, and the relationship description text; and determining resources for recommendation to the first user based on the at least one first entity, wherein the preset knowledge graph is generated by: obtaining target resources for constructing the knowledge graph; inputting the target resources into a large language model to extract information from the target resources using the large language model to obtain corresponding entities, relationships, entity description texts corresponding to the entities, and relationship description texts corresponding to the relationships; and generating the knowledge graph based on the extracted entities and relationships, entity description texts corresponding to the entities, and relationship description texts corresponding to the relationships.
[0006] According to another aspect of this disclosure, an apparatus for resource recommendation is provided, the apparatus comprising: a first acquisition unit configured to acquire a first resource list viewed by a first user; a second acquisition unit configured to acquire a preset knowledge graph, wherein the knowledge graph includes a plurality of entities and at least one edge, the edge being capable of representing a relationship between two associated entities, and wherein each of the plurality of entities corresponds to a corresponding entity description text, and each of the at least one edge corresponds to a corresponding relationship description text; and a retrieval unit configured to, based on the first resource list, the entity description text, and the relationship description text, retrieve from the knowledge graph a resource list that is related to the first resource list. The source list includes at least one first entity matching the source list; and a recommendation unit configured to determine resources for recommendation to the first user based on the at least one first entity, wherein the preset knowledge graph is generated by: obtaining target resources for constructing the knowledge graph; inputting the target resources into a large language model to extract information from the target resources through the large language model to obtain corresponding entities, relations, entity description text corresponding to the entities, and relation description text corresponding to the relations; and generating the knowledge graph based on the extracted entities and relations, entity description text corresponding to the entities, and relation description text corresponding to the relations.
[0007] According to another aspect of this disclosure, an electronic device is provided, comprising: at least one processor; and a memory communicatively connected to the at least one processor; the memory storing instructions executable by the at least one processor to enable the at least one processor to perform the methods described in this disclosure.
[0008] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions for causing a computer to perform the methods described in this disclosure.
[0009] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the methods described in this disclosure.
[0010] According to one or more embodiments of this disclosure, by using corresponding descriptive text to replace the attribute information of entities and relationships, that is, by using a large language model to mine the higher-level relationships between the attribute tags corresponding to entities and relationships, it is helpful to achieve better content understanding and user understanding based on the knowledge graph; and, when extracting information based on the knowledge graph, it significantly improves the information recall rate.
[0011] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0012] The accompanying drawings exemplify embodiments and form part of the specification, serving together with the textual description to explain exemplary implementations of the embodiments. The illustrated embodiments are for illustrative purposes only and do not limit the scope of the claims. Throughout the drawings, the same reference numerals refer to similar but not necessarily identical elements.
[0013] Figure 1 A schematic diagram of an exemplary system in which the various methods described herein may be implemented according to embodiments of the present disclosure is shown;
[0014] Figure 2 A flowchart illustrating a method for resource recommendation according to an embodiment of the present disclosure is shown;
[0015] Figure 3 A schematic diagram of an iterative incremental knowledge graph update process according to an embodiment of the present disclosure is shown;
[0016] Figure 4 A schematic diagram illustrating the generation of entity pairs according to an embodiment of the present disclosure is shown;
[0017] Figure 5 A structural block diagram of an apparatus for resource recommendation according to embodiments of the present disclosure is shown; and
[0018] Figure 6 A structural block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure is shown. Detailed Implementation
[0019] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0020] In this disclosure, unless otherwise stated, the use of terms such as "first," "second," etc., to describe various elements is not intended to limit the positional, temporal, or importance relationships of these elements; such terms are merely used to distinguish one element from another. In some examples, the first element and the second element may refer to the same instance of that element, while in other cases, based on the context, they may refer to different instances.
[0021] The terminology used in the description of the various examples described in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context explicitly indicates otherwise, an element may be one or more unless the number of elements is specifically limited. Furthermore, the term "and / or" as used in this disclosure covers any one of the listed items and all possible combinations thereof.
[0022] The embodiments of this disclosure will now be described in detail with reference to the accompanying drawings.
[0023] Figure 1 A schematic diagram of an exemplary system 100 in which the various methods and apparatus described herein can be implemented according to embodiments of this disclosure is shown. Reference Figure 1 The system 100 includes one or more client devices 101, 102, 103, 104, 105 and 106, a server 120, and one or more communication networks 110 coupling the one or more client devices to the server 120. The client devices 101, 102, 103, 104, 105 and 106 can be configured to execute one or more applications.
[0024] In embodiments of this disclosure, server 120 may run one or more services or software applications that enable the execution of methods for generating knowledge graphs based on large models.
[0025] In some embodiments, server 120 may also provide other services or software applications, which may include non-virtual and virtual environments. In some embodiments, these services may be provided as web-based services or cloud services, such as to users of client devices 101, 102, 103, 104, 105, and / or 106 under a Software as a Service (SaaS) model.
[0026] exist Figure 1 In the configuration shown, server 120 may include one or more components that implement the functions performed by server 120. These components may include software components, hardware components, or combinations thereof that can be executed by one or more processors. Users operating client devices 101, 102, 103, 104, 105, and / or 106 can sequentially interact with server 120 using one or more client applications to utilize the services provided by these components. It should be understood that various different system configurations are possible and may differ from system 100. Therefore, Figure 1 This is an example of a system used to implement the various methods described herein, and is not intended to be limiting.
[0027] Users can use client devices 101, 102, 103, 104, 105, and / or 106 to obtain corresponding resources. The client devices can provide an interface that allows users to interact with them. The client devices can also output information to the user through this interface. Although... Figure 1 Only six client devices are described, but those skilled in the art will understand that this disclosure can support any number of client devices.
[0028] Client devices 101, 102, 103, 104, 105, and / or 106 may include various types of computer devices, such as portable handheld devices, general-purpose computers (such as personal computers and laptops), workstation computers, wearable devices, smart screen devices, self-service terminal devices, service robots, gaming systems, thin clients, various messaging devices, sensors, or other sensing devices. These computer devices can run various types and versions of software applications and operating systems, such as Microsoft Windows, Apple iOS, UNIX-like operating systems, Linux or Linux-like operating systems (such as Google Chrome OS); or include various mobile operating systems, such as Microsoft Windows Mobile OS, iOS, Windows Phone, and Android. Portable handheld devices may include cellular phones, smartphones, tablets, personal digital assistants (PDAs), etc. Wearable devices may include head-mounted displays (such as smart glasses) and other devices. Gaming systems may include various handheld gaming devices, internet-enabled gaming devices, etc. Client devices are capable of executing various applications, such as various internet-related applications, communication applications (such as email applications), short message service (SMS) applications, and can use various communication protocols.
[0029] Network 110 can be any type of network well known to those skilled in the art, and can use any of a variety of available protocols (including but not limited to TCP / IP, SNA, IPX, etc.) to support data communication. By way of example only, one or more networks 110 can be a local area network (LAN), an Ethernet-based network, a token ring network, a wide area network (WAN), the Internet, a virtual network, a virtual private network (VPN), an intranet, an extranet, a blockchain network, a public switched telephone network (PSTN), an infrared network, a wireless network (e.g., Bluetooth, WIFI), and / or any combination of these and / or other networks.
[0030] Server 120 may include one or more general-purpose computers, special-purpose server computers (e.g., PC (personal computer) servers, UNIX servers, mid-range servers), blade servers, mainframe computers, server clusters, or any other suitable arrangement and / or combination. Server 120 may include one or more virtual machines running a virtual operating system, or other computing architectures involving virtualization (e.g., one or more flexible pools of logical storage devices that can be virtualized to maintain virtual storage devices for servers). In various embodiments, server 120 may run one or more services or software applications that provide the functionality described below.
[0031] The computing unit in server 120 can run one or more operating systems, including any of the aforementioned operating systems and any commercially available server operating system. Server 120 can also run any of a variety of additional server applications and / or middleware applications, including HTTP servers, FTP servers, CGI servers, JAVA servers, database servers, etc.
[0032] In some implementations, server 120 may include one or more applications to analyze and merge data feeds and / or event updates received from users of client devices 101, 102, 103, 104, 105, and 106. Server 120 may also include one or more applications to display data feeds and / or real-time events via one or more display devices of client devices 101, 102, 103, 104, 105, and 106.
[0033] In some implementations, server 120 can be a server for a distributed system or a server integrated with blockchain. Server 120 can also be a cloud server, or an intelligent cloud computing server or intelligent cloud host with artificial intelligence technology. A cloud server is a host product in the cloud computing service system, designed to address the shortcomings of traditional physical hosts and Virtual Private Server (VPS) services, such as high management difficulty and weak business scalability.
[0034] System 100 may also include one or more databases 130. In some embodiments, these databases may be used to store data and other information. For example, one or more of the databases 130 may be used to store information such as resources, knowledge graphs, user browsing history, etc. Databases 130 may reside in various locations. For example, a database used by server 120 may be local to server 120, or it may be located away from server 120 and may communicate with server 120 via a network-based or dedicated connection. Databases 130 may be of different types. In some embodiments, the database used by server 120 may be, for example, a relational database. One or more of these databases may store, update, and retrieve data from and from the databases in response to commands.
[0035] In some embodiments, one or more of the databases 130 may also be used by an application to store application data. The databases used by the application may be of different types, such as key-value stores, object stores, or regular stores supported by a file system.
[0036] Figure 1 The system 100 can be configured and operated in various ways to enable the application of the various methods and apparatus described in this disclosure.
[0037] Existing knowledge graph generation methods rely on traditional NLP techniques to extract entity, relation, and attribute information. Attribute information is presented as tags, such as "sports," "football," "director," and "producer." This attribute information is typically specific to a given set of tags, making it difficult to extend effectively. Furthermore, traditional tagging systems depend solely on feature extraction from individual content items, neglecting the relationships between global content. Consequently, when retrieving information using knowledge graphs, user understanding models struggle to generalize effectively across tags, resulting in low recall rates and ultimately leading to biases in the recommendation system's understanding of user interests and preferences.
[0038] Therefore, embodiments of this disclosure provide a method for resource recommendation. Figure 2 A flowchart of a knowledge graph generation method based on a large model according to an embodiment of the present disclosure is shown, such as... Figure 2As shown, method 200 includes: obtaining a first resource list that a first user has browsed (step 210); obtaining a preset knowledge graph, wherein the knowledge graph includes multiple entities and at least one edge, the edge being able to represent the relationship between two related entities, and wherein each of the multiple entities corresponds to a corresponding entity description text, and each of the at least one edge corresponds to a corresponding relationship description text (step 220); retrieving at least one first entity that matches the first resource list from the knowledge graph based on the first resource list, the entity description text, and the relationship description text (step 230); and determining resources for recommending to the first user based on the at least one first entity (step 240).
[0039] The preset knowledge graph is generated by the following method: obtaining target resources for constructing the knowledge graph; inputting the target resources into a large language model to extract information from the target resources through the large language model to obtain corresponding entities, relations, entity description texts corresponding to the entities, and relation description texts corresponding to the relations; and generating the knowledge graph based on the extracted entities and relations, entity description texts corresponding to the entities, and relation description texts corresponding to the relations.
[0040] Typically, knowledge graphs include entities, relationships, and attribute information. Entities are the basic units in a knowledge graph, representing objects in the real world, such as people, places, and organizations. Relationships are the links connecting different entities, representing various interactions and connections between them. Attributes describe and supplement entities, providing detailed information about them. As mentioned above, attribute information is usually specific information within a set of given labels, making it difficult to expand effectively; furthermore, traditional labeling systems rely only on feature extraction results from individual contents, without considering the relationships between global content. Moreover, when extracting information based on knowledge graphs, while the accuracy of extraction based on given label-based attribute information is sometimes high, it is accompanied by a relatively low recall rate.
[0041] In this disclosure, entity description text and relation description text can be content used to describe the detailed features of the corresponding entity or relation. For example, entity description text can add more information about the entity, including attributes, synonyms, hierarchical relationships, triple relationships with other entities, etc.
[0042] In this disclosure, the target resource is a resource used for recommendation to users. For example, the resource may include at least one of the following: images, documents, audio, video, etc. The knowledge graph generated through the above embodiments can be used to characterize user interests and preferences in the field of content recommendation, thereby improving content understanding and recommendation effectiveness.
[0043] In some embodiments, the first resource list already viewed by the first user serves as a direct carrier of user interests, providing a behavioral data foundation for subsequent semantic matching. The pre-defined knowledge graph can refer to a semantic network formed by extracting entities, relationships, and their corresponding descriptive texts from target resources using a large model and storing them in a graph structure. Therefore, based on the entity and relationship descriptive texts of the first resource list and the knowledge graph, a semantic matching algorithm (such as vector similarity calculation) can retrieve at least one first entity most relevant to the resource list. Furthermore, because the descriptive text generated by the large model is semantically rich, it can achieve a precise mapping from resource content to entities, avoiding the ambiguity problems of traditional keyword matching. Subsequently, based on the first entity, the relationship is expanded along the edges in the pre-defined knowledge graph to determine associated entities and corresponding resources, generating recommended content and achieving a natural extension of interests.
[0044] Therefore, according to the embodiments of this disclosure, by using corresponding descriptive text to replace the attribute information of entities and relationships, that is, by using a large language model to mine the higher-level relationships between the attribute tags corresponding to entities and relationships, it is helpful to achieve better content understanding and user understanding based on the knowledge graph; and, when recommending resources based on the knowledge graph, it significantly improves the recall rate of resources.
[0045] According to embodiments of this disclosure, the first resource list includes at least one resource, and wherein retrieving at least one first entity matching the first resource list from the knowledge graph includes: determining a first vector corresponding to each resource in the first resource list; obtaining a second vector corresponding to the entity description text in the knowledge graph; retrieving at least one second entity matching each resource from the knowledge graph based on the first vector and the second vector; determining at least one third entity connected to the at least one second entity by an edge in the knowledge graph, and the relationship description text corresponding to the edge between the second entity and the third entity; and generating the at least one first entity using a large language model based on the at least one second entity, the at least one third entity, and the relationship description text, wherein the at least one first entity is a corresponding entity among the at least one second entity and the at least one third entity.
[0046] In this disclosure, the first vector can be determined through semantic understanding of the resource itself, or by first extracting entities and then extracting features from those entities to obtain the corresponding vector. The first vector represents the core semantics of the resource. Correspondingly, the second vector, formed by the descriptive text of each entity in the knowledge graph, represents the specific meaning of the semantics and can provide a foundation for subsequent semantic matching. Then, based on vector similarity calculation, the second entity matching each resource can be retrieved from the knowledge graph, thereby locating the user's explicit interests. Furthermore, by traversing the edge relationships of the second entity in the knowledge graph, the interest boundary can be expanded using the graph's relational network. Finally, the second entity, the third entity, and the relational descriptive text are input into a large language model. The recalled entities are simplified, and through semantic fusion and logical reasoning, a first entity can be generated. This first entity contains both explicit interests and potential interest expansion directions.
[0047] Therefore, this solution improves the matching degree between recommended entities and users' potential interests, and compared with traditional recommendation models, it improves the accuracy of deep interest mining and effectively solves the problem of limited recommendation depth caused by insufficient semantic reasoning.
[0048] According to embodiments of this disclosure, inputting the target resource into a large language model to extract information from the target resource using the large language model to obtain corresponding entities, relations, entity description texts corresponding to the entities, and relation description texts corresponding to the relations includes: inputting the target resource into a large language model to extract information from the target resource using the large language model to obtain corresponding entities, relations, entity description texts corresponding to the entities, entity categories corresponding to the entities, relation description texts corresponding to the relations, and relation weights corresponding to the relations. Therefore, generating the knowledge graph based on the extracted entities and relations, entity description texts corresponding to the entities, and relation description texts corresponding to the relations includes: generating the knowledge graph based on the extracted entities and relations, entity categories corresponding to the entities, entity description texts corresponding to the entities, relation description texts corresponding to the relations, and relation weights corresponding to the relations.
[0049] In some embodiments, the target resources may include images, documents, audio, video, etc. First, the target resources used to construct the knowledge graph are input into a large language model. Leveraging the model's contextual learning and logical reasoning capabilities, multi-dimensional information extraction can be performed on the target resources: on the one hand, entities can be identified, such as specific objects or concepts, and the category information of the entities can be extracted simultaneously, such as "technical field" or "type," to standardize the semantic attribution of the entities; on the other hand, relationships between entities can be mined, for example, through keywords or contextual logical relationships, and descriptive text can be generated for each relationship, such as "machine learning is the theoretical foundation of deep learning," to clarify the relationship logic. Simultaneously, the model can quantitatively analyze features such as the frequency of relationship occurrence and contextual importance to assign weight values to relationships (e.g., values in the range of 0-1, with higher values indicating stronger relationships).
[0050] In this process, for example, a large language model can use dynamically adjusted Prompt instructions, such as "extract entities and label their categories, analyze the relationships and strength of associations between entities." Subsequently, in constructing a knowledge graph, entity categories can serve as classification identifiers for entities, ensuring the hierarchical organization of the knowledge network. Entity description text can serve as attribute information for nodes, and relationship description text can serve as attribute information for edges, achieving a breakthrough from the traditional fixed label system to clearly define the specific content of entities and the specific logic of relationships between entities; relationship weights can then serve as quantitative parameters for edges, characterizing the strength of the association.
[0051] Therefore, compared with traditional knowledge graphs, this solution significantly enhances the semantic clarity and logical interpretability of entities and relationships in knowledge graphs by further standardizing entity categories, refining relationship descriptions and weights, and effectively solves the technical problems of ambiguous association strength and unclear recommendation logic in traditional solutions.
[0052] According to embodiments of this disclosure, retrieving at least one first entity matching the first resource list from the knowledge graph includes: retrieving at least one first entity matching the first resource list from the knowledge graph based on the first resource list, the entity category corresponding to the entity, the relationship description text, and the relationship weight.
[0053] In this disclosure, entity category typically refers to a classification based on the domain to which an entity belongs. This can be used to narrow the search scope to semantically related entity clusters and avoid invalid cross-domain matches. Relationship description text can help large models capture potential semantic associations by parsing relationship logic. Relationship weights can ensure that high-weight related entities are retrieved first by quantifying the strength of the association, thereby ensuring the relevance of the recommendations.
[0054] Therefore, resource recommendation based on multiple aspects such as category, semantics, and weight can improve the accuracy of entity matching and effectively solve the technical problems of weak recommendation generalization ability and unclear association logic caused by insufficient feature dimensions.
[0055] According to embodiments of this disclosure, the preset knowledge graph is further generated by the following method: in response to obtaining a new target resource, the new target resource is input into the large language model to obtain a target entity output by the large language model and a first entity description text corresponding to the target entity; in response to determining that the knowledge graph already contains the target entity, a second entity description text corresponding to the target entity is obtained from the knowledge graph; the first entity description text and the second entity description text are input into the large language model to obtain a third entity description text output by the large language model; and the entity description text corresponding to the target entity in the knowledge graph is updated to the third entity description text.
[0056] In some embodiments, the new target resource can refer to newly added original resource data for knowledge supplementation and recommendation to users, such as the latest literature, news, or user-generated content. This data is input into a trained large language model, which utilizes the model's contextual understanding and information extraction capabilities to extract corresponding entities, i.e., target entities, such as core objects or concepts involved in the new resource, and generate a first entity description text corresponding to that entity. The first description text can be a characterization of entity features based on the semantics related to the new target resource, including information such as functions, attributes, and latest developments.
[0057] In this embodiment, if it is determined that the target entity already exists in the knowledge graph, i.e., the entity has been extracted from historical resources, then the entity description text corresponding to the entity, i.e., the second entity description text, can be obtained from the knowledge graph. By using the first and second entity description texts as input, and then inputting them again into the large language model, the semantic fusion and inductive capabilities of the large language model are utilized to generate a more comprehensive and accurate third entity description text. Afterwards, the original entity description text of the target entity can be replaced with the third entity description text in the knowledge graph to complete the knowledge graph update.
[0058] Therefore, an iterative incremental graph construction strategy was adopted to capture the latest entity information. By dynamically fusing new and old descriptive texts, the accuracy and timeliness of entity descriptions were ensured, thereby improving the accuracy of the knowledge graph and ultimately enhancing the content understanding level in the subsequent resource recommendation process, thus improving the recommendation effect.
[0059] Figure 3 A schematic diagram of an iterative incremental knowledge graph update process according to an embodiment of the present disclosure is shown. Figure 3As shown, the new target resource 302 contains the target entity "Kepler-452B" and the first entity description text "an exoplanet located in the constellation Cygnus, whose surface may have liquid water according to observations in 2024, with an orbital period of 385 days and a radius 1.6 times that of Earth"; while the knowledge graph 301 already contains the same target entity "Kepler-452B", and correspondingly, it also contains the second entity description text "the first Earth-like planet in the habitable zone discovered in 2015, with an orbital period of 385 days, a radius 1.6 times that of Earth, and a host star with 98% similarity to the Sun". In this case, the first entity description text and the second entity description text can be input into the large language model to obtain the third entity description text in the updated knowledge graph 303 output by the large language model: "Kepler-452B is an Earth-like exoplanet discovered in 2015, located in the habitable zone of Cygnus, and its host star has a 98% similarity to the Sun; the latest spectroscopic observations in 2024 confirmed that its atmosphere contains signs of water vapor, and liquid water may exist on its surface, further supporting the hypothesis of habitability."
[0060] Similarly, according to embodiments of this disclosure, the preset knowledge graph is also generated by the following method: in response to obtaining a new target resource, the new target resource is input into the large language model to obtain a target relation output by the large language model and a first relation description text corresponding to the target relation; in response to determining that the knowledge graph already contains the target relation, a second relation description text corresponding to the target relation is obtained from the knowledge graph; the first relation description text and the second relation description text are input into the large language model to obtain a third relation description text output by the large language model; and the relation description text corresponding to the target relation in the knowledge graph is updated to the third relation description text.
[0061] In some embodiments, by inputting new target resources into a trained large language model, and utilizing the model's semantic understanding and relation extraction capabilities, target relations can be identified from the new resources, and a first relation description text corresponding to the relation can be generated, i.e., a relational logical characterization of the new target resource.
[0062] In this embodiment, if it is determined that the target relation already exists in the knowledge graph, meaning the relation has been extracted and stored from historical resources, then the currently stored second relation description text is retrieved from the knowledge graph, i.e., a relation logic characterization based on historical resources. By inputting the first and second relation description texts back into the large language model, and utilizing the model's semantic fusion and inductive capabilities, cross-validation and complementary optimization of the old and new descriptions can be performed, generating a more comprehensive and accurate third relation description text that integrates old and new information. Subsequently, the original relation description text of the target relation can be replaced with the third relation description text in the knowledge graph to complete the knowledge graph update.
[0063] According to embodiments of this disclosure, the preset knowledge graph is further generated by the following method: obtaining a second resource list that the second user has browsed, wherein the second resource list includes at least two resources; determining a set of entities corresponding to each different resource in the second resource list; and updating the relationship between the entities corresponding to the different resources and the relationship description text in the knowledge graph to indicate that the same user has browsed resources corresponding to the entities associated with the corresponding relationship.
[0064] In some embodiments, the second user can refer to a historical user, i.e., a user who has performed historical browsing. The second resource list can refer to the collection of content that the user has browsed within a certain time window, such as articles or videos. These resources in the second resource list serve as direct carriers of user interests and can implicitly imply the user's tendency to associate and focus on different resources (corresponding to corresponding entities).
[0065] For each resource in the second resource list, natural language processing techniques or large language models can be used to extract entities from the resource content, resulting in a set of entities corresponding to each resource. Thus, entities corresponding to different resources are treated as entities with corresponding relationships. This allows for updating the relationships between entities corresponding to different resources and their descriptive text in the knowledge graph, representing resources associated with entities linked by the same user. For example, for entity A in resource A and entity B in resource B in the second resource list, an edge can be created between entities A and B in the knowledge graph, along with a descriptive text indicating that a user has associatedly viewed the corresponding resources.
[0066] According to embodiments of this disclosure, determining a set of entities corresponding to different resources in the resource list includes: determining at least one associated resource pair in the second resource list, wherein the resources in the resource pair are different resources; for each resource pair in the at least one associated resource pair, determining a first set of entities corresponding to one resource and a second set of entities corresponding to the other resource in the resource pair; updating the relationship between the entities corresponding to the different resources and the relationship description text includes: combining the first set of entities and the second set of entities in pairs to obtain one or more entity pairs; and taking the entities in at least one of the one or more entity pairs as two associated entities, so as to update the relationship and relationship description text corresponding to each entity pair in the knowledge graph.
[0067] In some embodiments, associated resource pairs can refer to ordered or unordered combinations of different resources. Their significance lies in filtering resource combinations where users may have shared interests. For each resource pair, a first set of entities corresponding to one resource and a second set of entities corresponding to the other resource can be further extracted. For example, core concepts can be extracted from resource content using natural language processing or large language models, transforming unstructured resources into structured sets of entities to pinpoint the specific direction of user interests.
[0068] In some embodiments, one or more entity pairs can be generated by combining the first group of entities with the second group of entities in pairs. Figure 4 A schematic diagram illustrating the generation of entity pairs according to embodiments of the present disclosure is shown. Figure 4 As shown, in resource list 401, resource A contains a set of entities, including "football" and "World Cup"; resource B contains another set of entities, including "basketball" and "NBA". By pairwise combining the first set of entities with the second set of entities, one or more entity pairs 402 can be generated, such as "football-basketball", "football-NBA", "World Cup-basketball", "World Cup-NBA", etc. Full combination can cover all possible associated entity relationships. For each entity pair, if it already has a relationship in the knowledge graph, the relationship can be strengthened based on user browsing behavior, such as increasing the relationship weight and supplementing the relationship description text; if there is no relationship yet, a new relationship can be added based on user browsing frequency, time intervals, and other characteristics, and relationship description text can be generated.
[0069] Therefore, by capturing users' real behavioral trajectories and transforming user behavior data into relational attributes of knowledge graphs, we can provide a posteriori behavioral data support for knowledge graph updates, enabling the relational network to not only reflect the semantics of the content but also embody the user's actual interest orientation.
[0070] According to embodiments of this disclosure, the resources in the second resource list are arranged sequentially. Determining at least one associated resource pair in the second resource list includes: determining a sliding window size N, the sliding window size representing the maximum number of resources that the sliding window can contain, where N≥2; sequentially traversing the resources in the second resource list to perform the following operations when a corresponding resource is traversed: taking the currently traversed resource as the starting element of the sliding window, and determining each resource within the sliding window based on the sliding window size, wherein the sliding window includes at least two resources; and combining the other resources in the sliding window besides the currently traversed resource with the currently traversed resource to form associated resource pairs.
[0071] In some embodiments, arranging resources in the resource list sequentially can yield associated resource pairs. For example, the order can be determined based on interaction time (e.g., two articles viewed consecutively by a user within one hour) or interaction intensity (e.g., a user bookmarking both articles). The interaction can be a preset behavior, such as browsing, commenting, or liking.
[0072] In the above embodiments, the sliding window size N≥2, meaning the number of resources N≥2 that can be contained in the sliding window, serves to limit the range of resources representing user interest associations. For example, resources that a user browses consecutively are more likely to be used to identify consistency in the user's interests. Conversely, resources outside the sliding window range may indicate weaker associations.
[0073] Subsequently, each resource in the resource list can be traversed sequentially: the currently traversed resource is used as the starting element of the sliding window, and the set of resources within the window is determined based on the window size N. Specifically, if there are fewer than N subsequent resources, the list can be extended to the end to ensure that the window contains at least two resources. For example, if the current resource is the i-th resource, the window can contain the i-th, i+1-th, ..., i+N-1-th resources.
[0074] In some embodiments, for each sliding window, the currently traversed resource can be combined with other resources within the window to form multiple associated resource pairs. For example, when N=3, the currently traversed resource is A, and the window contains resources A, B, and C, then two resource pairs (A, B) and (A, C) can be generated. For each resource pair, its respective entity groups can be extracted. For example, if the entity groups for resource A are "football" and "World Cup", and the entity groups for resource B are "basketball" and "NBA", then in the resource pair (A, B), the two entity groups can be combined pairwise to generate entity pairs such as "football-basketball", "football-NBA", "World Cup-basketball", and "World Cup-NBA".
[0075] Therefore, by traversing the sliding window in sequence, the temporal proximity characteristics of user browsing behavior can be fully captured, and the continuity and relevance of interests can be accurately located.
[0076] According to embodiments of this disclosure, the second user is multiple, and wherein, taking at least one entity pair among the one or more entity pairs as two associated entities to update the relationship and its description text corresponding to each entity pair in the knowledge graph includes: counting the number of each entity pair among the one or more entity pairs; and in response to determining that the number corresponding to a corresponding entity pair is greater than a preset threshold, taking the entities in the corresponding entity pair whose number is greater than the preset threshold as two associated entities to update the relationship and its description text corresponding to each entity pair in the knowledge graph.
[0077] In some embodiments, for each resource pair, its respective entity groups can be extracted, and the two groups of entities can be combined pairwise to generate multiple entity pairs. For example, in the entity pair composed of resource A and resource B mentioned above, the number of occurrences of each entity pair can be counted based on the resource list data corresponding to all second users, i.e., how many users have associated with and browsed the resources corresponding to the entity pair. This statistical process reflects the general association degree of the entity pair through the high frequency of group behavior. If the number of occurrences of an entity pair exceeds a preset threshold, such as 1000 times, it can be determined that the entity pair is a combination of entities that users generally associate with and browse, and its relationship and relationship description text can be updated or added in the knowledge graph. Specifically, if there is already a corresponding relationship in the knowledge graph, the relationship weight can be strengthened and the description can be supplemented, such as "XX users in the XX group have associated with and browsed the resources corresponding to this entity pair within XX time period, and there is a general interest association"; if there is no corresponding relationship in the knowledge graph, a new relationship can be added and a description can be generated.
[0078] Therefore, by quantitatively screening group behavior, we can ensure that the relationships for knowledge graph updates have a broad user base, improve the accuracy of capturing group interests, and effectively solve the problem of insufficient relationship generalization ability caused by the randomness of individual behavior or the semantic limitations of content.
[0079] According to embodiments of this disclosure, such as Figure 5As shown, a resource recommendation device 500 is also provided, comprising: a first acquisition unit 510 configured to acquire a first resource list browsed by a first user; a second acquisition unit 520 configured to acquire a preset knowledge graph, wherein the knowledge graph includes multiple entities and at least one edge, the edge being able to represent a relationship between two related entities, and wherein each of the multiple entities corresponds to a corresponding entity description text, and each of the at least one edge corresponds to a corresponding relationship description text; a retrieval unit 530 configured to retrieve at least one first entity matching the first resource list from the knowledge graph based on the first resource list, the entity description text, and the relationship description text; and a recommendation unit 540 configured to determine resources for recommendation to the first user based on the at least one first entity.
[0080] The preset knowledge graph is generated by the following method: obtaining target resources for constructing the knowledge graph; inputting the target resources into a large language model to extract information from the target resources through the large language model to obtain corresponding entities, relations, entity description texts corresponding to the entities, and relation description texts corresponding to the relations; and generating the knowledge graph based on the extracted entities and relations, entity description texts corresponding to the entities, and relation description texts corresponding to the relations.
[0081] Here, the operation of each of the above-mentioned units 510 to 540 of the resource recommendation device 500 is similar to the operation of steps 210 to 240 described above, and will not be repeated here.
[0082] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in the technical solution disclosed herein comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0083] According to embodiments of this disclosure, an electronic device, a readable storage medium, and a computer program product are also provided.
[0084] refer to Figure 6The present invention describes a structural block diagram of an electronic device 600 that can serve as a server or client of the present disclosure, which is an example of a hardware device that can be applied to various aspects of the present disclosure. The electronic device is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0085] like Figure 6 As shown, the electronic device 600 includes a computing unit 601, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 602 or a computer program loaded from a storage unit 608 into a random access memory (RAM) 603. The RAM 603 may also store various programs and data required for the operation of the electronic device 600. The computing unit 601, ROM 602, and RAM 603 are interconnected via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0086] Multiple components in electronic device 600 are connected to I / O interface 605, including: input unit 606, output unit 607, storage unit 608, and communication unit 609. Input unit 606 can be any type of device capable of inputting information to electronic device 600. Input unit 606 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device, and can include, but is not limited to, a mouse, keyboard, touchscreen, trackpad, trackball, joystick, microphone, and / or remote control. Output unit 607 can be any type of device capable of presenting information, and can include, but is not limited to, a monitor, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 608 can include, but is not limited to, disk and optical disk. Communication unit 609 allows electronic device 600 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and can include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth devices, 802.11 devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0087] The computing unit 601 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 601 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 601 performs the various methods and processes described above, such as method 200. For example, in some embodiments, method 200 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 600 via ROM 602 and / or communication unit 609. When the computer program is loaded into RAM 803 and executed by the computing unit 601, one or more steps of method 200 described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform method 200 by any other suitable means (e.g., by means of firmware).
[0088] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0089] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0090] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0091] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0092] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or middleware components (e.g., application servers), or frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), the Internet, and blockchain networks.
[0093] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.
[0094] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be performed in parallel, sequentially, or in a different order, as long as the desired result of the technical solution disclosed in this disclosure can be achieved, and this is not limited herein.
[0095] While embodiments or examples of this disclosure have been described with reference to the accompanying drawings, it should be understood that the methods, systems, and devices described above are merely exemplary embodiments or examples, and the scope of the invention is not limited by these embodiments or examples, but only by the granted claims and their equivalents. Various elements in the embodiments or examples may be omitted or replaced by their equivalents. Furthermore, the steps may be performed in a different order than that described in this disclosure. Further, various elements in the embodiments or examples may be combined in various ways. Importantly, as the technology evolves, many elements described herein can be replaced by equivalents that appear after this disclosure.
Claims
1. A method for resource recommendation, comprising: Get the first list of resources viewed by the first user; Obtain a preset knowledge graph, wherein the knowledge graph includes multiple entities and at least one edge, the edge being able to represent the relationship between two related entities, and wherein each of the multiple entities corresponds to a corresponding entity description text, and each of the at least one edge corresponds to a corresponding relationship description text; Based on the first resource list, the entity description text, and the relationship description text, at least one first entity matching the first resource list is retrieved from the knowledge graph; and Based on the at least one first entity, resources for recommending to the first user are determined. The preset knowledge graph is generated using the following method: Obtain the target resources used to construct the knowledge graph; The target resource is input into a large language model to extract information from the target resource using the large language model, thereby obtaining the corresponding entities, relations, entity description text corresponding to the entities, and relation description text corresponding to the relations; and The knowledge graph is generated based on the extracted entities and relations, the entity description text corresponding to the entities, and the relation description text corresponding to the relations. Obtain the second resource list that the second user has viewed, wherein the second resource list includes at least two resources; Determine a set of entities corresponding to each of the different resources in the second resource list; and In the knowledge graph, the relationships between entities corresponding to different resources and their relationship description text are updated to indicate that the same user has browsed resources corresponding to entities associated with the corresponding relationships.
2. The method as described in claim 1, wherein, The first resource list includes at least one resource, and wherein retrieving at least one first entity matching the first resource list from the knowledge graph includes: Determine the first vector corresponding to each resource in the first resource list; Obtain the second vector corresponding to the entity description text in the knowledge graph; Based on the first vector and the second vector, at least one second entity that matches each of the resources is retrieved from the knowledge graph. In the knowledge graph, at least one third entity connected to the at least one second entity via an edge is identified, along with the relational description text corresponding to the edges between the second and third entities; and Based on the at least one second entity, the at least one third entity, and the relation description text, the at least one first entity is generated through a large language model, wherein the at least one first entity is the corresponding entity among the at least one second entity and the at least one third entity.
3. The method as described in claim 1 or 2, wherein, Inputting the target resource into a large language model to extract information from the target resource using the large language model to obtain the corresponding entity, relation, entity description text corresponding to the entity, and relation description text corresponding to the relation includes: inputting the target resource into a large language model to extract information from the target resource using the large language model to obtain the corresponding entity, relation, entity description text corresponding to the entity, entity category corresponding to the entity, relation description text corresponding to the relation, and relation weight corresponding to the relation; Generating the knowledge graph based on the extracted entities and relations, the entity description text corresponding to the entity, and the relation description text corresponding to the relation includes: generating the knowledge graph based on the extracted entities and relations, the entity category corresponding to the entity, the entity description text corresponding to the entity, the relation description text corresponding to the relation, and the relation weight corresponding to the relation.
4. The method of claim 3, wherein, Retrieving at least one first entity from the knowledge graph that matches the first resource list includes: Based on the first resource list, the entity category corresponding to the entity, the relationship description text, and the relationship weight, at least one first entity matching the first resource list is retrieved from the knowledge graph.
5. The method of claim 1, wherein, The preset knowledge graph is also generated through the following methods: In response to acquiring a new target resource, the new target resource is input into the large language model to obtain the target entity output by the large language model and the first entity description text corresponding to the target entity; In response to determining that the target entity is contained in the knowledge graph, the second entity description text corresponding to the target entity is obtained from the knowledge graph; Input the first entity description text and the second entity description text into the large language model to obtain the third entity description text output by the large language model; as well as Update the entity description text corresponding to the target entity in the knowledge graph to the third entity description text.
6. The method as described in claim 1 or 5, wherein, The preset knowledge graph is also generated through the following methods: In response to acquiring a new target resource, the new target resource is input into the large language model to obtain the target relation output by the large language model and the first relation description text corresponding to the target relation; In response to determining that the target relation is already contained in the knowledge graph, the second relation description text corresponding to the target relation is obtained from the knowledge graph; Input the first relation description text and the second relation description text into the large language model to obtain the third relation description text output by the large language model; as well as Update the relation description text corresponding to the target relation in the knowledge graph to the third relation description text.
7. The method of claim 1, wherein, Determining the set of entities corresponding to each different resource in the second resource list includes: In the second resource list, at least one associated resource pair is identified, wherein the resources in the resource pair are different resources; For each of the at least one associated resource pair, determine a first group of entities corresponding to one resource and a second group of entities corresponding to the other resource in the resource pair; Updating the relationships between the entities corresponding to the different resources and the text describing those relationships includes: The first group of entities and the second group of entities are paired to obtain one or more entity pairs; and The entities in at least one of the one or more entity pairs are treated as two associated entities, so that the relationship and its description text corresponding to each entity pair are updated in the knowledge graph.
8. The method of claim 7, wherein, The resources in the second resource list are arranged in order, and wherein identifying at least one associated resource pair in the second resource list includes: Determine the sliding window size N, where the sliding window size represents the maximum number of resources that can be contained in the sliding window, and N≥2; The resources in the second resource list are traversed sequentially, and the following operations are performed when a corresponding resource is encountered: The currently traversed resource is used as the starting element of the sliding window, and the resources within the sliding window are determined based on the sliding window size, wherein the sliding window includes at least two resources; and The resources in the sliding window other than the currently traversed resource are combined with the currently traversed resource to form associated resource pairs.
9. The method of claim 7 or 8, wherein, The second user is multiple, and wherein, taking at least one entity pair from the one or more entity pairs as two associated entities, updating the relationship and its description text corresponding to each entity pair in the knowledge graph includes: Count the number of each entity pair in the one or more entity pairs; and In response to determining that the number of corresponding entity pairs is greater than a preset threshold, the entities in the corresponding entity pairs with the number greater than the preset threshold are regarded as two related entities, so as to update the relationship and its description text corresponding to each entity pair in the knowledge graph.
10. An apparatus for resource recommendation, comprising: The first acquisition unit is configured to acquire the first list of resources already viewed by the first user. The second acquisition unit is configured to acquire a preset knowledge graph, wherein the knowledge graph includes multiple entities and at least one edge, the edge being able to represent the relationship between two related entities, and wherein each of the multiple entities corresponds to a corresponding entity description text, and each of the at least one edge corresponds to a corresponding relationship description text; The retrieval unit is configured to retrieve at least one first entity matching the first resource list from the knowledge graph based on the first resource list, the entity description text, and the relationship description text; and The recommendation unit is configured to determine resources for recommending to the first user based on the at least one first entity. The preset knowledge graph is generated using the following method: Obtain the target resources used to construct the knowledge graph; The target resource is input into a large language model to extract information from the target resource using the large language model, thereby obtaining the corresponding entities, relations, entity description text corresponding to the entities, and relation description text corresponding to the relations; and The knowledge graph is generated based on the extracted entities and relations, the entity description text corresponding to the entities, and the relation description text corresponding to the relations. Obtain the second resource list that the second user has viewed, wherein the second resource list includes at least two resources; Determine a set of entities corresponding to each of the different resources in the second resource list; and In the knowledge graph, the relationships between entities corresponding to different resources and their relationship description text are updated to indicate that the same user has browsed resources corresponding to entities associated with the corresponding relationships.
11. An electronic device, comprising: At least one processor; as well as A memory that is communicatively connected to the at least one processor; in The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-9.
13. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the method of any one of claims 1-9.
Citation Information
Patent Citations
Resource recommendation method and device, electronic equipment and storage medium
CN114861059A