Intelligent question answering method and device, equipment and medium

By employing a multi-layered attention architecture and incremental attention updates, the static solidification and locality issues of knowledge representation in intelligent question answering are resolved, enabling dynamic knowledge updates and deep intent parsing, thereby improving the accuracy and efficiency of the question answering system.

CN122366465APending Publication Date: 2026-07-10BEIJING RES CENT FOR INFORMATION TECH & AGRI
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
BEIJING RES CENT FOR INFORMATION TECH & AGRI
Filing Date
2026-03-12
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

Existing intelligent question-answering technologies suffer from static and fixed knowledge representation, locality of encoding, superficial multimodal fusion, and insufficient precision in intent matching. This results in high knowledge update costs, incomplete logical question-answering results, low utilization of multimodal information, and high intent misjudgment rates.

Method used

A multi-layered attention architecture is adopted to construct knowledge representation. Through self-attention encoding, cross-unit and cross-modal attention fusion, dynamic knowledge updates and deep intent parsing are achieved. Combined with incremental attention updates and cross-attention weight calculation, semantic compression and indexing strategy optimization are performed to improve the accuracy and efficiency of knowledge retrieval.

Benefits of technology

It enables dynamic incremental updates of knowledge, cross-unit semantic association, and deep multimodal fusion, improving the accuracy, response efficiency, and scenario adaptability of the intelligent question answering system, while reducing the cost of knowledge updates and the rate of intent misjudgment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122366465A_ABST
    Figure CN122366465A_ABST
Patent Text Reader

Abstract

The application provides a kind of intelligent question and answer method, device, equipment and medium, it is related to computer technical field, the method includes: to multiple source data executes pre-processing, and based on the multiple source data of pre-processing adopts multi-level attention mechanism to build knowledge representation;Based on the intention modeling of attention guide, the intention of user question is parsed, and the intention of user question parsed is matched with knowledge representation;Based on the knowledge retrieval of user question intention and knowledge representation matched, by semantic compression and index strategy, output corresponding target answer with user question.The application can realize knowledge dynamic incremental update, cross unit semantic association, multi-modal deep fusion, accurate understanding of intention, improve the integrity, coherence and accuracy of intelligent question and answer system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to an intelligent question-answering method, apparatus, device, and medium. Background Technology

[0002] With the widespread application of intelligent question-answering technology in vertical fields such as law, healthcare, agriculture, and academia, how to achieve accurate and efficient representation of multi-source knowledge and complete deep semantic matching between user questions and knowledge has become a core technical pain point restricting the performance improvement of question-answering systems. Currently, the industry mainstream has formed three types of knowledge representation technology solutions: representation schemes based on static structured knowledge, representation schemes based on dynamic unstructured knowledge, and preliminary fusion schemes of multimodal knowledge. These three schemes attempt to solve the mapping and matching of "user question - knowledge representation" to user questions in question-answering scenarios through differentiated encoding and matching paths.

[0003] However, the existing solutions all suffer from insurmountable technical flaws and cannot meet the application requirements of high-performance intelligent question answering. Existing solutions generally have four core limitations: First, knowledge representation is static and fixed, lacking an efficient incremental update mechanism, resulting in high knowledge update costs and a high risk of catastrophic forgetting in the model; second, knowledge encoding suffers from locality defects, failing to construct long-distance semantic associations across units, leading to fragmented knowledge representation and insufficient logical integrity of question-answering results; third, multimodal fusion is merely a splicing of surface features, without establishing semantic mapping between modalities, resulting in low utilization of core information and significantly increased computational complexity in matching; fourth, intent matching relies on literal similarity calculations, failing to achieve deep semantic understanding, leading to frequent intent misjudgments and severely impacting the accuracy and reliability of the question-answering system. Summary of the Invention

[0004] This invention provides an intelligent question-answering method, apparatus, device, and medium to address the shortcomings of existing technologies, such as static and fixed knowledge representation, locality of encoding, multimodal surface fusion, and literal intent matching. It enables dynamic incremental knowledge updates, cross-unit semantic association, deep multimodal fusion, and accurate intent understanding, thereby improving the integrity, coherence, and accuracy of the intelligent question-answering system.

[0005] In a first aspect, the present invention provides an intelligent question answering method, comprising the following steps: performing preprocessing on multi-source data, and constructing a knowledge representation based on the preprocessed multi-source data using a multi-level attention architecture; Attention-oriented intent modeling is used to parse user questions and match the parsed user question intents with knowledge representations. Based on the matched user question intent and knowledge representation, knowledge retrieval is performed through semantic compression and indexing strategies to output the target answer corresponding to the user question.

[0006] In some embodiments, the intelligent question-answering method provided by the present invention includes preprocessing including at least one of the following: text preprocessing, image preprocessing, table preprocessing, and standardization preprocessing.

[0007] In some embodiments, according to an intelligent question-answering method provided by the present invention, a knowledge representation is constructed based on preprocessed multi-source data using a multi-layered attention architecture, including: The preprocessed multi-source data is retrieved, and self-attention encoding, cross-unit attention association, cross-modal attention fusion and incremental attention update actions are executed sequentially through a multi-level attention architecture to transform the multi-source data into a dynamic knowledge representation with a unified dimension.

[0008] According to the intelligent question-answering method provided by the present invention, the method further includes: Monitor the update status of multi-source data. When new data is detected, use incremental attention to perform encoding actions only on the new data. Combine this with existing knowledge representation to perform feature fusion and dynamic update actions, thus completing the incremental iteration of knowledge representation.

[0009] In some embodiments, an intelligent question-answering method according to the present invention performs intent parsing on user questions based on attention-oriented intent modeling, including: Perform preprocessing on user issues; Based on the preprocessed user question, the user question intent is output through an attention-oriented intent modeling network.

[0010] In some embodiments, according to an intelligent question-answering method provided by the present invention, matching the parsed user question intent with a knowledge representation includes: Based on the user's question intent and knowledge representation, perform cross-attention weight calculation; Based on cross-attention weights and knowledge representation, a knowledge representation for matching user question intent is obtained through weighted summation.

[0011] In some embodiments, according to an intelligent question-answering method provided by the present invention, knowledge retrieval is performed based on matched intent features and knowledge representation, using semantic compression and indexing strategies, including: Attention-guided principal component analysis is performed to reduce the dimensionality of the matched intent features and knowledge representations, and compressed retrieval feature vectors are generated within a preset semantic loss threshold. An index table mapping high-weight features to knowledge base storage locations is constructed based on cross-attention weights; Using compressed retrieval feature vectors as input and the mapping range of the index table as the retrieval boundary, neighborhood retrieval and similarity calculation are performed. After sorting the retrieval results, a candidate set is generated, and the target knowledge content is obtained by filtering through intent matching consistency verification.

[0012] In some embodiments, according to an intelligent question-answering method provided by the present invention, outputting a target answer corresponding to a user's question includes: By combining the user's question intent with slot information, the system performs answer generation, logic validation, and format standardization on the target knowledge content, matches it with corresponding multimodal resources, and outputs the target answer that corresponds to the user's question.

[0013] In some embodiments, the intelligent question-answering method provided by the present invention further includes: Collect domain-specific question-and-answer corpora and knowledge base data, label user questions, knowledge representations, and triples corresponding to the target answers of user questions, and divide them into training sets, validation sets, and test sets; Construct a weighted combination loss function of cross-entropy loss and contrastive loss, perform end-to-end training of the model, and iteratively update the model parameters; During training, an optimizer, cosine annealing learning rate scheduling, and early stopping mechanism are used to suppress model overfitting. After the trained model is adjusted and its performance is verified by multiple metrics, the model parameters and retrieval rules are iteratively optimized based on user feedback.

[0014] Secondly, the present invention provides an intelligent question-answering device, comprising the following modules: a processing module: the processing module is used to perform preprocessing on multi-source data, and to construct a knowledge representation based on the preprocessed multi-source data using a multi-level attention architecture; The processing module is also used to perform intent parsing on user questions based on attention-oriented intent modeling, and to match the parsed user question intent with the knowledge representation; The processing module is also used to perform knowledge retrieval based on the matched user question intent and knowledge representation, through semantic compression and indexing strategies, and output the target answer corresponding to the user question.

[0015] In some embodiments, the intelligent question-answering device provided by the present invention includes at least one of the following preprocessing methods: text preprocessing, image preprocessing, table preprocessing, and standardization preprocessing.

