A military question-answering method and system based on language large model

By constructing a military knowledge vector library and combining graphic information, the problem of difficulty in iteration and reasoning of traditional question-and-answer systems is solved, and a quick and accurate answer to military problems is achieved.

CN118839008BActive Publication Date: 2024-12-24XIAMEN YUANTING INFORMATION TECH CO LTD
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202411321455.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-24
Estimated Expiration
2044-09-23

AI Technical Summary

Technical Problem

Traditional intelligent question-and-answer systems are difficult to iterate and reason about the answers to military questions repeatedly, and cannot combine pictures to help users understand the answers, and it is difficult to quickly and accurately update the knowledge base to give specific answers.

Method used

By obtaining military domain knowledge data, a knowledge vector library is built, the questions are encoded and mapped into the library, the scope of the question is reduced according to the keywords, candidate answers are constructed and labeled and fused, the final answer is generated, and the answer is provided through the combination of pictures and texts.

Benefits of technology

Accurate and quick answers to military questions are achieved, enhancing the comprehensibility and reliability of answers, and ensuring the accuracy and reliability of answers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118839008B_ABST
    Figure CN118839008B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of reasoning question answering, and discloses a military question answering method and system based on a language large model. The military question answering method acquires military field knowledge data and constructs a knowledge vector library by classification; vector codes input military questions and maps them to a pre-constructed knowledge vector library; performs correlation pairing according to prompt words of the military questions, and gradually narrows the scope of the questions; constructs multiple groups of candidate answers according to the questions after the narrowing of the scope, aligns and annotates the multiple groups of candidate answers with question keywords, merges the multiple groups of answers after alignment and annotation, and iterates the merged answers; globally searches for corresponding image data according to the content of the changed answers, and generates the final answer by combining pictures and texts, so that the initially generated answers can be repeatedly iterated and inferred according to the question keywords, and the picture data is used to assist users to understand the answer content more easily, thereby ensuring the accuracy and reliability of the given answers.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of reasoning question answering, and in particular to a military question answering method and system based on a large language model. Background Art

[0002] In recent years, with the rapid development of artificial intelligence technology, especially the successful application of large language models in various natural language processing tasks, military intelligent question answering has also gained new development opportunities. Through large language models, military intelligent question answering can quickly give corresponding answers based on questions expressed in natural language, but traditional intelligent question answering systems usually have defects. They find it difficult to accurately give specific answers by repeatedly iterating and reasoning about the answer to a question, and they do not combine pictures to help users understand the answer content more easily. In addition, after each military question is answered, it is difficult for traditional intelligent question answering systems to update the knowledge base and add new definitions to the knowledge vector based on the content of the previous question answer, making it difficult for traditional question answering systems to quickly and accurately give specific answers that can solve the problem, and they do not combine pictures to make it easier for users to understand the answer content.

[0003] Therefore, the present invention obtains military knowledge data and constructs a knowledge vector library by classification; vector codes the input military questions and maps them to the pre-constructed knowledge vector library; pairs them according to the prompt words of the military questions, gradually narrows the scope of the questions, and then determines the direction of the next experimental operation;

[0004] Then, three sets of candidate answers are constructed based on the narrowed questions, and the three sets of candidate answers are aligned and labeled with the question keywords; the three sets of answers after alignment and annotation are merged, and the merged answers are iterated to generate the final answer for relevant research.

[0005] To sum up, how to answer military questions more accurately and quickly is an issue that needs to be urgently solved and optimized in the military question-answering system based on the large language model. Summary of the invention

[0006] The present invention provides a military question-answering method and system based on a large language model, which solves the technical problem in related technologies that it is difficult to answer military questions more accurately and quickly.

[0007] In order to solve the above technical problems, the present invention provides a military question-answering method and system based on a large language model. The specific technical solution is as follows:

[0008] In the first aspect, a military question answering method based on a large language model comprises the following steps:

[0009] Acquire knowledge data and classify and construct a knowledge vector library, which specifically includes: segmenting the acquired knowledge text information Et by setting the sentence length threshold K, extracting the sentence meaning of the segmented text information Et, and then embedding the sentence meaning of the text information Et into VQGAN to generate the corresponding image data Ei, and making the sentence meaning pass , where concat[] is an operator, which represents the concatenation operation of text information and image data, Etext(t) represents the features extracted from text t, and Etext(I) represents the features extracted from image I, so that the text information Et and image data Ei are mapped to the same space and associated by similarity;

[0010] Encode the input question into a vector and map it to a pre-built knowledge vector library;

[0011] Pair questions based on key words and gradually narrow the scope of questions;

[0012] Construct multiple sets of candidate answers based on the narrowed questions, align and annotate the multiple sets of candidate answers with the question keywords, merge the multiple sets of answers after alignment and annotation, and iterate the merged answers. Based on the content of the updated answers, search globally for the corresponding image data, and generate the final answer by combining pictures and texts.

[0013] Furthermore, knowledge data is obtained and classified to construct a knowledge vector library, including:

[0014] Acquire knowledge data through multiple channels and pre-process the knowledge data to obtain pre-processed data;

[0015] The text information Et in the preprocessed data is parsed, and image data Ei is generated according to the parsing results, and collected and organized into an image set;

[0016] Then, the classification base point is set according to the keywords of the context segment retained by the text information Et; and the military data is classified using the classification base point to obtain multiple types of military data;

[0017] Based on the preset classification rules and taking the keywords of the text as the classification basis, the knowledge data in the military field is classified and sorted;

[0018] Vectorize various types of data to build a knowledge vector library.

[0019] Furthermore, the text information Et in the preprocessed data is parsed into segments, and image data Ei is generated according to the segment parsing results, and collected and organized into an image set, including:

[0020] Set the sentence length threshold K to segment the text information Et and express it as: ; where SN is the Nth segment segmented, Indicates the segmentation point and obtains the segmentation data through dependency grammar analysis;

[0021] The segmented data is scanned for character recognition and semantic correction, and the sentence keywords of the extracted segmented data are used to obtain the sentence meaning based on the sentence keywords. The sentence meaning is embedded in VQGAN to generate image data Ei, which is then collected and organized into an image set.

[0022] Furthermore, the input question is vectorized and mapped to a pre-built knowledge vector library, including:

[0023] Input questions based on the knowledge vector library and extract question keywords to embed representation vectors;

[0024] Encode each representation vector to obtain an encoding vector;

[0025] Integrate the encoding vectors and map them into the knowledge vector library to obtain the corresponding vectors;

[0026] Obtain pre-generated image data Ei from the image set according to the corresponding vector content;

[0027] The keyword content of each extracted question is entered into the knowledge vector library to form a newly defined knowledge vector.

[0028] Furthermore, each extracted question keyword content is entered into the knowledge vector library to form a newly defined knowledge vector, including:

[0029] The extracted keywords are represented as w1, w2, ..., wi, and the corresponding word embedding vectors are represented as v1, v2, ..., vi. Then the question encoding vector q is expressed as: ;Where n is the number of keywords;

[0030] The newly input question keyword vector q is entered into the knowledge vector library. If there is a knowledge vector St with similar content in the knowledge vector library, the existing knowledge vector St is updated, which specifically includes:

[0031] Define cosj(a, b) as the similarity between the two vectors q and St, with a value range of [-1, 1]. The similarity between individual positions is: ; In the formula, the numerator is the inner product of vectors a and b, and the denominator is the product of the moduli of vectors a and b. The larger the coefficient of cosj (a, b), the easier it is for vectors q and St to overlap. At this time, through: ; In the formula, represents the qth question keyword in the tth iteration, that is, the current question vector q; represents a knowledge vector in the knowledge vector library of the t-th iteration; g* belongs to the position of the optimal knowledge vector in the t-th generation; and are the fitness values ​​of q and St respectively; α is the rotation factor; Rr is a random matrix whose elements are uniformly distributed in [-1, 1]; n||||2 is the 2-norm of the vector, δ is the iteration threshold, Re is the iteration element with a value of [0, 1], at this time, the position of q is rotated to any position with a radius of α, and the newly entered question vector q and the existing vector St in the knowledge vector library are updated to form a newly defined knowledge vector;

[0032] pass: ; In the formula, w is the weight, r represents the iteration index, and fi is the fitness of the i-th knowledge vector after iteration, thereby performing subsequent global phased searches on the updated knowledge vector library.

[0033] Furthermore, we matched the questions based on their keywords and gradually narrowed down the scope of the questions, including:

[0034] The code vector obtained from the military problem is obtained by ; Where P is the encoding vector, K is the knowledge base vector, ||P|| and ||K|| are the modulus vectors of P and K respectively, to obtain the overlap of the encoding vector in the vector library;

[0035] Obtaining a coincidence vector set according to the coincidence degree, and ranking the coincidence vector set to obtain a high coincidence vector set;

[0036] The obtained high-coincidence vector set is paired with the corresponding vectors in the knowledge vector set one by one to reduce the knowledge scope of military issues.

[0037] Furthermore, a coincidence vector set is obtained according to the coincidence degree, and the coincidence vector set is hierarchically sorted to obtain a high coincidence vector set, including:

[0038] Capture several similar vectors in the knowledge base according to the degree of overlap, and arrange the several similar vectors in order of degree of overlap;

[0039] Based on the similar vectors after hierarchical arrangement, a coincidence threshold G is set. When the actual coincidence exceeds this threshold G, it means that the coincidence of the two vectors is in line with expectations, thereby screening out vectors with high coincidence;

[0040] The multiple screened vectors are integrated to obtain a set of highly coincident vectors.

[0041] Furthermore, multiple sets of candidate answers are constructed based on the narrowed questions, the multiple sets of candidate answers are aligned and annotated with the question keywords, and the multiple sets of answers after alignment and annotation are merged, and the merged answers are updated, and the corresponding image data is globally searched according to the updated answer content, and the final answer is generated by combining the image and text, including:

[0042] Define the scope based on the keywords of the question and remove redundant information to determine the scope of the question;

[0043] Based on the scope of the question, construct multiple sets of candidate answers based on different interpretations, viewpoints and information sources of the keywords, and each set of answers should be constructed around a specific direction of the keyword of the question;

[0044] Highlight each candidate answer and clearly indicate which part of the answer corresponds to the key words in the question;

[0045] The contents of multiple sets of highlighted answers are fused after being changed several times, and the image data of the corresponding knowledge vectors are searched for according to the fused contents to generate the final answer combining pictures and texts.

[0046] In a second aspect, the system provides an electronic device including a memory, a processor, and a military question and answer method program based on a large language model stored in the memory and executable on the processor, wherein the military question and answer method program based on a large language model implements the steps of a military question and answer method based on a large language model when executed by the processor.

[0047] In the third aspect, a military question-answering system based on a large language model includes:

[0048] Knowledge acquisition module: It is used to acquire military knowledge data and classify and construct a knowledge vector library;

[0049] Vector encoding module: It is used to vector encode the input military questions and map them into the pre-built knowledge vector library;

[0050] Question processing module: It is used to match the prompt words of military questions and gradually narrow the scope of questions;

[0051] Answer generation module: It is used to construct multiple sets of candidate answers based on the narrowed questions, align and annotate the multiple sets of candidate answers with the question keywords, merge the multiple sets of answers after alignment and annotation, and iterate the merged answers. According to the updated answer content, the corresponding image data is searched globally, and the final answer is generated by combining pictures and texts.

[0052] Compared with the prior art, the present invention has the following beneficial effects:

[0053] The above scheme of the present invention obtains military knowledge data and constructs a knowledge vector library by classification; vector encodes the input military questions and maps them to the pre-constructed knowledge vector library; pairs them according to the prompt words of the military questions and gradually narrows the scope of the questions, so that while matching the question keywords, the corresponding vectors in the knowledge vector set are updated in real time with the information of the question keywords and added to the knowledge vector library, laying the foundation for facilitating subsequent global searches to accurately and quickly generate answers.

[0054] And gradually narrow the scope of the question, build multiple sets of candidate answers based on the narrowed scope of the question, align and annotate the multiple sets of candidate answers with the question keywords, merge the multiple sets of answers after alignment and annotation, and iterate the merged answers. According to the updated answer content, globally search for the corresponding image data, and generate the final answer by combining pictures and texts, to assist users to understand the answer content more clearly and intuitively, so that the preliminary answers can be repeatedly iterated and inferred against the question keywords, more accurately locate the core of the military problem and give the final answer, to ensure the accuracy and reliability of the answer. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] The accompanying drawings are used for further understanding of the present invention and are used to explain the present invention together with the embodiments of the present invention, but do not constitute a limitation of the present invention.

[0056] Figure 1 It is a flow chart of a military question-answering method based on a large language model provided by an embodiment of the present invention;

[0057] Figure 2 It is a schematic diagram of a military question-answering system based on a large language model provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0058] The subject matter described herein will now be discussed with reference to example implementations. It should be understood that the discussion of these implementations is only to enable those skilled in the art to better understand and implement the subject matter described herein, and the functions and arrangements of the elements discussed may be changed without departing from the scope of protection of the present specification. Various examples may omit, replace, or add various processes or components as needed. In addition, the features described in some examples may also be combined in other examples.

[0059] In order to better understand the above technical scheme, the technical scheme of the present invention will be described in detail below in conjunction with the accompanying drawings and specific implementation methods of the specification. It should be pointed out that the above steps are only a preferred implementation order. In the specific implementation process, some steps can be replaced without affecting the overall implementation effect. In order to more clearly explain the technical scheme of this application, the following content explains this scheme in a preferred manner.

[0060] like Figure 1 As shown, the present invention provides a military question answering method based on a language large model, comprising the following steps:

[0061] Step 1: Acquire knowledge data and classify and construct a knowledge vector library, which specifically includes: segmenting the acquired knowledge text information Et by setting the sentence length threshold K, extracting the sentence meaning of the segmented text information Et, and then embedding the sentence meaning of the text information Et into VQGAN to generate the corresponding image data Ei, and making the sentence meaning pass , where concat[] is an operator, which represents the concatenation operation of text information and image data, Etext(t) represents the features extracted from text t, and Etext(I) represents the features extracted from image I, so that the text information Et and image data Ei are mapped to the same space and associated by similarity;

[0062] Step 2: vectorize the input question and map it to the pre-built knowledge vector library;

[0063] Step 3: Pair questions based on keywords and gradually narrow the scope of questions;

[0064] Step 4: Construct multiple sets of candidate answers based on the narrowed questions, align and annotate the multiple sets of candidate answers with the question keywords, merge the multiple sets of answers after alignment and annotation, and iterate the merged answers. Based on the content of the updated answers, globally search for the corresponding image data, and generate the final answer by combining the image and text.

[0065] In a preferred embodiment of the present invention, data is extracted from public military databases, documents, reports and intelligence materials according to step 1. These data cover military equipment, tactics and strategies, historical battle examples and other aspects. Knowledge data in the military field is collected from multiple channels, specifically including:

[0066] Public documents: academic papers, military monographs, technical reports, etc.;

