Mixed question and answer method, device and equipment for global petroliferous basins and medium

By combining knowledge graph reasoning question answering and document question answering methods, a knowledge graph of oil and gas basins was constructed, subgraph structures were extracted and answers were reordered, which solved the problems of low recall and accuracy in professional fields and achieved efficient and accurate knowledge query and answer acquisition.

CN120687540APending Publication Date: 2025-09-23PETROCHINA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410312082.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-03-19
Publication Date
2025-09-23

AI Technical Summary

Technical Problem

In existing technologies, the recall rate of knowledge graphs in professional fields is low, and the accuracy of traditional document question-answering methods in the field of oil and gas basins is low, making it difficult to meet users' comprehensive data and knowledge resource retrieval needs.

Method used

Combining the reasoning question answering method based on knowledge graph and the document question answering method based on knowledge graph embedding, by constructing a knowledge graph of oil and gas basins, extracting subgraph structures, performing entity alignment and query, fusing candidate paragraphs, and using the self-attention mechanism and pre-trained language model to obtain candidate answers, the accuracy of the answers is improved through the re-ranking model.

Benefits of technology

It has improved the knowledge coverage and completeness of the oil and gas basin field, enhanced the efficiency of user knowledge query, improved the accuracy of answers, and improved the sharing level of research results and the knowledge service capabilities of exploration and development.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687540A_ABST
    Figure CN120687540A_ABST
Patent Text Reader

Abstract

The invention discloses a mixed question and answer method, device and equipment for a global petroliferous basin and a medium. The method comprises the following steps: extracting a sub-graph structure of a knowledge graph according to a to-be-answered question and a pre-constructed oil-gas-containing basin knowledge graph; filling all entities in the sub-graph structure into a preset query statement template to obtain a query statement, and obtaining a plurality of candidate answers from a graph database containing a petroliferous basin knowledge graph; according to the to-be-answered question, obtaining a preset number of candidate paragraphs from a pre-constructed full-text index and semantic index database; based on a TransE embedding model, according to the subgraph structure, obtaining a graph entity vector, fusing the candidate paragraph and the graph entity vector to obtain an updated candidate paragraph, and then based on a pre-training language model, obtaining a plurality of candidate answers; and for each candidate answer, encoding the candidate answer and the question to be answered, then inputting the candidate answer and the question to be answered into the trained reordering model, obtaining the matching degree of each question and answer pair, then performing ordering, and obtaining an answer list of the question to be answered.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a hybrid question-and-answer method, apparatus, equipment, and medium for global oil and gas basins. Background Art

[0002] The massive amount of oil and gas basin data and documents generated by exploration and development is extremely valuable, requiring new technologies to deeply mine and utilize them to provide data support and decision-making basis for exploration and development. To further mine and utilize these knowledge documents, mature, advanced, and applicable information technology should be utilized. Intelligent question answering based on knowledge graphs is a general term for a series of theories and methods for organizing data and mining knowledge based on graphs. It is well suited for deeply utilizing knowledge documents related to oil and gas basins, which have complex business processes and are knowledge-intensive. Summary of the Invention

[0003] In order to better realize intelligent question-answering for global oil and gas basin knowledge, the embodiments of the present application provide a hybrid question-answering method, device, equipment and medium for global oil and gas basin knowledge.

[0004] In a first aspect, an embodiment of the present application provides a hybrid question-answering method for global oil and gas basins, the method comprising:

[0005] Extracting a subgraph structure of the oil and gas basin knowledge graph based on the question to be answered and the pre-constructed oil and gas basin knowledge graph;

[0006] Fill all entities in the subgraph structure into a preset query statement template corresponding to the question to be answered to obtain a query statement;

[0007] According to the query statement, a plurality of candidate answers are obtained from a graph database of the oil and gas basin knowledge graph;

[0008] According to the question to be answered, a preset number of candidate paragraphs are obtained from a pre-built full-text index and semantic index library;

[0009] Based on the trained TransE embedding model, according to the subgraph structure, a graph entity vector of an entity in the oil and gas basin knowledge graph corresponding to the question to be answered is obtained;

[0010] Based on the self-attention mechanism, the candidate paragraph and the graph entity vector are fused to obtain an updated candidate paragraph;

[0011] Based on the pre-trained language model, a plurality of candidate answers are obtained according to the question to be answered and a preset number of the updated candidate paragraphs;

[0012] For each candidate answer, text encoding the candidate answer and the question to be answered to obtain multiple question-answer pairs;

[0013] Input each question-answer pair into the trained re-ranking model to obtain the matching degree of each question-answer pair;

[0014] All the candidate answers are sorted according to the matching degree to obtain a list of answers to the question to be answered.

[0015] In an optional implementation of the embodiment of the present application, extracting a subgraph structure of the oil and gas basin knowledge graph based on the question to be answered and the pre-constructed oil and gas basin knowledge graph includes:

[0016] Identifying question entities with oil and gas basin domain significance in the question to be answered;

[0017] The question entity is aligned with the entity in the pre-constructed oil and gas basin knowledge graph, and the subgraph structure of the oil and gas basin knowledge graph is extracted.

[0018] In an optional implementation of the embodiment of the present application, aligning the question entity with an entity in a pre-constructed oil and gas basin knowledge graph to extract a subgraph structure of the oil and gas basin knowledge graph includes:

[0019] Based on the pre-trained language model, converting the question entity into a question entity vector;

[0020] Based on Euclidean distance calculation, local sensitivity hashing algorithm and the question entity vector, determining alignment entities that meet a preset semantic matching threshold in the oil and gas basin knowledge graph;