[0016] In some embodiments, the intelligent question-answering device provided by the present invention includes a processing module that is further configured to retrieve preprocessed multi-source data and sequentially execute self-attention encoding, cross-unit attention association, cross-modal attention fusion, and incremental attention update actions through a multi-level attention architecture to transform the multi-source data into a dynamic knowledge representation with a unified dimension.

[0017] In some embodiments, the intelligent question-answering device provided by the present invention includes a processing module that is further configured to monitor the update status of multi-source data. When new data is detected, incremental attention is used to perform encoding actions only on the new data, and feature fusion and dynamic update actions are performed in combination with existing knowledge representations to complete the incremental iteration of knowledge representation.

[0018] In some embodiments, the processing module of the intelligent question-answering device provided by the present invention is further configured to perform preprocessing on user questions; The processing module is also used to output the user question intent based on the preprocessed user question through an attention-oriented intent modeling network.

[0019] In some embodiments, the processing module of the intelligent question-answering device provided by the present invention is further configured to perform cross-attention weight calculation based on the user's question intent and knowledge representation; The processing module is also used to obtain a knowledge representation of the user's question intent by weighted summation based on cross-attention weights and knowledge representation.

[0020] In some embodiments, according to the intelligent question-answering device provided by the present invention, the processing module is further configured to perform attention-guided principal component analysis dimensionality reduction on the matched intent features and knowledge representation, and generate a compressed retrieval feature vector within a preset semantic loss threshold. The processing module is also used to construct an index table that maps high-weight features to knowledge base storage locations based on cross-attention weights; The processing module is also used to perform neighborhood retrieval and similarity calculation with compressed retrieval feature vectors as input and the mapping range of the index table as the retrieval boundary. After sorting the retrieval results, a candidate set is generated, and the target knowledge content is obtained by filtering through intent matching consistency verification.

[0021] In some embodiments, according to the intelligent question-answering device provided by the present invention, the processing module is further configured to combine the user's question intent and slot information to perform answer generation, logical verification and format regularization on the target knowledge content, match the corresponding multimodal resources, and output the target answer corresponding to the user's question.

[0022] In some embodiments, an intelligent question-answering device according to the present invention further includes a data acquisition module; the data acquisition module is used to acquire domain question-answering corpus and knowledge base data, label user questions, knowledge representations, and triples of target answers corresponding to user questions, and divide them into training sets, validation sets, and test sets; The processing module is also used to construct a weighted combination loss function of cross-entropy loss and contrastive loss, perform end-to-end training of the model, and iteratively update the model parameters; The processing module is also used during training to employ optimizers, cosine annealing learning rate scheduling, and early stopping mechanisms to suppress model overfitting; The processing module is also used to adjust the trained model, and after performance verification by multi-dimensional indicators, iteratively optimize model parameters and retrieval rules based on user feedback.

[0023] Thirdly, the present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement any of the intelligent question-answering methods described above.

[0024] Fourthly, the present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements any of the intelligent question-answering methods described above.

[0025] Fifthly, the present invention also provides a computer program product, including a computer program that, when executed by a processor, implements any of the intelligent question-answering methods described above.

[0026] The intelligent question-answering method, apparatus, device, and medium provided by this invention address the core technical shortcomings of existing intelligent question-answering technologies, such as static and fixed knowledge representation, fragmented semantic association, superficial multimodal fusion, and insufficient intent matching accuracy. Through the collaborative design of a full-link attention mechanism and the targeted optimization of retrieval strategies, this invention achieves dynamic and accurate representation of multi-source knowledge, deep semantic parsing of user intent, and efficient targeted retrieval of knowledge, comprehensively improving the accuracy, response efficiency, and scenario adaptability of intelligent question-answering systems.

[0027] Specifically, compared with existing technologies, this invention addresses four core pain points in the background technology: First, by constructing knowledge representation through a multi-layered attention architecture, it overcomes the limitations of fixed encoding and full retraining in existing technologies, enabling dynamic updating and incremental adaptation of knowledge representation, significantly reducing knowledge update costs, and effectively avoiding catastrophic forgetting of models, thus ensuring the reliability of question-and-answer questions based on existing knowledge. Second, relying on the global encoding capability of the multi-layered attention architecture, it fully constructs cross-unit semantic associations and long-distance semantic dependencies between multi-source knowledge, solving the user problems of knowledge encoding locality and knowledge representation fragmentation in existing technologies, and ensuring the logical integrity and information completeness of question-and-answer results. The system offers several advantages: First, it achieves comprehensiveness. Second, it enables deep semantic fusion of multi-source heterogeneous data through a multi-layered attention architecture, replacing the existing surface feature splicing fusion method. This achieves semantic alignment and feature complementarity of data from different modalities, improving the utilization rate of multimodal information. At the same time, it reduces feature redundancy and computational complexity by combining subsequent semantic compression strategies. Third, it achieves deep intent parsing of user questions through attention-oriented intent modeling, directly completing the semantic matching of intent and knowledge representation. This replaces the indirect path of literal keyword matching in existing technologies, significantly reducing the intent misjudgment rate. Simultaneously, it performs knowledge retrieval based on the matching results through a targeted indexing strategy, achieving a simultaneous improvement in question-answering accuracy and response speed. Attached Figure Description

[0028] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.

[0029] Figure 1 This is one of the flowcharts of the intelligent question-answering method provided by the present invention.

[0030] Figure 2 This is the second flowchart of the intelligent question-answering method provided by the present invention.

[0031] Figure 3 This is a schematic diagram of the intelligent question-answering method device provided by the present invention.

[0032] Figure 4 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation

[0033] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.

[0034] To meet the needs of effective knowledge representation and application in the field of intelligent question answering (QA), the following three typical knowledge representation schemes have been developed. Each of these schemes attempts to solve the problem of mapping and matching user questions with knowledge through differentiated technical paths, but all have significant limitations, which are explained in detail below: Option 1: A representation scheme based on static structured knowledge.

[0035] Scheme 1, based on "predefined ontology + fixed encoding," is the mainstream technical approach for early intelligent question-answering systems. The specific implementation process of this scheme includes: Knowledge modeling: A semantic network of the ontology is manually constructed by those skilled in the art (e.g., a systematized nomenclature of medicine clinical terms (SNOMEDCT) in the medical field, or a wordnet in the general domain), abstracting knowledge into a static, structured form of "entity-relationship-entity". For example, in a legal question-and-answer scenario, a hierarchical relationship network of "legal provision-applicable crime-sentencing standard" can be constructed to clarify the logical connections between different knowledge units. Encoding Implementation: The entity and relation in the ontology are encoded using a bag of words (BoW) model or a fixed-dimensional word vector model (e.g., word to vector (WORD2VEC) or global vectors for word representation (GLOVE)). Each knowledge unit is transformed into a fixed-length vector (e.g., typically 100-300 dimensions), and the weights of this vector remain fixed after the model is trained and are no longer updated. For example, the entity "contract dispute" is encoded as a 300-dimensional vector [0.21, 0.56, ..., 0.13]. Matching retrieval: When a user asks a question to the target user, the system first performs word segmentation and keyword extraction on the user's question (for example, using the term frequency-inverse document frequency (TF-IDF) algorithm to filter core keywords such as "adjustment of liquidated damages" and "legal basis"). Then, it calculates the cosine similarity between the vector corresponding to the user's question keywords and the vector of each knowledge unit in the knowledge base, and returns the knowledge unit with the highest similarity as the question answer result.

[0036] Option 2: A representation scheme based on dynamic unstructured knowledge.