[0067] Professional databases: such as military databases, Ministry of National Defense databases, etc.;

[0068] Intelligence report: intelligence analysis report issued by national security agencies;

[0069] News and media: military news, analytical articles, etc.;

[0070] Forums and communities: military enthusiasts forums, professional discussion communities.

[0071] This ensures that the data covers multiple forms such as text, images, and videos to improve the richness and comprehensiveness of knowledge. At the same time, the acquired data is cleaned to remove redundant and irrelevant information to ensure data quality and consistency. The data is classified by subject or field (such as air force, navy, army, tactics and strategy, etc.) and vectorized to build a knowledge vector library. The orderly classification to build a knowledge vector library can quickly respond to query requests and greatly improve data retrieval efficiency. At the same time, fine classification makes relevance matching more accurate, which is helpful for accurate answers to questions in subsequent steps. Then, through step 2, the input military question keywords are passed ; In the formula, a sentence is set through the language model The probability of each keyword in , where wt is the keyword at time step t, and Given the previous keywords, the probability of the nth keyword is converted into a vector representation through t iterations, so that the problem keyword vector P is mapped with the knowledge vector St in the knowledge vector library constructed in step 1 to find the knowledge items most relevant to the problem. Vectorization processing enables the system to better understand complex military issues, and through vector mapping, the system can quickly locate relevant knowledge areas, thus laying the foundation for solving problems.

[0072] Then, according to step 3, key prompt words are extracted from the question vector. These prompt words usually have military-specific meanings, such as tactical terms, equipment models, etc. The prompt words are correlated with the entries in the knowledge vector library to identify the knowledge points closely related to the question. By excluding low-relevance or secondary prompt words, the discussion scope of the question is gradually reduced to focus on the core issue. Relevance pairing and problem scope reduction help the system accurately identify the core of the problem and avoid information overload. By reducing the scope of the problem, the calculation complexity is reduced and the execution efficiency of subsequent steps is improved.

[0073] Then, in step 4, based on the scope of the question narrowed down in step 3, the system generates three possible answers. These answers can be generated by searching for relevant knowledge items, applying military rules, or referring to historical experience. The key content in the candidate answers is aligned and annotated with the prompt words of the question to ensure the high relevance of the candidate answers to the question. By generating multiple candidate answers, a variety of choices are provided, which helps to improve the accuracy of the final answer. Through keyword alignment, the candidate answers are ensured to be closely centered around the core of the question and avoid deviation from the topic. Finally, the three groups of candidate answers are merged, and corresponding image data is generated according to the content of the three groups of answers, so as to assist users to understand the content of the given answers more easily. By comprehensively considering the advantages of each group of answers, a more complete answer is formed. The merged answer is optimized and adjusted, redundant or contradictory information is eliminated, and the logic and consistency of the answer are ensured. The changed answer is determined as the final answer and provided to the user. The process of merging multiple answers ensures that the final answer is more comprehensive and covers all key points of the question, thereby ensuring the high accuracy and relevance of the final answer and providing the best answer.

[0074] In a preferred embodiment of the present invention, the above step 1 further includes:

[0075] Step 11, acquiring knowledge data through multiple channels, and preprocessing the knowledge data to obtain preprocessed data;

[0076] Step 12, parsing the text information Et in the preprocessed data into segments, generating image data Ei according to the segment parsing results, and collecting and organizing them into an image set;

[0077] Step 13, setting classification base points according to the keywords of the context segment retained by the text information Et; and classifying the military data using the classification base points to obtain multiple types of military data;

[0078] Step 14, based on the preset classification rules and taking the text keywords as the classification basis, classify and organize the knowledge data in the military field;

[0079] Step 15, vectorize various types of military data to build a military knowledge vector library.

[0080] In an embodiment of the present invention, according to step 11, military knowledge corpus is obtained through various channels, including public databases, academic papers, government work reports, intelligence materials, news media, technical manuals and social media, etc., so that the corpus obtained covers military data in various forms such as text, images, videos, audios, etc., to ensure comprehensive coverage of different types of information. At the same time, the latest military data is regularly collected to maintain the timeliness and accuracy of the knowledge base. Through multi-channel and multi-form data acquisition, it is ensured that a wide range of military information is covered, thereby providing rich materials for subsequent analysis, and by regularly updating the data, the knowledge base can reflect the latest military dynamics and technological developments, and provide the latest information support for decision-making; then the collected raw data is cleaned to remove noise, redundant information and format errors to ensure the cleanliness and consistency of the data; and the multi-form data (such as text, images, videos, etc.) is converted into a unified format for subsequent processing. This may include text standardization, image resolution adjustment, audio editing, etc., labeling the pre-processed data, and adding metadata (such as date, source, content category, etc.) to facilitate subsequent data classification and retrieval. The pre-processing steps significantly improve the quality and consistency of the data, reduce errors and redundancy, and lay a solid foundation for subsequent analysis. The unified data format helps to improve the efficiency and accuracy of subsequent processing, which is especially important when processing multi-form data.

[0081] Then, according to step 12, the text data preprocessed in step 11 is parsed to extract key information, such as people, places, events, equipment models, and text data (such as images, scanned documents, etc.). ; In the formula, I is the input text data; φ(I) is the feature extraction function; the input text data I is converted into a feature vector; xi is the feature vector of the training sample; K(φ(I), φ(xi)) is the kernel function used to calculate the similarity in the feature space; αi is the Lagrange multiplier; yi is the label of the training sample; b is the bias term coefficient; f(x) is the extraction result; the text information is extracted and converted into parsable text content. Through parsing and recognition, the base points for data classification are extracted, that is, the core themes or categories of this information (such as military branches, war zones, tactical categories, etc.). Text parsing ensures that useful text information is extracted from multi-form data, laying the foundation for subsequent classification. By obtaining the classification base points, the system can classify the data more specifically, which helps to improve the accuracy and effectiveness of classification. According to the results of sentence parsing, the key elements describing the scene are extracted, such as military problem objects, military types or military scenes, functional uses, time, place, method, etc. According to the text information description, VQGAN is used to convert the text information into corresponding image data;

[0082] In this embodiment, step 12 specifically includes:

[0083] Step 121, set the sentence length threshold K to segment the text information Et, and express: ; where SN is the Nth segment segmented, Indicates the segmentation point and obtains the segmentation data through dependency grammar analysis;

[0084] Step 122, scan the segmented data for character recognition and semantic correction, extract the sentence keywords of the segmented data, obtain the sentence meaning according to the sentence keywords, and embed the sentence meaning into VQGAN to generate image data Ei, and collect and organize it into an image set.