[0021] The aligned entity and all entities associated with the aligned entity are extracted to obtain a subgraph structure of the oil and gas basin knowledge graph.

[0022] In an optional implementation of the embodiment of the present application, the step of filling all entities in the subgraph structure into a preset query statement template corresponding to the question to be answered to obtain a query statement includes:

[0023] Determine a preset query statement template corresponding to the question to be answered based on a graph matching algorithm;

[0024] Fill all entities in the subgraph structure into the preset query statement template to obtain a query statement.

[0025] In an optional implementation of the embodiment of the present application, determining the preset query statement template corresponding to the question to be answered based on the graph matching algorithm includes:

[0026] Performing dependency syntactic analysis on the question to be answered to obtain a question directed graph, and embedding the question directed graph based on a graph embedding method to obtain a syntactic vector;

[0027] The syntactic vector is input into a first classifier, and a plurality of preset query statement templates are obtained by matching. The preset query statement template with the highest matching degree is determined as the preset query statement template corresponding to the question to be answered.

[0028] In an optional implementation of the embodiment of the present application, the pre-trained language model is used to obtain multiple candidate answers according to the question to be answered and a preset number of updated candidate paragraphs, including:

[0029] According to the pre-trained language model, the question to be answered and the updated candidate paragraph are jointly encoded to obtain an encoded sequence;

[0030] Determining, based on the second classifier, whether there is an answer in the updated candidate paragraph;

[0031] If yes, perform word-level prediction on the updated candidate paragraph based on the sequence labeling model to determine the start and end positions of the answer in the updated candidate paragraph;

[0032] A plurality of candidate answers to the question to be answered are extracted from the updated candidate paragraphs according to the start and end positions.

[0033] In an optional implementation of the embodiment of the present application, obtaining a preset number of candidate paragraphs from a pre-built full-text index and semantic index library according to the question to be answered includes:

[0034] Acquire multiple candidate documents for the question to be answered from a pre-built full-text index and semantic index library based on a full-text search method and keywords of the question to be answered;

[0035] According to the local sensitivity hashing algorithm and the semantic retrieval method, a preset number of candidate paragraphs are obtained from the plurality of candidate documents.

[0036] In an optional implementation of the embodiment of the present application, the trained reordering model is obtained by the following method:

[0037] Obtain multiple question-answer pairs in the field of global oil and gas basins to build a training dataset;

[0038] The training data set is embedded into a unified vector space to train an initial model, thereby obtaining the trained re-ranking model.

[0039] In a second aspect, an embodiment of the present application provides a hybrid question-and-answer device for global oil and gas basins, the device comprising:

[0040] An extraction module, configured to extract a subgraph structure of the oil and gas basin knowledge graph based on the question to be answered and the pre-constructed oil and gas basin knowledge graph;

[0041] A first determining module is configured to fill all entities in the subgraph structure into a preset query statement template corresponding to the question to be answered to obtain a query statement;

[0042] A second determination module is configured to obtain a plurality of candidate answers from the graph database of the oil and gas basin knowledge graph according to the query statement;

[0043] A paragraph acquisition module is used to acquire a preset number of candidate paragraphs from a pre-built full-text index and semantic index library according to the question to be answered;

[0044] A vector acquisition module, configured to obtain, based on the trained TransE embedding model and the subgraph structure, a graph entity vector of an entity in the oil and gas basin knowledge graph corresponding to the question to be answered;

[0045] A fusion module, configured to fuse the candidate paragraphs and the graph entity vectors based on a self-attention mechanism to obtain updated candidate paragraphs;

[0046] A third determination module is configured to obtain a plurality of candidate answers based on the pre-trained language model and the question to be answered and a preset number of updated candidate paragraphs;

[0047] an encoding module, configured to perform text encoding on each candidate answer and the question to be answered to obtain a plurality of question-answer pairs;

[0048] a fourth determination module, configured to input each question-answer pair into a trained re-ranking model to obtain a matching degree for each question-answer pair;

[0049] A sorting module is used to sort all the candidate answers according to the matching degree to obtain a list of answers to the question to be answered.

[0050] In a third aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the hybrid question-and-answer method for global oil and gas basins as described above.

[0051] In a fourth aspect, an embodiment of the present application provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the hybrid question-and-answer method for global oil and gas basins as described above is implemented.

[0052] In a fifth aspect, an embodiment of the present application provides a computer program product comprising instructions, which, when executed on a computer device, enables the computer device to execute the hybrid question-and-answer method for global oil and gas basins as described above.

[0053] In a sixth aspect, an embodiment of the present application provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run computer programs or instructions to implement the above-mentioned hybrid question-and-answer method for global oil and gas basins.

[0054] The beneficial effects of the above technical solutions provided by the embodiments of the present application include at least:

[0055] The embodiment of the present application provides a hybrid question-answering method for global oil and gas basins. This method constructs a knowledge graph of oil and gas basins, covers a wide range of knowledge in the field of oil and gas basins, and increases the recall rate. The subgraph structure obtained in the reasoning question-answering method is embedded in the knowledge graph to obtain the graph entity vector of the entity in the knowledge graph of the oil and gas basin, which is then integrated with the candidate paragraphs in the document question-answering method to update the candidate paragraphs, thereby enabling a better understanding of the professional field content of the oil and gas basin. By combining the reasoning question-answering method based on the knowledge graph with the document question-answering method based on the knowledge graph embedding, and then re-ranking the obtained candidate answers to obtain the final answer, the user's knowledge query efficiency is improved, while ensuring the retrieval accuracy, the answer accuracy is ultimately improved, and the problems of low recall rate in professional fields of the reasoning question-answering method using the knowledge graph and low query accuracy of the traditional document question-answering method are solved. This method has the characteristics of easy operation, strong interactivity and accurate answers, improves the sharing level and efficiency of basin research results, and provides researchers with better exploration and development knowledge service capabilities.