[0037] The technical implementation process of Solution 2 is as follows: Knowledge Acquisition: Unstructured text data (e.g., academic papers, news reports, user Q&A logs, etc.) are obtained through web crawling technology. There is no need to manually construct the ontology structure; the raw text data is directly used as the core component of the knowledge base. Encoding Implementation: Recurrent Neural Network (RNN) or its variants (e.g., Long Short-Term Memory (LSTM) or Gated Recurrent Unit (GRU)) are used to encode textual knowledge in sequence. For example, in the academic question-and-answer scenario, the abstract of a paper is input into the LSTM model in sentence order, and the knowledge representation vector representing the core information of the abstract is output through the hidden layer state of the model. Matching optimization: A simplified version of the attention mechanism (e.g., the Bahdanau attention mechanism) is introduced. During the matching process between user questions and knowledge, a temporary weight is assigned to each word in the knowledge sequence (e.g., for the user question "core innovation of translation (transformer), the word "self-attention mechanism" in the knowledge text is assigned a higher weight). Then, a weighted summation operation is performed to obtain the matching score between the user question and the knowledge, and the return result is determined based on this score.

[0038] Option 3: A preliminary fusion scheme based on multimodal knowledge.

[0039] The specific implementation process of scheme 3 includes: Multimodal data processing: Differentiated processing methods are adopted for different types of multimodal data. Text data is encoded using the Bidirectional Encoder Representations from Transformers (BERT) model, image data is extracted for visual features using CNN and Residual Network (ResNet), and tabular data is extracted for structured field information using a rule engine (e.g., regular expressions). Feature fusion: Text feature vectors (e.g., 768-dimensional BERT encoded vectors), image feature vectors (e.g., 2048-dimensional ResNet extracted vectors), and table feature vectors (e.g., 128-dimensional structured field vectors) are fused into a knowledge representation vector with unified dimensions through "dimensional completion + direct concatenation". Question-answer matching: Traditional similarity calculation methods (e.g., Euclidean distance) are used to match the fused user question vector with the knowledge vector, and the corresponding question-answer results are returned based on the calculation results.

[0040] Based on the three knowledge representation schemes mentioned above, the shortcomings of current intelligent question-answering knowledge representation schemes can be categorized into the following four dimensions. The following sections will elaborate on these four dimensions from the perspectives of technical limitations and insufficient effectiveness: Dimension 1: The "static" nature of knowledge representation, that is, the lack of incremental update capability, and the inability to meet the needs of dynamic adaptation.

[0041] The technical limitations of this dimension 1 include: the encoding mechanism of the above scheme has the inherent defect of "static solidification". Specifically, the above scheme 1 adopts "predefined ontology + fixed vector encoding", and the vector weight of the knowledge unit is permanently fixed after training, with no room for dynamic adjustment; although the above scheme 1 supports unstructured knowledge input, it relies on "retraining with full data" to achieve knowledge updates, lacks an incremental learning mechanism, and cannot encode and update new knowledge separately.

[0042] The technical limitations of the above solutions lead to user problems such as low efficiency and high cost in knowledge updates. For example, when the medical knowledge base adds "diagnosis and treatment plan for the novel coronavirus variant strain XBB", solution 1 requires domain experts to manually modify the ontology semantic network and re-encode all existing knowledge vectors (the operation cycle is usually 3-7 days). Another example is method 2, which requires adding the new diagnosis and treatment text to the training set and performing full retraining on the entire LSTM / GRU model (which takes several hours to several days, depending on the data scale). Neither of these methods can meet the real-time question-answering needs of scenarios such as public health emergencies. Furthermore, full retraining can cause "catastrophic forgetting" of the model, that is, after learning new knowledge, the representation accuracy of existing knowledge decreases significantly. For example, after learning the XBB diagnosis and treatment plan, the retrieval accuracy of the original novel coronavirus strain diagnosis and treatment plan decreases by 15%-20%, resulting in damage to the reliability of question-answering based on old knowledge.

[0043] Dimension 2: The "locality" of knowledge encoding, that is, the break in cross-unit semantic association, and the fragmentation of knowledge representation.

[0044] The technical limitations of this dimension 2 include: the encoding logic of the above schemes only focuses on "local knowledge units" and does not build a semantic association modeling mechanism across units and long sequences. Specifically, the above scheme 1 only encodes a single "entity-relationship-entity" unit independently and does not consider the logical dependencies between different knowledge units (e.g., the applicable premises and causal relationships between legal provisions); the above scheme 2, based on RNN / LSTM / GRU sequence encoding, has the defect of "long-distance dependency decay" and is not good at remembering early key information in long texts.

[0045] The technical limitations of the aforementioned methods result in the inability to form a complete semantic logic chain in knowledge representation, leading to user issues such as "fragmentation" and "incompleteness" in question-and-answer results. For example, in legal question-and-answer scenarios, Scheme 1 can only encode the vector of a single legal provision and cannot link the applicable premise relationship between "Legal Provision A (rules for adjusting liquidated damages) - Legal Provision B (standards for determining actual losses)". Furthermore, when Scheme 2 processes long texts exceeding 500 words (e.g., complex contract clauses, multi-clause legal interpretations), the memory decay rate for early key information (e.g., "adjustment of liquidated damages must be based on actual losses") exceeds 40%. Additionally, when a user asks "How to handle a contract dispute where liquidated damages exceed 30% of actual losses?", the aforementioned scheme can only retrieve the "core legal provisions for adjusting liquidated damages" but misses the "related legal provisions for determining actual losses," resulting in an answer lacking complete logical support and failing to address the user's core needs.

[0046] Dimension 3: The "surface-leveling" of multimodal fusion, that is, the semantic fragmentation between modalities, resulting in reduced information utilization.

[0047] The technical limitations of this dimension 3 include: the initial multimodal fusion scheme adopts a surface fusion logic of "independent encoding + direct concatenation", without establishing semantic mapping relationships and weight allocation mechanisms between different modal knowledge: multimodal data such as text, images, and tables are encoded by independent models (e.g., BERT, ResNet, rule engines), and a unified vector is formed only through "dimensional completion + vector concatenation", without considering the complementarity and correlation between modalities (such as the correspondence between text descriptions and image features), and without filtering redundant features.

[0048] The technical limitations of the above solutions lead to a waste of the "synergistic value" of multimodal knowledge and a decline in both matching efficiency and accuracy. For example, in e-commerce product Q&A scenarios, the visual features of the text description "product weight 5kg" and the "weight marking area" in the image are complementary information. However, the above solutions simply concatenate the vectors of the two without calculating the association weight, thus failing to strengthen the representation of core information. At the same time, irrelevant features in the image (e.g., background color, shooting angle) and redundant expressions in the text are included in the vector together, causing the core information to be interfered with during matching. For example, when searching for "whether the product size meets the standard," size-related features are diluted by irrelevant features, resulting in a 25%-30% decrease in retrieval accuracy. In addition, the high-dimensional vector after concatenation (e.g., 768 dimensions of text + 2048 dimensions of image + 128 dimensions of table = 2944 dimensions) significantly increases the time complexity of matching calculations, making Q&A matching time 3 to 5 times longer than that of single-modal solutions.

[0049] Dimension 4: The "indirectness" of intent matching, that is, literal matching replaces semantic understanding, resulting in a significant deviation in question-answering accuracy.

[0050] The technical limitations of this dimension 4 include: the above-mentioned solution's "user question-knowledge" matching relies on the indirect path of "keyword extraction + similarity calculation", and does not establish a deep association model between user question intent and knowledge semantics: the matching process is essentially a literal matching of "user question keywords → knowledge keywords", rather than a core matching of "user question intent → knowledge semantics", and cannot identify deep semantics such as action relationships and logical demands in user questions, and can only capture literal overlap.

[0051] The technical limitations of the above-mentioned solutions lead to a high frequency of errors, such as "correct keyword matching but incorrect understanding of intent," resulting in a significant decrease in question-answering accuracy. For example, when a user asks "Who proposed the theory of relativity?", the above-mentioned solutions may extract keywords such as "proposed" and "relativity" through TF-IDF, but may retrieve knowledge containing keywords such as "the core innovation of relativity" and "application scenarios of relativity" that are irrelevant to the "proposer's" intent. In academic question-answering scenarios, such misjudgments of intent can lead to an error rate as high as 30%-40%, seriously affecting the reliability of intelligent question-answering systems and user experience.

[0052] To address the shortcomings of the aforementioned methods, such as insufficient dynamic adaptation capabilities, weak semantic association modeling, shallow multimodal information fusion, and low accuracy in matching user question intent, this invention proposes an intelligent question-answering knowledge representation and matching scheme based on an attention mechanism to overcome many limitations of existing technologies. The specific technical approach and effects are as follows: This invention achieves minute-level incremental knowledge updates by constructing an incremental attention update module, eliminating the need for full model retraining and fundamentally preventing catastrophic forgetting, thus ensuring the accuracy of new and old knowledge representation and real-time updates. It employs a network architecture combining a transformer and cross-unit attention to address the information memory decay problem during the encoding of long-sequence knowledge, constructing globally comprehensive semantic associations to overcome the defects of fragmented knowledge representation. A two-stage cross-modal attention network is built to achieve deep semantic fusion of multimodal information such as text, images, and tables, compressing feature vector dimensions while eliminating redundant features, significantly improving the utilization rate of multimodal information and question-answering matching efficiency. Finally, a user question-knowledge cross-attention mechanism is introduced to directly establish a precise mapping between user question intent and knowledge semantics, weakening the dependence on literal keyword matching and reducing intent comprehension bias and question-answering error rate.

[0053] This invention forms an end-to-end intelligent question-answering knowledge processing system through the above modules, which can effectively reduce the cost of model deployment and adaptation, support rapid migration and application in multiple fields, and comprehensively optimize from dimensions such as update real-time performance, semantic integrity, multimodal fusion depth, and intent matching accuracy, significantly improving the response efficiency, answer accuracy and practical performance of the intelligent question-answering system.

[0054] The following is combined Figure 1 Describe the intelligent question-answering method provided by this invention. Figure 1 This is one of the flowcharts illustrating the intelligent question-answering method provided by this invention, such as... Figure 1 As shown, the method includes the following: Step 101: Perform preprocessing on the multi-source data, and construct a knowledge representation based on the preprocessed multi-source data using a multi-level attention architecture.

[0055] In some embodiments, preprocessing includes at least one of the following: text preprocessing, image preprocessing, table preprocessing, and standardization preprocessing.

[0056] In some embodiments, the process of constructing a knowledge representation based on preprocessed multi-source data using a multi-level attention architecture may include: retrieving the preprocessed multi-source data, and sequentially executing self-attention encoding, cross-unit attention association, cross-modal attention fusion, and incremental attention update actions through the multi-level attention architecture to transform the multi-source data into a dynamic knowledge representation with a unified dimension.

[0057] In some embodiments, the intelligent question answering method provided by the present invention further includes: monitoring the update status of multi-source data; when new data is detected, performing encoding actions only on the new data through incremental attention; and performing feature fusion and dynamic update actions in combination with existing knowledge representations to complete the incremental iteration of knowledge representations.

[0058] Step 102: Based on attention-oriented intent modeling, perform intent parsing on user questions and match the parsed user question intent with the knowledge representation.

[0059] In some embodiments, the process of parsing user questions based on attention-oriented intent modeling may include: performing preprocessing on the user question, and outputting the user question intent based on the preprocessed user question through an attention-oriented intent modeling network.

[0060] In some embodiments, the process of matching the parsed user question intent with the knowledge representation may include: performing cross-attention weight calculation based on the user question intent and the knowledge representation, and obtaining the knowledge representation matching the user question intent by weighted summation based on the cross-attention weight and the knowledge representation.

[0061] Step 103: Based on the matched user question intent and knowledge representation, perform knowledge retrieval through semantic compression and indexing strategies, and output the target answer corresponding to the user question.

[0062] In some embodiments, the process of performing knowledge retrieval based on matched intent features and knowledge representations through semantic compression and indexing strategies may include: performing attention-guided principal component analysis to reduce the dimensionality of the matched intent features and knowledge representations; generating compressed retrieval feature vectors within a preset semantic loss threshold; and constructing an index table mapping high-weight features to knowledge base storage locations based on cross-attention weights. Using the compressed retrieval feature vectors as input and the mapping range of the index table as the retrieval boundary, neighborhood retrieval and similarity calculation are performed. After sorting the retrieval results, a candidate set is generated, and the target knowledge content is obtained through intent matching consistency verification.

[0063] In some embodiments, the process of outputting the target answer corresponding to the user question may include: combining the user question intent and slot information, performing answer generation, logic verification and format regularization on the target knowledge content, matching the corresponding multimodal resources, and outputting the target answer corresponding to the user question.

[0064] In some embodiments, the intelligent question-answering method provided by the present invention further includes: collecting domain question-answering corpora and knowledge base data, wherein user questions, knowledge representations, and triples corresponding to the target answers of user questions are labeled and divided into training sets, validation sets, and test sets. A weighted combined loss function of cross-entropy loss and contrastive loss is constructed, end-to-end model training is performed, model parameters are iteratively updated, and an optimizer, cosine annealing learning rate scheduling, and early stopping mechanism are employed during training to suppress model overfitting. The trained model is adjusted, and after performance verification by multi-dimensional metrics, model parameters and retrieval rules are iteratively optimized based on user feedback.

[0065] The implementation steps of this invention revolve around four core stages: "knowledge processing, encoding fusion, intent matching, and retrieval application." Through the deep embedding of a multi-layered attention mechanism, it achieves accurate, dynamic, and multimodal knowledge representation for intelligent question answering. The specific steps are as follows: Step 201: Input multi-source data into the multi-source knowledge base.

[0066] Step 202: Preprocess the above multi-source data.

[0067] For example, the preprocessing involved in this invention includes at least one of the following: text preprocessing, image preprocessing, table preprocessing, and standardization preprocessing.

[0068] Text preprocessing (also known as text knowledge base preprocessing) may include at least one of the following operations: Data cleaning: Regular expressions are used to filter noisy data in the text knowledge base. This noisy data includes special symbols (e.g., "@#¥"), meaningless short sentences (e.g., "This article has no relevant content"), and duplicate text (e.g., duplicate encyclopedia entries). For text data in fields such as agricultural technology services, breeding, and mechanization, non-professional expressions are further filtered using domain dictionaries (e.g., a "breeding terminology dictionary" for the breeding field). For example, "gene treatment" is uniformly corrected to "gene editing" to ensure the accuracy of the text semantics.

[0069] Knowledge Extraction: A joint model combining BERT, bidirectional long short-term memory (BiLSTM), and conditional random field (CRF) is used to extract entities (E), relations (R), and attributes (A) from text data. The BERT model transforms the text data into contextual semantic vectors, the BiLSTM model captures sequence dependencies, and the CRF model optimizes entity boundary recognition accuracy. After extraction, a standardized set of triples T = {(E1, R1, E2), (E1, R2, E3), (E2, A1, V1)} is formed, where V represents the attribute value.

[0070] Entity disambiguation: For ambiguous entities (e.g., "apple" can refer to fruit or company), an entity linking model is constructed, and ambiguity is eliminated by calculating the cosine similarity between the entity context vector and the standard entity vector in the knowledge base.

[0071] Image preprocessing (also known as image knowledge base preprocessing) may include at least one of the following operations: Visual Feature Extraction: A ResNet-50 convolutional neural network is used to extract features from images in the image knowledge base. ResNet-50 addresses the vanishing gradient problem in deep networks through residual connections, outputting a 2048-dimensional visual feature vector F_vis. For example, for an image of an e-commerce product "laptop," visual features such as screen size, keyboard layout, and body color are extracted, forming F_vis=[0.12,0.35,...,0.28] (i.e., 2048 dimensions).

[0072] Text label binding: Text data (e.g., the "vegetables" label on a product image) is extracted from the image using optical character recognition (OCR) technology and bound to the image's visual feature vector. Simultaneously, manually labeled tags (e.g., "vegetables-tomato") are combined to form a "visual feature-text label" mapping pair (F_vis, L_img), where L_img is a set of text labels (e.g., {"vegetables", "tomato"}).

[0073] The table preprocessing (also known as table knowledge base preprocessing) may include at least one of the following operations: Structural analysis: A table structure recognition model (e.g., Table Network, TableNet) is used to perform column boundary detection and cell content extraction on the table data. For example, for the table "IoT data of tomato planting base", the column headers such as "environment", "temperature (°C)" and "humidity (%)" are identified, as well as the corresponding numerical content of the cells (e.g., "M1,24.6,81").

[0074] Feature Encoding: The extracted tabular data is encoded using "column type mapping + numerical normalization". For example, text type columns (e.g., "temperature") are encoded into a 100-dimensional vector using Word2Vec, and numerical type columns (e.g., "humidity") are mapped to the [0,1] interval using Min-Max normalization, ultimately forming the tabular feature vector F_tab.

[0075] The standardization preprocessing (also known as multi-source data standardization) can include mapping the preprocessed feature vectors of text, images, and tables to the same dimension (e.g., 512 dimensions) and using L2 normalization to eliminate dimensional differences. For example, the feature vectors of text triples (e.g., initially 768 dimensions), the F_vis of images (e.g., 2048 dimensions), and the F_tab of tables (e.g., initially 300 dimensions) can all be compressed to 512 dimensions to ensure dimensional consistency during subsequent attention fusion.

[0076] Step 203: Knowledge encoding processing based on multi-level attention, that is, through the synergistic effect of self-attention encoding, cross-unit attention association, cross-modal attention and incremental attention, the preprocessed multi-source data is transformed into accurate and dynamic knowledge representation.

[0077] For example, knowledge encoding based on multi-level attention includes at least one of the following: text knowledge self-attention encoding, multimodal fusion encoding, and incremental attention update.

[0078] Text knowledge self-attention encoding can include at least one of the following operations: Transformer encoder initialization: A 6-layer transformer encoder is used to encode the text triple set T. Each transformer layer contains a multi-head self-attention layer (e.g., 8 attention heads) and a feedforward neural network (FFN). The multi-head self-attention layer captures fine-grained relationships between entities, relations, and attributes within the text triple set T by computing attention weights in parallel across different subspaces. The FFN uses a ReLU activation function + layer normalization structure to perform a non-linear transformation on the attention output, enhancing the model's expressive power.

[0079] Attention calculation within a set of text triples T: Taking a single triple (e.g., "tomato, yes, downy mildew") as an example, the 512-dimensional vectors of entities and relations are used as the input sequence X=[E1_vec,R1_vec,E2_vec] of the transformer, and the attention weight of each element is calculated using the self-attention formula. The specific implementation process is as follows: The input sequence X is mapped to a query vector, a key vector, and a value vector using learnable parameter matrices (W_Q, W_K, W_V), respectively. For example, Query, Key, and Value satisfy the following formulas 1 to 3: Query=X×W_Q Formula 1 Key = X × W_K Formula 2 Value = X × W_V (Formula 3) By calculating the similarity between the Query and the Key, and combining this with Softmax normalization, we obtain the Attention Score, which represents the attention weights between elements in the input sequence. For example, the Attention Score satisfies the following formula 4: Attention Score=Soft max(Query×Key^T / √d_k) Formula 4 Where T is the matrix transpose symbol. d_k is the key dimension, which is 512 in this case.

[0080] Multiplying the attention weight matrix by the value vector matrix achieves a weighted summation of the value vector, outputting the final feature vector Attention Output that incorporates the correlation information between elements within the sequence. In other words, Attention Output satisfies the following formula: Attention Output=Attention Score×Value Formula 5 After the aforementioned self-attention weight calculation process, the attention weight of the corresponding relation "proposed" (exemplary value 0.6) is significantly higher than the attention weights of the head entity (E1) and tail entity (E2) (exemplary values ​​are both 0.2), realizing the adaptive strengthening of the core supporting role of relations in knowledge semantic representation; finally, the attention encoding feature vector H_tri within the triple is output. The dimension of this vector is maintained at 512. Its generation logic is the weighted summation of the head entity vector, relation vector, and tail entity vector according to their corresponding attention weights. The specific expression is: H_tri = 0.2 × E1_vec + 0.6 × R1_vec + 0.2 × E2_vec.

[0081] Cross-triple attention fusion: For multiple associated triples (e.g., T1 = "tomato, has, downy mildew", T2 = "downy mildew, occurs, May"), a cross-triple attention layer is constructed. Using H_tri1 of T1 and H_tri2 of T2 as input, the cross-attention weights of the two are calculated. The specific implementation process is as follows: By calculating the similarity between H_tri1 and H_tri2 and combining it with Softmax normalization, the cross-attention weights (CrossAttentionScore) between elements in the input sequence are obtained. For example, CrossAttentionScore satisfies the following formula 6: CrossAttentionScore=Softmax(H_tri1×H_tri2^T / √d_k) Formula 6 Multiplying the cross-attention weights by H_tri2 achieves a weighted summation of H_tri2, outputting the final cross-feature vector CrossAttentionOutput, which integrates the element-related information within multiple triples. That is, CrossAttentionOutput satisfies the following formula 7: CrossAttentionOutput=CrossAttentionScore×H_tri2 Formula 7 Since "downy mildew" is a common entity of the two triples, H_tri1 and H_tri2 have a high similarity, and the cross-attention weights (exemplary values ​​of 0.8) are strengthened. The final output is the fused text knowledge representation H_text = 0.7 × H_tri1 + 0.3 × H_tri2 (that is, the semantics of the associated triples are integrated by weighted summation).

[0082] The multimodal fusion encoding can include at least one of the following operations: intramodal attention enhancement and cross-modal attention fusion.

[0083] Furthermore, intramodal attention enhancement may include at least one of the following operations: image modality, table modality.

[0084] Image modality refers to taking the visual feature vector F_vis (e.g., 512-dimensional) of an image, introducing a spatial attention layer, and generating a spatial attention mask M_vis (e.g., 512-dimensional) by calculating the semantic similarity between each feature dimension in F_vis and the text label L_img. For example, the label "15.6-inch screen" has a high similarity to the feature dimension corresponding to the screen size in F_vis, so the weight of this dimension in M_vis is set to 0.9, and the weights of other irrelevant dimensions (such as background color) are set to 0.1. The enhanced image feature F_vis_att = F_vis × M_vis.

[0085] The tabular modality refers to introducing a column attention layer into the table feature vector F_tab (e.g., 512-dimensional), and generating a column attention mask M_tab based on the relevance of the column headings to the semantics of the knowledge (e.g., in financial knowledge, the relevance of the "temperature" column is higher than that of the "other" column). For example, the feature dimension weight corresponding to the "temperature" column is set to 0.8, and the weight of the "other" column is set to 0.05. The enhanced table feature F_tab_att = F_tab × M_tab.

[0086] Furthermore, cross-modal attention fusion may include: constructing a cross-modal attention fusion network, with input text knowledge representation H_text, enhanced image features F_vis_att, and table features F_tab_att.

[0087] Specifically, first, calculate the cross-modal attention weights (Modality AttentionScore) between text and images. For example, the Modality Attention Score satisfies the following formula: Modality Attention Score=Softmax(H_text×F_vis_att^T / √d_k) Formula 8 Secondly, the cross-modal attention weights Modality Attention Score and F_vis_att for text and image are calculated to obtain Text-ImgFusion. For example, Text-ImgFusion satisfies the following formula 9: Text-ImgFusion=Modality Attention Score×F_vis_att Formula 9 Finally, cross-modal attention is calculated by combining Text-ImgFusion with the table feature F_tab_att, and a unified multimodal knowledge representation H_multi=0.6×H_text+0.25×Text-ImgFusion+0.15×F_tab_att is output. In this way, we can balance the contributions of different modalities through weight allocation.

[0088] Specifically, when new knowledge is added to the knowledge base (e.g., text triple T_new = (tomato, grown in, Zhaoxian County, Hebei Province), image P_new = "Zhaoxian County Base", table data T_new_tab = "List of Hebei Bases"), the incremental attention update module is activated. The incremental attention update can include at least one of the following operations: New knowledge preprocessing: Following the method shown in step 202, preprocess T_new, P_new, and T_new_tab to obtain the new text feature H_text_new, the new image feature F_vis_new_att, and the new table feature F_tab_new_att.

[0089] Association Weight Calculation: Calculate the association attention weight (Incremental Attention Score) between the new feature and the existing multimodal knowledge representation H_multi. Taking H_text_new and H_multi as examples, the Incremental Attention Score satisfies the following formula 10: Incremental Attention Score=Softmax(H_text_new×H_multi^T / √d_k) formula 10 Since the semantics of "tomato" in H_text_new are consistent with those of the "tomato" entity in H_multi, the association weight (e.g., a value of 0.9) is significantly higher than other dimensions, ensuring the effective association between new knowledge and existing knowledge.

[0090] Partial knowledge update: Only the dimensions in H_multi that are highly correlated with the new knowledge (such as the "tomato" related dimensions) are adjusted in weight. The updated H_multi (i.e., H_multi_update) satisfies the following formula 11: H_multi_update=H_multi×(1-Incremental Attention Score) +H_text_new×Incremental Attention Score+F_vis_new_att×Incremental Attention Score +F_tab_new_att×Incremental Attention Score Formula 11 The above process does not require retraining the entire model; new knowledge can be incorporated simply by updating local weights. The update time is controlled within 5 minutes, and the accuracy of the old knowledge representation decreases by ≤3%.

[0091] Step 204: User Question Intent Attention Encoding and Matching. This involves capturing the core intent of the user's question through an attention mechanism and accurately matching it with the multimodal knowledge representation. Specifically, this includes the following steps: 4.1 User issue preprocessing.

[0092] For example, user question preprocessing may include at least one of the following: text cleaning and word segmentation, and intent feature extraction.

[0093] Text cleaning and word segmentation refer to cleaning the user input question Q (such as "In which region is it more suitable to grow tomatoes?"), removing punctuation marks and meaningless words (such as "which" and "?"), and using the jieba word segmentation tool to split the user question into a word sequence: "tomato", "growing", "in", "which", "region", "more suitable".

[0094] Intent feature extraction refers to using the BERT model to encode the user's question after word segmentation, outputting a 768-dimensional user question context vector, and extracting core intent features through "entity recognition + question word classification". For example, entity Q_E = "tomato" "relatively suitable", action relationship Q_R = "planting", and target attribute Q_A = "region" (i.e., the core attribute that the user's question is concerned with).