[0085] Specific description: When setting the text information sentence length threshold K in step 121, firstly, according to the requirements of the target analysis, a suitable sentence length threshold K is set, and then according to: , so that the threshold K determines the granularity of the text when it is segmented, that is, the number of words contained in a sentence or fragment after segmentation. Usually, this threshold K will be numerically adjusted according to the characteristics of the domain and the specific application scenario to ensure that each segmented text fragment has sufficient semantic information for subsequent processing. According to the set threshold K, the long text information is segmented into multiple shorter fragments or sentences. When the sentence exceeds this threshold K, it will be further segmented into smaller fragments, which helps to reduce complexity and improve the accuracy of processing. Dependency grammar analysis is performed on the segmented text fragments. Dependency grammar analysis is an analysis method based on the internal grammatical structure of the sentence. By establishing dependency relationships between words (such as subject, predicate, object, etc.), a dependency tree or dependency graph is constructed to reveal the semantic structure and logical relationship within the sentence, thereby improving processing efficiency and accuracy: by setting the length threshold K, the amount of data processed each time can be reasonably controlled, thereby improving the overall processing speed and efficiency of the system. At the same time, reasonable segmentation ensures that each segment contains sufficient semantic information, reducing the risk of information loss. Dependency grammar analysis can identify and reveal the complex relationship between words in a sentence, thereby providing stronger support for subsequent semantic understanding and information extraction; then, through step 12, the information in the text data (such as pictures, scanned documents, etc.) is converted into an editable text format. And it can extract text information from the image, so that these originally non-editable data can enter the subsequent text processing process. Through character recognition, errors (such as wrong characters, missing characters, punctuation errors, etc.) are identified. Therefore, it is necessary to perform semantic correction on the recognition results. At the same time, semantic correction mainly automatically corrects errors that occur during the recognition process through understanding the semantics of the context to ensure the accuracy of the text. If the recognized text has unreasonable vocabulary or sentence structure in the context, the system will adjust and correct it based on the context, so that the text is converted into an editable text format, which greatly expands the data source. Through semantic correction, it is ensured that the recognized text is semantically reasonable and accurate, reducing the impact of erroneous information on subsequent processing. Then, the meaning of the adjusted and corrected text information segments is entered into VQGAN to generate images to help users understand the content of the given answer more easily.

[0086] Then, step 13 is used to extract the keywords that best represent the content of each paragraph. The keywords can summarize the core content of the paragraph, which is convenient for subsequent analysis and classification. At the same time, in order to retain the connection between the contexts, the keywords of each paragraph are sequenced and expanded to ensure that the keywords of adjacent paragraphs have a certain degree of overlap, and these overlaps can be achieved by retaining a part of the keywords at the segmentation boundary. The most relevant keywords in the context are selected through semantic similarity. For overlapping keywords, the system will further analyze the correlation between them and enhance the semantic links of the keywords in the paragraphs through the semantic network, which will help to ensure that semantically related content is more accurately associated and classified in subsequent classification and information retrieval. Through the sequence expansion of keywords, the system can still retain the semantic association of the context while segmenting the paragraphs, prevent information fragmentation, and strengthen the association between keywords, which will help to improve the accuracy of information classification and retrieval in subsequent steps, and ensure that the system's understanding of the content is more coherent and accurate.

[0087] Then, in step 14, according to the classification base points extracted in step 13, classification rules and standards are set to classify the pre-processed military data, and the data are classified into preset categories according to the content involved: air force, army, navy, strategy and tactics, weapons and equipment; on the basis of the system automatically classifying the acquired military data, military experts review it to ensure the accuracy of the classification, especially manual adjustment of difficult-to-classify or important data; thus, through classification, the original complex data becomes structured, which is convenient for retrieval and use, and the automatic classification combined with manual review greatly improves the accuracy and reliability of the classification, ensuring the high quality of the classified data.

[0088] Finally, step 15 converts the classified military data into vector representation based on step 14, and uses each document to be represented as a word frequency vector in a fixed-size vocabulary. By constructing a vocabulary, military terminology is summarized according to the content in the text information data, and duplicates are removed to form a vocabulary, and then ; Wherein, dj is the word frequency vector of document d; V = {w1, w2, …, wm} is a vocabulary containing m words; f(wm, dj) is the number of occurrences of word wm in document dj; the vectorized data is then stored in the military knowledge vector library, and each data category forms an independent vector space for subsequent retrieval and matching. The constructed vector library is optimized, including vector compression and index construction, to ensure that the system can quickly retrieve and match relevant information; the vectorized data can quickly perform similarity calculations in the vector space, thereby achieving efficient knowledge retrieval and matching, and the vector library integrates various types of military data into a unified system for comprehensive analysis and decision support.

[0089] In a preferred embodiment of the present invention, the above step 21 may include:

[0090] Step 21, input the question based on the knowledge vector library, and extract the question keyword embedding representation vector;

[0091] Step 22, encoding each representation vector to obtain an encoding vector;

[0092] Step 23, integrating the encoding vectors and mapping them to the knowledge vector library to obtain corresponding vectors;

[0093] Step 24, obtaining pre-generated image data Ei from the image set according to the corresponding vector content;

[0094] Step 25, entering the question keyword content extracted each time into the knowledge vector library to form a newly defined knowledge vector.

[0095] In the embodiment of the present invention, the knowledge vector database pre-built in step 1 contains a large amount of military-related knowledge, and each piece of knowledge is converted into a vector form. The vectorized representation enables the computer to process and retrieve this knowledge more effectively. Then, a military question is input in step 21, and the system analyzes the question and extracts the keywords therein. The keyword extraction process includes word segmentation, part-of-speech tagging, and named entity recognition. The extracted keywords are converted into embedded vectors, usually using ; Where Xij is the number of co-occurrences of words i and j, Pij is the co-occurrence probability, f() is the weight function, vi and vj are the word vectors of words i and j, bi and bj are the bias terms of words i and j respectively, and |V| is the vector coefficient (positive integer). Generate these vectors. Embedding vectors are points in a high-dimensional space that can capture the semantic information of keywords, making semantically similar words close to each other in the vector space. By converting the problem keywords into vectors, the system can better understand the semantics of the problem, and these vectors can retain the subtle differences between words, improving the accuracy of subsequent processing, and the keyword embedding vectors lay the foundation for the retrieval of relevant knowledge in subsequent steps, enabling the system to quickly find relevant content in a huge knowledge base. The embedding vector generated in step 21 is further encoded through step 22. Encoding usually involves processing the original embedding vector through a neural network (such as an encoder) to generate a new, more semantically characteristic vector. This step may involve nonlinear transformation of multi-layer neural networks, aiming to extract higher-level semantic features. The encoded vectors are called encoded vectors, which retain the core semantic information of the original question and may enhance the matching degree with the vectors stored in the knowledge base. The encoding process may also include dimensionality reduction or regularization steps to ensure the computational efficiency and stability of the vectors in subsequent processing, so that through encoding, the system can extract more representative semantic features, which help to more accurately match related knowledge vectors, so that the encoded vectors are optimized and more suitable for fast calculation and matching, and improve the efficiency of subsequent vector mapping steps.

[0096] After obtaining the encoding vector according to step 23, it is matched with the vector in the military knowledge vector library. This process usually adopts a vector similarity calculation method, such as cosine similarity, Euclidean distance, etc. By calculating the similarity between the encoding vector and each vector in the knowledge base, the system can find the knowledge vector most relevant to the input question, so that the system selects one or more knowledge vectors with the highest similarity to the encoding vector as the corresponding vector. These corresponding vectors represent the knowledge points in the knowledge base that are most relevant to the user input question, and through vector mapping, the system can quickly locate the knowledge points that are most relevant to the input question in the huge knowledge base, laying the foundation for subsequent knowledge redefinition, and using correlation mapping to ensure that the retrieved knowledge vector is highly semantically relevant to the input question, enhancing the system's ability to understand and respond to the question; based on step 23, the meaning of the segmented text information sentence segment is entered into VQGAN and converted into a corresponding image through step 24, and the color and contour of the image are refined and repaired, and the image is retrieved through multiple channels outside the system to ensure the accuracy and authenticity of the image.