[0056] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings.

[0057] The technical solution of the present application is further described in detail below through the accompanying drawings and examples. BRIEF DESCRIPTION OF THE DRAWINGS

[0058] The accompanying drawings are used to provide a further understanding of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings:

[0059] Figure 1 A flow chart of a hybrid question-answering method for global oil and gas basins provided in an embodiment of the present application;

[0060] Figure 2 A schematic diagram of a process for achieving entity alignment using a local sensitivity hashing algorithm provided in an embodiment of the present application;

[0061] Figure 3 A schematic diagram of the flow of the graph matching algorithm provided in an embodiment of the present application;

[0062] Figure 4 A schematic diagram of the process of the deep semantic matching model provided in the embodiment of the present application;

[0063] Figure 5 A schematic diagram of the answer reordering process provided in an embodiment of the present application;

[0064] Figure 6 A schematic structural diagram of a hybrid question-and-answer device for global oil and gas basins provided in an embodiment of the present application. DETAILED DESCRIPTION

[0065] In the following description, specific details such as specific system structures and techniques are provided for purposes of illustration rather than limitation to facilitate a thorough understanding of the embodiments of the present application. However, it will be apparent to those skilled in the art that the present application may be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to avoid obscuring the description of the present application with unnecessary detail.

[0066] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, integers, steps, operations, elements and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or collections thereof.

[0067] It will also be understood that the term "and / or" used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

[0068] As used in this specification and the appended claims, the term "if" can be interpreted as "when" or "upon" or "in response to determining" or "in response to detecting," depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "upon determination" or "in response to determining" or "upon detection of [described condition or event]" or "in response to detecting [described condition or event]," depending on the context.

[0069] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.

[0070] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof all mean "including but not limited to," unless otherwise specifically emphasized.

[0071] It should be understood that the size of the serial numbers of the steps in the following embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

[0072] In order to illustrate the technical solution of the present application, specific embodiments are provided below.

[0073] The inventors discovered that in the existing technology, there are two main problems with the retrieval of global oil and gas basin data and documents: First, although the knowledge graph can well integrate the knowledge contained in these data and documents, its concepts and relationships rely on manual construction, resulting in a limited scope of knowledge domains covered, and unable to achieve the retrieval and display of comprehensive data and knowledge resources under user query needs; second, the traditional question-and-answer method can obtain relevant answers in documents based on questions, which has the characteristics of wide knowledge coverage, but it is difficult to understand professional field content, resulting in low accuracy in the field of oil and gas basins. Therefore, how to solve the problems of low recall rate of knowledge graphs in professional fields and low accuracy of traditional document queries is a technical problem that people in this field urgently need to solve. Based on this, the inventors have made this application after further research and development, providing a hybrid question-and-answer method, device, equipment and medium for global oil and gas basins.

[0074] Example 1

[0075] The embodiment of the present application provides a hybrid question-answering method for global oil and gas basins, referring to Figure 1 As shown, the method includes the following steps S101 to S110:

[0076] S101: According to the question to be answered and the pre-constructed oil and gas basin knowledge graph, a subgraph structure of the oil and gas basin knowledge graph is extracted.

[0077] S102: Fill all entities in the subgraph structure into a preset query statement template corresponding to the question to be answered to obtain a query statement.

[0078] S103: According to the query statement, a plurality of candidate answers are obtained from the graph database of the oil and gas basin knowledge graph.

[0079] S104: According to the question to be answered, a preset number of candidate paragraphs are obtained from a pre-built full-text index and semantic index library.

[0080] S105: Based on the trained TransE embedding model and according to the subgraph structure, a graph entity vector of an entity in the oil and gas basin knowledge graph corresponding to the question to be answered is obtained.

[0081] S106: Based on the self-attention mechanism, the candidate paragraph and the graph entity vector are fused to obtain an updated candidate paragraph.

[0082] S107: Based on the pre-trained language model, a plurality of candidate answers are obtained according to the question to be answered and a preset number of updated candidate paragraphs.

[0083] S108: For each candidate answer, perform text encoding on the candidate answer and the question to be answered to obtain multiple question-answer pairs.

[0084] S109: Input each question-answer pair into the trained re-ranking model to obtain the matching degree of each question-answer pair.

[0085] S110: Sort all the candidate answers according to the matching degree to obtain a list of answers to the question to be answered.

[0086] The hybrid question-answering method for global oil and gas basins provided in the embodiment of the present application combines a reasoning question-answering method based on a knowledge graph with a document question-answering method based on knowledge graph embedding, and then reorders the obtained candidate answers to obtain the final answer. This method has a wide range of knowledge coverage in the field of oil and gas basins, can better understand professional field content, improve user knowledge query efficiency, increase the recall rate while ensuring retrieval accuracy, and ultimately improve the answer accuracy, solving the problems of low recall rate in professional fields using reasoning question-answering methods based on knowledge graphs and low query accuracy of traditional document question-answering methods; this method has the characteristics of easy operation, strong interactivity and accurate answers, which improves the sharing level and efficiency of basin research results, and also provides researchers with better exploration and development knowledge service capabilities.

[0087] In the above step S101, extracting the subgraph structure of the oil and gas basin knowledge graph based on the question to be answered and the pre-constructed oil and gas basin knowledge graph specifically includes the following steps S1011 to S1012:

[0088] S1011: Identify question entities with oil and gas basin domain significance in the question to be answered.

[0089] In step S1011, based on the user-entered question related to the field of oil and gas basins, i.e., the question to be answered, a domain entity recognition method can be used to identify entities with specific meanings in the question to be answered. Specifically, for the field of oil and gas basins, entities with specific meanings primarily include: professional terms in the field of oil and gas basins and the names of oil and gas basins; the domain entity recognition method refers to the use of natural language processing technology to identify professional domain entities in the field of oil and gas basins from text, such as the Albert Basin, Peace River Oil Sands, and Source Rocks, and can also identify and extract attribute relationships between professional domain entities in the field of oil and gas basins, such as basin location, basin type, basin name, and top geological age.

[0090] In a specific embodiment, a BERT pre-trained network can be added to the commonly used BiLSTM-CRF model as a word vector model for entity recognition. The training process of the word vector model is as follows:

[0091] First, a large amount of text related to oil and gas basins was obtained. Then, named entities in this field were annotated using the BIO annotation method to generate training and test sets. Finally, the generated training and test sets were used to train and test word embedding models, respectively. At the same time, an attention mechanism was introduced to optimize entity recognition, resulting in a trained word embedding model.

[0092] After the question to be answered is input into the word vector model trained through the above process for oil and gas basin domain entity recognition, the model outputs a list containing labeled oil and gas basin domain entities.

[0093] S1012: Align the question entity with the entity in the pre-constructed oil and gas basin knowledge graph, and extract a subgraph structure of the oil and gas basin knowledge graph.

[0094] A knowledge graph is a semantic network based on graph theory that represents entities, concepts, and the relationships between them. By presenting various entities and concepts as nodes and their relationships as edges, a large-scale, multi-layered, and organically integrated semantic network is constructed.

[0095] In this embodiment, a complete knowledge graph of oil and gas basins is pre-built based on relevant documents and data about the basins, by constructing ontology and triple representations of knowledge elements and using knowledge graph construction tools and algorithms. The knowledge graph of the oil and gas basins includes entities, attributes, and relationships, establishing the overall picture and structure of the knowledge of the oil and gas basins.

[0096] In step S1012, the identified question entity is compared with an entity with the same designation (the names may be different, but the reference is the same) in the pre-constructed oil and gas basin knowledge graph to determine whether the two are the same entity. If they are the same entity, the entity is extracted from the oil and gas basin knowledge graph. This process can use semantic matching to establish a correspondence between the question entity and the entity in the pre-constructed oil and gas basin knowledge graph, that is, to find the aligned entity of the question entity in the oil and gas basin knowledge graph, thereby determining whether the question entity and its aligned entity are the same entity.

[0097] In one embodiment, the question entity is aligned with an entity in a pre-constructed oil and gas basin knowledge graph to extract a subgraph structure of the oil and gas basin knowledge graph, specifically including the following steps S10121 to S10123:

[0098] S10121: Based on the pre-trained language model, convert the question entity into a question entity vector.

[0099] In the above step S10121, for a question entity obtained by question analysis, the BERT pre-trained language model can be used to convert the question entity into a vector representation, that is, into a question entity vector.

[0100] S10122: Based on Euclidean distance calculation, local sensitivity hashing algorithm and the question entity vector, determine the alignment entities that meet the preset semantic matching threshold in the oil and gas basin knowledge graph.

[0101] In step S10122, after the question entities are converted into vector representations, the semantic distance between the entities can be objectively evaluated using a distance calculation method between vectors. The distance between vectors can be calculated using Euclidean distance, cosine distance, or Hamming distance.

[0102] In a specific embodiment, the distance between vectors can be calculated using Euclidean distance. The Euclidean metric, also known as the Euclidean distance, is a commonly used distance definition, which refers to the real distance between two points in m-dimensional space, or the natural length of a vector (i.e., the distance from the point to the origin). The Euclidean distance in two-dimensional and three-dimensional space is the actual distance between two points. For example, for two text vectors α = [x1, x2, ..., xn ] and β=[y1,y2,...,y n ], the Euclidean distance between them is calculated as:

[0103]

[0104] Where d(x,y) is the Euclidean distance; x i is the i-th element of the text vector α; y i is the i-th element of the text vector β; i=1, 2, 3, ..., n; n is the number of elements of the text vector α or the text vector β.

[0105] For an entity obtained by question analysis, the semantic distance between the semantic vector of the question entity and the text of each node in the graph is calculated to select the closest entity for alignment. In order to speed up this process and reduce the time loss caused by one-by-one matching, the local sensitivity hashing algorithm is used to accelerate the matching process and efficiently obtain the alignment node with the highest matching degree. The process of entity alignment using the local sensitivity hashing algorithm is as follows: Figure 2 For example, the question "Where is Alberta?" is input into the entity recognition model to obtain the "Alberta" entity. The "Alberta" entity is then hashed using local sensitivity to calculate its similarity with entities in the knowledge graph. The entities are then sorted based on their similarity, and the "Alberta Basin" with the highest score is selected for alignment.

[0106] Due to the characteristics of the locality-sensitive hashing algorithm, any input entity will be matched to a graph entity with the closest semantics, even if the semantic similarity between the two is not high. Therefore, a preset semantic matching threshold is set at the end of the semantic matching process to filter out entity pairs with excessive semantic distance (i.e., not meeting the preset semantic matching threshold) and retain the aligned entities that meet the preset semantic matching threshold.