[0095] 4.2 User Question Intent Attention Encoding.

[0096] For example, user question intent attention encoding may include at least one of the following: intent attention weight calculation and intent representation vector generation.

[0097] Intent attention weight calculation refers to constructing a user question intent attention layer, taking the user question context vector output by BERT as input, and assigning weights according to the importance of intent features. For example, Q_R = "planting" (weight 0.4), Q_A = "region" (weight 0.3), Q_E = "tomato" (weight 0.2), "suitable" (weight 0.1), and irrelevant words (such as "at") are set to 0 weight.

[0098] Intent representation vector generation refers to obtaining the user question intent representation vector H_q through weighted summation. For example, H_q satisfies the following formula 12: H_q=0.4×Q_R_vec+0.3×Q_A_vec+0.2×Q_E1_vec+0.1×Q_E2_vec Formula 12 Among them, Q_R_vec, Q_A_vec, Q_E1_vec, and Q_E2_vec are vectors of the corresponding intent features.

[0099] The H_q above (e.g., 512 dimensions) accurately reflects the core needs of the user's problem, avoiding interference from irrelevant information.

[0100] 4.3 User problem - knowledge cross-attention matching.

[0101] For example, user question-knowledge cross-attention matching may include at least one of the following: cross-attention weight calculation and matching knowledge representation generation.