[0097] Image retrieval system: retrieve images from the image database based on keywords, descriptors or content; finally, through step 25, based on the corresponding vectors obtained in step 23, the system will redefine these vectors in combination with the keywords in the input question. The redefinition process may involve fine-tuning the original vectors to better reflect the semantic requirements of the input question. By adjusting the dimensions of the vectors, after redefinition, the system generates one or more newly defined knowledge vectors. These vectors not only reflect the information in the original knowledge base, but also integrate the unique semantic features of the input question. The newly defined knowledge vectors will be retained and added to the existing knowledge vector library. This process ensures the dynamic update and self-improvement of the knowledge base, so that it can become more intelligent and comprehensive as user interactions increase. Through keyword-driven redefinition, the system can flexibly adjust and generate new knowledge vectors, so that the knowledge base can respond to user needs more accurately. While retaining the original definition, the newly defined knowledge vectors enable the knowledge base to self-learn and expand, and continuously improve its ability to handle various complex problems over time.

[0098] In a preferred embodiment of the present invention, the above step 25 includes:

[0099] First, keywords are extracted from a given text or question. These keywords are used to represent the core concepts or themes of the text. The weight of the keyword is determined by calculating the frequency of the word in the document and its rarity in the entire document set. Then, meaningful entities in the text, such as names of people, places, organizations, etc., are identified. At the same time, they are used to discover potential topics from the document set. The words are then mapped to a high-dimensional vector space so that words with similar semantics are close to each other in the vector space.

[0100] According to the input military question, the definition of keyword vector is adjusted. In this case, the vectors of multiple keywords need to be combined and they can be weighted averaged. The weight can be based on the importance of the keyword or its relevance to the question.

[0101] Integrate the redefined vector into the existing knowledge vector, including:

[0102] Concatenate the newly defined vector with the original knowledge vector to form an extended vector representation: , where is the original knowledge vector, and Vnew is the new vector obtained by keyword extraction and redefinition; when the newly defined vector is merged with the original knowledge vector: , where α is a parameter that balances the importance of the two vectors. Finally, the updated knowledge vector is saved in the knowledge base for subsequent reasoning or query use.

[0103] In a preferred embodiment of the present invention, the above step 25 further comprises:

[0104] Step 251, the extracted keywords are represented as w1, w2, ..., wi, and the corresponding word embedding vectors are represented as v1, v2, ..., vi, then the question encoding vector q is represented as: ;Where n is the number of keywords;

[0105] Step 252, enter the newly input question keyword vector q into the knowledge vector library. If there is a knowledge vector St with similar content in the knowledge vector library, update the existing knowledge vector St, which specifically includes:

[0106] Define cosj(a, b) as the similarity between the two vectors q and St, with a value range of [-1, 1]. The similarity between individual positions is: ; In the formula, the numerator is the inner product of vectors a and b, and the denominator is the product of the moduli of vectors a and b. The larger the coefficient of cosj (a, b), the easier it is for vectors q and St to overlap. At this time, through: ; In the formula, represents the qth question keyword in the tth iteration, that is, the current question vector q; represents a knowledge vector in the knowledge vector library of the t-th iteration; g* belongs to the position of the optimal knowledge vector in the t-th generation; and are the fitness values ​​of q and St respectively; α is the rotation factor; Rr is a random matrix whose elements are uniformly distributed in [-1, 1]; n||||2 is the 2-norm of the vector, δ is the iteration threshold, Re is the iteration element with a value of [0, 1], at this time, the position of q is rotated to any position with a radius of α, and the newly entered question vector q and the existing vector St in the knowledge vector library are updated to form a newly defined knowledge vector;

[0107] Step 253, by: ; In the formula, w is the weight, r represents the iteration index, and fi is the fitness of the i-th knowledge vector after iteration, thereby performing subsequent global phased searches on the updated knowledge vector library.

[0108] In the embodiment of the present invention, according to the above-mentioned updating of the knowledge vector St by the input question vector q, a search strategy needs to be introduced: ; In the formula, Pit is the switching probability of the position of the i-th newly defined knowledge vector in the t-th iteration; Pmin and Pmax represent the maximum and minimum values ​​of the switching probability respectively; fmin represents the best fitness in the t-th iteration; fit is the fitness of the i-th newly defined knowledge vector individual in the t-th iteration, and log() is the search derivative function. When the fitness corresponding to the newly defined knowledge vector individual is close to the current optimal individual fitness, its switching probability is close to the maximum value, and it is easier to enter the global guidance; on the contrary, when the fitness of the current newly defined knowledge vector individual is significantly different from the best fitness, its switching probability is close to the minimum value, and it is easier to enter the local guidance. This is conducive to using good individuals to guide the global, and poor individuals get more local guidance opportunities.

[0109] And through: ; Where K is the adjusted sigmoid function, w is the search weight, and exp() is the coordinated search derivative function, thereby coordinating the search ability of the search strategy.

[0110] In another preferred embodiment of the present invention, it may specifically include:

[0111] Capture several similar vectors in the knowledge base according to the degree of overlap, and arrange the several similar vectors in order of degree of overlap;

[0112] Based on the similar vectors after hierarchical arrangement, a coincidence threshold G is set. When the actual coincidence exceeds this threshold G, it means that the coincidence of the two vectors is in line with expectations, thereby screening out vectors with high coincidence;

[0113] The multiple screened vectors are integrated to obtain a set of highly coincident vectors.

[0114] In an embodiment of the present invention, the overlap between the system input vector and all vectors in the knowledge base is first calculated. The overlap can quantify the similarity between two vectors in the vector space. According to the overlap calculation result, the system captures several vectors in the knowledge base that are highly similar to the input vector. These similar vectors are semantically close to the input vector and represent related knowledge points. The captured similar vectors are hierarchically arranged according to the overlap. In the arranged vector list, vectors with higher overlap are ranked higher, indicating that they are more similar to the input vector. Through accurate identification of related knowledge: through overlap calculation and capturing similar vectors, the system can accurately identify the knowledge points most relevant to the input vector from the huge knowledge base, providing high-quality input for subsequent processing. The hierarchically arranged vector list enables the system to more effectively perform subsequent screening and processing steps, improving overall processing efficiency and accuracy.

[0115] Then, according to the similar vectors after hierarchical arrangement, by setting a coincidence threshold G, when the actual coincidence exceeds this threshold G, it means that the coincidence of the two vectors is in line with expectations, thereby screening out vectors with high coincidence, and the system sets a coincidence threshold G for screening out vectors with high coincidence. This threshold G is usually set according to the specific application scenario and the requirements for similarity to ensure that the screened vectors are highly semantically related, and the similar vectors after hierarchical arrangement in step 221 are screened. When the coincidence of similar vectors exceeds the set threshold G, the system considers that the degree of coincidence of these vectors is in line with expectations, retains these vectors with high coincidence, and excludes vectors with a coincidence lower than the threshold G, because these vectors have low similarity with the input vector and do not meet the screening criteria. By setting the coincidence threshold G, the system can screen out vectors that are highly semantically related, ensure the accuracy and effectiveness of subsequent processing, exclude vectors with low coincidence, avoid irrelevant or noise information interfering with the system's processing process, and improve the quality of knowledge extraction.

[0116] Finally, the screened high-overlapping vectors are integrated. The integration process may involve weighted averaging of vectors, vector superposition, or using clustering algorithms to merge similar vectors into a representative vector. This process aims to generate one or more vector sets that integrate the information of high-overlapping vectors. The integrated vector sets retain the core semantic features of the original similar vectors while eliminating redundant information, making these vector sets more representative and processable. The integrated high-overlapping vector sets integrate the information of multiple similar vectors, providing a more comprehensive and accurate semantic representation, which is convenient for subsequent analysis and application. The integration of vectors reduces the redundant data processed by the system, improves processing efficiency, and ensures the high quality and accuracy of the vector sets.

[0117] In a preferred embodiment of the present invention, the above step 3 may include:

[0118] Step 31: Based on the code vector obtained from the military problem, ; Where P is the encoding vector, K is the knowledge base vector, ||P|| and ||K|| are the modulus vectors of P and K respectively, to obtain the overlap of the encoding vector in the vector library;

[0119] Step 32, obtaining a coincidence vector set according to the coincidence degree, and sorting the coincidence vector set in order to obtain a high coincidence vector set;

[0120] Step 33, pairing the acquired high overlap vector set with the corresponding vectors in the knowledge vector set one by one to reduce the scope of military problem knowledge.

[0121] In the embodiment of the present invention, firstly, the military question input by the user is encoded by the system through step 31 to generate a coding vector representing the question. The text data is converted into a vector form so as to be processed and matched in the vector space, and then the system is used to calculate the similarity between the coding vector and all the vectors in the vector library to determine the overlap between them. Commonly used overlap calculation methods include cosine similarity, Euclidean distance, etc. These methods can measure the similarity between vectors, so as to determine which knowledge vectors are most relevant to the input question. Through the overlap, the system can effectively evaluate the relevance between the input question and each knowledge point in the knowledge base. This precise matching can improve the system's understanding and processing capabilities of military issues. The overlap provides a screening standard for subsequent steps, so that the system can quickly and accurately retrieve relevant knowledge and improve processing efficiency.

[0122] Then, through step 32, based on the overlap calculated in step 31, the system collects all vectors whose overlap is higher than a certain set threshold to form an overlap vector set. This vector set contains the knowledge points that are semantically closest to the input military question, allowing the system to hierarchically sort the vectors in the overlap vector set. The sorting is based on the overlap. The higher the overlap, the closer the vector is to the semantics of the input question, and thus the higher it ranks in the sorting. This step ensures that the system prioritizes the most relevant knowledge points. Through overlap screening and sorting, the system can effectively screen out irrelevant information and only retain vectors that are highly relevant to the question, thereby improving processing accuracy. Hierarchical sorting enables the system to prioritize the most relevant knowledge and ensure timely processing and application of key information.

[0123] Finally, step 33 is used to pair the high overlap vector set obtained in step 32 with the vectors in the knowledge vector library one by one. The pairing process is usually completed through similarity matching, the purpose of which is to pair the knowledge points that are closest to the high overlap vector set. Then, through the pairing process, the system further reduces the scope of knowledge and only retains the knowledge points that are highly related to the high overlap vector set. In this way, the system can quickly lock the information most relevant to military issues in the huge knowledge base, narrow the scope of information processing, and for pairing one by one and reducing the scope of knowledge, the system can focus on the knowledge points most relevant to the input problem, thereby improving the accuracy and efficiency of information processing. This step effectively reduces the interference of redundant information in the processing process, ensures that the system only processes knowledge that is highly relevant to the input problem, and optimizes the utilization efficiency of resources.

[0124] In another preferred embodiment of the present invention, the above step 32 may include:

[0125] Step 321, capturing a number of similar vectors in the knowledge base according to the degree of overlap, and arranging the similar vectors in order of degree of overlap;

[0126] Step 322, based on the hierarchically arranged similar vectors, a coincidence threshold G is set. When the actual coincidence exceeds the threshold G, it means that the coincidence of the two vectors is in line with expectations, thereby screening out vectors with high coincidence.

[0127] Step 323, integrating the screened multiple vectors to obtain a high overlap vector set.

[0128] In an embodiment of the present invention, step 321 first inputs the degree of overlap between the vector and all vectors in the knowledge base, which is achieved through some mathematical models, such as cosine similarity, Euclidean distance, etc. These methods measure the similarity between the input vector and the vector in the library, thereby identifying the closest vector, and based on the degree of overlap obtained in step 2, the system captures a group of vectors similar to the input vector in the knowledge base. This step identifies the knowledge points that are semantically similar to the input vector by the degree of overlap, and arranges the captured similar vectors in a hierarchical manner according to the degree of overlap, with the vectors with higher overlap being ranked in front. This sorting process ensures that the system gives priority to the vectors that are most relevant to the input vector. Through the degree of overlap and hierarchical arrangement, the system can quickly and accurately identify and arrange the knowledge points that are most relevant to the input vector, laying a solid foundation for subsequent screening and processing. The results after hierarchical arrangement enable the system to process relevant information more efficiently, reduce the interference of irrelevant information, and improve the speed and quality of overall processing.

[0129] Then step 322 sets a coincidence threshold G to filter out vectors with high coincidence. This threshold is determined based on specific application scenarios or experimental data to ensure that the filtered vectors are highly correlated with the input vectors, so that the system can filter similar vectors after hierarchical arrangement and only retain those vectors with a coincidence higher than the threshold G. For all vectors exceeding this threshold, the system considers them to be highly semantically coincident with the input vector and therefore suitable for further processing. By setting the threshold G, the system can further filter out vectors with low correlation with the input vector and only retain highly correlated parts. This step greatly improves the accuracy and precision of the system processing. The screening process simplifies the processing tasks of subsequent steps, reduces the number of vectors that need to be considered, and optimizes resource usage.

[0130] Finally, step 323 integrates the high overlap vectors screened out in step 322. The integration method may include weighted averaging, vector superposition, or merging based on clustering algorithms. This process aims to generate a more representative and comprehensive set of high overlap vectors. Through integration, the system obtains one or more vector sets that integrate all high overlap vector features. This vector set condenses the key information of the original vector and has a higher semantic expression ability. The integration process merges multiple related information into one or more more representative vector sets, reduces redundant information, and retains the essence. This helps the system maintain high efficiency of information processing in complex tasks. By obtaining a high overlap vector set, the system can more accurately support decision-making and problem-solving processes, ensuring that the final output results are highly relevant and accurate.

[0131] In a preferred embodiment of the present invention, the above step 4 may include:

[0132] Step 41, defining the scope according to the problem keywords and removing redundant information to determine the scope of the problem;

[0133] Step 42, constructing multiple groups of candidate answers based on different interpretations, viewpoints and information sources of the keywords based on the scope of the question, and each group of answers should be constructed around a specific direction of the keyword of the question;

[0134] Step 43, highlighting and marking each group of candidate answers, clearly indicating that the part of the answer content corresponds to the key words in the question;

[0135] Step 44, multiple groups of highlighted and annotated answer contents are merged after being changed multiple times, and image data corresponding to the knowledge vectors are searched for based on the merged contents to generate a final answer combining images and texts.

[0136] In the embodiment of the present invention, core keywords are extracted from the input question through step 41. Keywords are usually words or phrases that can reflect the theme and main content of the question to automatically identify and extract keywords. After identifying the keywords, the system will search for relevant information in the knowledge base based on these keywords and preliminarily define the scope of the question. This process involves matching keywords with the content in the knowledge base, so as to define the relevant information within a specific range. On the basis of defining the scope, the system further removes unnecessary or repeated information. This step eliminates information that is not directly related to the question by screening and excluding information that is not directly related to the question, ensuring that the retained content is highly relevant to the question. By defining the scope and removing redundant information, the system can focus on processing content that is directly related to the question, thereby improving the accuracy and pertinence of the answer, reducing the interference of redundant information, and ensuring that the system can efficiently process the core content in subsequent steps and optimize resource use. Step 42 is used to analyze different interpretations, viewpoints and information sources of keywords. This includes understanding keywords from multiple perspectives, such as different semantic interpretations, differences in viewpoints in various fields, and interpretations of keywords by different information sources. Based on the above analysis, the system constructs three groups of candidate answers, each of which revolves around a specific direction of the question keyword. For example, one set of answers may focus on technical explanations, another set may focus on historical background, and a third set may focus on practical applications. This process ensures that each set of answers provides a unique perspective and enriches the dimensions of the problem. By providing multiple sets of candidate answers, the system can comprehensively cover different aspects of the problem, provide multi-angle analysis, and increase the depth and breadth of the answers. Answers from different directions can help users understand the problem from multiple angles and help form more comprehensive and in-depth insights.

