Information acquisition method and device based on knowledge graph, equipment and storage medium
By automatically obtaining information based on the characteristics and state relationships of the knowledge graph, the problems of inefficiency and low accuracy in the prior art are solved, and more efficient and accurate information acquisition is achieved.
Patent Information
- Application Number
- CN202510746670.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-05
- Publication Date
- 2025-09-05
- Estimated Expiration
- 2045-06-05
AI Technical Summary
During the existing dialogue process, relying on the experience of the second user, the results are inefficient and the accuracy of obtaining key information is not high.
Based on the knowledge graph, by obtaining the feature description and attribute description input by the user, the priority is calculated using feature nodes, attribute nodes and edge weights, and key information corresponding to the feature description is automatically obtained.
It improves the efficiency and accuracy of information acquisition, can more accurately reflect the actual status of users, and obtain more comprehensive information.
Smart Images

Figure CN120596633A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology applications, and in particular to a knowledge graph-based information acquisition method, device, equipment and storage medium. Background Art
[0002] In some application scenarios, a second user may need to engage in multiple rounds of conversation with the first user to obtain key information related to the first user's question. However, existing conversations generally rely on the second user's experience to drive the conversation forward. This increases the burden on the second user, resulting in low efficiency and inaccurate key information. Summary of the Invention
[0003] In view of the above technical problems, the technical solution adopted by the present invention is:
[0004] According to a first aspect of the present invention, a method for acquiring information based on a knowledge graph is provided, the method comprising the following steps:
[0005] S100, obtaining input information currently input by the user, wherein the input information includes a feature description or a feature description and an attribute description, wherein the feature description includes a first feature description or a first feature description and a second feature description, wherein the first feature description is a feature selected by the user, the second feature description is a feature not selected by the user, and the attribute description includes an attribute selected by the user.
[0006] S200, based on the input information currently input by the user, sets the identifier of the feature node corresponding to the first feature description in the current knowledge graph to the first identifier, as the first feature node, sets the identifier of the feature node corresponding to the second feature description in the current knowledge graph to the second identifier, as the second feature node, and sets the identifier of the attribute node corresponding to the attribute description in the current knowledge graph to the first identifier.
[0007] S300: For any state node i in the current knowledge graph, based on the edge weight between the state node i and the corresponding feature node and the edge weight between the state node i and the corresponding attribute node, obtain the priority PS corresponding to the state node i. i , i ranges from 1 to m, and m is the number of state nodes in the knowledge graph.
[0008] S400, for any third feature node u in the current knowledge graph, obtain the priority PF corresponding to the third feature node u based on the first preset path length, the second preset path length, the bias value corresponding to the third feature node u, the edge weight between the third feature node u and the corresponding state node, the edge weight between the third feature node u and the corresponding first feature node, and the edge weight between the third feature node u and the corresponding state node. u , the third feature node is the feature node in the knowledge graph except the first feature node and the second feature node, and the value of u ranges from 1 to n, where n is the number of third feature nodes.
[0009] S500, obtain max(PF1, PF2, ..., PF u ,……,PF n ) is used as the target information, and max() means taking the maximum value.
[0010] According to a second aspect of the present invention, there is provided an information acquisition device based on a knowledge graph, wherein the knowledge graph is composed of first to fourth type nodes, wherein the first type nodes are state nodes representing a state, the second type nodes are feature nodes representing a feature of a state, the third type nodes are attribute nodes representing an attribute of a state, and the fourth type nodes are region nodes representing a region to which the state belongs; the device comprises:
[0011] An information acquisition module is used to obtain the input information currently input by the user, wherein the input information includes a feature description or a feature description and an attribute description, wherein the feature description includes a first feature description and a second feature description, wherein the first feature description is a feature selected by the user, and the second feature description is a feature not selected by the user, and the attribute description includes an attribute selected by the user.
[0012] A setting module is used to set the identifier of the feature node corresponding to the first feature description in the current knowledge graph to the first identifier as the first feature node based on the input information currently input by the user, set the identifier of the feature node corresponding to the second feature description in the current knowledge graph to the second identifier as the second feature node, and set the identifier of the attribute node corresponding to the attribute description in the current knowledge graph to the first identifier.
[0013] The first priority acquisition module is used to obtain the priority PS corresponding to any state node i based on the edge weight between the state node i and the corresponding feature node and the edge weight between the state node i and the corresponding attribute node in the current knowledge graph. i , i ranges from 1 to m, and m is the number of state nodes in the knowledge graph.
[0014] The second priority acquisition module is used to obtain the priority PF corresponding to the third feature node u based on the first preset path length, the second preset path length, the bias value corresponding to the third feature node u, the edge weight between the third feature node u and the corresponding state node, the edge weight between the third feature node u and the corresponding first feature node, and the edge weight between the third feature node u and the corresponding state node. u , the third feature node is the feature node in the knowledge graph except the first feature node and the second feature node, and the value of u ranges from 1 to n, where n is the number of third feature nodes.
[0015] Target information acquisition module, used to obtain max(PF1, PF2, ..., PF u ,……,PF n ) is used as the target information, and max() means taking the maximum value.
[0016] According to a third aspect of the present invention, an electronic device is provided, comprising a processor and a memory; the processor is configured to execute the steps of the method according to the first aspect of the present invention by calling a program or instruction stored in the memory.
[0017] According to a fourth aspect of the present invention, there is provided a non-transitory computer-readable storage medium storing a program or instructions for enabling a computer to execute the steps of the method according to the first aspect of the present invention.
[0018] The present invention has at least the following beneficial effects:
[0019] The knowledge graph-based information acquisition method provided by an embodiment of the present invention can automatically acquire key information corresponding to the feature description input by the user based on the relationship between the features and states in the knowledge graph, thereby improving the efficiency and accuracy of information acquisition.
[0020] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0022] Figure 1Flowchart of the knowledge graph-based information acquisition method provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0023] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making any creative efforts shall fall within the scope of protection of the present invention.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this invention pertains. The terms used herein in the specification of the present invention are for the purpose of describing specific embodiments only and are not intended to limit the present invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0025] It should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe the steps as sequential processes, many of the steps can be performed in parallel, concurrently, or simultaneously. In addition, the order of the steps can be rearranged. A process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. A process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0026] An embodiment of the present invention provides a knowledge graph-based information acquisition method. An exemplary application scenario for this method may be a conversational scenario, which may include a first user and a second user. The first user poses a question, and the second user, based on the first user's question, guides the first user in a conversation to obtain a conclusion corresponding to the question. A specific application scenario may be an inquiry during a Traditional Chinese Medicine (TCM) diagnosis, in which the first user may be a doctor and the second user may be a patient.
[0027] In an embodiment of the present invention, the knowledge graph may be composed of first to fourth type nodes, wherein the first type nodes are state nodes representing a state, the second type nodes are feature nodes representing a characteristic of a state, the third type nodes are attribute nodes representing an attribute of a state, and the fourth type nodes are region nodes representing an area to which the state belongs. There are association relationships between the first type nodes and the second type nodes, between the first type nodes and the third type nodes, between the first type nodes and the fourth type nodes, and between the second type nodes and the second type nodes, and the nodes with association relationships are connected by connecting lines. The association relationship between the first type nodes and the second type nodes indicates that the state corresponding to the first type nodes has the characteristics corresponding to the second type nodes, the association relationship between the first type nodes and the third type nodes indicates that the state corresponding to the first type nodes may have the attributes corresponding to the third type nodes, and the association relationship between the first type nodes and the fourth type nodes indicates that the state corresponding to the first type nodes may occur in the area corresponding to the fourth type nodes. The relationships between the second type nodes may include mutually exclusive relationships and coexistence relationships.
[0028] In a specific embodiment of the present invention, the knowledge graph may be a Traditional Chinese Medicine (TCM) knowledge graph. The first type of node may represent an abnormal bodily condition, such as a disease. The second type of node may represent symptoms. The third type of node may represent the nature of the disease. The fourth type of node may represent the location of the disease. In this embodiment of the present invention, the nature of the disease may include deficiency, excess, cold, heat, and normal state.
[0029] In an embodiment of the present invention, the TCM symptom knowledge graph can be constructed and updated based on the latest TCM research results and clinical data.
[0030] In an embodiment of the present invention, the edge weight between two nodes with a connection relationship can be initialized, and the bias value of the feature node can be initialized. The edge weight can be determined according to the degree of association between the corresponding two nodes. When the knowledge graph is a traditional Chinese medicine knowledge graph, the edge weight can be initialized based on clinical data. For example, the initial weight value of the edge weight between general symptoms and diseases can be set to 1. Some symptoms are more important in specific diseases, so their weight value can be set to 5. The edge weight between two feature nodes with a mutually exclusive relationship, such as the "dry mouth" and "not dry mouth" nodes, can be represented by -1, and the edge weight between two feature nodes with a coexistence relationship, such as the "irritability" and "impatient and irritable" nodes, can be represented by +1.
[0031] In an embodiment of the present invention, the bias value of a feature node can be determined based on the order in which the features appear in the dialogue scene. For example, in a TCM diagnosis scenario, the bias value of each symptom can be set according to the priority order of TCM consultation (such as the order in the TCM consultation song). The bias value corresponding to any feature node is bias = log 10(V), where V is the value corresponding to the feature node, and its value range is [1, 10]. Taking the logarithm of the value is to reduce the impact of the bias value and ensure the importance of other factors in the priority calculation.
[0032] In an embodiment of the present invention, the initial values of the priorities of all nodes in the knowledge graph are set to 0.
[0033] Furthermore, if Figure 1 As shown, the information acquisition method based on knowledge graph provided by the embodiment of the present invention may include the following Figure 1 Steps shown:
[0034] S100: Obtain input information currently input by the user.
[0035] In an embodiment of the present invention, the input information includes a feature description or includes both a feature description and an attribute description, i.e., includes only the feature description or includes both the feature description and the attribute description. The attribute description includes the attribute selected by the user. For example, if the attribute description is "coldness," it indicates that the attribute selected by the user is "coldness."
[0036] The feature description includes the first feature description or the first feature description and the second feature description, that is, the feature description may include only the first feature description or the first feature description and the second feature description at the same time, wherein the first feature description is a feature selected by the user and the second feature description is a feature not selected by the user. For example, if the input feature description is "headache, no panic", the first feature description is "headache" and the second feature description is "panic".
[0037] In an embodiment of the present invention, the user may be the second user in a conversation scenario. When the conversation scenario is a traditional Chinese medicine diagnosis scenario, the attribute description may be obtained based on the tongue image information of the first user.
[0038] In the embodiment of the present invention, the current input information may be the reply information of the first user to the current inquiry content of the second user.
[0039] S200, based on the input information currently input by the user, sets the identifier of the feature node corresponding to the first feature description in the current knowledge graph to the first identifier, as the first feature node, sets the identifier of the feature node corresponding to the second feature description in the current knowledge graph to the second identifier, as the second feature node, and sets the identifier of the attribute node corresponding to the attribute description in the current knowledge graph to the first identifier.
[0040] In the embodiment of the present invention, the first identifier and the second identifier may be different identifiers, and the specific identifiers may be limited based on actual needs, and the present invention does not make any special limitations.
[0041] S300: For any state node i in the current knowledge graph, based on the edge weight between the state node i and the corresponding feature node and the edge weight between the state node i and the corresponding attribute node, obtain the priority PS corresponding to the state node i. i .
[0042] Furthermore, in an embodiment of the present invention, PS i The following conditions are met:
[0043] PS i =(∑ f1(i) j1=1 w ds ij1 -∑ f2(i) j2=1 w ds ij2 ) / ∑ h(i) j=1 w ds ij ×λ1+(∑ z(i) r=1 w dn ir ) / (∑ g(i) s=1 w dn is )×λ2.
[0044] Among them, the value of i ranges from 1 to m, m is the number of state nodes in the knowledge graph, and w ds ij1 is the edge weight between state node i and the j1th first feature node connected to state node i, j1 ranges from 1 to f1(i), f1(i) is the number of first feature nodes connected to state node i, w ds ij2 is the edge weight between state node i and the j2th second feature node connected to state node i, j2 ranges from 1 to f2(i), f2(i) is the number of second feature nodes connected to state node i, w ds ij is the edge weight between state node i and the jth feature node among the feature nodes connected to state node i, j ranges from 1 to h(i), h(i) is the number of feature nodes connected to state node i, w dn ir is the edge weight between state node i and the rth attribute node among the attribute nodes connected to state node i and identified as the first identifier, r ranges from 1 to z(i), z(i) is the number of attribute nodes connected to state node i and identified as the first identifier, w dn isis the edge weight between state node i and the sth attribute node among the attribute nodes connected to state node i, the value of s is 1 to g(i), g(i) is the number of attribute nodes connected to state node i, λ1 is the first preset coefficient, and λ2 is the second preset coefficient.
[0045] Those skilled in the art know that if the input information does not include the second feature description and the attribute description, the number of the second feature nodes is 0, and the number of the attribute nodes with the first identifier is 0.
[0046] Furthermore, w ds ij1 The following conditions are met: If 0≤w ds-init ij1 ≤1,w ds ij1 =1, if w ds-init ij1 >1,w ds ij1 =w ds-init ij1 .
[0047] w ds ij2 The following conditions are met: If 0≤w ds-init ij2 ≤1,w ds ij2 =0, if w ds-init ij2 >1,w ds ij2 =w ds -init ij2 .
[0048] Among them, w ds-init ij1 w ds ij1 The corresponding initial weight, w ds-init ij2 w ds ij2 Since the first user's description may be inaccurate, by increasing the weight of the first feature node with a lower initial weight and reducing the weight of the second feature node with a lower initial weight, a higher error tolerance rate can be achieved.
[0049] In the embodiment of the present invention, λ1>λ2, and λ1+λ2=1, which may be empirical values. In an exemplary embodiment, λ1=0.9, λ2=0.1.
[0050] In this embodiment of the present invention, the priority of each state node can be dynamically calculated based on the features selected and not selected by the user, thereby more accurately reflecting the actual state of the first user. In addition, since the attributes of the state are taken into account, the information obtained can be more comprehensive and accurate.
[0051] S400, for any third feature node u in the current knowledge graph, obtain the priority PF corresponding to the third feature node u based on the first preset path length, the second preset path length, the bias value corresponding to the third feature node u, the edge weight between the third feature node u and the corresponding state node, the edge weight between the third feature node u and the corresponding first feature node, and the edge weight between the third feature node u and the corresponding state node. u , the third feature node is the feature node in the knowledge graph except the first feature node and the second feature node, and the value of u ranges from 1 to n, where n is the number of third feature nodes.
[0052] Furthermore, PF u The following conditions are met:
[0053] PF u =∑ y1(u) q1=1 ((1-log 10 (path1+1)×w ds-init uq1 ×PS 3 uq1 )+∑ y2(u) q2=1 ((1-log 10 (path2+1)
[0054] ×w ss-init uq2 )+bias u ; path1 is the first preset path length, path2 is the second preset path length, w ds -init uq1 is the initial edge weight between the third feature node u and the q1th state node among the state nodes connected to it, the value of q1 ranges from 1 to y1(u), y1(u) is the number of state nodes connected to the third feature node u, PS uq1 is the priority corresponding to the q1th state node, w ss-init uq2 is the initial edge weight between the third feature node u and the q2th first feature node connected to it, q2 ranges from 1 to y2(u), y2(u) is the number of first feature nodes connected to the third feature node u, bias u is the bias value corresponding to the third feature node u.
[0055] In the embodiment of the present invention, the priority of a feature node takes into account the priority of the state node connected thereto, the weight of the first feature node connected thereto, and the bias value, so that the obtained priority can be more accurate.
[0056] In the embodiment of the present invention, path1 and path2 may be empirical values to ensure that the calculation result is as accurate as possible. In an exemplary embodiment, path1=2, path2=1.
[0057] S500, obtain max(PF1, PF2, ..., PF u ,……,PF n ) is used as the target information, and max() means taking the maximum value.
[0058] In a specific application scenario of the method provided by the present invention, when the user input information is "headache", through the calculation of the above steps, the feature node with the highest priority may be obtained, that is, the symptom is "abnormal blood pressure", then it is recommended that the second user give priority to asking about the "abnormal blood pressure" symptom in the next inquiry, and then obtain the current input information based on the first user's reply information to this inquiry content.
[0059] Based on the same inventive concept, an embodiment of the present invention provides an information acquisition device based on a knowledge graph, wherein the knowledge graph is composed of first to fourth type nodes, wherein the first type nodes are state nodes representing states, the second type nodes are feature nodes representing features of states, the third type nodes are attribute nodes representing attributes of states, and the fourth type nodes are region nodes representing regions to which the states belong; the device comprises:
[0060] An information acquisition module is used to obtain the input information currently input by the user, wherein the input information includes a feature description or a feature description and an attribute description, wherein the feature description includes a first feature description and a second feature description, wherein the first feature description is a feature selected by the user, and the second feature description is a feature not selected by the user, and the attribute description includes an attribute selected by the user.
[0061] A setting module is used to set the identifier of the feature node corresponding to the first feature description in the current knowledge graph to the first identifier as the first feature node based on the input information currently input by the user, set the identifier of the feature node corresponding to the second feature description in the current knowledge graph to the second identifier as the second feature node, and set the identifier of the attribute node corresponding to the attribute description in the current knowledge graph to the first identifier.
[0062] The first priority acquisition module is used to obtain the priority PS corresponding to any state node i based on the edge weight between the state node i and the corresponding feature node and the edge weight between the state node i and the corresponding attribute node in the current knowledge graph. i .
[0063] The second priority acquisition module is used to obtain the priority PF corresponding to the third feature node u based on the first preset path length, the second preset path length, the bias value corresponding to the third feature node u, the edge weight between the third feature node u and the corresponding state node, the edge weight between the third feature node u and the corresponding first feature node, and the edge weight between the third feature node u and the corresponding state node. u , the third feature node is the feature node in the knowledge graph except the first feature node and the second feature node, and the value of u ranges from 1 to n, where n is the number of third feature nodes.
[0064] Target information acquisition module, used to obtain max(PF1, PF2, ..., PF u ,……,PF n ) is used as the target information, and max() means taking the maximum value.
[0065] Furthermore, PS i The following conditions are met:
[0066] PS i =(∑ f1(i) j1=1 w ds ij1 -∑ f2(i) j2=1 w ds ij2 ) / ∑ h(i) j=1 w ds ij ×λ1+(∑ z(i) r=1 w dn ir ) / (∑ g(i) s=1 w dn is )
[0067] ×λ2, where i ranges from 1 to m, m is the number of state nodes in the knowledge graph, and w ds ij1 is the edge weight between state node i and the j1th first feature node connected to state node i, j1 ranges from 1 to f1(i), f1(i) is the number of first feature nodes connected to state node i, w dsij2 is the edge weight between state node i and the j2th second feature node connected to state node i, j2 ranges from 1 to f2(i), f2(i) is the number of second feature nodes connected to state node i, w ds ij is the edge weight between state node i and the jth feature node among the feature nodes connected to state node i, j ranges from 1 to h(i), h(i) is the number of feature nodes connected to state node i, w dn ir is the edge weight between state node i and the rth attribute node among the attribute nodes connected to state node i and identified as the first identifier, r ranges from 1 to z(i), z(i) is the number of attribute nodes connected to state node i and identified as the first identifier, w dn is is the edge weight between state node i and the sth attribute node among the attribute nodes connected to state node i, the value of s is 1 to g(i), g(i) is the number of attribute nodes connected to state node i, λ1 is the first preset coefficient, and λ2 is the second preset coefficient.
[0068] Furthermore, PF u The following conditions are met:
[0069] PF u =∑ y1(u) q1=1 ((1-log 10 (path1+1)×w ds-init uq1 ×PS 3 uq1 )+∑ y2(u) q2=1 ((1-log 10 (path2+1)
[0070] ×w ss-init uq2 )+bias u ; path1 is the first preset path length, path2 is the second preset path length, w ds -init uq1 is the initial edge weight between the third feature node u and the q1th state node among the state nodes connected to it, the value of q1 ranges from 1 to y1(u), y1(u) is the number of state nodes connected to the third feature node u, PS uq1 is the priority corresponding to the q1th state node, w ss-init uq2is the initial edge weight between the third feature node u and the q2th first feature node connected to it, q2 ranges from 1 to y2(u), y2(u) is the number of first feature nodes connected to the third feature node u, bias u is the bias value corresponding to the third feature node u.
[0071] The device can be used to perform Figure 1 The method shown in the embodiment shown, therefore, for the functions that can be realized by each functional module of the device, please refer to Figure 1 The description of the illustrated embodiment is omitted for brevity.
[0072] An embodiment of the present invention also provides an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are configured to execute the method described in the embodiment of the present invention.
[0073] An embodiment of the present invention further provides a non-transitory computer-readable storage medium storing computer-executable instructions, wherein the computer instructions are used to execute the method described in the embodiment of the present invention.
[0074] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions disclosed in the present invention can be achieved. This is not limited herein.
[0075] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for acquiring information based on knowledge graph, characterized in that: The method comprises the following steps: S100, obtaining input information currently input by a user, the input information including a feature description or a feature description and an attribute description, the feature description including a first feature description or a first feature description and a second feature description, the first feature description being a feature selected by the user, the second feature description being a feature not selected by the user, and the attribute description including an attribute selected by the user; S200, based on the input information currently input by the user, setting the identifier of the feature node corresponding to the first feature description in the current knowledge graph to the first identifier as the first feature node, setting the identifier of the feature node corresponding to the second feature description in the current knowledge graph to the second identifier as the second feature node, and setting the identifier of the attribute node corresponding to the attribute description in the current knowledge graph to the first identifier; S300: For any state node i in the current knowledge graph, based on the edge weight between the state node i and the corresponding feature node and the edge weight between the state node i and the corresponding attribute node, obtain the priority PS corresponding to the state node i. i ; The value of i ranges from 1 to m, where m is the number of state nodes in the knowledge graph; S400, for any third feature node u in the current knowledge graph, obtain the priority PF corresponding to the third feature node u based on the first preset path length, the second preset path length, the bias value corresponding to the third feature node u, the edge weight between the third feature node u and the corresponding state node, the edge weight between the third feature node u and the corresponding first feature node, and the edge weight between the third feature node u and the corresponding state node. u , the third feature node is a feature node in the knowledge graph other than the first feature node and the second feature node, and the value of u ranges from 1 to n, where n is the number of third feature nodes; S500, obtain max(PF1, PF2, ..., PF u ,……,PF n ) is used as the target information, and max() means taking the maximum value.
2. The method according to claim 1, characterized in that PS i The following conditions are met: PS i =(∑ f1(i) j1=1 w ds ij1 -∑ f2(i) j2=1 w ds ij2 ) / ∑ h(i) j=1 w ds ij ×λ1+(∑ z(i) r=1 w dn ir ) / (∑ g(i) s= 1w dn is ) ×λ2, where w ds ij1 is the edge weight between state node i and the j1th first feature node connected to state node i, j1 ranges from 1 to f1(i), f1(i) is the number of first feature nodes connected to state node i, w ds ij2 is the edge weight between state node i and the j2th second feature node connected to state node i, j2 ranges from 1 to f2(i), f2(i) is the number of second feature nodes connected to state node i, w ds ij is the edge weight between state node i and the jth feature node among the feature nodes connected to state node i, j ranges from 1 to h(i), h(i) is the number of feature nodes connected to state node i, w dn ir is the edge weight between state node i and the rth attribute node among the attribute nodes connected to state node i and identified as the first identifier, r ranges from 1 to z(i), z(i) is the number of attribute nodes connected to state node i and identified as the first identifier, w dn is is the edge weight between state node i and the sth attribute node among the attribute nodes connected to state node i, the value of s is 1 to g(i), g(i) is the number of attribute nodes connected to state node i, λ1 is the first preset coefficient, and λ2 is the second preset coefficient.
3. The method according to claim 2, characterized in that w ds ij1 The following conditions are met: If 0≤w ds-init ij1 ≤1,w ds ij1 =1, if w ds-init ij1 >1,w ds ij1 =w ds-init ij1 ; w ds ij2 The following conditions are met: If 0≤w ds-init ij2 ≤1,w ds ij2 =0, if w ds-init ij2 >1,w ds ij2 =w ds -init ij2 ; Among them, w ds-init ij1 w ds ij1 The corresponding initial weight, w ds-init ij2 w ds ij2 The corresponding initial weights.
4. The method according to claim 1, wherein PF u The following conditions are met: PF u =∑ y1(u) q1=1 ((1-log 10 (path1+1)×w ds-init uq1 ×PS 3 uq1 )+∑ y2(u) q2=1 ((1-log 10 (path2+1) ×w ss-init uq2 )+bias u ; path1 is the first preset path length, path2 is the second preset path length, w ds-init uq1 is the initial edge weight between the third feature node u and the q1th state node among the state nodes connected to it, the value of q1 ranges from 1 to y1(u), y1(u) is the number of state nodes connected to the third feature node u, PS uq1 is the priority corresponding to the q1th state node, w ss-init uq2 is the initial edge weight between the third feature node u and the q2th first feature node connected to it, q2 ranges from 1 to y2(u), y2(u) is the number of first feature nodes connected to the third feature node u, bias u is the bias value corresponding to the third feature node u.
5. The method according to claim 4, characterized in that path1=2, path2=1.
6. An information acquisition device based on knowledge graph, characterized in that: The knowledge graph is composed of first to fourth type nodes, wherein the first type nodes are state nodes representing a state, the second type nodes are feature nodes representing a feature of a state, the third type nodes are attribute nodes representing an attribute of a state, and the fourth type nodes are region nodes representing a region to which the state belongs; the device includes: An information acquisition module is used to acquire input information currently input by the user, wherein the input information includes a feature description or a feature description and an attribute description, wherein the feature description includes a first feature description and a second feature description, wherein the first feature description is a feature selected by the user and the second feature description is a feature not selected by the user, and the attribute description includes an attribute selected by the user; A setting module, configured to set, based on input information currently input by the user, an identifier of a feature node in the current knowledge graph corresponding to the first feature description to a first identifier as the first feature node, set an identifier of a feature node in the current knowledge graph corresponding to the second feature description to a second identifier as the second feature node, and set an identifier of an attribute node in the current knowledge graph corresponding to the attribute description to the first identifier; The first priority acquisition module is used to obtain the priority PS corresponding to any state node i based on the edge weight between the state node i and the corresponding feature node and the edge weight between the state node i and the corresponding attribute node in the current knowledge graph. i ; The value of i ranges from 1 to m, where m is the number of state nodes in the knowledge graph; The second priority acquisition module is used to obtain the priority PF corresponding to the third feature node u based on the first preset path length, the second preset path length, the bias value corresponding to the third feature node u, the edge weight between the third feature node u and the corresponding state node, the edge weight between the third feature node u and the corresponding first feature node, and the edge weight between the third feature node u and the corresponding state node. u , the third feature node is a feature node in the knowledge graph other than the first feature node and the second feature node, and the value of u ranges from 1 to n, where n is the number of third feature nodes; Target information acquisition module, used to obtain max(PF1, PF2, ..., PF u ,……,PF n ) is used as the target information, and max() means taking the maximum value.
7. The device according to claim 6, characterized in that PS i The following conditions are met: PS i =(∑ f1(i) j1=1 w ds ij1 -∑ f2(i) j2=1 w ds ij2 ) / ∑ h(i) j=1 w ds ij ×λ1+(∑ z(i) r=1 w dn ir ) / (∑ g(i) s= 1w dn is ) ×λ2, where i ranges from 1 to m, m is the number of state nodes in the knowledge graph, and w ds ij1 is the edge weight between state node i and the j1th first feature node connected to state node i, j1 ranges from 1 to f1(i), f1(i) is the number of first feature nodes connected to state node i, w ds ij2 is the edge weight between state node i and the j2th second feature node connected to state node i, j2 ranges from 1 to f2(i), f2(i) is the number of second feature nodes connected to state node i, w ds ij is the edge weight between state node i and the jth feature node among the feature nodes connected to state node i, j ranges from 1 to h(i), h(i) is the number of feature nodes connected to state node i, w dn ir is the edge weight between state node i and the rth attribute node among the attribute nodes connected to state node i and identified as the first identifier, r ranges from 1 to z(i), z(i) is the number of attribute nodes connected to state node i and identified as the first identifier, w dn is is the edge weight between state node i and the sth attribute node among the attribute nodes connected to state node i, the value of s is 1 to g(i), g(i) is the number of attribute nodes connected to state node i, λ1 is the first preset coefficient, and λ2 is the second preset coefficient.
8. The device according to claim 6, characterized in that PF u The following conditions are met: PF u =∑ y1(u) q1=1 ((1-log 10 (path1+1)×w ds-init uq1 ×PS 3 uq1 )+∑ y2(u) q2=1 ((1-log 10 (path2+1) ×w ss-init uq2 )+bias u ; path1 is the first preset path length, path2 is the second preset path length, w ds-init uq1 is the initial edge weight between the third feature node u and the q1th state node among the state nodes connected to it, the value of q1 ranges from 1 to y1(u), y1(u) is the number of state nodes connected to the third feature node u, PS uq1 is the priority corresponding to the q1th state node, w ss-init uq2 is the initial edge weight between the third feature node u and the q2th first feature node connected to it, q2 ranges from 1 to y2(u), y2(u) is the number of first feature nodes connected to the third feature node u, bias u is the bias value corresponding to the third feature node u.
9. An electronic device, characterized in that: including processor and memory; The processor is configured to execute the steps of the method according to any one of claims 1 to 8 by calling the program or instructions stored in the memory.
10. A non-transitory computer-readable storage medium, characterized in that The non-transitory computer-readable storage medium is used to store a program or instruction, and the program or instruction enables a computer to execute the steps of the method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Method and device for training graph neural network model for characterizing knowledge graph
CN110866190A
Abnormal event detection method and device based on knowledge graph, equipment and medium
CN113360580A
Knowledge graph construction method and device and knowledge graph construction system
CN116542327A
Node recommendation method and system based on knowledge graph, storage medium and processor
CN118585654A
Interrogation priority calculation method based on traditional Chinese medicine disease relationship knowledge graph
CN119581064A