[0107] S10123: Extract the aligned entity and all entities associated with the aligned entity to obtain a subgraph structure of the oil and gas basin knowledge graph.

[0108] In the above step S10123, all entities associated with the aligned entity determined in S10122 are obtained from the oil and gas basin knowledge graph to form a subgraph structure, thereby obtaining the subgraph structure of the oil and gas basin knowledge graph.

[0109] In the above step S102, all entities in the subgraph structure are filled into the preset query statement template corresponding to the question to be answered to obtain a query statement, which specifically includes the following steps S1021 to S1022:

[0110] S1021: Based on a graph matching algorithm, determine a preset query statement template corresponding to the question to be answered.

[0111] In the above step S1021, the determination of the preset query statement template corresponding to the question to be answered based on the graph matching algorithm specifically includes the following steps S10211 to S10212:

[0112] S10211: Perform dependency syntactic analysis on the question to be answered to obtain a question directed graph, and embed the question directed graph based on a graph embedding method to obtain a syntactic vector.

[0113] S10212: Input the syntactic vector into a first classifier, match and obtain multiple preset query statement templates, and determine the preset query statement template with the highest matching degree as the preset query statement template corresponding to the question to be answered.

[0114] In the embodiment of the present application, the process of the graph matching algorithm is as follows Figure 3 As shown, first, dependency parsing is performed on the user's question input to derive a directed graph structure, i.e., a question directed graph. This question directed graph is then embedded using graph embedding to obtain a syntactic vector. Finally, the syntactic vector is input into a pre-trained first classifier to match different preset query templates. The preset query template with the highest score (highest match) is selected as the preset query template corresponding to the question to be answered. For example, if the question to be answered is "Where is the location of Alberta?", the entity "Alberta Basin" and the relation "location" are identified, and dependency parsing is performed to match the query template. The graph database is then queried to obtain the answer.

[0115] S1022: Fill all entities in the subgraph structure into the preset query statement template to obtain a query statement.

[0116] In the above step S1022, all entities contained in the subgraph structure extracted in the above step S101 are filled into corresponding positions in the preset query statement template to obtain an executable query statement.

[0117] In the above step S103, the query statement obtained in the above step S102 is brought into the graph database of the oil and gas basin knowledge graph to execute the query and obtain the query result, that is, obtain multiple candidate answers.

[0118] Steps S101 to S103 above implement a knowledge graph-based reasoning question-answering method: First, domain-specific named entity recognition methods are used to extract the entities and attribute relationships in the question. These entities and relationships are then aligned with those in the oil and gas basin knowledge graph. After performing dependency parsing on the question, a graph matching algorithm is used to generate a corresponding database query template. Finally, the query template and the aligned knowledge entities are combined to generate an executable query statement, which is then queried in the graph database to obtain the answer.

[0119] A full-text index is a keyword-based index structure used to quickly find documents matching a query within a text. When creating a full-text index, the text is broken down into a series of terms, each of which is associated with a document, forming an index table. When a query is run, the indexing system breaks down the query terms, searches the index table for matching terms, and returns a list of matching documents.

[0120] Semantic indexing is an index structure built based on the semantic information of text, designed to improve the accuracy and efficiency of text search and matching. Constructing a semantic index for document paragraphs requires mapping all paragraph information in the document repository into a high-dimensional space to form semantically informed text vectors, which are then indexed. The semantic index structure established in the document repository is tree-like, with indexed objects as leaf nodes and concepts as root nodes. The semantic index extracts commonalities from each indexed object and is automatically generated from the bottom up. Semantic indexing considers not only the frequency and position of word occurrences, but also the semantic relationships between words and their context.

[0121] In the above step S104, according to the question to be answered, a preset number of candidate paragraphs are obtained from the pre-built full-text index and semantic index library, which specifically includes the following steps S1041 to S1042:

[0122] S1041: According to the full-text search method and the keywords of the question to be answered, a plurality of candidate documents of the question to be answered are obtained from a pre-built full-text index and semantic index library.

[0123] S1042: Obtain a preset number of candidate paragraphs from the plurality of candidate documents according to a local sensitivity hashing algorithm and a semantic retrieval method.

[0124] In the pre-built full-text index and semantic index library (inverted index and semantic index library), full-text search is used to obtain candidate documents based on keyword matching. At the same time, semantic search using local sensitivity hashing method obtains a large number of candidate paragraphs. The number of candidate paragraphs can be manually set, for example, to the top 5 or top 10.

[0125] In the above step S105, the subgraph structure obtained in the above step S101 is input into the trained TransE embedding model to realize knowledge graph embedding, and a vector representation of the entity in the knowledge graph of the oil and gas basin corresponding to the question to be answered is obtained, that is, the graph entity vector is obtained. Among them, the training method of the TransE embedding model can refer to the detailed description in the prior art and is not specifically limited here. Among them, Knowledge Graph Embedding is a method for solving the problem of knowledge graph completion. It embeds the entities (Entity) and relations (Relation) in the knowledge graph into a continuous vector space, thereby facilitating calculation while retaining the structural information in the knowledge graph.

[0126] In step S106, the preset number of candidate paragraphs obtained in S104 are fused with the graph entity vectors of the entities in the knowledge graph of the oil and gas basins corresponding to the question, obtained using the TransE embedding model, through a self-attention mechanism to obtain updated candidate paragraphs. The method for fusion based on the self-attention mechanism can be found in the detailed description of the prior art and is not specifically limited here.

