An intelligence intelligent question and answer method based on a knowledge graph
By employing a knowledge graph-based intelligent question-answering method, this approach utilizes Trie trees, AC automata, and the Word2Vec algorithm for entity recognition and fuzzy matching, combined with a relation template library to achieve efficient querying of military questions. This addresses the shortcomings in accuracy and robustness of question-answering systems in the military field, enabling efficient acquisition and response of military knowledge.
Patent Information
- Application Number
- CN202211011628.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-23
- Publication Date
- 2026-01-23
- Estimated Expiration
- 2042-08-23
AI Technical Summary
Question-answering systems in the military field lack open sources of professional knowledge and sufficient up-to-date databases, making it difficult to efficiently acquire and accurately understand military knowledge. Existing technologies suffer from insufficient accuracy and robustness in areas such as entity recognition, attribute recognition, and question template matching.
This paper adopts an intelligence-based question-answering method based on knowledge graphs. It uses Trie trees and AC automata algorithms for entity retrieval, combines Word2Vec algorithm for fuzzy matching, designs a relation template library and converts it into MongoDB_SQLs query statements. It achieves accurate matching of questions and querying of answers by mapping entities to attributes and exhaustively enumerating relation templates.
It improved the recall and accuracy of entity recognition, enhanced the robustness of question recognition, and achieved an accuracy of 88% on 50 simple questions, demonstrating its ability to efficiently understand and answer questions in the military field.
Smart Images