[0102] Cross-attention weight calculation refers to inputting the user question intent representation vector H_q and the incrementally updated multimodal knowledge representation H_multi_update into the cross-attention layer, and calculating the semantic association weight Match AttentionScore between the two. For example, Match Attention Score satisfies the following formula 13: Match Attention Score=Softmax(H_q×H_multi_update^T / √d_k) Formula 13 For example, the semantic correlation between “planting” and “region” in H_q and “tomato-planting-region” and “tomato-planted in-Zhaoxian base” in H_multi_update is relatively high, with corresponding weights of 0.6 (“planting” correlation) and 0.3 (“region” correlation), respectively, while the weights of other dimensions are ≤0.1.

[0103] Matching knowledge representation generation refers to obtaining a user-question-oriented matching knowledge representation H_match through weighted summation. For example, H_match satisfies the following formula 14: H_match=Match Attention Score×H_multi_update Formula 14 The H_match above highlights the semantic knowledge relevant to the user's question intent (e.g., "in which region is it planted?", "Zhao County base"), filters out irrelevant knowledge (e.g., "list of Hebei bases"), and provides accurate input for subsequent searches.

[0104] Step 205, Knowledge Retrieval and Question Answering, which involves improving knowledge matching efficiency through semantic compression and index construction, ultimately outputting accurate answers. This includes the following steps: 5.1 Semantic compression of knowledge representation.