[0137] Then, each group of candidate answers is annotated through step 43, especially highlighting the part that directly corresponds to the key words of the question. The annotation may be made by highlighting, bolding or color marking, so that the position and role of the key words in the answer are more obvious. Through annotation, the system clarifies which content in the answer directly responds to the key words in the question. This process ensures the close relevance of the content of the answer to the key words of the question, allowing users to quickly locate and understand key information. The key information in the answer is made more conspicuous and easy to understand through annotation, which helps users quickly obtain useful information. Through visual highlighting, users can more easily understand and remember the key information in the answer, improving learning and memory effects; the three groups of candidate answers are further evaluated through step 44. The evaluation criteria may include the accuracy, relevance, completeness and closeness of the answer to the key words of the question. The system may use automated tools or based on manual feedback to perform this evaluation. According to the evaluation results, the system refines or adjusts the answers in real time and extracts core information from each group of answers. These core information are the parts that are most closely related to the keywords of the question, and are usually the most representative and critical content for answering the question. The extracted core information will be integrated together. In this process, the system will pay attention to avoiding duplication of content and ensure that each group of core information is reasonably integrated in the draft. The integration methods include synthesizing views, integrating facts or unifying wording to ensure the coherence and consistency of the draft content. By extracting and integrating core information, the system can condense the most critical content and reduce redundant and unnecessary information.

[0138] Finally, the fused answer annotation content is matched with the generated knowledge vector in the image database to retrieve the image data related to the answer content. The image retrieval process can be based on the following methods:

[0139] Find the closest image in the system image library by the similarity between vectors;

[0140] Based on the keywords or phrases in the answer content, globally search for images associated with the answer content;

[0141] If there is no directly matching image, the question keywords can be embedded into VQGAN to generate corresponding images and include them in the pre-built image library for subsequent use.

[0142] Combine the text answer with the retrieved image data. The combination can be a simple juxtaposition of text and images, or a more complex mixed arrangement of text and images, ensuring that the image can effectively supplement the expression of the text content.

[0143] If multiple images are retrieved, the images can be sorted and arranged according to the logical order or theme of the text content, and the layout and presentation of the images and text can be optimized when generating the final answer. For example, ensure the clarity and relevance of the images, and the readability and coherence of the text.

[0144] It can also be personalized according to user needs, such as adjusting the size and position of the image, or enhancing the key points of the generated final answer.

[0145] In the above preferred embodiment, it specifically also includes:

[0146] The three marked candidate answers are analyzed, and a preliminary comprehensive draft is formed based on the three answers merged in step 44, making the answers more concise and clear. The core information in different candidate answers is integrated into one draft, which helps to form a more comprehensive and balanced preliminary answer and improve the overall quality of the answer.

[0147] The initial comprehensive draft was then further evaluated and refined in multiple rounds, using: ; In the formula, Q(s, a) is the primary comprehensive draft a in state s, α is the learning rate, which determines the degree of influence of new information on the Q value, R(s, a) is the new primary draft a in state s, γ is the discount factor to measure the value of the iteration, and maxQ(s', a') is the maximum Q value in all the iterated primary comprehensive drafts a' in the new state s'. In each round of iteration, the draft will be refined and adjusted according to the evaluation results. The purpose of these iterations is to ensure that the draft can fully cover all the keywords in the question and accurately reflect the different levels of the keywords. During the evaluation process, the system will review the accuracy, relevance and logic of the draft, and refine or modify it according to the problems found. For example, the explanation of some keywords may need to be more detailed, or some logical connections may need to be further optimized. As the iteration proceeds, the draft is gradually optimized into an intermediate answer set that covers all the keywords of the question. This answer set comprehensively covers all aspects of the question and can answer the questions better. Through multiple rounds of iterations and refinements, the preliminary draft has gradually evolved into a more mature and complete intermediate answer set, ensuring the improvement of answer quality. The intermediate answer set can more comprehensively include all keywords in the question, reducing the possibility of omissions and errors.

[0148] Finally, based on the intermediate answer set, the system performs language proofreading and optimization on the answers, making the language clearer and easier to understand by simplifying complex sentences and optimizing wording. This process also ensures logical coherence, so that the answers have reasonable advancement and hierarchy in structure, and the optimized answers are proofread for grammar and spelling to ensure that there are no grammatical errors or spelling problems in the answers. In addition, proofreading also involves checking the use of format and punctuation to ensure that the answers are correct in form. After language optimization and proofreading, the system generates the final answer. This answer is not only accurate and comprehensive in content, but also clear and fluent in language expression, and rigorous in logic. Language optimization makes the final answer clearer and easier to read, ensuring that users can easily understand the content of the answer. Through strict proofreading, the grammatical and spelling errors in the final answer are minimized, enhancing the professionalism and credibility of the answer. The optimized answer is logically coherent and consistent, ensuring the accuracy and effectiveness of information transmission.

[0149] like Figure 2 As shown, a military question answering system based on a large language model includes:

[0150] Knowledge acquisition module 201: used to acquire military knowledge data and classify and construct a knowledge vector library;

[0151] Vector encoding module 202: used to vector encode the input military question and map it into a pre-built knowledge vector library;

[0152] Question processing module 203: used to match according to the prompt words of the military question and gradually narrow the scope of the question;

[0153] Answer generation module 204: It is used to construct three sets of candidate answers based on the narrowed questions, and align and annotate the three sets of candidate answers with the question keywords; merge the three sets of aligned and annotated answers, and iterate the merged answers to generate the final answer.

[0154] An embodiment of the present invention further provides an electronic device according to a military question-answering method and system based on a large language model, including a memory, a processor, and a military question-answering method program based on a large language model stored in the memory and executable on the processor. When the military question-answering method program based on a large language model is executed by the processor, the steps of the military question-answering method based on a large language model are implemented. All implementation methods in the above method embodiments are applicable to this embodiment and can achieve the same technical effect.

[0155] Those skilled in the art will also appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present invention.

[0156] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0157] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0158] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0159] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0160] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, magnetic disks, or optical disks.

[0161] In addition, it should be pointed out that in the apparatus and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. Moreover, the steps of performing the above series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order, and some steps can be performed in parallel or independently of each other. For those of ordinary skill in the art, it can be understood that all or any steps or components of the method and apparatus of the present invention can be implemented in hardware, firmware, software or a combination thereof in any computing device (including processors, storage media, etc.) or a network of computing devices, which can be achieved by those of ordinary skill in the art using basic programming skills after reading the description of the present invention.

[0162] Therefore, the purpose of the present invention can also be achieved by running a program or a group of programs on any computing device. The computing device can be a well-known general device. Therefore, the purpose of the present invention can also be achieved by simply providing a program product containing a program code that implements the method or device. That is to say, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any well-known storage medium or any storage medium developed in the future. It should also be pointed out that in the device and method of the present invention, it is obvious that each component or each step can be decomposed and / or recombined. These decompositions and / or recombinations should be regarded as equivalent schemes of the present invention. In addition, the steps of performing the above-mentioned series of processing can naturally be performed in chronological order according to the order of description, but it is not necessary to perform them in chronological order. Some steps can be performed in parallel or independently of each other.