Figure CN115422323B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of artificial intelligence technology, and in particular relates to an intelligence intelligent question answering method based on knowledge graphs. Background Technology
[0002] Intelligence is information that has been transmitted, organized, and analyzed. Intelligence is the prerequisite and foundation for any decision-making process. By scientifically and rationally processing intelligence information, we can gain a deep understanding of the current situation, grasp key elements such as the enemy's situation, our own situation, and the environment, and thus formulate decisions that best serve our interests.
[0003] Intelligent question answering can be traced back to the birth of artificial intelligence. In 1950, Alan Turing proposed judging the intelligence of machines by asking and answering questions. In 1966, Weizenbaum designed a chatbot that could easily communicate with humans. In 2011, Professor Etzioni of the University of Washington published an article pointing out that search engines needed to modify Nature, suggesting that question-answering systems using natural language would become the mainstream of future question-answering system development. Therefore, question-answering systems play an important role in future information and intelligence services.
[0004] Military knowledge comes from diverse sources. The internet offers numerous open data sources that provide a wealth of basic military information, such as the types and performance of weapons and equipment. By crawling and structuring military knowledge from the internet, much fundamental military knowledge can be obtained. Currently, more diverse and in-depth military knowledge often comes from specialized databases, typically contained within different military information systems. Knowledge graphs from different sources often have different structures, and their corresponding schema layers may differ.
[0005] Compared to open question-and-answer systems, military question-and-answer systems have the following characteristics:
[0006] (1) Compared to question-answering systems primarily designed for open-domain, mass-market applications, question-answering systems for the military domain offer relatively limited support. In other words, the diversity of identical questions in the military domain is less than that in the open domain.
[0007] (2) Compared with open domain knowledge question answering platforms that currently have complete open knowledge sources, military domain question answering platforms lack open professional knowledge sources and sufficient up-to-date databases;
[0008] (3) In the open domain, the answers to many questions are stored in cyberspace through FQA, so simple retrieval can solve many problems. However, the questions and answers in the military domain are closed and cannot be obtained from the network.
[0009] (4) When building a question-and-answer system for the military field, developers need to have a deeper understanding and application of professional military knowledge, and through in-depth understanding of logical reasoning, in order for the system to correctly understand the question and generate the answer.
[0010] Therefore, the main difficulties in military-related question-and-answering lie in acquiring military knowledge, constructing military knowledge graphs, and reasoning for solving military problems.
[0011] In research on knowledge graph question answering in the military field, Zhang Keliang et al. proposed a question answering system for the aviation field. This system categorizes user questions into 12 types, employs structured semantic information extraction methods, and transforms the information. The system then uses a SPARQL query to input the question and find the answer. Dou Xiaoqiang et al. introduced a template-based intelligent question answering system for military knowledge. This system subdivides user questions, inputs the results into pre-made question templates, and generates a knowledge graph query method corresponding to each question type. The final answer is obtained through the query, but the paper does not mention the key technologies that enable the system.
[0012] Che Jinli et al. proposed a method for creating a knowledge graph of military equipment. This method retrieves encyclopedic data through web crawling, generates a knowledge graph through knowledge extraction and fusion, and stores it in the Neo4j graph database, enabling continuous updates and repairs. Furthermore, they mentioned how to implement knowledge question answering. This involves segmenting words using a dictionary, comparing them with predefined templates, and translating them into Neo4j's Cypher query language for result retrieval, but does not include solutions for entity disambiguation, spoken language queries, etc. Jiang Chengyue proposed a problem understanding template and semantic problem analysis model based on dependency trees. By decomposing a complex problem into multiple simple triples, a set of structured problem tuples with multiple constraints is generated.
[0013] Jha Shisong created a knowledge graph for the aircraft domain based on structured data from relational databases and semi-structured data from the internet. He combined neural network design to implement an aircraft knowledge graph question-answering system. He attempted to use a Naive Bayes classifier to understand questions and employed a doc2vec model and word2vec+TextCNN method to translate natural language questions into distributed representations for question comprehension. Liu Tianya, utilizing knowledge-based structures, question topics, and other prior information, researched and designed a weapon and equipment question representation model composed of a question semantic graph and question intent. He also studied methods for reducing ambiguity and supporting generative question understanding and expression models. Li Daiyi et al., in their implemented military weapon question-answering system, first matched the question classification task with a question template using an SVM multi-classifier, then used a BiLSTM-CRF model to add named entities. In the question recognition stage, the question template was applied to the recognition of task data entities and relationships, generating Cypher query results. This method supports manual construction and training of SVM and BiLSTM-CRF models. Building military question-answering data, especially large-scale datasets, requires significant time and effort. Furthermore, it places high demands on model training and parameter tuning, which is not conducive to the rapid iteration and application of practical models.
[0014] In general, the development time for knowledge graph question answering in the military field is relatively short. While there are some template- and rule-based design concepts, there is a lack of detailed specifications including practical technical and implementation details. Machine learning-based solutions also have some drawbacks. Furthermore, there is significant room for research in key technologies, such as embedded learning-based question understanding and answering of knowledge graph questions.
[0015] The unique characteristics of the military field place special demands on knowledge graph-based military intelligence question-answering systems, which are reflected in aspects such as entity recognition and attribute recognition, and question template matching.
[0016] (1) Entity recognition and attribute recognition
[0017] Named entity recognition (NER) refers to natural language understanding from unstructured input text. Learning algorithms that identify entities with specific types or strong references, such as Hidden Markov Models, Conditional Random Fields, and LSTM-CRF, are primarily used in open-domain question-answering systems.
[0018] However, due to the lack of open data sources in the military field, it is difficult to obtain the large training sets required for machine learning. Therefore, due to the limited number of entities available, simple and efficient dictionary-based and rule-based methods are typically used.
[0019] 1) Dictionary-based entity recognition and attribute recognition
[0020] Entity dictionaries are now widely used to construct all knowledge base entities and their alias attributes. An attribute dictionary is built using the attribute names of all entities, and extended terms are added. For example, the entity "QBZ95 automatic rifle" can be given names like "Type 95" or "Type 95 automatic rifle". Extended terms like "China" can be added to the attribute "country of origin". The dictionary also allows for custom parts of speech; for example, "QBZ95 automatic rifle" is categorized as an entity, while "country of origin" is categorized as an attribute value. Word segmentation and tagging are generally implemented using the jieba library.
[0021] At this point, using word segmentation tools and an auxiliary dictionary, the entities and attributes of the natural language question are complete. Furthermore, attribute values, comparators, and most value symbols have been identified. However, if the question description is not standardized and the question entity cannot be found in the dictionary when inputting the question, the entity needs to be modified. Cases where attributes such as "How far can an F-22 fighter jet fly?" cannot be recognized should be handled using other methods, such as neural network-based question template matching.
[0022] 2) Entity correction based on inverted index dictionary
[0023] Entities in military knowledge graphs often have complex names, typically consisting of letters and numbers, such as "QBZ95 automatic rifle". This should be taken into account if users enter incorrect or out of order entity names.
[0024] A fuzzy matching mechanism can be configured to enhance the robustness of dictionary matching. An inverted index dictionary of word-to-word mappings is constructed using all entity names in the knowledge base. For example, Table 1 shows the inverted index of the dictionary {F-15, F-22, F-35}.
[0025] Table 1 Examples of Inverted Indexes
[0026]
[0027]
[0028] If no matching entity or attribute is found in the input question, an inverted index dictionary is used to retrieve all entities or attributes corresponding to each character in the question. The cumulative count of each entity or attribute is then calculated, and the three entities selected most frequently are identified. Alternatively, the attribute can be added to a candidate list, and the entity to be queried can be determined through user interaction.
[0029] (2) Problem template matching
[0030] Due to the limited variety of questions in the military field, question template matching is typically used for semantic analysis. This involves manually designing question templates, using rules or neural network models to classify and match questions, and then matching the query statements based on the templates to handle the complexity of questions in the Chinese context.
[0031] 1) Rule-based question template matching
[0032] For questions using standardized question methods, rule-based question template matching is a simple and effective approach. After processing with a word segmentation tool, the entities, attributes, attribute values, comparison operators, and extrema operators in the question sentence are represented by parts of speech, and direct matching can generate the corresponding query question template.
[0033] Rule-based question templates include single-entity single-attribute question-and-answer, single-entity multi-attribute question-and-answer, single-entity most valuable attribute question-and-answer, and single-entity attribute range question-and-answer. They are divided into four categories of questions and answers.
[0034] 2) TextCNN-based question template matching
[0035] While manually defined rule-based question template matching is accurate and efficient, it struggles to parse different forms of questions expressing the same semantic meaning within a Chinese context. For example, the questions "How far can the Liaoning aircraft carrier sail?" and "What is the Liaoning aircraft carrier's range?" convey the same meaning and have the same answer. However, the former fails to identify valid attribute entity names, resulting in no matching question template. Therefore, introducing the TextCNN neural network model for question template matching effectively solves this problem.
[0036] The TextCNN network model, proposed by Yoon Kim in 2014, is specifically designed for text classification. It boasts a relatively simple structure, high accuracy, and is widely used in natural language processing and recommendation systems. The model takes a text T containing n words as input, each word represented by a k-dimensional distributed matrix. Through convolutional operations, feature matrices for each word are obtained at different window sizes. Max pooling is then performed in the pooling layer, and the maximum value obtained is the feature value corresponding to the convolution kernel. These features are then fed into fully connected layers and softmax layers to achieve text classification.
[0037] One question template matching method based on TextCNN utilizes a word2vec model to convert entity recognition question text into word vectors, which are then classified using a TextCNN network model. After classification, a template corresponding to the question is obtained, and the corresponding knowledge graph query statement is used to retrieve the answer. The matching process is: Question -> Entity Recognition -> Word2vec -> TextCNN -> Answer Retrieval -> Answer Received.
[0038] All datasets used to train the neural network were created manually. Problem templates collect different problem approaches and use synonyms instead of expanding the dataset.
[0039] During the training phase, the word2vec model from the gensim Python library was used to convert the text into an n×k word vector matrix, where k represents the dimension of the word vectors and n represents the maximum sentence length. Then, a TextCNN network model was built using the Python Keras library and trained on the dataset. In the pre-trained TextCNN model, the convolutional kernels and word vectors had the same width but different heights. Convolutional kernels with heights of 3, 4, and 5 were used in the model. In the pooling layers, the maximum value of each feature vector was used to represent the feature, and the scalars calculated by convolutional kernels of the same height were combined to generate a single feature vector. Finally, in the fully connected layers, the ReLU function was used as the activation function, and the softmax function was used to calculate the probability of belonging to different classes. L2 and abort methods were used simultaneously, and the steepest descent method was employed for parameter updates and model optimization.
[0040] In application, when a question is identified by entity recognition, the entity is replaced with part-of-speech tagging and formed as text input. This is then converted into a word vector matrix using the word2vec model and fed into a pre-trained TextCNN network model to generate the corresponding question model. The converted Cypher query is then input into the database for querying.
[0041] The advantages of the TextCNN-based question template matching method are mainly: it has a relatively accurate understanding of different questions with the same semantics. For example, for questions such as "How far can [entity] sail?", "How far can [entity] sail at most?", and "What is the maximum range of [entity]?" after entity recognition, although standard attribute names cannot be directly extracted through attribute recognition, TextCNN can associate these three questions with the template "[entity] + [attribute: maximum range]". Summary of the Invention
[0042] In view of this, the present invention proposes an intelligent question-answering method based on knowledge graphs, comprising the following steps:
[0043] Building a knowledge graph using a knowledge base: Based on an existing small-scale military type database, identify entities and relationships between entities in the database, and build a knowledge graph based on the document-oriented database MongoDB;
[0044] Given a natural language problem, use a Trie tree to store entity database information and perform entity retrieval based on the AC automaton algorithm;
[0045] For entities that do not receive a match, we use the CBOW network in the Word2Vec algorithm to perform fuzzy matching of entities; then, we use an exhaustive approach based on relation templates to identify the issues involved in natural language problems, and achieve the correspondence and pairing between entities and query attribute items.
[0046] Based on the entities and relationships returned in the question, the query is converted into a MongoDB SQL query statement and used as a structured query language for question-and-answer search. This query is then input into the MongoDB database, and the results are returned.
[0047] Furthermore, building a relational template library includes creating templates from the widest possible input questions and adding them to the library to achieve efficient question answering.
[0048] Furthermore, the objective function of the CBOW network model is as follows:
[0049] For the current word ω, the goal is to predict the words that may exist in its context Context(ω). The objective function is set in the following log-likelihood function form:
[0050]
[0051] Following the Hierarchical Softmax concept, the CBOW model defines it as:
[0052]
[0053] Furthermore, in the CBOW model,
[0054]
[0055] Written as a whole expression:
[0056]
[0057] Substituting into the objective function and simplifying the logarithmic operation, we get:
[0058]
[0059] To further simplify:
[0060]
[0061] Thus, the objective function of the CBOW model is obtained.
[0062] Furthermore, gradient-based algorithms are used for parameter updates:
[0063] First, calculate L(ω,j) for each pair of pairs. gradient:
[0064]
[0065] therefore, The update formula is written as:
[0066]
[0067] η is the learning rate;
[0068] Similarly, based on the symmetry property, the gradient of L(ω,u,j) with respect to v(ω) can be calculated:
[0069]
[0070] The update formula for v(ω) is:
[0071]
[0072] Furthermore, after obtaining the word vector of the entity name according to the Word2Vec algorithm, the word vectors of other candidate synonyms and domain words are also obtained. After calculating the Euclidean distance between the two, the judgment is made according to the set distance threshold, and the top eight candidate synonyms with similarity are recorded to achieve fuzzy matching of entities not in the entity name database.
[0073] Furthermore, a relational template library containing various templates and their corresponding database search statements is designed to ensure accurate matching of the problem.
[0074] The beneficial effects of this invention are as follows:
[0075] This research on knowledge graph question answering systems based on simple retrieval is divided into two sub-tasks: entity recognition and question recognition. Methods with both accuracy and robustness are explored for each task.
[0076] In the entity recognition subtask, this invention introduces an entity recognition algorithm based on multi-pattern matching. By combining the commonly used AC automaton multi-pattern matching algorithm with fuzzy matching based on the Word2Vec algorithm, the feature entity extraction capability of the model is improved, and good experimental results are obtained.
[0077] In the problem identification subtask, this invention proposes a problem identification algorithm based on relational template exhaustive search, which greatly improves the robustness and accuracy of the model and solves the problem that traditional methods are difficult to apply effectively in the military field.
[0078] This invention also designs MongoDB query statements based on each relation template. Through the construction, analysis, and experimentation of the question-answering system, the system achieved an accuracy rate of 88% on 50 simple questions, demonstrating its good performance. Attached Figure Description
[0079] Figure 1 Example diagram of problem template matching;
[0080] Figure 2 Chinese Trie tree;
[0081] Figure 3 This invention provides a question-answering framework based on knowledge graphs;
[0082] Figure 4 A schematic diagram of the CBOW model training of this invention. Detailed Implementation
[0083] The present invention will be further described below with reference to the accompanying drawings, but this is not intended to limit the present invention in any way. Any modifications or substitutions made based on the teachings of the present invention shall fall within the protection scope of the present invention.
[0084] There are many types of questions related to the military field, and a comprehensive list of all these types is crucial for accurately identifying the types of unknown problems. This section lists the types of military problems and their corresponding examples as comprehensively as possible, categorized as follows.
[0085] The problems mainly consist of 4 major categories and 26 subcategories, including those related to entity attributes and those related to events. Entity attribute problems include simple problems such as querying, judging, selecting, and enumerating; as well as complex problems such as quantitative reasoning, computational reasoning, and logical reasoning. Event-related problems include problems related to head and tail entities, relation attributes, relation types, and enumeration; as well as quantitative reasoning and probabilistic reasoning problems. See Table 2 for details.
[0086] Table 2 Types and Examples of Military Issues
[0087]
[0088]
[0089] This invention primarily studies simple and complex quantitative and logical reasoning types within entity-related questions, and also investigates yes / no and multi-hop questions, such as "What is the communication capability of the communication equipment of the J-11B heavy fighter jet?" and "Does the engine of the AH-64E helicopter lack armor protection?". The research focuses on question type-based retrieval algorithms, therefore assuming that all input question types are included in a question type database. Accurate question matching and answering are achieved by designing retrieval algorithms for each question type.
[0090] Knowledge graph question answering based on simple retrieval is a question-answering system implemented by deeply studying the format and content of military-related questions and utilizing high-precision entity matching and question recognition algorithms. While such systems may not perform ideally in terms of the openness of the questions, they are capable of achieving a full understanding and answering of the questions, making them highly significant for research.
[0091] The fundamental task of retrieval-based question answering is to understand the question, retrieve existing military knowledge, and output the correct answer. The system takes the user's question as input and the results from the knowledge base query as output. When the system receives user input, it first performs Chinese word segmentation, then retrieves keywords and related terms from the question. Next, based on the part-of-speech tags of the segmented words, it searches a question template library, obtains matching question templates, and converts them into MongoDB SQL queries. Finally, the query is input into the knowledge graph to generate the final answer and return it.
[0092] In knowledge graphs, knowledge exists in the form of triples: <subject, predicate, object>, where each triple describes a fact. The task of a knowledge graph question-answering system is to find the correct answer to a given natural question. If both the entity and relation are correctly identified, the final answer can be obtained directly. Based on these inferences, this invention decomposes the knowledge graph question-answering system into three parts. The overall framework of the question-answering system is as follows: Figure 3 As shown.
[0093] The system framework is as follows:
[0094] (1) Construct a knowledge graph using a knowledge base. Based on an existing small-scale military type database, identify entities and relationships between entities in the database, and construct a knowledge graph based on the document-oriented database MongoDB.
[0095] (2) Given a natural language problem, a Trie tree is used to store entity database information, and entity retrieval is performed using the AC automaton algorithm. For entities that do not find a match, fuzzy entity matching is performed using the CBOW idea in the Word2Vec algorithm. Then, based on the exhaustive search of relation templates, the problems involved in the natural language problem are identified, realizing the correspondence and pairing between entities and query attribute items.
[0096] Entity matching algorithm based on Trie tree and AC automaton
[0097] The purpose of entity recognition is to identify entities in a question and link them to a knowledge graph. While neural network-based recognition using fuzzy matching can achieve better recall, it presents two challenges when applied to the military field. First, when an entity in the question is synonymous with but not identical entities in the knowledge graph, word-by-word matching is typically used to measure similarity, compromising accuracy. Second, even when an entity in the question perfectly matches an entity in the knowledge graph, neural network-based methods still suffer from a certain error rate, affecting the effectiveness of entity linking. To address the high accuracy requirements of military intelligence question-answering systems, this chapter employs an entity matching algorithm that integrates multi-modal matching. Although recall is slightly reduced, it guarantees extremely high accuracy.
[0098] A Trie tree, also known as a "prefix tree," is a data structure specifically designed for matching strings. Essentially, a Trie tree constructs a tree-like data structure that utilizes common prefixes among multiple strings, merging duplicate prefixes together to reduce search space and save search time. Figure 1 It is a Trie tree of Chinese words (containing the words: "military", "military force", "service", "land", "land warfare", "land corps").
[0099] like Figure 1 Each node in the tree is composed of Chinese characters from the word set. All node pointers point to the next Chinese character in the word corresponding to that node. Some nodes have a "#" symbol, indicating that the Chinese character is the last character of the word formed from the root node to that node.
[0100] Building a Trie tree requires scanning all words, resulting in a time complexity of O(n). Once the tree is built, tree-based queries become highly efficient. For each query, assuming the word to be queried is of length k, only approximately k nodes need to be compared to retrieve the word successfully, regardless of the size or length of the original word set. Therefore, after building the Trie tree, the time complexity for querying a specific word is O(k), where k is the length of the word to be queried.
[0101] The Aho-Corasick algorithm, also known as the AC automaton algorithm, essentially constructs a Trie tree from multiple pattern strings and then creates failure pointers for some nodes, similar to the next array in the KMP algorithm, enabling efficient patterns for skip-matching.
[0102] When using an Acolyte automaton to match strings, there are generally two matching processes. When the current character matches a given word, it means that a path along an edge in the tree leads from the current node to the target character. Matching continues along this edge, while the pointer to the target string moves to the next node. When the current character does not match a given word, matching continues from the node following the failure pointer of the current node, ending when the pointer reaches the root node (ROOT node). This process is repeated until the entire string to be matched is matched.
[0103] In a text string, to find the frequency and position of multiple target strings, the common approach is to search for each target string individually and record its position each time. This method is inefficient when the text string is large and there are many target strings. To improve efficiency, the AC automaton algorithm was developed.
[0104] The AC automaton algorithm is an accelerated query algorithm based on Trie trees. Each node in the tree includes a pointer to its child nodes and a fail pointer. The fail pointer indicates the state that the AC automaton should transition to when the input character does not match any of the current node's child nodes.
[0105] The construction method of the AC automaton is shown in Algorithm 1.
[0106]
[0107]
[0108] The AC automaton preprocesses the entity dictionary into a deterministic finite-state automaton. Therefore, when scanning the problem, matching can be completed in just one pass. The time complexity of the AC automaton is O(n), which greatly reduces the time spent on matching.
[0109] However, existing entity name databases are often limited in size and struggle to include entity-related synonyms, domain terms, and so on. Therefore, when an entity cannot be matched from an entity name database, fuzzy matching using learning methods becomes effective.
[0110] When applying machine learning methods to the field of natural language processing, it is usually necessary to mathematically represent language. Word vectors are numerical encodings of a word, representing it as a vector. This chapter uses distributed representation, which offers better performance and greater robustness, to numerically represent entity words. Through training, each word is mapped to a relatively short vector of fixed length. All words, after this mapping, form a word vector space, where each word is equivalent to a point. Therefore, by introducing the concept of "distance" into this space, we can determine the syntactic and semantic similarity between two words. There are many ways to obtain word vectors, including the widely used Word2Vec algorithm from Google's Tomas Mikolov team.
[0111] Word2Vec is a small-scale neural network model. This invention uses a CBOW network model based on Hierarchical Softmax. Word2Vec is a language model that learns semantic knowledge from large amounts of text in an unsupervised manner.
[0112] The Word2Vec model consists of only an input layer, hidden layers, and an output layer network. Based on its framework, the model can be divided into two main types: CBOW and Skip-gram models, differing in their input and output. The CBOW model starts with a given word w... t Context w t-2 ,w t-1 ,w t+1 ,w t+2 In this case, predict the word w t The Skip-gram model, on the other hand, uses existing words w... t In the context of the word w t-2 ,w t-1 ,w t+1 ,w t+2 Make predictions.
[0113] Given the current word ω, the goal is to predict the words that may exist in its context Context(ω). Therefore, the objective function is set as the following log-likelihood function form:
[0114]
[0115] For the CBOW model, the key lies in constructing the conditional probability function p(ω|Context(ω)). Following the Hierarchical Softmax concept, the CBOW model defines it as follows:
[0116]
[0117] (3) Based on the corresponding question template, convert it into a query statement, perform the query, and return the results. Based on the entities and relationships of the returned questions, convert them into MongoDB_SQLs query statements and use them as the structured query language for question-and-answer search. Input the query into the MongoDB database and return the query results.
[0118] in,
[0119]
[0120] Written as a whole expression:
[0121]
[0122] Substituting into the objective function and simplifying the logarithmic operation, we get:
[0123]
[0124]
[0125] For ease of gradient derivation, let's denote the content within the curly braces as L(ω,j), hence it can be written as:
[0126]
[0127] At this point, the objective function of the CBOW model has been obtained. For parameter updates, gradient-based algorithms are used here.
[0128] First, calculate L(ω,j) for each pair of pairs. gradient:
[0129]
[0130] therefore, The update formula can be written as:
[0131]
[0132] η is the learning rate. Similarly, based on the symmetry property, the gradient of L(ω,u,j) with respect to v(ω) can be calculated:
[0133]
[0134] The update formula for v(ω) is:
[0135]
[0136] After obtaining the word vector of the entity name using the Word2Vec algorithm, it is necessary to simultaneously obtain the word vectors of other candidate synonyms and domain words, calculate the Euclidean distance between them, and then make a judgment based on the set distance threshold.
[0137] In the military field, the results of using learning models and other methods to identify entities such as weapons are often unsatisfactory. This invention uses the Word2Vec algorithm for fuzzy recognition, which calculates synonyms for the query entity and associates them with the entity, thereby achieving entity matching even when the input entity name is non-standardized. This makes entity recognition, attribute value recognition, and numerical value recognition more efficient, provides more flexible question-and-answer responses, and makes the question-and-answer system more robust.
[0138] Problem identification algorithm based on relation template exhaustive search:
[0139] In military intelligence question answering, the requirements for question comprehension are extremely high. Any misunderstanding leading to feedback bias is unacceptable, as it will cause decision-making errors and generate a chain of negative effects. Therefore, using a question identification algorithm with high accuracy and robustness is particularly important.
[0140] Building a relation template library is a highly accurate and stable method. By creating templates from the widest possible input questions and adding them to the library, efficient question answering for this type of question can be achieved. Once the relation template library reaches a certain size, accurately answering the input questions becomes feasible. Based on the judgment of the input questions, the questions are divided into 3 main categories and 9 subcategories, as shown in Table 3.
[0141] Table 3 Problem Template Table
[0142]
[0143] Algorithms for solving problems based on matching queries:
[0144] After the user inputs a question, the question understanding module retrieves the question type, entities, and question intent, resulting in a question understanding report. Based on this report, the question understanding report can be used as query criteria to retrieve the answer to the question from the weaponry and equipment knowledge base.
[0145] When searching for answers to questions, the answer type generally varies depending on the question type. Therefore, each question type has a corresponding method for querying answers. The corresponding answer matching method is determined based on the question type results obtained from the question understanding module. Then, by combining entity link results and relationship recognition results, a query statement for the MongoDB database is constructed and matched against the weapon and equipment knowledge base.
[0146] For example, for the attribute-based question "<entity><attribute>", the corresponding MongoDB query is "db.MilitaryKG.find({"name":"entity_name","attribute":"entity_attr"})". Here, `entity_name` is the entity name, and `entity_attr` is the name of the entity attribute to be searched. Inputting the above statement into the MongoDB-formatted weapons and equipment knowledge base will retrieve the answer. If no answer is found, it will return "Query failed".
[0147] This invention constructs a military intelligence database by summarizing and generalizing historical intelligence and collecting and organizing popular news information from the internet, and then standardizing it. This database serves as a question-and-answer knowledge base. Analysis reveals that the database contains 50,178 weapon and equipment entities; it includes 15 major categories and 153 subcategories of weapon and equipment types, such as helicopters, surface combat ships, and sensors; all weapon and equipment entities possess 216 different entity attributes, such as length, width, frequency band, and year of service. Statistical information for the dataset is shown in Table 4.
[0148] Table 4. Statistical information of the dataset
[0149] project quantity Example Major Categories 15 Helicopters and surface combat ships Subcategories 153 Missiles, attack aircraft, transport aircraft nation 117 Country A, Country B, Country C entity 50178 Type 1 fighter jet, Type 3 aircraft carrier Entity attributes 216 Maximum payload, communication capabilities, autonomy
[0150] Due to the domain-specific and specialized nature of weaponry and equipment, manual annotation was used when constructing the training set for the question understanding module. Business personnel summarized common question formats for each question type, and then manually annotated 50 data entries containing simple questions and answers. All of this data can be used to train the question type classification model and entity recognition model within the question understanding module.
[0151] To evaluate the performance of the constructed question-answering system, performance tests were conducted on tasks such as question type recognition, entity recognition, and intent recognition within the question understanding module. The F1 score was used as the evaluation metric for algorithm performance.
[0152] The formula for calculating the F1 value is as follows:
[0153]
[0154]
[0155]
[0156] Where TP represents the number of correct predictions for the positive class; FP represents the number of incorrect predictions for the negative class; TN represents the number of correct predictions for the negative class; and FN represents the number of incorrect predictions for the positive class.
[0157] Based on the extended word entity recognition algorithm based on multi-pattern matching and the question recognition algorithm based on relation template exhaustion proposed in this invention, a simple retrieval knowledge graph question answering system is constructed.
[0158] Testing the performance of a question-answering system requires large-scale question testing. When testing the system, it's necessary to examine each module separately to understand its performance and make targeted improvements. The entity matching module's task is to identify the topic entities and attribute entities in the input question and match them with existing entities in the knowledge graph. The question recognition module's task is to identify the relationships between entities in the input question and match the corresponding relationship templates. The answer query template's task is to generate a knowledge graph query statement based on the matched entity and relationship templates and retrieve the answer.
[0159] This invention conducts system performance tests based on 50 manually labeled simple questions, and 44 questions yielded correct answers. In the experiment, the entity matching module had an F1 score of 0.94, the question recognition module had an F1 score of 0.90, and the answer query module had an F1 score of 1.00, with a system accuracy of 88%, which fully demonstrates the superior performance of the system on simple questions.
[0160] Table 5 Experimental Results
[0161] System Module Model used Model performance F1 score Entity matching AC Automata + Word2Vec 0.94 Problem identification Exhaustive enumeration of relation templates 0.90 Answer search MongoDB_Sqls 1.00 Question and Answer System —— 0.88
[0162] This chapter selects nine typical question examples belonging to different question templates as input. The system query statements and feedback results are shown in Table 6. After manual comparison, the system output is correct, the effect is good, and the accuracy is high.
[0163] Table 6. Question and Answer Results for 9 Question Templates
[0164]
[0165]
[0166] The beneficial effects of this invention are as follows:
[0167] This research on knowledge graph question answering systems based on simple retrieval is divided into two sub-tasks: entity recognition and question recognition. Methods with both accuracy and robustness are explored for each task.
[0168] In the entity recognition subtask, this invention introduces an entity recognition algorithm based on multi-pattern matching. By combining the commonly used AC automaton multi-pattern matching algorithm with fuzzy matching based on the Word2Vec algorithm, the feature entity extraction capability of the model is improved, and good experimental results are obtained.
[0169] In the problem identification subtask, this invention proposes a problem identification algorithm based on relational template exhaustive search, which greatly improves the robustness and accuracy of the model and solves the problem that traditional methods are difficult to apply effectively in the military field.
[0170] This invention also designs MongoDB query statements based on each relation template. Through the construction, analysis, and experimentation of the question-answering system, the system achieved an accuracy rate of 88% on 50 simple questions, demonstrating its good performance.
[0171] The term "preferred" as used in this invention refers to any instance, example, or illustration. Any aspect or design described as "preferred" in this invention is not necessarily to be construed as more advantageous than others. Rather, the use of the term "preferred" is intended to present the concept in a specific manner. The term "or" as used in this application is intended to mean an inclusive "or" rather than an exclusionary "or." That is, unless otherwise specified or clear from the context, "X uses A or B" naturally includes either of the permutations. That is, if X uses A; X uses B; or X uses both A and B, then "X uses A or B" is satisfied in any of the foregoing examples.
[0172] Furthermore, although this disclosure has been shown and described with respect to one or more implementations, equivalent variations and modifications will occur to those skilled in the art based on a reading and understanding of this specification and the accompanying drawings. This disclosure includes all such modifications and variations and is limited only by the scope of the appended claims. In particular, with respect to the various functions performed by the aforementioned components (e.g., elements, etc.), the terminology used to describe such components is intended to correspond to any component (unless otherwise indicated) that performs the specified function of said component (e.g., is functionally equivalent to it), even if structurally not equivalent to the disclosed structure performing the functions of the exemplary implementations of this disclosure shown in the present invention. Moreover, although specific features of this disclosure have been disclosed with respect to only one of several implementations, such features may be combined with one or more features of other implementations that may be desirable and advantageous for a given or particular application. Furthermore, with regard to the use of the terms “comprising,” “having,” “containing,” or variations thereof in the Detailed Description or claims, such terms are intended to be included in a manner similar to the term “including.”
[0173] The functional units in this invention embodiment can be integrated into a processing module, or each unit can exist physically separately, or multiple units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. The aforementioned devices or systems can execute the storage methods in the corresponding method embodiments.
[0174] In summary, the above embodiments are one implementation of the present invention, but the implementation of the present invention is not limited to the embodiments described above. Any changes, modifications, substitutions, combinations, or simplifications made that deviate from the spirit and principle of the present invention should be considered equivalent substitutions and are included within the protection scope of the present invention.
Claims
1. A knowledge graph-based intelligent question-answering method, characterized in that, Includes the following steps: Building a knowledge graph using a knowledge base: Based on an existing small-scale military type database, identify entities and relationships between entities in the database, and build a knowledge graph based on the document-oriented database MongoDB; Given a natural language problem, use a Trie tree to store entity database information and perform entity retrieval based on the AC automaton algorithm; For entities that do not receive a match, we use the CBOW network in the Word2Vec algorithm to perform fuzzy matching of entities; then, we use an exhaustive approach based on relation templates to identify the issues involved in natural language problems, and achieve the correspondence and pairing between entities and query attribute items. Based on the entities and relationships returned in the question, the query is converted into a MongoDB SQL query statement and used as the structured query language for question-and-answer search. This query is then input into the MongoDB database, and the query results are returned. The objective function of the CBOW network model is as follows: For the current word The goal is its context. The objective function is set to predict the possible words in the text, and the objective function is set to the following log-likelihood function form: Following the Hierarchical Softmax concept, the CBOW model defines it as: In the CBOW model, Written as a whole expression: Substituting into the objective function and simplifying the logarithmic operation, we get: To further simplify: Thus, the objective function of the CBOW model is obtained.
2. The knowledge graph-based intelligent question-answering method for intelligence according to claim 1, characterized in that, Building a relational template library involves creating templates from the widest possible range of input questions and adding them to the library to achieve efficient question answering.
3. The knowledge graph-based intelligent question answering method for intelligence as described in claim 1, characterized in that, Use gradient-based algorithms for parameter updates: First calculate right gradient: therefore, The update formula is written as: The learning rate; Similarly, based on the property of symmetry, we can calculate... right gradient: The update formula is: 。 4. The knowledge graph-based intelligent question-answering method for intelligence according to claim 3, characterized in that, After obtaining the word vector of the entity name using the Word2Vec algorithm, the word vectors of other candidate synonyms and domain words are also obtained. After calculating the Euclidean distance between the two, the judgment is made according to the set distance threshold, and the top eight candidate synonyms with the highest similarity are recorded to achieve fuzzy matching of entities not in the entity name database.
5. The knowledge graph-based intelligent question-answering method for intelligence according to claim 1, characterized in that, The design includes a relational template library with various templates and their corresponding database search statements for accurate matching of questions.