[0105] Knowledge representation semantic compression refers to using "attention weight-guided PCA dimensionality reduction" to compress the semantics of H_match. Specifically, based on the Match Attention Score, core feature dimensions with a weight ≥ 0.2 (e.g., dimensions related to "planting" and "Zhao County base") are selected, retaining core semantic information. Principal component analysis (PCA) is then used to compress the 512-dimensional H_match to 256 dimensions, reducing the computational load of subsequent retrieval while ensuring a semantic loss rate ≤ 5%.

[0106] 5.2 Attention Weight Index Construction.

[0107] Attention weight index construction refers to building a "core feature-weight" index table based on the Match Attention Score, recording the knowledge base location (e.g., text triple ID, image ID, table ID) corresponding to high-weight features (e.g., weights ≥ 0.2) in H_match. For example, the "propose" feature corresponds to the ID of triple T1, and the "base" feature corresponds to the ID of triple T_new. After forming the index table, relevant knowledge can be directly located, avoiding a full database traversal.

[0108] 5.3 Quick Search and Answer Generation.

[0109] For example, quick retrieval and answer generation may include at least one of the following: similarity calculation, result sorting and filtering, and answer generation.

[0110] Similarity calculation refers to performing cosine similarity calculation between the compressed H_match and the pre-compressed knowledge representation in the knowledge base to obtain the similarity. For example, Similarity satisfies the following formula 15: Similarity = (H_match × K_vec^T) / (||H_match|| × ||K_vec||) (Formula 15) Where K_vec is the knowledge representation vector in the knowledge base.

[0111] Results sorting and filtering refers to sorting the search results in descending order based on similarity scores, taking the top-5 results as candidate answers, and combining them with the attention weight index table to verify the consistency between the candidate answers and the user's question intent (e.g., whether the candidate answers contain the "base" attribute), and finally filtering out the top-3 accurate answers.

[0112] Answer generation refers to converting filtered knowledge into natural language answers, such as: "Tomatoes grown at the Zhaoxian base, some of which contracted downy mildew." This is accompanied by relevant images (such as pictures of the greenhouse at the Zhaoxian base) and tables (such as the tomato planting and cultivation time), forming a multimodal answer output.

[0113] Step 206, Model Training and Optimization, is to ensure the effectiveness of the attention mechanism in each stage. The model needs to be trained and iteratively optimized end-to-end. Specifically, it includes the following steps: dataset construction, loss function design, training strategy implementation, and model iterative optimization.

[0114] 6.1 Dataset construction refers to collecting vegetable knowledge question and answer datasets (e.g., the "Vegetable Disease and Pest Original Color Atlas Sequel" in the field of vegetable diseases and pests, and the mid-term database of vegetable germplasm resources in the field of vegetable breeding), labeling "user question-knowledge-answer" triplets, and forming training set (80%), validation set (10%), and test set (10%).

[0115] 6.2 Loss function design refers to using a combined loss function of "cross-entropy loss function + contrastive loss function" to ensure that the model has both accurate matching and discriminative abilities. The cross-entropy loss function (also known as the matching loss function) is used to optimize the matching accuracy between the user's question intent and the knowledge representation. The cross-entropy loss function L_{ce} satisfies the following formula 16: L_{ce}=-\frac{1}{N}\sum_{i=1}^{N}[y_i\log(p_i)+(1-y_i)\log(1-p_i)]Formula 16 Where N is the number of training samples, y_i is the sample label (1 means "match between user question and knowledge", 0 means "no match"), and p_i is the matching probability output by the model.

[0116] By using cross-entropy loss, the model is guided to learn the mapping relationship of "high probability of outputting matching samples and low probability of outputting non-matching samples".

[0117] The contrastive loss function (also known as the discriminative loss function) is used to enhance the model's ability to distinguish similar knowledge and avoid "confusion of near-synonyms" (such as "tomatoes are grown in Zhao County" and "tomatoes are cultivated in Zhao County"). The contrastive loss function L_{contrast} satisfies the following formula 17: L_{contrast}=\frac{1}{M}\sum_{j=1}^{M}[\max(0,d_{pos}-d_{neg}+\alpha)]Formula 17 Where M is the number of comparison samples, d_{pos} is the distance between "user question - matching knowledge" (e.g., Euclidean distance), d_{neg} is the distance between "user question - similar non-matching knowledge", and alpha is the marginal parameter (set to 0.5). When d_{pos} - d_{neg} + alpha > 0, the model incurs a loss, prompting the model to widen the distance between "matching knowledge" and "similar non-matching knowledge".

[0118] The combined loss function of "cross-entropy loss function + contrastive loss function" is used to integrate the two losses through weight allocation to balance the training objectives of matching accuracy and discriminative ability. The combined loss function L_{total} of "cross-entropy loss function + contrastive loss function" satisfies the following formula 18: L_{total}=0.7L_{ce}+0.3L_{contrast} (Formula 18) 6.3 The implementation of the training strategy refers to selecting an optimizer and using the AdamW optimizer, setting the initial learning rate to 1e-5 and the weight decay coefficient to 1e-4, and suppressing model overfitting through weight decay.

[0119] The learning rate scheduling employs a "cosine annealing learning rate" strategy, maintaining a high learning rate in the early stages of training (to accelerate convergence) and gradually decreasing the learning rate in the later stages of training (to fine-tune parameters). The learning rate scheduling (lr) satisfies the following formula 19: lr=lr_0\times\frac{1+\cos(\frac{T_{cur}}{T_{max}}\times\pi)}{2} Formula 19 Where lr_0 is the initial learning rate, T_{cur} is the current training epoch, and T_{max} is the total number of training epochs (set to 100 epochs).

[0120] The early stopping mechanism refers to stopping training when the "question-answering accuracy" of the validation set has not improved for 10 consecutive rounds, in order to avoid the model from overfitting on the training set.