[0127] In an embodiment of the present application, a flowchart of deep semantic matching of the updated candidate paragraphs and the question to be answered is performed through a pre-trained language model. Wherein, the pre-trained language model can be a deep semantic matching model (Deep SemanticMatching Model), which is a text matching model based on deep learning, and aims to improve the accuracy and efficiency of text matching by deeply mining text semantic information. It is based on the full-text index and semantic index to obtain paragraphs related to the user's question, and to determine the answerability of the question and extract the span of the candidate answer. This model is independent of the specific question-answering method and only calculates the degree of matching between the question and the answer.

[0128] In the above step S107, based on the pre-trained language model, a plurality of candidate answers are obtained according to the question to be answered and a preset number of updated candidate paragraphs, which specifically includes the following steps S1071 to S1075:

[0129] S1071: According to the pre-trained language model, the question to be answered and the updated candidate paragraphs are jointly encoded to obtain an encoding sequence.

[0130] According to the pre-trained language model, the updated candidate paragraphs are jointly encoded with the question to be answered. Figure 4As shown in Figure 1, it is a flow chart of the deep semantic matching model. The question to be answered in the figure is "What are the petroleum geological conditions in the Bohai Bay Basin?" The updated candidate paragraph is "The geothermal gradient in the Bohai Bay Basin is generally 3.7℃ / 100m, and the main oil and gas depressions have basically undergone a complete thermal evolution process." The input text is encoded in the joint encoder to obtain the encoded sequence, and then the vector (sentence vector) corresponding to the first [CLS] tag in the encoded sequence is used as the aggregated sequence representation.

[0131] S1072: Based on the second classifier, determine whether there is an answer in the updated candidate paragraph. If so, execute S1073; if not, execute S1074.

[0132] According to the trained second classifier, Figure 4 The middle classification layer determines whether the updated candidate paragraphs contain an answer. The second classifier can be trained using contrastive learning, with positive samples representing paragraphs with answers and negative samples representing paragraphs without answers. The learning objective is to minimize the semantic distance between the question and the positive samples and maximize the semantic distance with the negative samples.

[0133] S1073: Based on the sequence labeling model, perform word-level prediction on the updated candidate paragraph to determine the start and end positions of the answer in the updated candidate paragraph.

[0134] S1074: Set the answer to a null value.

[0135] S1075: Extracting multiple candidate answers to the question to be answered from the updated candidate paragraphs based on the start and end positions.

[0136] Based on the start and end positions, the corresponding text subsequences are extracted from the updated candidate paragraphs as candidate answers to the question to be answered. For example, if the question to be answered is "What are the petroleum geological conditions in the Bohai Bay Basin?", then the candidate answer to the question to be answered is "The geothermal gradient in the Bohai Bay Basin is generally 3.7℃ / 100m." There may be multiple candidate answers, such as "The maximum hydrocarbon generation intensity in the Bohai Bay Basin is 18×106~22×106t / km 2 ","The Bohai Bay Basin has excellent spatial supporting conditions...", etc.

[0137] In the above steps S104 to S107, a document question-answering method based on knowledge graph embedding is implemented: full-text indexes and semantic indexes are constructed for a large number of oil and gas basin document contents, candidate paragraphs are retrieved based on question retrieval, the oil and gas basin knowledge graph is embedded through graph embedding, and then a deep semantic matching model is used to obtain candidate answers from the candidate paragraphs.

[0138] In the above step S108, for each candidate answer, the candidate answer and the question to be answered are text-encoded. Figure 5 As shown in the figure, it is a flowchart of answer re-ranking. In the figure, the question to be answered is "What are the petroleum geological conditions in the Bohai Bay Basin?", and the candidate answer is "The geothermal gradient in the Bohai Bay Basin is generally 3.7℃ / 100m." The trained re-ranking model is input and encoded through the text encoding layer to obtain the encoded text.

[0139] In the above step S109, the trained reordering model can be obtained through the following steps S1091 to S1092:

[0140] S1091: Obtain multiple question-answer pairs in the field of global oil and gas basins to construct a training dataset.

[0141] S1092: Embed the training data set into a unified vector space to train an initial model to obtain the trained reordering model.

[0142] In the embodiment of this application, a professional data set is constructed for the global oil and gas basin field, which contains a collection of question-answer pairs in the field. Figure 5 As shown, the question-answer pairs are embedded into a unified vector space using a language model (which can be BERT), and a model that can judge the matching degree between questions and answers is trained, that is, a trained re-ranking model is obtained.

[0143] In the above step S109, when the multiple question-answer pairs obtained from the above step S108 are input into the above trained re-ranking model, one question-answer pair is input each time, and the corresponding matching degree is calculated by the re-ranking algorithm, thereby obtaining the matching degree of multiple question-answer pairs.

[0144] In the above step S110, according to the matching pairs of each question-answer pair obtained in S109, all question-answer pairs are sorted from high to low according to the matching degree, and a list of answers to the questions to be answered is output.

[0145] Furthermore, the answer list of the unanswered questions output in S110 may be evaluated. The specific evaluation method is as follows:

[0146] The benchmark models used for experimental comparison with the document question answering method embedded in knowledge graphs are from QANet, BERT and SG-Net, and the experiment uses accuracy, EM and F1 as evaluation criteria.

[0147] The calculation formula for accuracy is as follows:

[0148]

[0149] Where, accuracy is the accuracy rate; P is the number of correctly predicted samples; N is the number of incorrectly predicted samples.

[0150] The Exact Match score (EM) is used to measure the degree of exact match between the answer predicted by the model and the standard answer. The calculation formula is as follows:

[0151]

