Graph question-answering method and device, electronic equipment and storage medium
By building the target map in the graph question and answer and analyzing and value linking, querying is directly performed in the graph database, the problems of poor physical linking effect and poor long-distance dependency query construction in the existing technology are solved, and more efficient and accurate graph data processing.
Patent Information
- Application Number
- CN202411152690.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-21
- Publication Date
- 2025-01-07
AI Technical Summary
In the prior art, the graph question and answer scheme has poor effect in building entity links and long-distance dependency query, resulting in high difficulty in starting the system, high cost and poor migration.
By determining the target problem, building the target map, parsing, value linking and query statement construction, directly performing queries in the graph database, avoiding the influence of traditional entity links, and using global and local value links to improve the flexibility and accuracy of query.
It improves the accuracy and efficiency of graph questions and answers, simplifies graph data processing, reduces the complexity and cost of the system, and enhances the ability to build long-distance dependent queries.
Smart Images

Figure CN119271768A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of natural language processing technology, and in particular to a graph question answering method and device, an electronic device and a storage medium. Background Art
[0002] Question answering based on structured knowledge has always been a hot topic in the field of natural language processing. Traditional solutions usually involve converting questions described in natural language into query statements (such as SQL or Cypher), then querying in the database to obtain structured results, and then converting these results into natural language answers.
[0003] Traditional graph question-answering solutions mainly rely on technologies such as entity recognition, syntactic analysis, and entity linking. These solutions are highly customizable, and each change of scenario requires a large amount of data and model training, which leads to problems such as difficulty in system startup, high cost, and poor portability. With the development of big model technology, many modules can now be replaced by big models, and the previous effects can be achieved with a small amount of labeled data or even zero labeled data. Graph question-answering in the big model era is usually implemented based on steps such as semantic retrieval and big model parsing. The specific implementation includes entity linking of questions, linking entity relationships, and finally determining the query target, constructing query statements, and completing retrieval and question-answering. However, when using questions to directly link entities, other content in the question will affect the effect of entity linking, and the query construction effect is poor for long-distance dependent queries. Summary of the invention
[0004] The embodiments of the present application provide a graph question answering method to solve the problems of poor entity linking effect and poor query construction effect for long-distance dependencies in the prior art.
[0005] Correspondingly, the embodiment of the present application also provides a graph question and answer device, an electronic device and a storage medium to ensure the implementation and application of the above method.
[0006] In order to solve the above problems, the present application embodiment discloses a graph question answering method, which includes:
[0007] Identify the target problem;
[0008] Parsing the target question according to the target graph to obtain a parsing result corresponding to the target question; the parsing result corresponding to the target question includes a query condition and a query target;
[0009] Performing value linking on the value of the analysis result corresponding to the target question to obtain the analysis result value corresponding to the target question; the value linking includes a global value linking and a local value linking;
[0010] Obtaining a query statement corresponding to the target question according to the target graph and the parsing result value corresponding to the target question;
[0011] Determine a query result corresponding to the target question according to the query statement corresponding to the target question.
[0012] Optionally, before determining the target problem, the method further includes:
[0013] Construct the target graph; the target graph includes node relationships and node attributes.
[0014] Optionally, parsing the target problem according to the target graph to obtain a parsing result corresponding to the target problem includes:
[0015] Constructing a node information index and an entity information index according to the target graph;
[0016] Determine the target node in the target problem according to the node information index;
[0017] The target node in the target question is parsed according to the entity information index to obtain a parsing result corresponding to the target question.
[0018] Optionally, performing value linking on the value of the parsing result corresponding to the target question to obtain the parsing result value corresponding to the target question includes:
[0019] Determine the entity value in the query condition;
[0020] Determine a node in the entity information index corresponding to the entity value in the query condition;
[0021] The value of the parsing result corresponding to the target question is value-linked according to the node corresponding to the entity value in the query condition to obtain the parsing result value corresponding to the target question.
[0022] Optionally, obtaining a query statement corresponding to the target question according to the target graph and the parsing result value corresponding to the target question includes:
[0023] Determining, in the node relationship, a target relationship between target nodes in the target problem;
[0024] Determining, from the node attributes, a target attribute corresponding to a target node in the target problem;
[0025] The parsing result value corresponding to the target question, the target relationship and the target attribute are converted into a query statement corresponding to the target question.
[0026] Optionally, performing value linking on the value of the parsing result corresponding to the target question according to the node corresponding to the entity value in the query condition to obtain the parsing result value corresponding to the target question includes:
[0027] When the node corresponding to the entity value in the query condition is a root node, the global value link is performed on the entity value in the query condition to obtain a global resolution value; the global value link is used to search for an entity matching the entity value in the query condition in the target graph corresponding to the root node;
[0028] When the node corresponding to the entity value in the query condition is a child node, the root node corresponding to the child node is determined as the target root node, and the local value link is performed on the entity value in the query condition to obtain a local resolution value; the local value link is used to search for an entity matching the entity value in the query condition in the target graph corresponding to the target root node;
[0029] The global resolution value and the local resolution value are used as the resolution result value, and the child node is an extension of the root node.
[0030] Optionally, the node relationship includes a plurality of nodes and a relationship between the plurality of nodes, the node attribute includes the plurality of nodes and attribute values respectively corresponding to the plurality of nodes, and the step of constructing a node information index and an entity information index according to the target graph includes:
[0031] Taking the multiple nodes, the relationships between the multiple nodes and the attribute values respectively corresponding to the multiple nodes as node information, constructing the node information index;
[0032] The attribute values respectively corresponding to the multiple nodes are used as entity information to construct the entity information index.
[0033] The present application also discloses a graph question-answering device, which includes:
[0034] Determination module, used to determine the target problem;
[0035] A parsing module, used to parse the target question according to the target graph to obtain a parsing result corresponding to the target question; the parsing result corresponding to the target question includes a query condition and a query target;
[0036] A value linking module, used to perform value linking on the value of the parsing result corresponding to the target question to obtain the parsing result value corresponding to the target question; the value linking includes a global value linking and a local value linking;
[0037] A query statement module, used to obtain a query statement corresponding to the target question according to the target graph and the parsing result value corresponding to the target question;
[0038] The query result module is used to determine the query result corresponding to the target question according to the query statement corresponding to the target question.
[0039] An embodiment of the present application also discloses an electronic device, including: a processor; and a memory, on which executable code is stored. When the executable code is executed, the processor executes the graph question and answer method as described in any one of the embodiments of the present application.
[0040] An embodiment of the present application also discloses a machine-readable medium having executable code stored thereon. When the executable code is executed, the processor executes the graph question-and-answer method as described in any one of the embodiments of the present application.
[0041] Compared with the prior art, the embodiments of the present application have the following advantages:
[0042] In an embodiment of the present application, a target problem is determined; the target problem is parsed according to a target graph to obtain a parsing result corresponding to the target problem; the parsing result corresponding to the target problem includes a query condition and a query target; the value of the parsing result corresponding to the target problem is value-linked to obtain a parsing result value corresponding to the target problem; the value link includes a global value link and a local value link; the query statement corresponding to the target problem is obtained according to the target graph and the parsing result value corresponding to the target problem; the query result corresponding to the target problem is determined according to the query statement corresponding to the target problem. In an embodiment of the present application, the target problem is parsed by a target graph to obtain a parsing result, and then the parsing result is value-linked to construct a query statement. There is no need to use traditional entity links, thereby avoiding other content in the target problem from affecting the effect of entity links, and it is simpler, more convenient and more accurate for this type of graph data. Moreover, the graph question-answering method provided in the embodiment of the present application can also solve the problem of poor query construction effect of long-distance dependencies for feature fields. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] Figure 1 This is a flowchart of the steps of an embodiment of a graph question-answering method of the present application;
[0044] Figure 2 It is a structural block diagram of an embodiment of a graph question-answering device of the present application;
[0045] Figure 3 It is a schematic diagram of the structure of a device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0046] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0047] In the embodiments of the present application, in order to better understand the technical solution of the present application, the relevant information of the enterprise's pollutant discharge permit is used as an example to describe the relevant content. The present application is not limited to the field of processing the enterprise's pollutant discharge permit, but can also be extended to other fields, such as the enterprise's employees, departments, positions, etc., which are not limited by the embodiments of the present application.
[0048] Although text2SQL (text to SQL) has been widely studied in this field, some data types are more suitable for storage in graph databases, such as Neo4J database, which uses CYPHER query language (a language for querying and managing graph databases). Therefore, in the graph question-answering process in the embodiment of the present application, the Neo4J database is used, so the graph question-answering process is a process of converting natural language into CYPHER, querying, and generating answers.
[0049] Reference Figure 1 , is a flowchart of a step embodiment of a graph question answering method of the present application, comprising the following steps:
[0050] Step 101: determine the target problem;
[0051] In the embodiment of the present application, a natural language question input by a user is first received, for example, what are the exhaust gas emission outlets involving particulate matter of Company A.
[0052] Step 102: parse the target question according to the target graph to obtain a parsing result corresponding to the target question; the parsing result corresponding to the target question includes a query condition and a query target;
[0053] In the embodiment of the present application, the target graph refers to a pre-constructed knowledge graph that contains structured information of nodes, attributes, and relationships. In this step, the system uses the target graph to parse the user's question, identify the nodes, relationships, and query targets in the question, and obtain the parsing result.
[0054] Specifically, the parsing results will be returned in JSON (JavaScript Object Notation, a lightweight data exchange format). JSON has two parts, namely "query conditions" and "query target".
[0055] "Query Condition" field: The condition value representing the condition query in the target question. The value of the field is an array. The elements in the array are condition dictionaries. Each condition dictionary is a screening condition. There are three fields in the condition dictionary. Field 1 is "tag", and the value must be the data table field name. Field 2 is "values", and the value is an array. The content in the array is the condition value mentioned in the question. Field 3 is "operator", and the values are "equal to", "not equal to", "greater than" and "less than", "greater than or equal to", and "less than or equal to". No other values are allowed.
[0056] "Query Target" field: the purpose of the target question. The value of the field is an array and the value must be node-related information.
[0057] For example, for the question "What are the exhaust gas emission outlets involving particulate matter of Company A?", the analysis results are as follows:
[0058] {
[0059] "Query Condition":
[0060] {
[0061] "tag": "enterprise",
[0062] "operator": "equal to",
[0063] "values": ["Company A"]
[0064] },
[0065] {
[0066] "tag": "Organized emission of air pollutants",
[0067] "operator": "equal to",
[0068] "values": ["particle matter"]
[0069] },
[0070] Query Target:
[0071] ["Exhaust gas outlet",]
[0072] }
[0073] Among them, "query condition" is the condition mentioned in the target question, "tag" is the possible entity type of the condition value in the graph, "operator" is the operator, "values" is the condition value mentioned in the target question, and "query target" is the purpose of the target question.
[0074] The embodiment of the present application utilizes a pre-built knowledge graph to perform problem analysis, which can accurately identify the nodes, relationships and query targets in the problem and generate structured analysis results. This structured analysis result provides a clear data foundation for subsequent value links and query statement construction, thereby improving the processing efficiency and accuracy of the system.
[0075] Step 103: value linking is performed on the value of the analysis result corresponding to the target question to obtain the analysis result value corresponding to the target question; the value linking includes a global value linking and a local value linking;
[0076] Value linking refers to the process of matching the entity and attribute values in the parsing results with the specific nodes and attributes in the target graph. This step includes global value linking and local value linking. Global value linking refers to finding matching entities or attributes within the entire graph, while local value linking matches within a specific context or subgraph. Through value linking, the system can determine that the abstract concepts in the parsing results correspond to the specific data in the graph.
[0077] In the embodiment of the present application, since an enterprise is used as the root node when constructing the target graph and other entities are extensions of the root node, when performing value linking, global value linking will be used for enterprise entities, while local value linking will be used for other non-enterprise entities.
[0078] The embodiments of the present application can match the abstract concepts in the parsing results with the specific data in the graph through value links, thereby ensuring the accuracy of the query conditions and query targets. The combined use of global value links and local value links improves the flexibility and accuracy of the links, especially when processing graphs with enterprises as root nodes, which can better adapt to specific contexts.
[0079] Step 104: Obtain a query statement corresponding to the target question according to the target graph and the parsing result value corresponding to the target question;
[0080] In an embodiment of the present application, a query statement is constructed based on the analysis result value and the target graph, and the analysis result value is converted into a statement of the graph database query language. The query language in the embodiment of the present application is CYPHER. After obtaining the query statement, the query statement will be specifically used to perform query operations in the graph database.
[0081] The embodiment of the present application converts the parsing result value into a query statement in CYPHER format, so that the system can directly perform query operations in the graph database. This direct query method improves the efficiency and accuracy of the query, and also simplifies the query process.
[0082] Step 105: Determine a query result corresponding to the target question according to the query statement corresponding to the target question.
[0083] In the embodiment of the present application, the data related to the query statement will be retrieved from the graph database based on the query statement. Since the data related to the query statement is usually structured, it is necessary to convert these data into natural language form to obtain the query result corresponding to the target question and return it to the user. For example, for the question "What are the exhaust gas emission outlets involving particulate matter of Company A?", the final result may be a list containing the following information: Exhaust Gas Emission Outlet 1 and Exhaust Gas Emission Outlet 2. This result will be converted into a natural language answer, such as: "The exhaust gas emission outlets involving particulate matter of Company A are Exhaust Gas Emission Outlet 1 and Exhaust Gas Emission Outlet 2."
[0084] Specifically, when querying according to the query statement, the Neo4J database can be directly queried. In the question-and-answer session, the query result is a data table. The large model has the function of directly performing table questions and answers. The table can be directly questioned and answered by converting it into text. Generally, tables in html (HyperText Markup Language) or markdown (markup language) format are selected. Since the application environment of the embodiment of the present application corresponds to many values, and markdown does not support merging cells, the embodiment of the present application finally uses html to answer the target question.
[0085] For example: "Now you are given a question and a query result. It is known that the result is the result of querying the question in the database, but the result is stored in the form of an HTML table. Please reorganize the language of the database return result according to human habits to answer the question, and describe the query result information in detail. If the structured information is completely irrelevant to the question, please answer "No relevant information was found."
[0086] Database query results:
[0087] \n'
[0088]
[0089]
[0090]
[0091]
[0092]
[0093]
[0094]
[0095]
[0096]
[0097]
[0098]
[0099]
[0100]
[0101]
[0102]
[0103]
[0104] <table border="1"class="dataframe">\n \n <tr style="text-align:right;">\n \n Company Name \n Emissions \n standard \n \n \n \n \n 0 \n Company A \n SO2 \n GB 01234 \n \n \n '
[0105] Question: What are the emission standards of Company A?
[0106] Please answer the question. "
[0107] By inputting the above content into the big model, we can get the query result of "The emission standard of Company A is GB 01234." The type of big model is not limited in the embodiment of the present application. Open source models such as Wenxinyiyan, ChatGLM (a chat model based on the GLM architecture), and ChatGPT (a chat model based on the GPT architecture of OpenAI) can be used. The stronger the model, the better the problem parsing ability.
[0108] In an embodiment of the present application, the user's natural language target question is converted into a query statement in a data format supported by the graph database through operations such as parsing and value linking, and information related to the query statement is extracted from the target graph. After the data format is converted, a query result corresponding to the target question is generated, thereby improving the accuracy and efficiency of the question-answering system and enabling users to interact with a structured knowledge base through natural language.
[0109] In an embodiment of the present application, a target problem is determined; the target problem is parsed according to a target graph to obtain a parsing result corresponding to the target problem; the parsing result corresponding to the target problem includes a query condition and a query target; the value of the parsing result corresponding to the target problem is value-linked to obtain a parsing result value corresponding to the target problem; the value link includes a global value link and a local value link; the query statement corresponding to the target problem is obtained according to the target graph and the parsing result value corresponding to the target problem; the query result corresponding to the target problem is determined according to the query statement corresponding to the target problem. In an embodiment of the present application, the target problem is parsed by a target graph to obtain a parsing result, and then the parsing result is value-linked to construct a query statement. There is no need to use traditional entity links, thereby avoiding other content in the target problem from affecting the effect of entity links, and it is simpler, more convenient and more accurate for this type of graph data. Moreover, the graph question-answering method provided in the embodiment of the present application can also solve the problem of poor query construction effect of long-distance dependencies for feature fields.
[0110] In one embodiment of the present application, before determining the target problem, the method further includes:
[0111] Construct the target graph; the target graph includes node relationships and node attributes.
[0112] In the embodiment of the present application, data preparation is required before performing graph question and answer. In the data preparation stage, a target graph needs to be prepared, including node relationships and node attributes. The target graph in the embodiment of the present application is the relevant information of the enterprise's pollutant discharge permit, as shown in Table 1 and Table 2 below:
[0113] Table 1 Node relationship
[0114]
[0115]
[0116] In the node relationship shown in Table 1, the nodes (start nodes and end nodes) are part of the nodes in the actual application graph, and the nodes shown in Table 1 are only examples.
[0117] Table 2 Node attributes
[0118]
[0119]
[0120]
[0121] In the node attributes described in Table 2, the label represents the type or category of the node in the target graph, and each label corresponds to a specific type of node in the target graph. For example, "enterprise", "pollution permit", "production industry", etc. are all different node types. A node refers to an entity in the graph. Each node can have multiple attributes. Attributes are specific information that describes the node. For example, "enterprise name", "production and operation site address", "registration address", etc. are all attributes of the "enterprise" node.
[0122] The type of a node is defined by a label, and a node is a specific instance of that type with corresponding attributes. For example, there can be multiple specific "enterprise" nodes under the "enterprise" label, and each node has attributes such as "enterprise name" and "production and operation site address".
[0123] In one embodiment of the present application, parsing the target problem according to the target graph to obtain a parsing result corresponding to the target problem includes:
[0124] Constructing a node information index and an entity information index according to the target graph;
[0125] Determine the target node in the target problem according to the node information index;
[0126] The target node in the target question is parsed according to the entity information index to obtain a parsing result corresponding to the target question.
[0127] In the data preparation stage of the embodiment of the present application, in addition to preparing the target graph, it is also necessary to prepare the index. Specifically, all node information and entity information need to be stored in the index. These indexes are used to quickly retrieve and match the information in the graph.
[0128] Node information includes node name, attributes and relationships. For example, the "enterprise" node may contain attributes such as "enterprise name" and "address of production and operation site". Entity information refers to specific data instances in the target graph, such as "enterprise: Shougang Group Co., Ltd." and "organized emission of air pollutants: SO2".
[0129] When building a node information index, all node information is collected from the target graph, including node names, attributes, and relationships, and the node information is standardized to ensure that the node information is unique in the index. For example, for attribute names, the "node name + attribute name" method is used for indexing to avoid multiple entities with duplicate names, which affects the effect of entity linking; the relationship information in the graph is stored in the relationship index, such as "enterprise corresponding pollution discharge permit"; the node's attribute information is stored in the attribute index, including the node name and attribute name.
[0130] The node information index in the embodiment of the present application includes a relationship index and an attribute index, both of which are constructed by using node information to index, so as to ensure fast retrieval of attribute information. In addition, the index used by the node information is the semantic retrieval model faiss. The semantic retrieval model used in the embodiment of the present application is an open source model, so there is no need to make special customization and adjustments for the field, which can avoid the difficulty of system startup, high cost and poor mobility.
[0131] When building an entity information index, all entity information is collected from the target graph, including entity names, attributes, and relationships, and the entity information is standardized to ensure that the entity information is unique in the index. For example, for enterprise-type entities, the Company and Value fields are consistent. For other types of entities, Value is the entity value and Company is the corresponding enterprise.
[0132] When constructing the entity information index, you can build an elasticsearch index or a faiss index. Specifically, use the elasticsearch index to store entity information, including fields such as Company and Value, and configure the index fields, such as setting the Company and Value fields to be indexable, to ensure full-text search and fast retrieval; or, use the faiss index to store entity information, especially for entity information that requires semantic retrieval, configure the faiss index to ensure efficient semantic retrieval.
[0133] In another embodiment of the present application, a prompt word index can also be constructed. Specifically, a suitable index type is selected according to needs, such as a faiss index, which is used to store and retrieve prompt word samples. Necessary fields are configured in the index, and formatted prompt word samples are imported into the index in batches to ensure that the index can quickly retrieve and match sample information.
[0134] In the embodiment of the present application, the query conditions and query target extraction prompt words of the large model are both constructed using a dynamic fewshot method, which can not only improve the accuracy of question parsing, but also improve the scalability of the large model's parsing capabilities. In particular, when the target question contains specific reference content, a few shot template can be directly added to prompt the large model, thereby improving the accuracy of question parsing.
[0135] In practical applications, there are many nodes, attributes and relationships in the target graph. If all the nodes are passed to the large model for parsing, there will be many nodes and the text will be very long, which will increase the difficulty of the large model in parsing the problem. Therefore, in the embodiment of the present application, in order to complete the parsing function of the target problem, it is first necessary to search in the node information index. When the node information similar to the problem is retrieved, it is handed over to the large model for parsing.
[0136] The embodiment of the present application uses basic prompt words to implement the analysis of the target problem. The specific basic prompt words can be as follows:
[0137] "I hope you can help me complete a problem decomposition function, which is to extract the query conditions and query targets in the problem. Problem decomposition is based on node attributes and node relationships. I will give you node information and problems. Please complete the problem analysis according to the following requirements and examples.
[0138] Extraction requirements:
[0139] 1. The result is returned in the form of JSON. There are two parts in JSON, namely "query condition" and "query target": the "query condition" field indicates the condition value of the condition query in the question. The value of the field is an array. The elements in the array are condition dictionaries. Each condition dictionary is a screening condition. There are three fields in the condition dictionary. Field 1 is "tag", and the value must be the data table field name. Field 2 is "values", and the value is an array. The content in the array is the condition value mentioned in the question. Field 3 is "operator", and the value is "equal to", "not equal to", "greater than" and "less than", "greater than or equal to", "less than or equal to", and other values cannot be taken; the "query target" field indicates the purpose of the question. The value of the field is an array, and the value must be node related information;
[0140] 2. The conditions in the question often involve pronouns, such as "this", "these", "the company" and other descriptions. If there are pronouns, just extract the pronouns as the condition value;
[0141] 3. Because the problem analysis involved in this task is generally related to air pollutant emissions and wastewater emissions, the questions are similar to "emission of ***" and "*** emissions", where "***" is the description of chemicals and "***" is generally a label related to "air pollutants" and "water pollutants". You need to use your own professional knowledge to distinguish them;
[0142] 4. The query conditions are generated only based on the question and the data table field name. Condition values that are not in the question cannot be added;
[0143] 5. No comments or explanation information should be generated in the JSON string;
[0144] 6. For logical judgment questions that ask "yes or no", the node that needs to be judged should be directly used as the query target;
[0145] 7. If the data table field name does not match the question, please answer "Cannot generate".
[0146] Next, I will give you new data table field names and questions. Please parse the questions based on the previous examples and extract the "query conditions" and "query targets". "
[0147] In addition to the basic prompt words, the final prompt words also include some pre-prepared samples. In order to provide the most similar samples to the current problem when the large model is parsing the problem, the sample library is searched according to the current problem, and the closest sample is used as the input of the few shot prompt. Using this method to construct prompt words can significantly improve the accuracy of problem parsing, especially when the question is unclear, such as the sample question "What are the exhaust gas emission outlets involving particulate matter in Company A?" Particulate matter is obviously a pollutant, but the large model does not know whether it is an organized or unorganized emission of pollutants. At this time, we provide a sample, and the large model can parse it correctly. The final sample prompt words are: [
[0149] {
[0150] "role": "user",
[0151] "content": "Attribute nodes: organized emissions of air pollutants, unorganized emissions of air pollutants, enterprises, waste gas emission outlets, waste gas emission standards\nRelationship nodes: Enterprises corresponding to waste gas emission outlets\nQuestion: What are the waste gas emission outlets of Company A involving particulate matter?"
[0152] },
[0153] {
[0154] "role": "assistant",
[0155] “content”: “{“query condition”: [{“tag”: “enterprise”, “operator”: “equal to”, “values”: [“Company A”]}, {“tag”: “organized emission of air pollutants”, “operator”: “equal to”, “values”: [“particulate matter”]}], “query target”: [“waste gas emission outlet”]}”
[0156] },
[0157] … ]
[0159] In the embodiment of the present application, few shot used a total of three retrieved question-answer pairs as prompt examples. Among the attribute nodes, the enterprise node is a necessary node, and if it is not retrieved, it must also be added.
[0160] In an embodiment of the present application, by constructing a node information index and an entity information index, the system can achieve fast and accurate information retrieval and problem resolution. The node information index includes a relationship index and an attribute index, which are used to store and retrieve node names, attributes, and relationships, while the entity information index is used to store specific entity data, such as company names and pollutant information. In addition, constructing a prompt word index provides reference examples for problem resolution for large models, further improving the accuracy of resolution. The use of these indexes not only improves the retrieval efficiency and resolution accuracy of the system, but also enhances the flexibility and scalability of the system, allowing the system to better adapt to the needs of different fields and provide more comprehensive and accurate question-and-answer services.
[0161] In another embodiment of the present application, there is no restriction on the types of node information index, entity information index and prompt word index, but there are two requirements for the index: 1) it can provide an absolute score of similarity, which can be used for value filtering, such as cosine similarity; 2) it can provide a retrieval function when locking a certain field, for example, in SQL, there are field A and field B, A is required to be strictly matched and B is required to be fuzzy matched.
[0162] In one embodiment of the present application, performing value linking on the value of the parsing result corresponding to the target question to obtain the parsing result value corresponding to the target question includes:
[0163] Determine the entity value in the query condition;
[0164] Determine a node in the entity information index corresponding to the entity value in the query condition;
[0165] The value of the parsing result corresponding to the target question is value-linked according to the node corresponding to the entity value in the query condition to obtain the parsing result value corresponding to the target question.
[0166] In an embodiment of the present application, for the parsing result corresponding to the target question, it is necessary to link the value in the query condition. There are two types of value links, one is the company name and the other is the non-company name. When linking by company name, no value is assigned to the Company field. When linking by non-company name, the company needs to be specified and the company is required to be strictly matched. Different companies will have nodes with similar names. If the company is not specified, entity link errors may occur. For example, the sulfide of Company A is SO2, and the sulfide of Company B is SO1. If the sulfide of Company A is mentioned in the target question, it should be linked to SO2. If Company A is not specified, linking to SO1 will cause a query error.
[0167] After value linking, if the entity tag in the initially generated query condition is found to be wrong, the tag value needs to be corrected according to the linking result. In actual scenarios, the query information is all expanded for the current company. The company name can be directly parsed from the question or obtained from the conversation history.
[0168] In the embodiments of the present application, through the precise value linking process, the system can accurately match the entity value in the query condition with the node in the entity information index to ensure the accuracy of the query result. In particular, the distinction between enterprise names and non-enterprise names, as well as the label correction after value linking, further improve the system's parsing accuracy and query efficiency. This refined value linking mechanism not only reduces the risk of entity linking errors, but also enhances the system's adaptability and robustness, enabling the system to better serve enterprise-level query needs and provide more reliable and accurate question-and-answer services.
[0169] In one embodiment of the present application, obtaining a query statement corresponding to the target question according to the target graph and the parsing result value corresponding to the target question includes:
[0170] Determining, in the node relationship, a target relationship between target nodes in the target problem;
[0171] Determining, from the node attributes, a target attribute corresponding to a target node in the target problem;
[0172] The parsing result value corresponding to the target question, the target relationship and the target attribute are converted into a query statement corresponding to the target question.
[0173] In actual application scenarios, a very long query chain may be constructed, or multiple query chains may be generated in one question. If only query statements corresponding to the question are created for the head and tail nodes, it will be very limited.
[0174] In the embodiment of the present application, the relationship query can be directly determined after the value is linked, because the entity types of the condition nodes in the query chain are all determined and can be directly determined based on the previous entity relationship, so the query can only query the value.
[0175] For the target question "What are the exhaust gas emission outlets involving particulate matter of Company A?", the target question is analyzed as follows:
[0176] {“query condition”: [{“tag”: “enterprise”, “operator”: “equal to”, “values”: [“Company A”]}, {“tag”: “organized emission of air pollutants”, “operator”: “equal to”, “values”: [“particulate matter”]}], “query target”: [“waste gas emission outlet”]}
[0177] Based on the tag and query target, we can determine that the nodes involved in the query of this target problem are: enterprise, organized emissions of atmospheric pollutants, and waste gas emission outlets. Based on the node relationship in the target graph, we can use the graph algorithm to obtain that in the target graph, these three nodes can construct the following query chain: enterprise->pollution discharge permit->waste gas emission outlet->organized emissions of atmospheric pollutants.
[0178] Convert the target problem in natural language form into a query statement: MATCH (a: enterprise)-[: enterprise corresponding pollutant discharge permit]->(b: pollutant discharge permit)-[: enterprise corresponding waste gas emission outlet]->(c: waste gas emission outlet)-[: waste gas emission]->(d: organized emission of atmospheric pollutants) WHERE (a. enterprise name = "Company A") AND (d. pollutant name = "particulate matter") RETURN a, b, c, d.
[0179] The nodes in the above example can build a query chain. In some problems, the nodes in the problem cannot be built into a query chain, so multiple query chains are built. It is known that the problem is initiated based on a root node (enterprise), so multiple query chains are built from the root. For example, the question: What are the emission standards corresponding to the organized and unorganized emissions of Company A? The following query chain will be built: 1) Enterprise->Emission Permit->Waste Gas Emission Outlet->Organized Emission of Air Pollutants->Waste Gas Emission Standards; 2) Enterprise->Emission Permit->Waste Gas Unorganized Emissions->Unorganized Emission of Air Pollutants->Waste Gas Emission Standards.
[0180] In an embodiment of the present application, by accurately determining the relationships and attributes between target nodes and converting this information into query statements, the system can construct a flexible and comprehensive query chain. Even in the face of complex questions, multiple query chains can be generated to cover all relevant information. This query statement construction method not only improves the accuracy and coverage of the query, but also enhances the adaptability and flexibility of the system, enabling the system to better handle complex query requirements and provide more comprehensive and accurate question-and-answer services.
[0181] In one embodiment of the present application, the node corresponding to the entity value in the query condition performs a value link on the value of the parsing result corresponding to the target question to obtain the parsing result value corresponding to the target question, including:
[0182] When the node corresponding to the entity value in the query condition is a root node, the global value link is performed on the entity value in the query condition to obtain a global resolution value; the global value link is used to search for an entity matching the entity value in the query condition in the target graph corresponding to the root node;
[0183] When the node corresponding to the entity value in the query condition is a child node, the root node corresponding to the child node is determined as the target root node, and the local value link is performed on the entity value in the query condition to obtain a local resolution value; the local value link is used to search for an entity matching the entity value in the query condition in the target graph corresponding to the target root node;
[0184] The global resolution value and the local resolution value are used as the resolution result value, and the child node is an extension of the root node.
[0185] In the embodiment of the present application, it is necessary to decide whether to use a global value link or a local value link according to the node type (root node or child node) corresponding to the entity value in the query condition.
[0186] When the node corresponding to the entity value in the query condition is the root node, the system will perform global value linking to find entities that match the entity value in the query condition in the entire target graph. This linking method is suitable for entities that are unique in the entire graph, such as company names.
[0187] When the node corresponding to the entity value in the query condition is a child node, the system will determine the root node corresponding to the child node and perform local value linking to find the entity matching the entity value in the query condition in the target graph corresponding to the target root node. This linking method is suitable for entities that are unique in a specific context, such as products or services of a specific enterprise. Finally, the global resolution value obtained through global value linking and the local resolution value obtained through local value linking will be merged as the final resolution result value.
[0188] The child node is considered an extension of the root node, which means that the entity value linking of the child node is performed in the context of the root node. The embodiment of the present application can more accurately locate and match entities by distinguishing the value linking method of the root node and the child node, thereby improving the accuracy and reliability of the parsing results. The global value link ensures a unique match in the entire graph, while the local value link ensures an accurate match in a specific context. The combination of the two enables the system to handle complex queries and provide accurate parsing results.
[0189] In one embodiment of the present application, the node relationship includes a plurality of nodes and a relationship between the plurality of nodes, the node attributes include the plurality of nodes and attribute values respectively corresponding to the plurality of nodes, and the step of constructing a node information index and an entity information index according to the target graph includes:
[0190] Taking the multiple nodes, the relationships between the multiple nodes and the attribute values respectively corresponding to the multiple nodes as node information, constructing the node information index;
[0191] The attribute values respectively corresponding to the multiple nodes are used as entity information to construct the entity information index.
[0192] In another embodiment of the present application, a prompt word index can also be constructed. Specifically, a suitable index type is selected according to needs, such as a faiss index, which is used to store and retrieve prompt word samples. Necessary fields are configured in the index, and formatted prompt word samples are imported into the index in batches to ensure that the index can quickly retrieve and match sample information.
[0193] In the embodiment of the present application, the node information index and the prompt word index are as follows:
[0194] Relationship index:
[0195] [{
[0196] "page_content": "Corresponding pollution discharge permit for enterprises",
[0197] },
[0198] {
[0199] "page_content": "Corresponding production facilities of the enterprise",
[0200] },
[0201] {
[0202] "page_content": "Corresponding waste gas treatment facilities of enterprises",
[0203] }]
[0204] Property Index:
[0205] [{
[0206] "page_content": "Enterprise",
[0207] "meta_data":{"node":"""attribute":""}
[0208] },
[0209] {
[0210] "page_content": "Address of the production and operation site of the enterprise",
[0211] "meta_data":{"node":"enterprise","attribute":"address of production and operation site"}
[0212] },
[0213] {
[0214] "page_content": "Company address",
[0215] "meta_data":{"node":"enterprise","attribute":"address of production and operation site"}
[0216] }]
[0217] Prompt word index:
[0218] [{
[0219] "page_content": "What are the exhaust gas emission outlets involving particulate matter of Company A?"
[0220] “meta_data”:{“nodes”:[“Enterprise”,“Organized Emissions of Air Pollutants”,“Unorganized Emissions of Air Pollutants”],”result”:“{“Query Condition”:[{“tag”:“Enterprise”,“operator”:“equals”,“values”:[“Company A”]},{“tag”:“Organized Emissions of Air Pollutants”,“operator”:“equals”,“values”:[“Particulate Matter”]}],”Query Target”:[“Exhaust Emission Outlet”]}”
[0221] ]}
[0222] In the relationship index, page_content represents the relationship (i.e., the node relationship shown in Table 1). In the node index, page_content represents the node name and attribute name (i.e., the node attribute shown in Table 2), the node in meta_data represents the corresponding node, the attribute represents the standard name of the attribute, and the enterprise address is the extended name of the address of the enterprise's production and operation site. The more comprehensive the extended name, the better the retrieval effect will be, and the better the subsequent question analysis will be. In the prompt word index, page_content is a sample question, and the company in all the samples is referred to as "Company A" because the main purpose here is to search for questions. In order to reduce the impact of the company name, nodes represent the alternative nodes when analyzing the problem, so that the model can identify and consider these nodes when analyzing the problem. For example, for a question about an enterprise's pollution discharge permit, the alternative nodes may include: enterprise, pollution discharge permit, production facilities, pollutants, and result is the result of the problem analysis.
[0223] In the faiss index, only the page_content field is involved in the retrieval, and other information is not involved.
[0224] In the embodiment of the present application, the entity information uses the elasticsearch index, and the index uses the following fields. Index indicates whether to index. The entity information index is as follows:
[0225] Company:
[0226] Index: True
[0227] Value:
[0228] Index: True
[0229] Node:
[0230] Index: True
[0231] Attribute:
[0232] Index: True
[0233] For enterprise-type entities, Company and Value are the same, both are company names. For other types of entities, Value is the entity value (various attribute values of the node), and Company is the corresponding enterprise. When searching for an enterprise, you can search directly. When searching for other values, you need to specify the Company field. Node is the node type or category of the entity in the graph, which is used to identify the node type to which the entity belongs. Attribute is the specific attribute or feature of the entity, which is used to store the specific attribute value of the entity.
[0234] In an embodiment of the present application, by constructing a node information index and an entity information index, the system can achieve fast and accurate information retrieval and problem resolution. The node information index includes a relationship index and an attribute index, which are used to store and retrieve node names, attributes, and relationships, while the entity information index is used to store specific entity data, such as company names and pollutant information. In addition, constructing a prompt word index provides reference examples for problem resolution for large models, further improving the accuracy of resolution. The use of these indexes not only improves the retrieval efficiency and resolution accuracy of the system, but also enhances the flexibility and scalability of the system, enabling the system to better adapt to the needs of different fields and provide more comprehensive and accurate question-and-answer services.
[0235] In an embodiment of the present application, a target problem is determined; the target problem is parsed according to a target graph to obtain a parsing result corresponding to the target problem; the parsing result corresponding to the target problem includes a query condition and a query target; the value of the parsing result corresponding to the target problem is value-linked to obtain a parsing result value corresponding to the target problem; the value link includes a global value link and a local value link; the query statement corresponding to the target problem is obtained according to the target graph and the parsing result value corresponding to the target problem; the query result corresponding to the target problem is determined according to the query statement corresponding to the target problem. In an embodiment of the present application, the target problem is parsed by a target graph to obtain a parsing result, and then the parsing result is value-linked to construct a query statement. There is no need to use traditional entity links, thereby avoiding other content in the target problem from affecting the effect of entity links, and it is simpler, more convenient and more accurate for this type of graph data. Moreover, the graph question-answering method provided in the embodiment of the present application can also solve the problem of poor query construction effect of long-distance dependencies for feature fields.
[0236] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of the present application are not limited by the described order of actions, because according to the embodiments of the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present application.
[0237] On the basis of the above-mentioned embodiments, this embodiment further provides a graph question-answering device, which is applied to electronic devices such as terminal devices and servers.
[0238] Reference Figure 2 , shows a structural block diagram of an embodiment of a graph question-answering device of the present application, which may specifically include the following modules:
[0239] A determination module 201 is used to determine a target problem;
[0240] The parsing module 202 is used to parse the target question according to the target graph to obtain a parsing result corresponding to the target question; the parsing result corresponding to the target question includes a query condition and a query target;
[0241] A value linking module 203 is used to perform value linking on the value of the parsing result corresponding to the target question to obtain the parsing result value corresponding to the target question; the value linking includes a global value linking and a local value linking;
[0242] A query statement module 204 is used to obtain a query statement corresponding to the target question according to the target graph and the parsing result value corresponding to the target question;
[0243] The query result module 205 is used to determine the query result corresponding to the target question according to the query statement corresponding to the target question.
[0244] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0245] The embodiment of the present application also provides a non-volatile readable storage medium, which stores one or more modules (programs). When the one or more modules are applied to a device, the device can execute instructions (instructions) of each method step in the embodiment of the present application.
[0246] The embodiment of the present application provides a machine-readable medium on which instructions are stored, and when executed by a processor, an electronic device executes a method as described in any one of the above embodiments. In the embodiment of the present application, the electronic device includes various types of devices such as terminal devices and servers (clusters).
[0247] The embodiments of the present disclosure may be implemented as a device configured as desired using any appropriate hardware, firmware, software, or any combination thereof, and the device may include electronic devices such as terminal devices and servers (clusters). Figure 3 An exemplary apparatus 300 that can be used to implement various embodiments described in this application is schematically shown.
[0248] For one embodiment, Figure 3An exemplary apparatus 300 is shown having one or more processors 302, a control module (chip set) 304 coupled to at least one of the processor(s) 302, a memory 306 coupled to the control module 304, a non-volatile memory (NVM) / storage device 308 coupled to the control module 304, one or more input / output devices 310 coupled to the control module 304, and a network interface 312 coupled to the control module 304.
[0249] The processor 302 may include one or more single-core or multi-core processors, and the processor 302 may include any combination of general-purpose processors or special-purpose processors (such as graphics processors, application processors, baseband processors, etc.). In some embodiments, the device 300 can be used as a terminal device, server (cluster), etc. described in the embodiments of the present application.
[0250] In some embodiments, the apparatus 300 may include one or more computer-readable media (e.g., memory 306 or NVM / storage device 308) having instructions 314 and one or more processors 302 configured in conjunction with the one or more computer-readable media to execute the instructions 314 to implement a module to perform the actions described in the present disclosure.
[0251] For one embodiment, control module 304 may include any suitable interface controller to provide any suitable interface to at least one of processor(s) 302 and / or any suitable device or component in communication with control module 304 .
[0252] The control module 304 may include a memory controller module to provide an interface to the memory 306. The memory controller module may be a hardware module, a software module, and / or a firmware module.
[0253] The memory 306 may be used, for example, to load and store data and / or instructions 314 for the device 300. For one embodiment, the memory 306 may include any suitable volatile memory, such as a suitable DRAM. In some embodiments, the memory 306 may include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
[0254] For one embodiment, control module 304 may include one or more input / output controllers to provide an interface to NVM / storage device 308 and input / output device(s) 310 .
[0255] For example, NVM / storage 308 may be used to store data and / or instructions 314. NVM / storage 308 may include any suitable non-volatile memory (e.g., flash memory) and / or may include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).
[0256] NVM / storage device 308 may include storage resources that are physically part of the device on which apparatus 300 is installed, or it may be accessible to the device without being part of the device. For example, NVM / storage device 308 may be accessed via input / output device(s) 310 over a network.
[0257] (One or more) input / output devices 310 may provide an interface for the apparatus 300 to communicate with any other appropriate device, and the input / output device 310 may include a communication component, an audio component, a sensor component, etc. The network interface 312 may provide an interface for the apparatus 300 to communicate through one or more networks, and the apparatus 300 may wirelessly communicate with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols, for example, access a wireless network based on a communication standard, such as WiFi, 2G, 3G, 4G, 5G, etc., or a combination thereof for wireless communication.
[0258] For one embodiment, at least one of the processor(s) 302 may be packaged together with the logic of one or more controllers (e.g., a memory controller module) of the control module 304. For one embodiment, at least one of the processor(s) 302 may be packaged together with the logic of one or more controllers of the control module 304 to form a system-in-package (SiP). For one embodiment, at least one of the processor(s) 302 may be integrated on the same die with the logic of one or more controllers of the control module 304. For one embodiment, at least one of the processor(s) 302 may be integrated on the same die with the logic of one or more controllers of the control module 304 to form a system-on-chip (SoC).
[0259] In various embodiments, the apparatus 300 may be, but is not limited to, a terminal device such as a server, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet computer, a netbook, etc.). In various embodiments, the apparatus 300 may have more or fewer components and / or a different architecture. For example, in some embodiments, the apparatus 300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including a touch screen display), a non-volatile memory port, multiple antennas, a graphics chip, an application-specific integrated circuit (ASIC), and a speaker.
[0260] Among them, the main control chip can be used as a processor or control module in the detection device, sensor data, location information, etc. are stored in a memory or NVM / storage device, the sensor group can be used as an input / output device, and the communication interface may include a network interface.
[0261] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0262] The various embodiments in this specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the various embodiments can be referenced to each other.
[0263] The embodiments of the present application are described with reference to the flowcharts and / or block diagrams of the methods, terminal devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable graph question-and-answer terminal device to produce a machine, so that the instructions executed by the processor of the computer or other programmable graph question-and-answer terminal device generate instructions for implementing the processes in the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0264] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable graph question-answering terminal device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce a manufactured product including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0265] These computer program instructions can also be loaded onto a computer or other programmable graph question-answering terminal device, so that a series of operating steps are executed on the computer or other programmable terminal device to produce a computer-implemented process, thereby providing instructions executed on the computer or other programmable terminal device for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.
[0266] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the embodiments of the present application.
[0267] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or terminal device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or terminal device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or terminal device including the elements.
[0268] The above is a detailed introduction to a graph question-and-answer method and device, an electronic device and a storage medium provided by the present application. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea; at the same time, for general technical personnel in this field, according to the idea of the present application, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.
Claims
1. A graph question answering method, characterized in that: The method comprises: Identify the target problem; Parsing the target question according to the target graph to obtain a parsing result corresponding to the target question; the parsing result corresponding to the target question includes a query condition and a query target; Performing value linking on the value of the analysis result corresponding to the target question to obtain the analysis result value corresponding to the target question; the value linking includes a global value linking and a local value linking; Obtaining a query statement corresponding to the target question according to the target graph and the parsing result value corresponding to the target question; Determine a query result corresponding to the target question according to the query statement corresponding to the target question.
2. The method according to claim 1, characterized in that Before determining the target problem, the method further includes: Construct the target graph; the target graph includes node relationships and node attributes.
3. The method according to claim 1, characterized in that The step of parsing the target problem according to the target graph to obtain a parsing result corresponding to the target problem includes: Constructing a node information index and an entity information index according to the target graph; Determine the target node in the target problem according to the node information index; The target node in the target question is parsed according to the entity information index to obtain a parsing result corresponding to the target question.
4. The method according to claim 3, characterized in that The step of performing value linking on the value of the analysis result corresponding to the target question to obtain the analysis result value corresponding to the target question includes: Determine the entity value in the query condition; Determine a node in the entity information index corresponding to the entity value in the query condition; The value of the parsing result corresponding to the target question is value-linked according to the node corresponding to the entity value in the query condition to obtain the parsing result value corresponding to the target question.
5. The method according to claim 2, characterized in that: The step of obtaining a query statement corresponding to the target question according to the target graph and the parsing result value corresponding to the target question includes: Determining, in the node relationship, a target relationship between target nodes in the target problem; Determining, from the node attributes, a target attribute corresponding to a target node in the target problem; The parsing result value corresponding to the target question, the target relationship and the target attribute are converted into a query statement corresponding to the target question.
6. The method according to claim 4, characterized in that The step of value-linking the value of the parsing result corresponding to the target question according to the node corresponding to the entity value in the query condition to obtain the parsing result value corresponding to the target question includes: When the node corresponding to the entity value in the query condition is a root node, the global value link is performed on the entity value in the query condition to obtain a global resolution value; the global value link is used to search for an entity matching the entity value in the query condition in the target graph corresponding to the root node; When the node corresponding to the entity value in the query condition is a child node, the root node corresponding to the child node is determined as the target root node, and the local value link is performed on the entity value in the query condition to obtain a local resolution value; the local value link is used to search for an entity matching the entity value in the query condition in the target graph corresponding to the target root node; The global resolution value and the local resolution value are used as the resolution result value, and the child node is an extension of the root node.
7. The method according to claim 2, characterized in that The node relationship includes a plurality of nodes and the relationship between the plurality of nodes, the node attribute includes the plurality of nodes and the attribute values respectively corresponding to the plurality of nodes, and the node information index and the entity information index are constructed according to the target graph, including: Taking the multiple nodes, the relationships between the multiple nodes and the attribute values respectively corresponding to the multiple nodes as node information, constructing the node information index; The attribute values respectively corresponding to the multiple nodes are used as entity information to construct the entity information index.
8. A graph question-answering device, characterized in that: The device comprises: Determination module, used to determine the target problem; A parsing module, used to parse the target question according to the target graph to obtain a parsing result corresponding to the target question; the parsing result corresponding to the target question includes a query condition and a query target; A value linking module, used to perform value linking on the value of the parsing result corresponding to the target question to obtain the parsing result value corresponding to the target question; the value linking includes a global value linking and a local value linking; A query statement module, used to obtain a query statement corresponding to the target question according to the target graph and the parsing result value corresponding to the target question; The query result module is used to determine the query result corresponding to the target question according to the query statement corresponding to the target question.
9. An electronic device, characterized in that: include: processor; and A memory having executable code stored thereon, which, when executed, enables the processor to execute the graph question answering method as described in any one of claims 1-7.
10. A machine-readable medium having executable code stored thereon, which, when executed, enables a processor to execute the graph question-answering method as described in any one of claims 1-7.