[0121] 6.4 Model iterative optimization refers to parameter fine-tuning. Specifically, after training, the attention weight allocation parameters are fine-tuned according to the characteristics of different domains (e.g., pests and diseases, cultivation). For example, in the pests and diseases domain, the attention weights of the "symptom-prevention" relationship need to be strengthened, and in the cultivation domain, the attention weights of the "crop-planting method" relationship need to be strengthened. This domain adaptation improves the model's performance in specific scenarios. Performance evaluation refers to evaluating model performance using three core indicators: "question-answer accuracy," "answer completeness," and "response time." On the test set, the requirements are: question-answer accuracy ≥ 92% (i.e., the proportion of the model's Top-1 answer that matches the standard answer), answer completeness ≥ 85% (i.e., the proportion of the model's output answer that contains the core information of the standard answer), and single question-answer response time ≤ 0.5 seconds, ensuring that the model meets the needs of practical applications.

[0122] This invention, through systematic technological innovation of the entire process of intelligent question-answering knowledge representation, breaks through the core technological bottlenecks of current methods, forming five mutually supportive and synergistic core technological innovations, and constructing a complete technical system covering "encoding-updating-matching-efficiency-adaptation", as detailed below: To address the inherent shortcomings of current technologies, such as "equal encoding of entity relationships, fragmented knowledge units, and shallow multimodal fusion," this invention innovatively proposes a three-level collaborative encoding architecture: "intra-triple self-attention - cross-triple cross-attention - cross-modal fusion attention." The intra-triple encoding stage dynamically learns the semantic weights of entities and relationships through a self-attention mechanism, achieving adaptive reinforcement of relational semantics (e.g., the attention weights of core relationships such as "propose" and "prevent" are significantly higher than entity weights), overcoming the unreasonable design of "equal assignment of values ​​to entities and relationships" in traditional encoding. The cross-triple encoding stage mines the logical connections between different knowledge units through a cross-attention mechanism (e.g., the semantic link between "tomato-suitable planting area" and "tomato-large-scale planting base"), constructing a global knowledge semantic network and avoiding fragmented knowledge representation. The cross-modal encoding stage employs a two-stage attention mechanism of "intra-modal feature reinforcement + inter-modal semantic matching" (e.g., semantic association modeling between visual features of pests and diseases in images and symptom descriptions in text), achieving deep semantic fusion of multi-source data such as text and images. This architecture improves the semantic integrity of knowledge representation by more than 40% compared to existing technologies, fundamentally solving the technical limitations of single-modal coding and localized coding in capturing global semantic relationships.

[0123] To address the technical challenges of long update cycles and catastrophic forgetting caused by global retraining in current technologies, this invention innovatively proposes a local incremental update scheme based on semantic association weights. This differs from the traditional "full data retraining" update model: when new knowledge is added to the knowledge base (e.g., new vegetable pests and diseases, new cultivation techniques), the semantic association between the new knowledge and existing knowledge is first calculated using an incremental attention module (e.g., the similarity between new entities and existing related entities, the semantic matching degree between new relationships and existing relationships). Attention weights are adjusted only for feature dimensions highly associated with the new knowledge, without reconstructing the entire knowledge representation system. Experimental results show that this mechanism reduces knowledge update time from "days" to "minutes" (update time for a single batch of new knowledge ≤ 5 minutes), and the accuracy of existing knowledge representation decreases by ≤ 3%, effectively avoiding the "catastrophic forgetting" problem of traditional models. This meets the application needs of real-time knowledge updates in fields such as vegetable pests and diseases and cultivation techniques.

[0124] Addressing the core pain point of current technologies, which rely on indirect keyword matching leading to biased intent understanding, this invention innovatively constructs an end-to-end intent-oriented attention modeling system encompassing "intent feature extraction - core weight allocation - semantic cross-matching." The intent feature extraction stage, through entity recognition, relationship classification, and intent recognition sub-modules, accurately locates the core intent of the user's question (e.g., the intent to "plant," the intent to "base location," and the intent to "pest and disease control"). The core weight allocation stage assigns zero or low weight to irrelevant redundant information in the user's question (e.g., modal particles like "which," "at," and descriptive expressions) through an intent attention layer, strengthening the representational intensity of the core intent features. The semantic cross-matching stage introduces a user question-knowledge cross-attention mechanism, directly establishing a deep mapping between the user's question intent and the semantics of knowledge, skipping the traditional indirect matching stage of "keyword extraction - similarity calculation." This system reduces the intent understanding error rate from over 30% to below 10% compared to existing technologies, and increases the Top-1 question answering accuracy to over 92%, completely solving the technical problem of "correct keyword matching but biased intent understanding."

[0125] To overcome the technical bottleneck of high vector dimensionality and time-consuming retrieval after multimodal fusion, this invention innovatively proposes an attention-guided semantic compression and efficient indexing strategy. The semantic compression stage filters core feature dimensions based on matching attention weights (e.g., a filtering threshold ≥ 0.2), retaining semantic information crucial for question-and-answer matching. Then, the 512-dimensional knowledge representation vector is compressed to 256 dimensions using PCA dimensionality reduction, achieving a core semantic loss rate ≤ 5%, thus eliminating redundant features while ensuring semantic integrity. The efficient indexing stage constructs a mapping index table of "core feature dimensions - knowledge base storage location," prioritizing the matching of core feature-related knowledge with high attention weights during question-and-answer retrieval, avoiding full database traversal. This strategy reduces single-question-and-answer response time to ≤ 0.5 seconds, improving retrieval efficiency by over 60% compared to traditional methods. It achieves a dynamic balance between question-and-answer matching accuracy and real-time response efficiency, adapting to the needs of real-time interactive scenarios such as intelligent customer service and intelligent field management assistants.

[0126] Addressing the engineering pain points of current technologies, namely poor domain adaptability and high deployment costs due to full retraining, this invention innovatively designs a domain-adaptive training optimization system based on "combined loss function + domain parameter fine-tuning." The loss function design employs a combination of "cross-entropy loss function (ensuring matching accuracy) + contrastive loss function (enhancing semantic discrimination)," effectively resolving user issues related to confusion in similar knowledge representations (e.g., semantic differentiation of different pest symptoms, and differential representation of similar cultivation techniques). In the domain parameter fine-tuning stage, after the model completes basic training, only the attention weight allocation strategy is fine-tuned for the knowledge characteristics of different application domains (e.g., strengthening the association weight between "pest symptoms and control methods" in the pest domain, and strengthening the association weight between "product parameters and performance" in the e-commerce domain), eliminating the need for full retraining. This system enables cross-domain transfer adaptation of the model to take ≤24 hours, reduces deployment costs by 50% compared to traditional models, significantly improves the model's engineering practicality, and solves the technical bottlenecks of traditional models, namely "difficult domain transfer and high deployment costs."

[0127] This invention demonstrates significant application effects, overcoming existing technological bottlenecks in multiple dimensions: In terms of accuracy, Top-1 question-and-answer accuracy is ≥92%, answer completeness is ≥85%, and the correct retrieval rate for fuzzy intent user questions reaches 94.7%, an improvement of 15-20 percentage points compared to traditional methods; in terms of dynamic adaptability, knowledge update time is reduced from "days" to "minutes" (≤5 minutes), the accuracy decline rate of old knowledge is ≤3%, and update efficiency is improved by 95%; in terms of multimodal fusion, information utilization rate reaches 89.2%, question-and-answer accuracy is 93.1%, and the misjudgment rate is reduced to 6.9%; in terms of efficiency, the long sequence key information memory rate reaches 91.3%, response time is ≤0.5 seconds, and it supports 200+ concurrent requests per second; in terms of practicality, cross-domain adaptation time is ≤24 hours, deployment costs are reduced by 50%, and accuracy in each domain is ≥90%. Experimental verification is thorough, adapting to knowledge services in multiple scenarios such as vegetable pest and disease control and cultivation management, improving the efficiency of agricultural technology extension services.

[0128] The intelligent question-answering device provided by the present invention is described below. The intelligent question-answering device described below can be referred to in correspondence with the intelligent question-answering method described above.

[0129] Figure 3This is a schematic diagram of the intelligent question-answering device provided by the present invention. The present invention discloses an intelligent question-answering device, including the following modules: Processing module 310: Processing module 310 is used to perform preprocessing on multi-source data, and construct a knowledge representation based on the preprocessed multi-source data using a multi-level attention architecture; Processing module 310 is also used to perform intent parsing on user questions based on attention-oriented intent modeling, and match the parsed user question intent with the knowledge representation; Processing module 310 is also used to perform knowledge retrieval based on the matched user question intent and knowledge representation, through semantic compression and indexing strategies, and output the target answer corresponding to the user question.

[0130] In some embodiments, the intelligent question-answering device provided by the present invention includes at least one of the following preprocessing methods: text preprocessing, image preprocessing, table preprocessing, and standardization preprocessing.

[0131] In some embodiments, according to the intelligent question-answering device provided by the present invention, the processing module 310 is further configured to retrieve preprocessed multi-source data and sequentially execute self-attention encoding, cross-unit attention association, cross-modal attention fusion and incremental attention update actions through a multi-level attention architecture to transform the multi-source data into a dynamic knowledge representation with a unified dimension.

[0132] In some embodiments, the processing module 310 of the intelligent question-answering device provided by the present invention is further configured to monitor the update status of multi-source data. When new data is detected, incremental attention is used to perform encoding actions only on the new data, and feature fusion and dynamic update actions are performed in combination with existing knowledge representation to complete the incremental iteration of knowledge representation.

[0133] In some embodiments, according to the intelligent question-answering device provided by the present invention, the processing module 310 is further configured to perform preprocessing on the user question; the processing module 310 is further configured to output the user question intent based on the preprocessed user question through an attention-oriented intent modeling network.

[0134] In some embodiments, according to the intelligent question-answering device provided by the present invention, the processing module 310 is further configured to perform cross-attention weight calculation based on the user's question intent and knowledge representation; the processing module 310 is further configured to obtain the knowledge representation matching the user's question intent by weighted summation based on the cross-attention weight and knowledge representation.

[0135] In some embodiments, according to the intelligent question-answering device provided by the present invention, the processing module 310 is further configured to perform attention-guided principal component analysis for dimensionality reduction on the matched intent features and knowledge representation, and generate a compressed retrieval feature vector within a preset semantic loss threshold; the processing module 310 is further configured to construct an index table mapping high-weight features to knowledge base storage locations based on cross-attention weights; the processing module 310 is further configured to perform neighborhood retrieval and similarity calculation with the compressed retrieval feature vector as input and the mapping range of the index table as the retrieval boundary, generate a candidate set after sorting the retrieval results, and obtain the target knowledge content after filtering by intent matching consistency verification.

[0136] In some embodiments, according to the intelligent question-answering device provided by the present invention, the processing module 310 is further configured to combine the user's question intent and slot information to perform answer generation, logic verification and format regularization on the target knowledge content, match the corresponding multimodal resources, and output the target answer corresponding to the user's question.

[0137] In some embodiments, the intelligent question-answering device provided by the present invention further includes a data acquisition module 320; the data acquisition module 320 is used to acquire domain question-answering corpus and knowledge base data, label user questions, knowledge representations, and triples corresponding to the target answers of user questions, and divide them into training sets, validation sets, and test sets; the processing module 310 is also used to construct a weighted combination loss function of cross-entropy loss and contrastive loss, perform end-to-end training of the model, and iteratively update the model parameters; the processing module 310 is also used to employ an optimizer, cosine annealing learning rate scheduling, and early stopping mechanism during training to suppress model overfitting; the processing module 310 is also used to adjust the trained model, and after performance verification by multi-dimensional indicators, iteratively optimize the model parameters and retrieval rules based on user feedback.

[0138] The working principles of the processing module 310 and the acquisition module 320 can be referred to the above. Figure 1 and / or Figure 2 The steps shown are not repeated here.

[0139] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4As shown, the electronic device may include a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, communications interface 420, and memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute an intelligent question-answering method. This method includes: preprocessing multi-source data and constructing a knowledge representation based on the preprocessed multi-source data using a multi-level attention architecture; parsing the user's question intent based on attention-oriented intent modeling and matching the parsed user question intent with the knowledge representation; and performing knowledge retrieval based on the matched user question intent and knowledge representation through semantic compression and indexing strategies, outputting the target answer corresponding to the user's question.

[0140] Furthermore, the logical instructions in the aforementioned memory 430 can be implemented as software functional units and, when sold or used as independent products, 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 a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0141] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the intelligent question-answering method provided by the above methods. The method includes: performing preprocessing on multi-source data and constructing a knowledge representation based on the preprocessed multi-source data using a multi-level attention architecture; parsing the user question's intent based on attention-oriented intent modeling and matching the parsed user question intent with the knowledge representation; and performing knowledge retrieval based on the matched user question intent and knowledge representation through semantic compression and indexing strategies, and outputting the target answer corresponding to the user question.

