Method and device for updating knowledge graph
By determining the video entities and their parent entities that match the target keywords in the knowledge graph, the shortcomings of video entity relevance and search comprehensiveness in the existing technology are solved, and more accurate and comprehensive information acquisition is achieved.
Patent Information
- Application Number
- CN201811012702.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2018-08-31
- Publication Date
- 2025-09-30
- Estimated Expiration
- 2038-08-31
AI Technical Summary
Existing knowledge graphs are insufficient in terms of video entity relevance and search comprehensiveness, making it difficult to accurately obtain other entity information associated with the target information.
By obtaining the target keywords, the attribute information of the matching entity is determined from the pre-established knowledge graph, matched with the target keywords, and the parent entity and its attribute information are established and added to the knowledge graph to achieve entity clustering and association.
It improves the correlation between entities in the knowledge graph and the comprehensiveness of video search, and enhances the accuracy and comprehensiveness of information acquisition.
Smart Images

Figure CN109189938B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, and specifically to a method and apparatus for updating a knowledge graph. Background Art
[0002] A knowledge graph is a type of knowledge base known as a semantic network, or a knowledge base with a directed graph structure, where the nodes of the graph represent entities or concepts, and the edges represent the various semantic relationships between entities / concepts. Entities can have corresponding attribute information, which can be used to represent certain properties of the entity (such as the category of the information represented by the entity, the storage address, and other attributes). Knowledge graphs can be applied in various fields, such as information search and information recommendation. Using knowledge graphs, we can identify other entities associated with an entity representing a certain piece of information, thereby more accurately obtaining other information associated with that information. Summary of the Invention
[0003] The embodiments of the present application propose a method and apparatus for updating a knowledge graph, as well as a method and apparatus for outputting information.
[0004] In a first aspect, an embodiment of the present application provides a method for updating a knowledge graph, the method comprising: obtaining a target keyword; determining at least one entity whose corresponding attribute information matches the target keyword as a matching entity from entities represented by a video included in a pre-established knowledge graph; establishing a parent entity of the at least one matching entity determined, and generating attribute information of the parent entity based on the attribute information of the matching entity; and adding the parent entity and the attribute information of the parent entity to the knowledge graph.
[0005] In some embodiments, from entities included in a pre-established knowledge graph that represent videos, at least one entity whose corresponding attribute information matches the target keyword is determined as a matching entity, including: from entities included in a pre-established knowledge graph that represent videos that are long videos, at least one entity whose corresponding attribute information matches the target keyword is determined as a matching entity.
[0006] In some embodiments, the attribute information of the entity included in the knowledge graph includes text information; and from the entities represented by the pre-established knowledge graph and included in the knowledge graph, at least one entity whose corresponding attribute information matches the target keyword is determined as a matching entity, including: from the entities represented by the pre-established knowledge graph and included in the knowledge graph, at least one entity whose corresponding attribute information includes text information containing the target keyword is determined as a matching entity.
[0007] In some embodiments, the number of target keywords is at least one, and the attribute information of the entity used to represent the video includes at least one keyword for describing the video; and from the entities representing the video included in the pre-established knowledge graph, at least one entity whose corresponding attribute information matches the target keyword is determined as a matching entity, including: calculating the similarity between the obtained at least one target keyword and at least one keyword corresponding to the entity used to represent the video, and determining the entity corresponding to the similarity greater than or equal to a preset similarity threshold as a matching entity.
[0008] In some embodiments, the attribute information of the matching entity is a sub-attribute information set consisting of at least one sub-attribute information; and based on the attribute information of the matching entity, the attribute information of the upper-level entity is generated, including: determining the intersection of the sub-attribute information sets of the matching entities in at least one matching entity as the attribute information of the upper-level entity.
[0009] In a second aspect, an embodiment of the present application provides a method for outputting information, the method comprising: receiving a search term input by a user; matching the search term with attribute information of an entity with associated subordinate entities in a pre-established knowledge graph, and determining an entity corresponding to the attribute information matching the search term as a matching entity, wherein the knowledge graph is an updated knowledge graph obtained by the method described in any implementation method of the first aspect above; and outputting relevant information of the subordinate entities of the matching entity.
[0010] In the third aspect, an embodiment of the present application provides a device for updating a knowledge graph, the device comprising: an acquisition unit configured to acquire a target keyword; a determination unit configured to determine at least one entity whose corresponding attribute information matches the target keyword from entities representing a video included in a pre-established knowledge graph as a matching entity; a generation unit configured to establish a parent entity of the at least one matching entity determined, and generate attribute information of the parent entity based on the attribute information of the matching entity; an update unit configured to update the parent entity and the attribute information of the parent entity into the knowledge graph.
[0011] In some embodiments, the determination unit is further configured to: determine at least one entity whose corresponding attribute information matches the target keyword as a matching entity from entities included in the pre-established knowledge graph and representing that the video is a long video.
[0012] In some embodiments, the attribute information of the entity included in the knowledge graph includes text information; and the determination unit is further configured to: determine at least one entity whose corresponding attribute information includes text information containing the target keyword as a matching entity from the entities representing the video included in the pre-established knowledge graph.
[0013] In some embodiments, the number of target keywords is at least one, the attribute information of the entity used to characterize the video includes at least one keyword for describing the video; and the determination unit is further configured to: calculate the similarity between the at least one acquired target keyword and at least one keyword corresponding to the entity used to characterize the video, and determine the entity corresponding to the similarity greater than or equal to a preset similarity threshold as a matching entity.
[0014] In some embodiments, the attribute information of the matching entity is a sub-attribute information set consisting of at least one sub-attribute information; and the generation unit is further configured to: determine the intersection of the sub-attribute information sets of the matching entities in at least one matching entity as the attribute information of the upper-level entity.
[0015] In a fourth aspect, an embodiment of the present application provides a device for outputting information, the device comprising: a receiving unit configured to receive a search term input by a user; a matching unit configured to match the search term with attribute information of an entity with associated subordinate entities in a pre-established knowledge graph, and determine the entity corresponding to the attribute information matching the search term as a matching entity, wherein the knowledge graph is an updated knowledge graph obtained by the method described in any implementation of the first aspect above; and an output unit configured to output relevant information of the subordinate entities of the matching entity.
[0016] In a fifth aspect, an embodiment of the present application provides a server comprising: one or more processors; a storage device on which one or more programs are stored; when the one or more programs are executed by one or more processors, the one or more processors implement the method described in any implementation method of the first aspect or the second aspect.
[0017] In a sixth aspect, an embodiment of the present application provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements the method described in any one of the implementation modes of the first aspect or the second aspect.
[0018] The method and apparatus for updating the knowledge graph provided in the embodiments of the present application obtain target keywords, and then determine at least one entity whose corresponding attribute information matches the target keyword from the entities representing the video included in the pre-established knowledge graph as a matching entity, and then establish a parent entity of the at least one matching entity determined, and generate attribute information of the parent entity, and finally add the parent entity and the attribute information of the parent entity to the knowledge graph. This allows clustering of entities in the knowledge graph by establishing parent entities of entities in the knowledge graph that represent similar videos or the same type of videos, which helps to improve the correlation between entities in the knowledge graph and helps to improve the comprehensiveness of searching for videos using the knowledge graph. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] Other features, objects and advantages of the present application will become more apparent upon reading the detailed description of non-limiting embodiments made with reference to the following drawings:
[0020] Figure 1 is an exemplary system architecture diagram in which an embodiment of the present application may be applied;
[0021] Figure 2 is a flowchart of an embodiment of a method for updating a knowledge graph according to an embodiment of the present application;
[0022] Figure 3 is a schematic diagram of an application scenario of a method for updating a knowledge graph according to an embodiment of the present application;
[0023] Figure 4 is a flowchart of an embodiment of a method for outputting information according to an embodiment of the present application;
[0024] Figure 5 1 is a schematic structural diagram of an embodiment of an apparatus for updating a knowledge graph according to an embodiment of the present application;
[0025] Figure 6 is a structural diagram of an embodiment of a device for outputting information according to an embodiment of the present application;
[0026] Figure 7 It is a structural diagram of a computer system suitable for implementing a server in an embodiment of the present application. DETAILED DESCRIPTION
[0027] The present application will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely for the purpose of explaining the relevant invention and are not intended to limit the invention. It should also be noted that, for ease of description, only portions relevant to the relevant invention are shown in the accompanying drawings.
[0028] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in this application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.
[0029] Figure 1 An exemplary system architecture 100 is shown in which a method for updating a knowledge graph or an apparatus for updating a knowledge graph according to an embodiment of the present application can be applied.
[0030] like Figure 1As shown, system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. Network 104 is a medium for providing communication links between terminal devices 101, 102, 103 and server 105. Network 104 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0031] Users can use terminal devices 101, 102, and 103 to interact with server 105 via network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, and 103, such as video playback applications, web browser applications, search applications, instant messaging tools, social platform software, etc.
[0032] Terminal devices 101, 102, and 103 can be hardware or software. When terminal devices 101, 102, and 103 are hardware, they can be various electronic devices, including but not limited to smartphones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III, Moving Picture Experts Group Audio Layer 3), MP4 players (Moving Picture Experts Group Audio Layer IV, Moving Picture Experts Group Audio Layer 4), laptop computers, and desktop computers, etc. When terminal devices 101, 102, and 103 are software, they can be installed in the electronic devices listed above. They can be implemented as multiple software or software modules (for example, software or software modules used to provide distributed services), or they can be implemented as a single software or software module. No specific limitations are given here.
[0033] Server 105 may be a server that provides various services, such as a background information processing server that performs matching processing on target keywords obtained from terminal devices 101, 102, and 103. The background information processing server may perform matching processing on the obtained target keywords with entities included in the knowledge graph, and obtain processing results (e.g., adding the parent entity of the matched entity and the parent entity's attribute information to the knowledge graph).
[0034] It should be noted that the method for updating the knowledge graph or the method for outputting information provided in the embodiments of the present application is generally executed by the server 105. Accordingly, the device for updating the knowledge graph or the method for outputting information is generally set in the server 105.
[0035] It should be noted that a server can be either hardware or software. When a server is hardware, it can be implemented as a distributed server cluster consisting of multiple servers, or as a single server. When a server is software, it can be implemented as multiple software programs or software modules (for example, software or software modules used to provide distributed services), or as a single software program or software module. This is not specifically limited here.
[0036] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0037] Continue to refer Figure 2 , shows a process 200 of an embodiment of a method for updating a knowledge graph according to the present application. The method for updating a knowledge graph includes the following steps:
[0038] Step 201: Obtain target keywords.
[0039] In this embodiment, the execution subject of the method for updating the knowledge graph (e.g. Figure 1 The server shown) can be connected via a wired or wireless connection from a remote (e.g. Figure 1 The target keyword is a keyword to be matched with the attribute information of the entity representing the video included in the pre-established knowledge graph.
[0040] Optionally, the target keywords may be keywords extracted by the execution entity from pre-obtained text information using various existing keyword extraction algorithms (e.g., the TF-ID (Term Frequency-Inverse Document Frequency) algorithm, algorithms based on topic models, etc.). The text information may be pre-entered into the execution entity by a user, or entered into a terminal device used by the user and then transmitted from the terminal device to the execution entity.
[0041] Step 202: Determine at least one entity whose corresponding attribute information matches the target keyword as a matching entity from entities representing the video included in the pre-established knowledge graph.
[0042] In this embodiment, based on the target keyword obtained in step 201, the execution entity may determine at least one entity whose corresponding attribute information matches the target keyword from the entities representing the video included in the pre-established knowledge graph as a matching entity. Generally, entities in a knowledge graph can be used to represent certain things or concepts (e.g., representing people, places, time, information, etc.). The form of an entity may include at least one of the following: numbers, text, symbols, etc. In this embodiment, the knowledge graph may include entities used to represent videos. As an example, a pre-established entity used to represent a video may be "v-abc", where "v" indicates that the entity is used to represent the video, and "abc" is an identifier used to represent the video. In addition, the knowledge graph of this embodiment may also include entities used to represent other things or concepts besides videos. For example, a pre-established entity used to represent a person may be "p-xyz", where "p" indicates that the entity is used to represent the person, and "xyz" is an identifier used to represent the person.
[0043] The attribute information of an entity representing a video can be information related to the video represented by the entity, and may include, but is not limited to, at least one of the following: information about people associated with the video (e.g., video producer, actor, director, etc.), information about the time associated with the video (e.g., release date, filming time, etc.), information about the video's source (e.g., video playback URL, website name of the video), and other information related to the video's content (e.g., video description, stills, poster images, etc.). Typically, in a knowledge graph, the correspondence between entities and attribute information can be represented using a triple-tuple data structure: "entity-attribute-attribute value," where the entity's attribute information can include the aforementioned attribute-attribute value. For example, a triple-tuple might be "abc123-name-XXX," where "abc123" is the entity representing the movie "XXX," "name" is an attribute, and "XXX" is the attribute value.
[0044] In practice, the relationships between entities in a knowledge graph can be represented using a triple-tuple data structure. For example, a triple is "entity A - relationship - entity B." The "relationship" can be pre-set information in various forms (such as text or symbols) that represents the relationship between the two entities. For example, if entity A represents a movie and entity B represents an actor, the "relationship" could be "starring actor," indicating that the actor represented by entity B is the star of the movie represented by entity A.
[0045] In this embodiment, the execution entity may match the description information of the target video with the attribute information of the entity in the knowledge graph according to various methods.
[0046] In some optional implementations of this embodiment, the attribute information of the entity included in the knowledge graph includes text information. As an example, the text information may be information such as the title, genre, and content summary of the video represented by the entity. The execution entity may determine, from the entities represented by the video in the pre-established knowledge graph, at least one entity whose corresponding attribute information includes text information containing the target keyword as a matching entity.
[0047] Optionally, when the number of target keywords is at least two, the execution entity may determine entities corresponding to text information including a preset number of target keywords among the acquired at least two target keywords as matching entities.
[0048] In some optional implementations of this embodiment, the number of target keywords obtained may be at least one, and the attribute information of the entity may include at least one keyword for describing the video. As an example, the attribute information of an entity may include the following keywords: "martial arts", "domestic", "director Zhang XX", etc., which are used to describe the video represented by the entity. The above-mentioned execution subject may calculate the similarity between the at least one target keyword obtained and at least one keyword corresponding to the entity according to various existing algorithms for calculating the similarity between keywords (such as the Levenshtein Distance algorithm, the cosine distance algorithm based on the Vector Space Model (VSM)), etc., and determine the entity corresponding to the similarity greater than or equal to the preset similarity threshold as a matching entity.
[0049] In practice, the videos indicated by each matching entity may be videos belonging to a series. For example, suppose three matching entities are determined, representing the first, second, and third videos of the series movie "XXX".
[0050] In some optional implementations of this embodiment, the execution entity may determine, from entities in a pre-established knowledge graph representing long videos, at least one entity whose corresponding attribute information matches the target keyword as a matching entity. Typically, the video represented by an entity can be either a long video or a short video. In this implementation, the matching entity may be determined from entities representing long videos. A long video may be a video with a playback time greater than or equal to a preset time threshold, or a video with a number of image frames greater than or equal to a preset number threshold. An entity at a preset level. Correspondingly, a short video may be a video with a playback time less than or equal to a preset time threshold, or a video with a number of image frames less than a preset number threshold. For example, an entity representing a video in a knowledge graph may have a corresponding video length tag to indicate whether the entity is a long video or a short video. The video length tag may be stored in association with the video, or it may be included in the entity's identifier (for example, an entity may be "v-abc-l," where "v" indicates that the entity represents a video, "abc" is the entity's identifier, and "l" indicates that the video represented by the entity is a long video).
[0051] Step 203: Establish a parent entity of the determined at least one matching entity, and generate attribute information of the parent entity based on the attribute information of the matching entity.
[0052] In this embodiment, the above-mentioned execution subject can establish the parent entity of the at least one matching entity determined. Specifically, the above-mentioned execution subject can generate the parent entity of the at least one matching entity as specified by the technician, or automatically. That is, each matching entity in the at least one matching entity can be jointly associated with the generated parent entity. Generally, in the knowledge graph, the superior-subordinate relationship between entities can be represented by a data structure in the form of a triple. For example, the three matching entities are A, B, and C, which are used to represent the movies "XXX One", "XXX Two", and "XXX Three" respectively. The newly established parent entity is D, which is used to represent the series of movies "XXX". The association relationship between the matching entities A, B, C and the parent entity D can be represented by the following triples: "D-Series-A", "D-Series-B", "D-Series-C. Among them, "Series" is used to represent that the relationship between the videos represented by the two entities is the relationship between a series video and one of the videos in the series.
[0053] The execution subject may generate the attribute information of the upper-level entity based on the attribute information of the matching entity. For example, the execution subject may extract specified information from the attribute information of each matching entity as specified by the technician and merge the extracted information into the attribute information of the upper-level entity.
[0054] In some optional implementations of this embodiment, the attribute information of the matching entity is a sub-attribute information set consisting of at least one sub-attribute information. The above-mentioned execution subject can determine the intersection of the sub-attribute information sets of the matching entities in at least one matching entity as the attribute information of the parent entity. As an example, it is assumed that the sub-attribute information set of each matching entity includes the following sub-attribute information: the name of a certain series of movies "XXX", the name of the director "Zhang X", the name of the starring actor "Wang X", and the name of the website where the video is located "Station A". Then the attribute information of the newly established parent entity can include the name of the series of movies "XXX", the name of the director "Zhang X", the name of the starring actor "Wang X", and the name of the website where the video is located "Station A".
[0055] Step 204: Add the parent entity and its attribute information to the knowledge graph.
[0056] In this embodiment, the execution entity can add the parent entity and its attribute information to the knowledge graph, thereby obtaining an updated knowledge graph. The updated knowledge graph, due to the addition of the parent entity, can more accurately and comprehensively represent the relationship between entities.
[0057] Continue to see Figure 3 , Figure 3 This is a schematic diagram of an application scenario of the method for updating the knowledge graph according to this embodiment. Figure 3 In the application scenario, the server 301 first obtains the target keyword 302 (for example, the name of a series of movies "XXX") pre-stored locally. Then, the server 301 matches the target keyword 302 with the attribute information of the entity representing the video included in the pre-established knowledge graph 303. Among them, entities 3031, 3032, and 3033 represent the movies "XXX 1", "XXX 2", and "XXX 3", respectively. Since the attribute information of entities 3031, 3032, and 3033 includes the name of the represented movie, and the name contains "XXX", the server 301 can determine that entities 3031, 3032, and 3033 are matching entities. Then, the server 301 establishes the parent entity 3030 of the matching entities 3031, 3032, and 3033, and extracts the information included in the attribute information of the matching entities 3031, 3032, and 3033 as the attribute information 30301 of the parent entity. For example, if the attribute information of matching entities 3031, 3032, and 3033 all include the title of the film series "XXX", the director's name "Zhang X", and the lead actor's name "Wang X", the attribute information of the generated parent entity will include: the film title "XXX", the director's name "Zhang X", and the lead actor's name "Wang X". Finally, server 301 adds parent entity 3030 and the attribute information of parent entity 3030 to knowledge graph 303, resulting in an updated knowledge graph 304.
[0058] The method provided by the above-mentioned embodiment of the present application obtains the target keyword, and then determines at least one entity whose corresponding attribute information matches the target keyword from the entities representing the video included in the pre-established knowledge graph as a matching entity, and then establishes the parent entity of the at least one matching entity determined, and generates the attribute information of the parent entity, and finally adds the parent entity and the attribute information of the parent entity to the knowledge graph. In this way, by establishing the parent entity of the entity in the knowledge graph that represents similar videos or the same type of videos, the entities in the knowledge graph can be clustered, which helps to improve the correlation between entities in the knowledge graph and helps to improve the comprehensiveness of searching for videos using the knowledge graph.
[0059] Continue to refer Figure 4 , shows a process 400 of an embodiment of a method for outputting information according to the present application. The method for outputting information includes the following steps:
[0060] Step 401: Receive a search term input by a user.
[0061] In this embodiment, the method for updating the knowledge graph is executed on the electronic device (e.g. Figure 1 The server shown in FIG) can receive the user's electronic device (eg, Figure 1 The search term may be a search term entered by a terminal device (as shown). The number of search terms may be at least one. A search term may be a word, phrase, or sentence used for information search. The form of the search term may include, but is not limited to, at least one of the following: text, numbers, symbols, etc., in any language (e.g., Chinese, English, etc.).
[0062] Step 402 , matching the search term with the attribute information of entities in a pre-established knowledge graph that are used to characterize the video and have associated subordinate entities, and determining the entity corresponding to the attribute information that matches the search term as a matching entity.
[0063] In this embodiment, the execution subject may match the search term with the attribute information of an entity in a pre-established knowledge graph that is used to characterize the video and has associated subordinate entities, and determine the entity corresponding to the attribute information that matches the search term as a matching entity. Specifically, the execution subject may match the search term with the attribute information in various ways. For example, the attribute information of the entity may include text information (such as information used to characterize the names of various actors, information used to describe the content of the video, etc.). The execution subject may determine the entity whose text information included in the corresponding attribute information includes the search term as a matching entity. It should be noted that when the number of search terms is at least one, the execution subject may determine the entity whose text information included in the attribute information includes all search terms or a preset number of search terms in the at least one search term as a matching entity.
[0064] Optionally, the text information included in the attribute information of the entity may include at least one keyword used to describe the video (e.g., "science fiction," "domestic," "2018," etc.). The execution entity may calculate the similarity between the search term and the at least one keyword corresponding to the entity using various existing algorithms for calculating similarity between keywords (e.g., a Levenshtein distance algorithm, a cosine distance algorithm based on a vector space model (VSM)), and determine the entity corresponding to a similarity greater than or equal to a preset similarity threshold as a matching entity.
[0065] In this embodiment, the above-mentioned knowledge graph is as follows Figure 2 The updated knowledge graph obtained by the method described in the corresponding embodiment. For a description of the knowledge graph, please refer to Figure 2 The contents described in the corresponding embodiments will not be repeated here.
[0066] Typically, a matching entity may be an entity used to represent a series of videos, and each subordinate entity of the matching entity is used to represent one of the videos in the series.
[0067] Step 403: output relevant information of the subordinate entities of the matching entity.
[0068] In this embodiment, the execution entity may output relevant information about the subordinate entities of the matching entity. The relevant information may be information included in the attribute information of the subordinate entity, or other information related to the subordinate entity (e.g., pre-acquired user comments and ratings on the video represented by the matching entity). As an example, the attribute information may include various types of sub-information, and the sub-information may have corresponding identifiers or serial numbers to distinguish the categories of the sub-information. The execution entity may extract sub-information of a preset category from the attribute information as relevant information. It should be noted that the outputted relevant information may be relevant information about each subordinate entity of the matching entity, or it may be relevant information about a preset, default subordinate entity.
[0069] Optionally, the execution entity may output the relevant information of the subordinate entity in various ways, such as displaying the relevant information of the subordinate entity on a display connected to the execution entity, or outputting the relevant information of the matching entity to other electronic devices in communication with the execution entity.
[0070] The method for outputting information provided by the embodiment of the present application receives a search term input by a user, matches the search term with attribute information of an entity with associated subordinate entities in a pre-established knowledge graph, and determines the entity corresponding to the attribute information matching the search term as a matching entity, wherein the knowledge graph is as follows Figure 2 The updated knowledge graph obtained by the method described in the embodiment finally outputs the relevant information of the subordinate entities of the matching entity, so that the updated knowledge graph can be used to improve the accuracy and comprehensiveness of the relevant information obtained by the search.
[0071] Further references Figure 5 , as a response to the above Figure 2 The present application provides an embodiment of a device for updating a knowledge graph. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0072] like Figure 5 As shown, the device 500 for updating the knowledge graph of this embodiment includes: an acquisition unit 501, configured to acquire a target keyword; a determination unit 502, configured to determine at least one entity whose corresponding attribute information matches the target keyword as a matching entity from the entities representing the video included in the pre-established knowledge graph; a generation unit 503, configured to establish a parent entity of the at least one matching entity determined, and generate attribute information of the parent entity based on the attribute information of the matching entity; an update unit 504, configured to update the parent entity and the attribute information of the parent entity in the knowledge graph.
[0073] In this embodiment, the acquisition unit 501 can obtain the data from a remote location (eg, Figure 1 The target keyword is a keyword to be matched with the attribute information of the entity representing the video included in the pre-established knowledge graph.
[0074] In this embodiment, based on the target keyword obtained by the acquisition unit 501, the determination unit 502 may determine, from the entities representing the video included in the pre-established knowledge graph, at least one entity whose corresponding attribute information matches the target keyword as a matching entity. Generally, entities in a knowledge graph can be used to represent certain things or concepts (e.g., people, places, times, information, etc.). The form of an entity may include at least one of the following: numbers, text, symbols, etc. In this embodiment, the knowledge graph may include entities used to represent videos. As an example, a pre-established entity used to represent a video may be "v-abc," where "v" indicates that the entity represents the video and "abc" is an identifier used to represent the video. Furthermore, the knowledge graph of this embodiment may also include entities used to represent other things or concepts besides videos. For example, a pre-established entity used to represent a person may be "p-xyz," where "p" indicates that the entity represents the person and "xyz" is an identifier used to represent the person.
[0075] The attribute information of an entity representing a video can be information related to the video represented by the entity, and may include, but is not limited to, at least one of the following: information about people associated with the video (e.g., video producer, actor, director, etc.), information about the time associated with the video (e.g., release date, filming time, etc.), information about the video's source (e.g., video playback URL, website name of the video), and other information related to the video's content (e.g., video description, stills, poster images, etc.). Typically, in a knowledge graph, the correspondence between entities and attribute information can be represented using a triple-tuple data structure: "entity-attribute-attribute value," where the entity's attribute information can include the aforementioned attribute-attribute value. For example, a triple-tuple might be "abc123-name-XXX," where "abc123" is the entity representing the movie "XXX," "name" is an attribute, and "XXX" is the attribute value.
[0076] In practice, the relationships between entities in a knowledge graph can be represented using a triple-tuple data structure. For example, a triple is "entity A - relationship - entity B." The "relationship" can be pre-set information in various forms (such as text or symbols) that represents the relationship between the two entities. For example, if entity A represents a movie and entity B represents an actor, the "relationship" could be "starring actor," indicating that the actor represented by entity B is the star of the movie represented by entity A.
[0077] In this embodiment, the above-mentioned generation unit 503 can establish the parent entity of the at least one matching entity determined. Specifically, the above-mentioned generation unit 503 can generate the parent entity of the at least one matching entity as specified by the technician, or automatically. That is, each matching entity in the at least one matching entity can be jointly associated with the generated parent entity. Generally, in the knowledge graph, the parent-child relationship between entities can be represented by a data structure in the form of a triple. For example, the three matching entities are A, B, and C, which are used to represent the movies "XXX One", "XXX Two", and "XXX Three" respectively. The newly established parent entity is D, which is used to represent the series of movies "XXX". The association relationship between the matching entities A, B, C and the parent entity D can be represented by the following triples: "D-Series-A", "D-Series-B", "D-Series-C. Among them, "series" is used to represent that the relationship between the videos represented by the two entities is the relationship between a series video and one of the videos in the series.
[0078] The generating unit 503 may generate the attribute information of the upper-level entity based on the attribute information of the matching entity. As an example, the generating unit 503 may extract the specified information from the attribute information of each matching entity as specified by the technician and merge the extracted information into the attribute information of the upper-level entity.
[0079] In this embodiment, the updating unit 504 may add the parent entity and the attribute information of the parent entity to the knowledge graph, thereby obtaining an updated knowledge graph. Since the updated knowledge graph includes the parent entity, it can more accurately and comprehensively represent the relationship between entities.
[0080] In some optional implementations of this embodiment, the determination unit 502 can be further configured to: determine at least one entity whose corresponding attribute information matches the target keyword as a matching entity from the entities included in the pre-established knowledge graph and representing that the video is a long video.
[0081] In some optional implementations of this embodiment, the attribute information of the entity included in the knowledge graph may include text information; and the determination unit 502 may be further configured to: determine, from the entities representing the video included in the pre-established knowledge graph, at least one entity whose corresponding attribute information includes text information containing the target keyword as a matching entity.
[0082] In some optional implementations of this embodiment, the number of target keywords is at least one, and the attribute information of the entity used to represent the video includes at least one keyword for describing the video; and the determination unit 502 can be further configured to: calculate the similarity between the at least one acquired target keyword and at least one keyword corresponding to the entity used to represent the video, and determine the entity corresponding to the similarity greater than or equal to a preset similarity threshold as a matching entity.
[0083] In some optional implementations of this embodiment, the attribute information of the matching entity is a sub-attribute information set consisting of at least one sub-attribute information; and the generation unit 503 can be further configured to: determine the intersection of the sub-attribute information sets of the matching entities in at least one matching entity as the attribute information of the parent entity.
[0084] The device provided by the above-mentioned embodiment of the present application obtains the target keyword, and then determines at least one entity whose corresponding attribute information matches the target keyword from the entities representing the video included in the pre-established knowledge graph as a matching entity, and then establishes the parent entity of the at least one matching entity determined, and generates the attribute information of the parent entity, and finally adds the parent entity and the attribute information of the parent entity to the knowledge graph. In this way, by establishing the parent entity of the entity in the knowledge graph that represents similar videos or the same type of videos, the entities in the knowledge graph can be clustered, which helps to improve the correlation between entities in the knowledge graph and helps to improve the comprehensiveness of searching for videos using the knowledge graph.
[0085] Further references Figure 6 , as a response to the above Figure 4 The present application provides an embodiment of a device for outputting information. Figure 4 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0086] like Figure 6As shown, the apparatus 600 for outputting information in this embodiment includes: a receiving unit 601, configured to receive a search term input by a user; a matching unit 602, configured to match the search term with attribute information of an entity with associated subordinate entities in a pre-established knowledge graph, and determine an entity corresponding to attribute information matching the search term as a matching entity, wherein the knowledge graph is as follows Figure 2 The updated knowledge graph obtained by the method described in the corresponding embodiment; the output unit 603 is configured to output relevant information of the subordinate entities of the matching entity.
[0087] In this embodiment, the receiving unit 601 can receive the user's electronic device (for example, Figure 1 The search term may be a search term entered by a terminal device (as shown). The number of search terms may be at least one. A search term may be a word, phrase, or sentence used for information search. The form of the search term may include, but is not limited to, at least one of the following: text, numbers, symbols, etc., in any language (e.g., Chinese, English, etc.).
[0088] In this embodiment, the matching unit 602 may match the search term with the attribute information of an entity in a pre-established knowledge graph that is used to characterize a video and has associated subordinate entities, and determine the entity corresponding to the attribute information that matches the search term as a matching entity. Specifically, the matching unit 602 may match the search term with the attribute information in various ways. For example, the attribute information of the entity may include text information (such as information used to characterize the names of various actors, information used to describe the content of the video, etc.). The matching unit 602 may determine the entity whose text information included in the corresponding attribute information includes the search term as a matching entity. It should be noted that when the number of search terms is at least one, the matching unit 602 may determine the entity whose text information included in the attribute information includes all search terms or a preset number of search terms in the at least one search term as a matching entity.
[0089] Typically, a matching entity may be an entity used to represent a series of videos, and each subordinate entity of the matching entity is used to represent one of the videos in the series.
[0090] In this embodiment, the output unit 603 can output relevant information about the subordinate entities of the matching entity. The relevant information can be information included in the attribute information of the subordinate entity, or other information related to the subordinate entity (such as pre-acquired user comments and ratings on the video represented by the matching entity). As an example, the attribute information can include various types of sub-information, and the sub-information can have corresponding identifiers or serial numbers to distinguish the categories of the sub-information. The output unit 603 can extract sub-information of a preset category from the attribute information as relevant information. It should be noted that the output relevant information can be relevant information about each subordinate entity of the matching entity, or it can be relevant information about a preset, default subordinate entity.
[0091] The device for outputting information provided by the embodiment of the present application receives a search term input by a user, matches the search term with attribute information of an entity with associated subordinate entities in a pre-established knowledge graph, and determines the entity corresponding to the attribute information matching the search term as a matching entity, wherein the knowledge graph is as follows Figure 2 The updated knowledge graph obtained by the method described in the embodiment finally outputs the relevant information of the subordinate entities of the matching entity, so that the updated knowledge graph can be used to improve the accuracy and comprehensiveness of the relevant information obtained by the search.
[0092] Reference below Figure 7 , which shows a structural diagram of a computer system 700 suitable for implementing a server of an embodiment of the present application. Figure 7 The server shown is merely an example and should not limit the functions and scope of use of the embodiments of the present application.
[0093] like Figure 7 As shown, computer system 700 includes a central processing unit (CPU) 701, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage unit 708 into a random access memory (RAM) 703. Various programs and data required for the operation of system 700 are also stored in RAM 703. CPU 701, ROM 702, and RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to bus 704.
[0094] The following components are connected to the I / O interface 705: an input section 706 including a keyboard, mouse, and the like; an output section 707 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and speakers; a storage section 708 including devices such as a hard disk; and a communication section 709 including a network interface card such as a LAN card or a modem. The communication section 709 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 705 as needed. Removable media 711, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 710 as needed, so that computer programs read from the media can be installed in the storage section 708 as needed.
[0095] In particular, according to embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for executing the methods illustrated in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 709 and / or installed from removable media 711. When executed by the central processing unit (CPU) 701, the computer program performs the aforementioned functions defined in the methods of the present application.
[0096] It should be noted that the computer-readable medium described in this application may be a computer-readable signal medium or a computer-readable medium, or any combination thereof. Computer-readable media may include, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or components, or any combination thereof. More specific examples of computer-readable media may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this application, a computer-readable medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.
[0097] Computer program code for performing the operations of the present application can be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0098] 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 application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of 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 than that 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 and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0099] The units involved in the embodiments described in this application can be implemented by software or hardware. The units described can also be set in a processor. For example, it can be described as: a processor includes an acquisition unit, a determination unit, a generation unit, and an update unit. The names of these units do not constitute a limitation of the units themselves in some cases. For example, the acquisition unit can also be described as a "unit for acquiring target keywords."
[0100] As another aspect, the present application also provides a computer-readable medium, which may be included in the server described in the above embodiment; or may exist independently and not be assembled into the server. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by the server, the server: obtains a target keyword; determines at least one entity whose corresponding attribute information matches the target keyword from entities representing the video included in a pre-established knowledge graph as a matching entity; establishes a parent entity of the at least one matching entity determined, and generates attribute information of the parent entity based on the attribute information of the matching entity; and adds the parent entity and the attribute information of the parent entity to the knowledge graph.
[0101] In addition, when one or more of the above programs are executed by the server, the server can also: receive search terms input by the user; match the search terms with the attribute information of entities with associated subordinate entities in a pre-established knowledge graph, and determine the entity corresponding to the attribute information matching the search terms as a matching entity, wherein the knowledge graph is an updated knowledge graph obtained using the method for updating the knowledge graph as described in the above embodiments; and output relevant information of the subordinate entities of the matching entity.
[0102] The above description is merely a preferred embodiment of the present application and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of the invention herein is not limited to technical solutions formed by a specific combination of the aforementioned technical features. It also encompasses other technical solutions formed by any combination of the aforementioned technical features or their equivalents, without departing from the aforementioned inventive concept. For example, a technical solution formed by replacing the aforementioned features with (but not limited to) technical features with similar functions disclosed in this application.
[0103] If user information is required when using the various embodiments of this disclosure, the user must be informed of the type, scope, and usage scenarios of the personal information involved in this disclosure and obtain their authorization in accordance with relevant laws and regulations through appropriate and legal means. It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws and regulations and relevant provisions.
Claims
1. A method for updating a knowledge graph, comprising: Get target keywords; Determine, from entities representing the video included in a pre-established knowledge graph, at least one entity whose corresponding attribute information matches the target keyword as a matching entity; Establishing a parent entity of the at least one matching entity determined, and generating attribute information of the parent entity based on attribute information of the matching entity, wherein each matching entity in the at least one matching entity is commonly associated with the parent entity, and the parent entity is a parent entity of an entity used to represent similar videos or similar videos; The parent entity and the attribute information of the parent entity are added to the knowledge graph.
2. The method according to claim 1, wherein The step of determining at least one entity whose corresponding attribute information matches the target keyword from entities representing the video included in the pre-established knowledge graph as a matching entity includes: From the entities included in the pre-established knowledge graph and representing that the video is a long video, determine at least one entity whose corresponding attribute information matches the target keyword as a matching entity.
3. The method according to claim 1, wherein The attribute information of entities included in the knowledge graph includes text information; and The step of determining at least one entity whose corresponding attribute information matches the target keyword from entities representing the video included in the pre-established knowledge graph as a matching entity includes: From the entities representing the video included in the pre-established knowledge graph, determine at least one entity whose corresponding attribute information includes text information containing the target keyword as a matching entity.
4. The method according to claim 1, wherein The number of the target keyword is at least one, and the attribute information of the entity representing the video includes at least one keyword for describing the video; and The step of determining at least one entity whose corresponding attribute information matches the target keyword from entities representing the video included in the pre-established knowledge graph as a matching entity includes: The similarity between the obtained at least one target keyword and at least one keyword corresponding to an entity used to represent the video is calculated, and an entity corresponding to a similarity greater than or equal to a preset similarity threshold is determined as a matching entity.
5. The method according to any one of claims 1 to 4, wherein: The attribute information of the matching entity is a sub-attribute information set consisting of at least one sub-attribute information; as well as The generating the attribute information of the upper-level entity based on the attribute information of the matching entity includes: An intersection of sub-attribute information sets of the matching entities in the at least one matching entity is determined as the attribute information of the upper-level entity.
6. A method for outputting information, comprising: Receive search terms entered by the user; matching the search term with attribute information of an entity having associated subordinate entities in a pre-established knowledge graph, and determining an entity corresponding to attribute information matching the search term as a matching entity, wherein the knowledge graph is an updated knowledge graph obtained by the method of any one of claims 1 to 5; Output relevant information of the subordinate entities of the matching entity.
7. A device for updating a knowledge graph, comprising: an acquisition unit, configured to acquire a target keyword; a determining unit configured to determine, from entities representing the video and included in a pre-established knowledge graph, at least one entity whose corresponding attribute information matches the target keyword as a matching entity; a generating unit configured to establish a parent entity of the determined at least one matching entity, and generate attribute information of the parent entity based on attribute information of the matching entity, wherein each matching entity in the at least one matching entity is commonly associated with the parent entity, and the parent entity is a parent entity of an entity used to represent similar videos or similar videos; An updating unit is configured to update the parent entity and the attribute information of the parent entity in the knowledge graph.
8. The device according to claim 7, wherein The determining unit is further configured to: From the entities included in the pre-established knowledge graph and representing that the video is a long video, determine at least one entity whose corresponding attribute information matches the target keyword as a matching entity.
9. The device according to claim 7, wherein The attribute information of entities included in the knowledge graph includes text information; and The determining unit is further configured to: From the entities representing the video included in the pre-established knowledge graph, determine at least one entity whose corresponding attribute information includes text information containing the target keyword as a matching entity.
10. The device according to claim 7, wherein The number of the target keyword is at least one, and the attribute information of the entity representing the video includes at least one keyword for describing the video; and The determining unit is further configured to: The similarity between the obtained at least one target keyword and at least one keyword corresponding to an entity used to represent the video is calculated, and an entity corresponding to a similarity greater than or equal to a preset similarity threshold is determined as a matching entity.
11. The device according to any one of claims 7 to 10, wherein: The attribute information of the matching entity is a sub-attribute information set consisting of at least one sub-attribute information; and The generating unit is further configured to: An intersection of sub-attribute information sets of the matching entities in the at least one matching entity is determined as the attribute information of the upper-level entity.
12. A device for outputting information, comprising: a receiving unit configured to receive a search term input by a user; a matching unit configured to match the search term with attribute information of an entity having associated subordinate entities in a pre-established knowledge graph, and to determine an entity corresponding to attribute information matching the search term as a matching entity, wherein the knowledge graph is an updated knowledge graph obtained by the method of any one of claims 1 to 5; The output unit is configured to output relevant information of the subordinate entities of the matching entity.
13. A server comprising: one or more processors; a storage device having one or more programs stored thereon, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 6.
14. A computer-readable medium having a computer program stored thereon, wherein: When the program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Knowledge data processing method and knowledge data processing device
CN105373590A
Knowledge graph improvement method and apparatus
CN107748754A
Method and equipment for displaying commodity full results after commodity information input by user
CN107861972A
Structured entity recording method and device, server and storage medium
CN108038183A
Determination method and device for recommended search keyword
CN107169010A