[0152] Where EM is the exact match score; m is the total number of predicted samples; and n is the number of samples whose predicted answers are completely consistent with the standard answers.

[0153] The fuzzy matching score F1 is obtained by calculating the repetition between the answer predicted by the model and the standard answer. The calculation formula is as follows:

[0154]

[0155] Where precision is the accuracy; predict_answer is the answer predicted by the model; len(predict_answer) is the number of words in the answer predicted by the model; Num same The number of repeated words between the predicted answer and the standard answer;

[0156]

[0157] In the formula, recall is the recall rate; gold_answer represents the actual label answer; len(gold_answer) represents the number of words in the actual label answer; Num same The number of repeated words between the predicted answer and the standard answer;

[0158]

[0159] Where F1 is the fuzzy matching score, which represents the harmonic mean of precision and recall; precision is the precision; recall is the recall.

[0160] Through the above method, the evaluation results obtained by the method of this application are compared with the evaluation results of single knowledge graph question answering and document question answering. The question answering accuracy of the method of this application in the field of global oil and gas basins can reach 84.38%, while the question answering accuracy of the knowledge graph-based reasoning question answering method and the knowledge graph embedded document question answering method in the field of global oil and gas basins are 82.30% and 74.30% respectively. It can be seen that the method of this application has a significant improvement compared with the two traditional question answering methods.

[0161] Example 2

[0162] Based on the same inventive concept, the embodiment of the present application also provides a hybrid question-answering device for global oil and gas basins, referring to Figure 6 As shown, the device includes:

[0163] Extraction module 101, configured to extract a subgraph structure of the oil and gas basin knowledge graph based on the question to be answered and the pre-constructed oil and gas basin knowledge graph;

[0164] A first determining module 102 is configured to fill all entities in the subgraph structure into a preset query statement template corresponding to the question to be answered to obtain a query statement;

[0165] A second determination module 103 is configured to obtain multiple candidate answers from the graph database of the oil and gas basin knowledge graph according to the query statement;

[0166] The paragraph acquisition module 104 is used to acquire a preset number of candidate paragraphs from a pre-built full-text index and semantic index library according to the question to be answered;

[0167] A vector acquisition module 105 is configured to obtain, based on the trained TransE embedding model and the subgraph structure, a graph entity vector of an entity in the oil and gas basin knowledge graph corresponding to the question to be answered;

[0168] A fusion module 106 is configured to fuse the candidate paragraphs and the graph entity vectors based on a self-attention mechanism to obtain updated candidate paragraphs;

[0169] A third determining module 107 is configured to obtain a plurality of candidate answers based on the pre-trained language model and the question to be answered and a preset number of updated candidate paragraphs;

[0170] An encoding module 108 is configured to perform text encoding on each candidate answer and the question to be answered to obtain a plurality of question-answer pairs;

[0171] A fourth determination module 109 is configured to input each question-answer pair into a trained re-ranking model to obtain a matching degree for each question-answer pair;

[0172] The sorting module 110 is configured to sort all the candidate answers according to the matching degree to obtain a list of answers to the question to be answered.

[0173] Each module 101 - 110 in the hybrid question-answering device for global oil and gas basins can respectively execute the process of steps S101 - S110 of the first embodiment. The repeated steps will not be repeated here.

[0174] Example 3

[0175] Based on the same inventive concept, an embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, it implements the hybrid question-and-answer method for global oil and gas basins as described in the above embodiment 1.

[0176] Example 4

[0177] Based on the same inventive concept, an embodiment of the present application also provides a computer device, including a memory, a processor, and a computer program stored in the memory and runnable on the processor. When the processor executes the computer program, it implements the hybrid question-and-answer method for global oil and gas basins as described in the above embodiment 1.

[0178] Example 5

[0179] Based on the same inventive concept, an embodiment of the present application also provides a computer program product containing instructions. When the computer program product is run on a computer device, the computer device executes the hybrid question-and-answer method for global oil and gas basins as described in the above embodiment 1.

[0180] Example 6

[0181] Based on the same inventive concept, an embodiment of the present application also provides a chip, which includes a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run computer programs or instructions to implement the hybrid question-and-answer method for global oil and gas basins as described in the above embodiment one.

[0182] Those skilled in the art will appreciate that the embodiments of the present application can be provided as methods, systems, or computer program products. Therefore, the present application can adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application can adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage and optical storage, etc.) that contain computer-usable program code.

[0183] The present application is described with reference to the flowcharts and / or block diagrams of the methods, 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 data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the steps in the process. Figure 1 a process or multiple processes and / or boxes Figure 1A device that provides the functions specified in a block or multiple blocks.

[0184] These computer program instructions may also be stored in a computer readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 a process or multiple processes and / or boxes Figure 1 The function specified in one or more boxes.

[0185] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operational steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing the instructions executed on the computer or other programmable device for implementing the process. Figure 1 a process or multiple processes and / or boxes Figure 1 The steps for the function specified in one or more boxes.

[0186] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.

Claims

1. A hybrid question-answering method for global oil and gas basins, characterized by: include: Extracting a subgraph structure of the oil and gas basin knowledge graph based on the question to be answered and the pre-constructed oil and gas basin knowledge graph; Fill all entities in the subgraph structure into a preset query statement template corresponding to the question to be answered to obtain a query statement; According to the query statement, a plurality of candidate answers are obtained from a graph database of the oil and gas basin knowledge graph; According to the question to be answered, a preset number of candidate paragraphs are obtained from a pre-built full-text index and semantic index library; Based on the trained TransE embedding model, according to the subgraph structure, a graph entity vector of an entity in the oil and gas basin knowledge graph corresponding to the question to be answered is obtained; Based on the self-attention mechanism, the candidate paragraph and the graph entity vector are fused to obtain an updated candidate paragraph; Based on the pre-trained language model, a plurality of candidate answers are obtained according to the question to be answered and a preset number of the updated candidate paragraphs; For each candidate answer, text encoding the candidate answer and the question to be answered to obtain multiple question-answer pairs; Input each question-answer pair into the trained re-ranking model to obtain the matching degree of each question-answer pair; All the candidate answers are sorted according to the matching degree to obtain a list of answers to the question to be answered.