[0142] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the intelligent question-answering method provided by the above methods. The method includes: performing preprocessing on multi-source data and constructing a knowledge representation based on the preprocessed multi-source data using a multi-level attention architecture; parsing the user question's intent based on attention-oriented intent modeling and matching the parsed user question intent with the knowledge representation; and performing knowledge retrieval based on the matched user question intent and knowledge representation through semantic compression and indexing strategies, and outputting the target answer corresponding to the user question.

[0143] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0144] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

[0145] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. An intelligent question-answering method, characterized in that, The method includes: Preprocessing is performed on multi-source data, and knowledge representation is constructed based on the preprocessed multi-source data using a multi-level attention architecture; Attention-oriented intent modeling is used to parse the intent of user questions and match the parsed intent of the user questions with the knowledge representation. Based on the intent of the user's question after matching and the knowledge representation, knowledge retrieval is performed through semantic compression and indexing strategies to output the target answer corresponding to the user's question.

2. The method according to claim 1, characterized in that, The preprocessing includes at least one of the following: text preprocessing, image preprocessing, table preprocessing, and standardization preprocessing.

3. The method according to claim 1, characterized in that, The knowledge representation is constructed using the multi-layered attention architecture based on the preprocessed multi-source data, including: The preprocessed multi-source data is retrieved, and self-attention encoding, cross-unit attention association, cross-modal attention fusion, and incremental attention update actions are executed sequentially through the multi-level attention architecture to transform the multi-source data into a dynamic knowledge representation with a unified dimension.

4. The method according to claim 3, characterized in that, The method further includes: The update status of the multi-source data is monitored. When new data is detected, incremental attention is used to encode only the new data. Combined with the existing knowledge representation, feature fusion and dynamic update are performed to complete the incremental iteration of the knowledge representation.

5. The method according to claim 1, characterized in that, The attention-oriented intent modeling performs intent parsing on the user question, including: Perform the preprocessing on the user's question; Based on the preprocessed user question, the intent of the user question is output through the attention-oriented intent modeling network.

6. The method according to claim 1, characterized in that, The step of matching the intent of the parsed user question with the knowledge representation includes: Based on the user's intent and the knowledge representation, perform cross-attention weight calculation; Based on the cross-attention weights and the knowledge representation, a knowledge representation matching the intent of the user's question is obtained by weighted summation.

7. The method according to claim 1, characterized in that, The knowledge retrieval, based on the matched intent features of the user's question and the knowledge representation, is performed through the semantic compression and indexing strategy, including: Attention-guided principal component analysis is performed to reduce the dimensionality of the matched user question intent features and knowledge representation, generating a compressed retrieval feature vector within a preset semantic loss threshold. An index table mapping high-weight features to knowledge base storage locations is constructed based on the cross-attention weights; Using the compressed retrieval feature vector as input and the mapping range of the index table as the retrieval boundary, neighborhood retrieval and similarity calculation are performed. After sorting the retrieval results, a candidate set is generated, and the target knowledge content is obtained by filtering through intent matching consistency verification.

8. The method according to claim 7, characterized in that, The output corresponding to the target answer to the user question includes: Based on the intent of the user's question and the slot information, the system performs answer generation, logic verification, and format standardization on the target knowledge content, matches the corresponding multimodal resources, and outputs the target answer corresponding to the user's question.

9. The method according to claim 1, characterized in that, The method further includes: Collect domain question-and-answer corpora and knowledge base data, label the user question, the knowledge representation, and the triplet corresponding to the target answer of the user question, and divide them into training set, validation set and test set; Construct a weighted combination loss function of cross-entropy loss and contrastive loss, perform end-to-end training of the model, and iteratively update the parameters of the model; During training, an optimizer, cosine annealing learning rate scheduling, and early stopping mechanism are used to suppress overfitting of the model. The trained model is adjusted, and after performance verification by multiple dimensions, the model's parameters and retrieval rules are iteratively optimized based on user feedback.

10. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, The processor executes a computer program to implement the method as described in any one of claims 1 to 9.

11. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When a computer program is executed by a processor, it implements the method as described in any one of claims 1 to 9.

12. A computer program product, comprising a computer program, characterized in that, When a computer program is executed by a processor, it implements the method as described in any one of claims 1 to 9.