[0163] The above describes an embodiment of the present invention, but this embodiment is not limited to the above-mentioned specific implementation mode. The above-mentioned specific implementation mode is merely illustrative and not restrictive. Under the guidance of this embodiment, ordinary technicians in this field can also make more forms of equivalent embodiments, all of which are within the protection of this embodiment.

Claims

1. A military question-answering method based on a large language model, characterized in that: The following steps are involved: Acquire knowledge data and classify and construct a knowledge vector library, which specifically includes: segmenting the acquired knowledge text information Et by setting the sentence length threshold K, extracting the sentence meaning of the segmented text information Et, and then embedding the sentence meaning of the text information Et into VQGAN to generate the corresponding image data Ei, and making the sentence meaning pass , where concat[] is an operator, which represents the concatenation operation of text information and image data. represents the features extracted from the text t, Represents the features extracted from image I, so that the text information Et and image data Ei are mapped into the same space and associated by similarity; Encode the input question into a vector and map it to a pre-built knowledge vector library; Input questions based on the knowledge vector library and extract question keywords to embed representation vectors; Encode each representation vector to obtain an encoding vector; Integrate the encoding vectors and map them into the knowledge vector library to obtain the corresponding vectors; Obtain pre-generated image data Ei from the image set according to the corresponding vector content; Enter the extracted keyword content of each question into the knowledge vector library to form a newly defined knowledge vector; The extracted keywords are represented as w1, w2, ..., wi, and the corresponding word embedding vectors are represented as v1, v2, ..., vi. Then the question encoding vector q is expressed as: ;Where n is the number of keywords; The newly input question keyword vector q is entered into the knowledge vector library. If there is a knowledge vector St with similar content in the knowledge vector library, the existing knowledge vector St is updated, which specifically includes: Will define is the similarity between the two vectors q and St, with a value range of [-1, 1]. The similarity between individual positions is: ; In the formula, the numerator is the inner product of vectors a and b, and the denominator is the product of the moduli of vectors a and b. The larger the coefficient, the easier it is for the two vectors q and St to coincide. At this time, through: ; In the formula, represents the qth question keyword in the tth iteration, that is, the current question vector q; represents a knowledge vector in the knowledge vector library of the t-th iteration; g* belongs to the position of the optimal knowledge vector in the t-th generation; and are the fitness values ​​of q and St respectively; α is the rotation factor; the elements of Rr are random matrices uniformly distributed within [-1, 1]; is the 2-norm of the vector, δ is the iteration threshold, Re is the iteration element with a value of [0, 1]. At this time, the position of q is rotated to any position with a radius of α, and the newly entered question vector q and the existing vector St in the knowledge vector library are updated to form a newly defined knowledge vector; pass: ; In the formula, w is the weight, r represents the iteration index, and fi is the fitness of the i-th knowledge vector after iteration, thereby performing subsequent global phased searches on the updated knowledge vector library; Pair questions based on key words and gradually narrow the scope of questions; The code vector obtained from the military problem is obtained by ; To obtain the overlap of the encoding vector in the vector library, where P is the encoding vector, K is the knowledge base vector, ||P|| and ||K|| are the module vectors of P and K respectively; Obtaining a coincidence vector set according to the coincidence degree, and ranking the coincidence vector set to obtain a high coincidence vector set; Based on the high coincidence vector set obtained, the corresponding vectors in the knowledge vector set are matched one by one to reduce the knowledge scope of military issues; Capture several similar vectors in the knowledge base according to the degree of overlap, and arrange the several similar vectors in order of degree of overlap; Based on the similar vectors after hierarchical arrangement, a coincidence threshold G is set. When the actual coincidence exceeds this threshold G, it means that the coincidence of the two vectors is in line with expectations, thereby screening out vectors with high coincidence; Integrate the multiple vectors after screening to obtain a high coincidence vector set; Construct multiple sets of candidate answers based on the narrowed questions, align and annotate the multiple sets of candidate answers with the question keywords, merge the multiple sets of answers after alignment and annotation, and iterate the merged answers. Based on the content of the updated answers, search globally for the corresponding image data, and generate the final answer by combining pictures and texts.

2. A military question-answering method based on a large language model according to claim 1, characterized in that: Acquire knowledge data and classify and construct a knowledge vector library, including: Acquire knowledge data through multiple channels and pre-process the knowledge data to obtain pre-processed data; The text information Et in the preprocessed data is parsed, and image data Ei is generated according to the parsing results, and collected and organized into an image set; Then, the classification base point is set according to the keywords of the context segment retained by the text information Et; and the military data is classified using the classification base point to obtain multiple types of military data; Based on the preset classification rules and taking the keywords of the text as the classification basis, the knowledge data in the military field is classified and sorted; Vectorize various types of data to build a knowledge vector library.

3. A military question-answering method based on a language large model according to claim 2, characterized in that: The text information Et in the preprocessed data is parsed, and image data Ei is generated according to the parsing results, and collected and organized into an image set, including: Set the sentence length threshold K to segment the text information Et and express it as: ; where SN is the Nth segment segmented, Indicates the segmentation point and obtains the segmentation data through dependency grammar analysis; The segmented data is scanned for character recognition and semantic correction, and the sentence keywords of the extracted segmented data are used to obtain the sentence meaning based on the sentence keywords. The sentence meaning is embedded in VQGAN to generate image data Ei, which is then collected and organized into an image set.

4. A military question-answering method based on a large language model according to claim 3, characterized in that: Construct multiple sets of candidate answers based on the narrowed questions, align and annotate the multiple sets of candidate answers with the question keywords, merge the multiple sets of answers after alignment and annotation, and iterate the merged answers. Globally search for corresponding image data based on the updated answer content, and generate the final answer by combining pictures and texts, including: Define the scope based on the keywords of the question and remove redundant information to determine the scope of the question; Based on the scope of the question, construct multiple sets of candidate answers based on different interpretations, viewpoints and information sources of the keywords, and each set of answers should be constructed around a specific direction of the keyword of the question; Highlight each candidate answer and clearly indicate which part of the answer corresponds to the key words in the question; The contents of multiple sets of highlighted answers are fused after being changed several times, and the image data of the corresponding knowledge vectors are searched for according to the fused contents to generate the final answer combining pictures and texts.

5. A military question-answering system based on a large language model, characterized in that: The system sets up an electronic device including a memory, a processor and a military question and answer method program based on a large language model stored in the memory and executable on the processor. When the military question and answer method program based on a large language model is executed by the processor, the steps of the military question and answer method based on a large language model as described in any one of claims 1-4 are implemented.

6. A military question-answering system based on a language large model according to claim 5, characterized in that: The system includes: Knowledge acquisition module: It is used to acquire military knowledge data and classify and construct a knowledge vector library; Vector encoding module: It is used to vector encode the input military questions and map them into the pre-built knowledge vector library; Question processing module: It is used to match the prompt words of military questions and gradually narrow the scope of questions; Answer generation module: It is used to construct multiple sets of candidate answers based on the narrowed questions, align and annotate the multiple sets of candidate answers with the question keywords, merge the multiple sets of answers after alignment and annotation, and iterate the merged answers. According to the updated answer content, the corresponding image data is searched globally, and the final answer is generated by combining pictures and texts.

Citation Information

Patent Citations

  • Visual question and answer method based on multi-image fusion

    CN113010712A

  • Visual knowledge question-answering method and system based on triple asymmetry and principle generation

    CN116881422A

  • Target picture acquisition method and device, target picture model acquisition method and device, equipment and storage medium

    CN117274430A

  • Intelligent customer service question and answer prediction and recommendation dialogue generation method and device

    CN117668199A

  • Guide method based on large model

    CN118069812A