2. The method according to claim 1, wherein The subgraph structure of the oil and gas basin knowledge graph is extracted based on the question to be answered and the pre-constructed oil and gas basin knowledge graph, including: Identifying question entities with oil and gas basin domain significance in the question to be answered; The question entity is aligned with the entity in the pre-constructed oil and gas basin knowledge graph, and the subgraph structure of the oil and gas basin knowledge graph is extracted.

3. The method according to claim 2, wherein The step of aligning the question entity with an entity in a pre-constructed oil and gas basin knowledge graph and extracting a subgraph structure of the oil and gas basin knowledge graph includes: Based on the pre-trained language model, converting the question entity into a question entity vector; Based on Euclidean distance calculation, local sensitivity hashing algorithm and the question entity vector, determining alignment entities that meet a preset semantic matching threshold in the oil and gas basin knowledge graph; The aligned entity and all entities associated with the aligned entity are extracted to obtain a subgraph structure of the oil and gas basin knowledge graph.

4. The method according to claim 1, wherein Filling all entities in the subgraph structure into a preset query statement template corresponding to the question to be answered to obtain a query statement includes: Determine a preset query statement template corresponding to the question to be answered based on a graph matching algorithm; Fill all entities in the subgraph structure into the preset query statement template to obtain a query statement.

5. The method according to claim 4, wherein Determining the preset query statement template corresponding to the question to be answered based on the graph matching algorithm includes: Performing dependency syntactic analysis on the question to be answered to obtain a question directed graph, and embedding the question directed graph based on a graph embedding method to obtain a syntactic vector; The syntactic vector is input into a first classifier, and a plurality of preset query statement templates are obtained by matching. The preset query statement template with the highest matching degree is determined as the preset query statement template corresponding to the question to be answered.

6. The method according to claim 1, wherein The method of obtaining multiple candidate answers based on the pre-trained language model according to the question to be answered and a preset number of updated candidate paragraphs includes: According to the pre-trained language model, the question to be answered and the updated candidate paragraph are jointly encoded to obtain an encoded sequence; Determining, based on the second classifier, whether there is an answer in the updated candidate paragraph; If yes, perform word-level prediction on the updated candidate paragraph based on the sequence labeling model to determine the start and end positions of the answer in the updated candidate paragraph; A plurality of candidate answers to the question to be answered are extracted from the updated candidate paragraphs according to the start and end positions.

7. The method according to claim 1, wherein According to the question to be answered, a preset number of candidate paragraphs are obtained from a pre-built full-text index and semantic index library, including: Acquire multiple candidate documents for the question to be answered from a pre-built full-text index and semantic index library based on a full-text search method and keywords of the question to be answered; According to the local sensitivity hashing algorithm and the semantic retrieval method, a preset number of candidate paragraphs are obtained from the plurality of candidate documents.

8. The method according to claim 1, wherein The trained reordering model is obtained by: Obtain multiple question-answer pairs in the field of global oil and gas basins to build a training dataset; The training data set is embedded into a unified vector space to train an initial model, thereby obtaining the trained re-ranking model.

9. A hybrid question-answering device for global oil and gas basins, characterized by: include: An extraction module, configured to extract a subgraph structure of the oil and gas basin knowledge graph based on the question to be answered and the pre-constructed oil and gas basin knowledge graph; A first determining module is configured to fill all entities in the subgraph structure into a preset query statement template corresponding to the question to be answered to obtain a query statement; A second determination module is configured to obtain a plurality of candidate answers from the graph database of the oil and gas basin knowledge graph according to the query statement; A paragraph acquisition module is used to acquire a preset number of candidate paragraphs from a pre-built full-text index and semantic index library according to the question to be answered; A vector acquisition module, configured to obtain, based on the trained TransE embedding model and the subgraph structure, a graph entity vector of an entity in the oil and gas basin knowledge graph corresponding to the question to be answered; A fusion module, configured to fuse the candidate paragraphs and the graph entity vectors based on a self-attention mechanism to obtain updated candidate paragraphs; A third determination module is configured to obtain a plurality of candidate answers based on the pre-trained language model and the question to be answered and a preset number of updated candidate paragraphs; an encoding module, configured to perform text encoding on each candidate answer and the question to be answered to obtain a plurality of question-answer pairs; a fourth determination module, configured to input each question-answer pair into a trained re-ranking model to obtain a matching degree for each question-answer pair; A sorting module is used to sort all the candidate answers according to the matching degree to obtain a list of answers to the question to be answered.

10. A computer-readable storage medium having a computer program stored therein, wherein when the program is executed by a processor, the processor executes the hybrid question-answering method for global oil and gas basins as described in any one of claims 1 to 8.

11. A computer device, characterized in that: It includes a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the hybrid question-answering method for global oil and gas basins as described in any one of claims 1 to 8 is implemented.

12. A computer program product comprising instructions, which, when executed on a computer device, causes the computer device to execute the hybrid question-answering method for global oil and gas basins as claimed in any one of claims 1 to 8.