Intelligent question and answer method and system for primary school science education

By constructing the joint semantic parsing model BSJ-BERT, the problem of insufficient semantic understanding and contextual reasoning ability of existing intelligent question answering models in primary school science education scenarios is solved, achieving higher question answering accuracy and learning efficiency, and enhancing students' scientific interest.

CN120975234BActive Publication Date: 2026-03-31HUAZHONG NORMAL UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-08-01
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

Existing intelligent question-answering models struggle to effectively capture deep semantic connections in elementary school science education scenarios, lack contextual reasoning capabilities in multi-turn dialogues, and fail to guide students through a complete thought process of asking questions, designing experiments, and verifying conclusions for deep learning.

Method used

We employ the pre-trained language model BERT based on a self-supervised learning mechanism, combined with a slot labeling module and an intent recognition module, and construct a joint semantic parsing model BSJ-BERT through a parameter sharing mechanism. This enables deep collaborative modeling of intent recognition and slot labeling, thereby improving the model's robustness in parsing complex queries.

Benefits of technology

It significantly improves the accuracy and robustness of intelligent question answering, enabling it to better understand students' questions, provide accurate and reliable answers, and enhance learning efficiency and students' scientific interest.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120975234B_ABST
    Figure CN120975234B_ABST
Patent Text Reader

Abstract

The application provides a primary school science education intelligent question and answer method and system, comprising: inputting a user's question sample into a BERT model to obtain an encoding result of the question sample output by the BERT model; inputting the encoding result of the question sample into a slot labeling module and an intention recognition module to obtain slot information of the question sample output by the slot labeling module and an intention type of the question sample output by the intention recognition module; jointly training the slot labeling module and the intention recognition module according to the slot information and the intention type of the question sample; inputting a current question of a user into the BERT model and the intention recognition module in sequence to obtain an intention type of the current question, and obtaining an answer of the current question according to the intention type of the current question. The application improves the accuracy of educational intelligent question and answer.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of intelligent education technology, and in particular to an intelligent question-and-answer method and system for primary school science education. Background Technology

[0002] In this new phase of accelerated digital transformation, artificial intelligence (AI) technology is permeating education itself, moving beyond its tool-like aspects and driving a structural shift in science education paradigms. A key challenge for current research is how to construct a science education model deeply integrated with AI, enabling machine learning algorithms to function not only as teaching aids but also as cognitive scaffolds for cultivating students' computational thinking and innovative abilities. This transformation involves not only restructuring teaching content but also establishing a new human-machine collaborative teaching relationship. This presents innovative demands on traditional instructional design theories and offers an opportunity for a paradigm shift in core competency-based evaluation systems.

[0003] With the development of artificial intelligence, machine learning algorithms are breaking through the limitations of being merely "technical tools" and gradually evolving towards cognitive assistance and intelligent guidance. In the field of education, AI is not only a means to assist teaching, but also plays an active guiding role in students' knowledge construction process. The development of modern artificial intelligence technologies such as Natural Language Processing (NLP), Reinforcement Learning (RL), and adaptive learning algorithms has enabled intelligent education models to have stronger comprehension and adaptability. For example, advancements in NLP enable machines to accurately analyze open-ended questions posed by students and provide logically clear and progressive responses based on context, while reinforcement learning algorithms can optimize teaching paths through continuous feedback, enabling students to obtain personalized learning experiences.

[0004] Furthermore, the introduction of adaptive learning algorithms enables AI to dynamically adjust teaching content based on learners' knowledge levels, learning styles, cognitive characteristics, and emotional states. During the learning process, students' emotional changes significantly impact learning outcomes. For example, moderate challenges can stimulate curiosity, while excessive difficulty may lead to frustration and burnout. AI can assess students' emotional states in real time by analyzing their learning trajectories, response times, and even combining multimodal data such as facial expressions and tone of voice. Based on this, AI can adjust teaching strategies accordingly. For instance, when students show confusion or anxiety, the model can reduce task difficulty, provide more intuitive examples or guiding prompts to enhance their learning confidence; when students show increased proficiency and a stronger desire to explore, the complexity of the questions can be increased to guide them to deeper thinking and inquiry. This contextual awareness not only improves learning efficiency but also helps students maintain positive emotions during scientific exploration, cultivate lasting scientific interest, and promote the development of systematic scientific thinking, laying a solid cognitive and psychological foundation for solving complex problems.

[0005] Despite breakthroughs in adaptive learning algorithms for dynamically adjusting teaching content and contextual awareness, current intelligent question-answering models still have many limitations in science education scenarios. Current intelligent question-answering models in education primarily employ rule-based template matching and retrieval methods, which face significant limitations when dealing with elementary school science education scenarios: First, elementary school students' questions are often colloquial and fragmented (e.g., the semantic equivalence of "Why does ice melt into water?" and "What is the reason why ice turns into water when heated?"), making it difficult for traditional methods to effectively capture deep semantic connections; second, the hierarchical progression of scientific knowledge requires systems to possess contextual reasoning capabilities in multi-turn dialogues, while retrieval models based on word frequency statistics often fall into isolated "question-answer" matching; third, existing models generally lack adaptive support for the scientific inquiry process, making it difficult to guide students through the complete thought chain of "posing questions - designing experiments - verifying conclusions" for deep learning. Summary of the Invention

[0006] This invention provides an intelligent question-answering method and system for primary school science education, addressing the limitations of existing intelligent question-answering models in science education scenarios. It introduces a pre-trained language model based on a self-supervised learning mechanism, offering a new technical path for intelligent education. Large Language Models (LLMs), represented by BERT and GPT, have demonstrated near-human-level contextual understanding and generation capabilities in open domains through deep semantic representation. These models, through parameter-sharing mechanisms to form multimodal compatible feature spaces, provide a crucial technical foundation for constructing science education models that align with children's cognitive characteristics. They can not only handle mixed text and image input but also simulate collaborative inquiry processes between teachers and students in teaching scenarios through conversational interaction.

[0007] This invention provides an intelligent question-and-answer method for elementary school science education, comprising:

[0008] Input the user's question sample into the BERT model to obtain the encoded result of the question sample output by the BERT model;

[0009] The encoding result of the question sample is input into the slot labeling module and the intent recognition module to obtain the slot information of the question sample output by the slot labeling module and the intent type of the question sample output by the intent recognition module.

[0010] Based on the slot information and intent type of the question sample, the slot labeling module and the intent recognition module are jointly trained;

[0011] The user's current question is sequentially input into the BERT model and the intent recognition module to obtain the intent type of the current question, and the answer to the current question is obtained based on the intent type of the current question.

[0012] This invention also provides an intelligent question-and-answer system for elementary school science education, comprising:

[0013] The encoding module is used to input user question samples into the BERT model and obtain the encoding result of the question samples output by the BERT model;

[0014] The recognition module is used to input the encoding result of the question sample into the slot labeling module and the intent recognition module to obtain the slot information of the question sample output by the slot labeling module and the intent type of the question sample output by the intent recognition module.

[0015] The training module is used to jointly train the slot labeling module and the intent recognition module based on the slot information and intent type of the question sample.

[0016] The question-answering module is used to input the user's current question into the BERT model and the intent recognition module in sequence, obtain the intent type of the current question, and obtain the answer to the current question based on the intent type of the current question.

[0017] The intelligent question-answering method and system for primary school science education provided by this invention proposes a joint semantic parsing model BSJ-BERT, which aims to achieve deep collaborative modeling of intent recognition and slot labeling tasks. Compared with the traditional pipeline architecture where the two tasks are processed independently, BSJ-BERT constructs a bidirectional enhanced joint learning framework through parameter sharing mechanism and feature interaction design: the intent classification module provides semantic constraints for slot labeling, while the slot labeling module provides entity clues for intent recognition, forming a dynamic knowledge transfer loop. This collaborative mechanism effectively alleviates the semantic representation bias problem in data-sparse scenarios, significantly improves the model's robustness to parsing complex queries, and thus improves the accuracy of intelligent question answering. Attached Figure Description

[0018] 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.

[0019] Figure 1 This is a flowchart illustrating the intelligent question-and-answer method for elementary science education provided by the present invention;

[0020] Figure 2 This is a schematic diagram of the overall network structure of the BSJ-BERT model in the intelligent question-and-answer method for primary school science education provided by this invention;

[0021] Figure 3 This is a schematic diagram of the intent-aware retrieval enhancement generation method in the intelligent question-and-answer method for primary school science education provided by the present invention;

[0022] Figure 4 This is a schematic diagram of the overall research framework of the intelligent question-and-answer method for primary school science education provided by the present invention;

[0023] Figure 5 This is a bar chart illustrating the model performance on the ATIS dataset in the intelligent question-answering method for primary school science education provided by this invention.

[0024] Figure 6 This is a radar diagram illustrating the model performance on the SNIPS dataset in the intelligent question-answering method for primary school science education provided by this invention.

[0025] Figure 7This is a schematic diagram illustrating the change of model evaluation indicators with Epoch in the intelligent question-and-answer method for primary school science education provided by this invention;

[0026] Figure 8 This is a schematic diagram of four key indicators of the intelligent question-and-answer method for primary school science education provided by this invention on the StrategyQA dataset;

[0027] Figure 9 This is a schematic diagram of four key indicators of the intelligent question-and-answer method for primary school science education provided by this invention on the TruthfulQA dataset;

[0028] Figure 10 This is a schematic diagram of the intelligent question-and-answer system for elementary school science education provided by the present invention. Detailed Implementation

[0029] 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.

[0030] The following is combined Figure 1 This invention describes an intelligent question-and-answer method for elementary school science education, comprising:

[0031] Step 101: Input the user's question sample into the BERT model to obtain the encoding result of the question sample output by the BERT model;

[0032] Step 102: Input the encoding result of the question sample into the slot labeling module and the intent recognition module to obtain the slot information of the question sample output by the slot labeling module and the intent type of the question sample output by the intent recognition module.

[0033] Step 103: Based on the slot information and intent type of the question sample, jointly train the slot labeling module and the intent recognition module;

[0034] Step 104: Input the user's current question into the BERT model and the intent recognition module in sequence to obtain the intent type of the current question, and obtain the answer to the current question based on the intent type of the current question.

[0035] This embodiment proposes a joint semantic parsing model, named BERT-based Synergistic Joint Model (BSJ-BERT). This model uses BERT as a shared encoding layer, enabling it to simultaneously identify the intent type in user queries and extract relevant slot information. To adapt to the specific needs of the education field, a dataset (SES-ID) for science education in grades 5-6 of primary school can be constructed, containing a large amount of question-and-answer data related to primary school science, providing targeted resources for model training. Furthermore, through optimization of feature extraction and loss function, the accuracy and robustness of the model in the education field are significantly improved.

[0036] The overall network structure of the BSJ-BERT model is as follows: Figure 2 As shown, the BSJ-BERT model introduces an encoding unit that shares features across tasks, enabling intent recognition and slot labeling to learn based on a common BERT representation. BERT excels at capturing deep semantic information from context, and the BERT model trained on Chinese corpora provides a solid foundation for semantic representation in Chinese scenarios. This structure allows the two tasks to collaboratively mine key information in the text, thereby improving the model's ability to understand complex semantics.

[0037] Unlike traditional pipelined models, BSJ-BERT establishes direct connections between tasks during the encoding process, enabling the slot labeling module to provide richer semantic cues to the intent recognition module. For example, in sentences with multiple intents or complex expressions, slot labeling information can assist the intent classification task, helping the model more accurately identify the user's true needs, thereby optimizing the overall task coordination performance.

[0038] This embodiment proposes a joint semantic parsing model, BSJ-BERT, which aims to achieve deep collaborative modeling of intent recognition and slot labeling tasks. Compared with the traditional pipeline architecture where the two tasks are processed independently, BSJ-BERT constructs a bidirectional enhanced joint learning framework through parameter sharing and feature interaction design: the intent classification module provides semantic constraints for slot labeling, while the slot labeling module provides entity clues for intent recognition, forming a dynamic knowledge transfer loop. This collaborative mechanism effectively alleviates the semantic representation bias problem in data-sparse scenarios, significantly improves the model's robustness to parsing complex queries, and thus improves the accuracy of intelligent question answering.

[0039] Based on the above embodiments, the intent recognition module in this embodiment includes the [CLS] layer and a fully connected layer in the BERT model. The encoding result of the question sample is input into the intent recognition module to obtain the intent type of the question sample output by the intent recognition module, including:

[0040] Based on the encoding result of the question sample, the hidden state of the question sample is marked with [CLS].

[0041] After applying linear transformation and dropout operations to the hidden state of the question sample using the CapNet module, it is mapped to the intent label space to obtain the intent type of the question sample.

[0042] In the intent classification task, the hidden state of the [CLS] tag serves as the core basis for sentence-level semantic representation. Inspired by the next sentence prediction task in BERT's pre-training objective, the [CLS] embedding is guided to learn the ability to discriminate logical relationships between sentences, thereby implicitly encoding global semantic features. The [CLS] tag hidden state is set to h through a fully connected layer. [CLS] Mapping to the intent label space R K×d (K is the number of intent categories, d is the hidden layer dimension) and complete intent classification:

[0043] y intent =softmax(W intent h [CLS] +b intent ),W intent ∈R K×d (1)

[0044] In this process, the CapNet module is introduced to h [CLS] With further processing, CapNet captures fine-grained contextual features, enhancing the model's ability to understand complex semantics and extract information.

[0045] CapNet applies a linear transformation and dropout operation to this feature to reduce the impact of BERT feature distribution differences on the intent classification task, thereby improving the stability and accuracy of the model during the optimization process. The CapNet module captures fine-grained contextual features through a variant of Capsule Network, reducing the impact of BERT feature distribution differences on intent classification and improving the stability of complex semantic recognition.

[0046] Based on the above embodiments, the slot labeling module in this embodiment includes the WordPiece segmentation module in the BERT model, as well as a linear transformation and softmax layer. The encoding result of the query sample is input into the slot labeling module to obtain the slot information of the query sample output by the slot labeling module, including:

[0047] After inputting the encoding result of the question sample and the hidden state of the first subword of each word into the WordPiece word segmentation module, the hidden state of the first subword is mapped to the slot label space through the linear transformation and softmax layer to obtain the slot information of the question sample.

[0048] The slot information of the question sample is adjusted based on the Conditional Random Field (CRF) to train the joint semantic parsing model according to the intent type of the question sample and the adjusted slot information.

[0049] The slot labeling task aims to classify the slot labels of each word in the input sentence to identify key semantic components. Since BERT uses the WordPiece segmentation mechanism, a single word may be decomposed into multiple sub-words. To address word alignment issues, this embodiment selects the hidden state of the first sub-word of each word as the input feature for slot label prediction. This ensures the accuracy of slot prediction without affecting the segmentation performance. Subsequently, through linear transformation and a softmax layer, the hidden states are mapped to specific slot label categories:

[0050]

[0051] With this design, the model can capture slot information at the word level and avoid redundant calculations of sub-words.

[0052] Furthermore, the model features a flexible slot labeling mechanism. For slot labeling tasks, a CRF layer is introduced to further enhance labeling accuracy. The CRF layer can adjust the labeling results based on global features and sequence dependencies, making the labeling results more consistent with the structural characteristics of natural language. Compared to traditional independent labeling methods, CRF can better capture contextual relationships when processing sequence labels, thus providing more accurate slot predictions in complex labeling scenarios.

[0053] Based on the above embodiments, this embodiment uses the following formula to jointly train the slot labeling module and the intent recognition module according to the slot information and intent type of the question sample:

[0054]

[0055] Where p(y intent |X) is the intent type y intent The conditional probability, It is the conditional probability of the nth slot information label, where N is the number of slot information, X is the encoding result, and p(y) is the conditional probability of the nth slot information label. intent ,y slot|X) is the conditional probability of the joint intent type and slot information.

[0056] In this embodiment, a joint probability model is constructed to simultaneously optimize the joint intent classification and slot labeling tasks. It is the product of conditional probabilities for slot labeling. This joint probability design can capture the correlation between the two tasks during the optimization process, improving the synergistic effect of the model in semantic understanding and labeling tasks.

[0057] Based on the above embodiments, this embodiment uses the following formula to jointly train the slot labeling module and the intent recognition module according to the slot information and intent type of the question sample:

[0058]

[0059]

[0060] Where L is the loss function, λ intent The loss weights are of the intent type, λ slot It is the loss weight of slot information, p(y intent |X) is the intent type y intent The conditional probability, X represents the conditional probability of labeling the information in the nth slot, where N is the number of slots and X is the encoding result. λ is the loss weight for the t-th iteration of the intention identification task or slot labeling task. base It is a preset weight. It is the loss of the (t-1)th iteration of the intention recognition task or slot labeling task, where σ(·) represents the Sigmoid function and α1 is the adjustment parameter.

[0061] Intent classification and slot labeling tasks may have varying levels of difficulty during training. To avoid optimization problems caused by task imbalance, this model employs a dynamic loss weight adjustment mechanism. This mechanism dynamically adjusts the loss weight of each task based on its loss value, allowing the model to allocate more attention to more challenging tasks during training.

[0062] The formula for calculating the loss weight is shown in formula (5). If the loss of a certain task is large, its weight will increase accordingly to ensure that the model pays more attention to that task during optimization. This mechanism can effectively balance the optimization difficulty of intent classification and slot labeling, and improve the overall performance of the model.

[0063] To achieve joint learning of intent classification and slot labeling tasks, the ultimate goal of the model is to maximize the joint probability p(y). intent ,y slot|X), to achieve joint learning of intent classification and slot labeling. Therefore, the joint cross-entropy loss function is used to optimize the model, and the definition of the joint loss function is as shown in formula (4).

[0064] By minimizing the joint loss function, the model can simultaneously optimize the accuracy of intent classification and slot labeling tasks during training, thereby improving its global and local understanding of user statements.

[0065] To further improve model performance, an end-to-end joint training method was adopted within the multi-task framework of intent recognition and slot labeling. During training, the model simultaneously optimized the loss functions of both tasks, thereby enhancing information exchange and synergy between them. Furthermore, targeted optimization strategies, such as adaptive loss function adjustment and feature selection, were introduced during training to ensure the model has high generalization ability and efficiency in practical applications. Through these optimization measures, the model can better understand students' questions, thus providing accurate and reliable support for intelligent question answering models.

[0066] To further enhance the model's coordination across different tasks, this embodiment designs a strategy for dynamically adjusting the loss. Typically, in multi-task learning, the loss values ​​for different tasks may fluctuate during training, thus affecting the model's training performance. By calculating the loss values ​​separately for intent recognition and slot labeling tasks, and dynamically adjusting their respective loss weights, effective task balance is ensured at each stage of model training. Specifically, this loss adjustment mechanism dynamically allocates weights based on the magnitude of each task's loss, assigning higher weights to tasks with larger loss values, thereby effectively avoiding training bias caused by excessively high or low losses in a single task. This not only ensures a smooth training process but also significantly improves the model's convergence speed and accuracy.

[0067] Based on the above embodiments, this embodiment further includes jointly training the slot labeling module and the intent recognition module according to the slot information and intent type of the question sample, and also includes:

[0068] Based on the accumulated gradient from multiple iterations, the parameters in the slot labeling module and the intent recognition module are updated using the stochastic gradient descent method.

[0069] The training process includes several key steps, starting with data preparation and continuing until model optimization and storage.

[0070] During the training phase, random sampling is used to load data onto the training set to enhance the model's resilience against data diversity and over-selection. Sequential sampling is used on the validation and test sets to ensure consistent evaluation rules during testing. DataLoader efficiently delivers batches of data to the model, and preprocessing and standardization ensure the quality and consistency of the input data.

[0071] Stochastic Gradient Descent (SGD) is used as the primary optimization algorithm, combined with the cross-entropy loss function to measure the difference between the model's predictions and the actual labels. The cross-entropy loss function is defined as follows in classification tasks:

[0072]

[0073] Among them, y i For the true label of the i-th sample (usually using one-hot encoding), p i Let N be the class probability predicted by the model, and N be the number of samples. By minimizing the cross-entropy loss function, the optimizer can adjust the model parameters to make the predictions as close as possible to the true labels.

[0074] To improve training memory efficiency and support larger batches of data, this embodiment introduces a gradient accumulation strategy. The model updates its parameters only after accumulating several steps, effectively reducing the GPU memory usage per training step and improving training stability. The formula for calculating the accumulated gradient is as follows:

[0075]

[0076] Based on the above embodiments, this embodiment further includes jointly training the slot labeling module and the intent recognition module according to the slot information and intent type of the question sample, and also includes:

[0077] The AdamW optimizer is used to jointly train the slot labeling module and the intent recognition module, and the parameters of the AdamW optimizer are updated using the following formula:

[0078]

[0079] Where, θ t θ is the parameter of the AdamW optimizer in the t-th iteration. t-1 These are the parameters of the AdamW optimizer in the (t-1)th iteration, where α2 is the learning rate and m t and v t These are the first-order moment estimate and the second-order moment estimate of the gradient, respectively. β is the weight decay coefficient, and ε is a small constant to prevent division by zero errors.

[0080] The model optimization uses the AdamW optimizer, which introduces a weight decay mechanism on the basis of the Adam optimizer, thereby effectively alleviating the overfitting problem. The parameter update rule of AdamW is as shown in formula (8). The AdamW optimizer can dynamically adjust the learning rate according to the gradient of each parameter, which accelerates the training process and improves the generalization ability of the model.

[0081] Based on the above embodiments, in this embodiment, during the warm-up phase of the initial training stage, the learning rate increases linearly using the following formula:

[0082]

[0083] Among them, lr t is the learning rate for the t-th iteration, lr0 is the initial learning rate, t is the current iteration number, and steps is the number of iterations corresponding to the warm-up phase;

[0084] After the warm-up phase ends, the learning rate decreases linearly with the number of iterations according to the following formula:

[0085]

[0086] Where maxsteps is the preset maximum number of iterations.

[0087] To improve training stability, this embodiment employs a strategy combining linear warm-up and linear decay. This strategy allows the model to smoothly enter the learning state in the early stages of training, while also improving convergence stability in the later stages.

[0088] After each epoch of model training, an evaluation is performed to monitor model performance. Common metrics such as loss and accuracy are used to measure model performance during the evaluation. Accuracy is defined as follows:

[0089]

[0090] in, It is the model's predicted label, y i The true label is I(·), which is an indicator function that takes the value 1 when the prediction is correct and 0 otherwise. Accuracy reflects the model's performance on the validation set and helps to determine its generalization ability.

[0091] Based on the above embodiments, this embodiment obtains the answer to the current question according to the intent type of the current question, including:

[0092] Using Bing Search v7, a preliminary answer to the current question is obtained based on the intent type of the current question.

[0093] Building upon the existing security filtering in Bing Search v7, a content screening model from the BERT model is introduced to remove inappropriate content from the search results.

[0094] Verify the rationality and completeness of the preliminary answer, and revise the preliminary answer based on the verification results.

[0095] The Intent-Aware Multimodal Retrieval-Augmented Generation (IAM-RAG) method proposed in this embodiment integrates intent-aware and retrieval-enhanced large language model reasoning, comprising three key steps aimed at improving the accuracy, scientific rigor, and comprehensibility of explanatory question-and-answer tasks in elementary science education. The specific process is as follows: Figure 3 As shown, it includes:

[0096] The first step is an intent-based thought chain reasoning method. In this stage, the intent recognition model proposed earlier is used to analyze the questioner's intent. This model, through semantic parsing of the question, can accurately identify the core content and potential intent of the question. The model decomposes the question into multiple sub-tasks and generates appropriate reasoning steps based on the nature of each sub-task. These reasoning steps include analyzing the question's background, extracting relevant scientific principles, and constructing explanatory logic. By explicitly generating these intermediate reasoning steps, the model can avoid ambiguity or gaps in the answer, improving its ability to handle complex problems and ensuring the logic and coherence of the final answer. This mechanism not only improves the depth of question understanding but also allows the answer to better align with the questioner's actual needs, thereby enhancing the scientific validity and comprehensibility of the explanation.

[0097] The second step is retrieval-enhanced generation. In this step, the model combines external scientific knowledge bases or educational resources, enabling it to not only rely on pre-trained knowledge when generating answers but also dynamically acquire supplementary information relevant to the question. In this way, the model can instantly access specific experimental data, scientific facts, or academic background support related to the question, significantly improving the accuracy and authority of its answers. This mechanism is particularly suitable for science education questions that require detailed, authoritative data or background information, allowing the model to provide more comprehensive and accurate solutions, and increasing the academic depth and reliability of the answers.

[0098] In this embodiment, the Bing Search v7 API was chosen as the primary tool for the external retrieval module to optimize the efficiency and effectiveness of the retrieval enhancement generation process. Compared to other information sources, the Bing Search v7 API exhibits unique advantages in terms of real-time performance and breadth. First, Bing Search v7 can update information in real time via the internet, providing the system with the latest data support, a feature particularly important in rapidly changing fields (such as technological developments and news reports). Furthermore, Bing Search v7 supports multimodal data retrieval, providing information in various formats such as text, images, and videos, thereby further expanding the applicability of the question-answering model. Simultaneously, Bing Search v7 offers rich filtering functions, including customized parameters such as region, language, and number of results, enabling precise retrieval of target data based on specific needs. These advantages make Bing Search v7 an ideal choice for enhancing the external knowledge acquisition capabilities of the intelligent question-answering model in this study.

[0099] Table 1 shows typical search results related to "Brownian motion" obtained through the Bing Search v7 API. Based on the initial answers generated by the model, the search module retrieved academic materials and experimental research related to "Brownian motion" from external databases. After adopting the enhanced search mode, the model obtained more detailed key information, such as that Brownian motion applies not only to pollen particles but also to suspended particles like smoke particles and oil droplets, and that water temperature affects the particle's velocity. Compared to the basic search mode, the optimized enhanced search generation process makes the system's answers more in-depth and comprehensive, combining supporting information from multiple dimensions to ensure the accuracy, scientific validity, and insightful nature of the answers, thereby improving the applicability of the intelligent question-answering system in educational scenarios.

[0100] Table 1 Example of API query results

[0101]

[0102] To ensure knowledge security in educational settings, this embodiment constructs a dual content filtering mechanism: the lower layer relies on Bing Search v7's native security policy, while the upper layer deploys a fine-grained screening model based on BERT. This ensures continuous access to the latest scientific knowledge, avoiding inaccurate answers due to outdated local knowledge base information, which is particularly suitable for fields with rapidly evolving technologies. Furthermore, to guarantee the appropriateness of search results, a BERT-based content screening model is introduced on top of Bing Search v7's native security filtering to remove inappropriate content, improving the reliability of the question-answering model in educational scenarios.

[0103] The third step involves backtracking and self-correction. After generating the initial answer, the model automatically generates a series of targeted questions to verify the reasonableness and completeness of the answer. This backtracking mechanism helps the model identify potential errors or omissions and correct the answer when necessary. This process simulates the reflection and revision behavior of human experts when reviewing answers, thereby improving the quality and credibility of the answer. Through this mechanism, the model can continuously optimize the content of the answer, improve its scientific rigor and credibility, and also ensure that the answer is more accurate and relevant to the questioner's needs. The overall research framework diagram is as follows: Figure 4 As shown.

[0104] Table 2 presents the experimental results of multiple models on the ATIS dataset. Significant differences were observed in intent accuracy and slot F1 score across various evaluation metrics, with variations in slot precision, slot recall, and semantic accuracy among the models. Overall, BSJ-BERT performed best in intent accuracy (97.4%) and slot recall (94.3%), while also maintaining high levels in slot precision (93.3%) and slot F1 score (93.8%), achieving a semantic accuracy of 83.7%, outperforming most other models. Secondly, JointBERT slightly lagged behind in intent accuracy (97.1%), but its slot F1 score and semantic accuracy of 94.5% and 85.5% respectively still demonstrated excellent performance.

[0105] Table 2 Experimental results of the baseline model on the ATIS dataset

[0106]

[0107]

[0108] like Figure 5 As shown in the bar chart, the overall performance of BSJ-BERT and JointBERT is the most outstanding. In terms of intent recognition, the bar heights of BSJ-BERT and JointBERT are similar, both significantly higher than other models, indicating that these two models have a significant advantage in intent recognition. Specifically, BSJ-BERT excels in intent recognition, while JointBERT has a slight advantage in slot filling and semantic understanding. Slot Gate achieves exceptional slot accuracy, but its overall performance is somewhat unbalanced, mainly limited by insufficient intent recognition capability.

[0109] Therefore, although JointBERT slightly improved its slot-filling F1 score to 94.5%, compared to BSJ-BERT's 93.8%, BSJ-BERT performed better overall in intent recognition and semantic accuracy. Specifically, BSJ-BERT achieved an accuracy of 97.4% in intent recognition, surpassing JointBERT's 97.1% and demonstrating stronger intent capture capabilities. Meanwhile, in terms of semantic accuracy, BSJ-BERT reached 83.7%, closely following JointBERT's 85.5%, maintaining a high level. This indicates that when faced with structured corpora, BSJ-BERT can effectively learn sentence-level semantic information, accurately recognizing user intent while also considering overall slot-filling performance, thus exhibiting more balanced performance across multiple evaluation metrics.

[0110] The experimental results on the SNIPS dataset are shown in Table 3. Overall, the models generally achieved high accuracy in the intent recognition task, but there were significant differences in slot filling and semantic accuracy. The three best-performing models were JointBERT, BERT-BiGRU-CRF, and BSJ-BERT. BSJ-BERT achieved 98.1% accuracy in intent recognition, 94.3% F1 score in slot filling, and 86.9% semantic accuracy. In comparison, JointBERT achieved 98.9% accuracy in intent recognition, 93.7% F1 score in slot filling, and 85.9% semantic accuracy; BERT-BiGRU-CRF achieved 98.3% accuracy in intent recognition, 94.1% F1 score in slot filling, and 86.3% semantic accuracy.

[0111] Table 3. Experimental results of the baseline model on the SNIPS dataset.

[0112]

[0113] like Figure 6 As shown in the radar chart, the performance of each model on three key metrics—intent recognition, slot filling F1 score, and semantic accuracy—is further visualized. It can be seen that BSJ-BERT significantly outperforms other models in slot filling F1 score and semantic accuracy, especially excelling in semantic accuracy. This indicates that BSJ-BERT can more comprehensively understand user intent and slot information. Furthermore, although JointBERT has a slight edge in intent recognition, BSJ-BERT demonstrates better overall balance across the three metrics, showcasing robustness and practicality in multi-task scenarios.

[0114] In summary, BSJ-BERT demonstrates superior performance in intent recognition, slot filling, and overall semantic understanding, showing a clear advantage, particularly in slot filling and semantic accuracy. In contrast, while JointBERT has a slight edge in intent recognition, it lags slightly behind in overall performance balance. BSJ-BERT's performance proves its effectiveness in handling multi-task natural language understanding tasks, showcasing good generalization ability and practical value.

[0115] In summary, BSJ-BERT demonstrates superior performance on both the ATIS and SNIPS public datasets, achieving high accuracy in intent recognition and slot filling tasks, as well as outstanding semantic accuracy. Particularly on the SNIPS dataset, BSJ-BERT outperforms other comparative models in metrics such as Slot F1 score and semantic accuracy. This indicates that the model effectively captures the implicit relationship between intent and slots in the joint learning tasks of intent classification and slot filling, thereby achieving more accurate information extraction and intent understanding.

[0116] To further verify the robustness and practical application value of the model, a self-built dataset, SES-ID, was used for testing. The SES-ID dataset focuses on intent classification and slot filling tasks in elementary school science education question-and-answer scenarios, involving more professional educational terminology and question-and-answer formats that are closer to real teaching environments. The experimental results are shown in Table 4.

[0117] Table 4 shows the experimental results on the SES-ID dataset.

[0118]

[0119] In the intent recognition task, both BERT-BiGRU-CRF and BSJ-BERT achieved 100% accuracy, significantly outperforming JointBERT's 98.2%. This demonstrates that in intent classification tasks within the elementary science education question-and-answer domain, both BSJ-BERT and BERT-BiGRU-CRF models can accurately determine the user's intent with virtually no false positives. This high intent recognition accuracy is crucial for the practical application of educational question-and-answer models, as it ensures a more accurate understanding of student questions, thereby providing more appropriate answers.

[0120] In the slot filling task, the BERT-BiGRU-CRF model achieved the highest F1 score (95.6%), demonstrating its detailed ability in slot annotation. Furthermore, BERT-BiGRU-CRF's slot accuracy (94.8%) and recall (96.4%) were both higher than JointBERT and BSJ-BERT. Although BSJ-BERT's F1 score in slot filling was slightly lower than BERT-BiGRU-CRF (93.9%), its accuracy (93.1%) and recall (94.7%) remained very close. JointBERT performed relatively poorly in the slot filling task, with an F1 score of 91.3%, indicating slightly inferior accuracy and recall in slot extraction.

[0121] Semantic accuracy is a crucial metric for evaluating a model's overall accuracy in intent recognition and slot filling tasks, reflecting its comprehensive understanding of the joint task. BSJ-BERT achieved a semantic accuracy of 94.7%, significantly outperforming BERT-BiGRU-CRF's 56.1% and JointBERT's 92.9%. This indicates that BSJ-BERT demonstrates better collaborative processing capabilities between intent recognition and slot filling tasks, exhibiting greater robustness in comprehensively understanding the semantics of the problem. In contrast, while BERT-BiGRU-CRF performs well in slot filling, its lower semantic accuracy may be due to its inability to effectively balance the performance of intent classification and slot annotation in the joint task.

[0122] like Figure 7 As shown, the training process and performance of BSJ-BERT were evaluated. First, regarding the accuracy of intent recognition, with the increase in training epochs, the model's accuracy rapidly increased from the initial value of 0.77 to 0.97, and then stabilized after the sixth epoch, eventually reaching 1.0. This indicates that the model can effectively recognize different intents and continuously optimizes during training, demonstrating good convergence. However, regarding the change in loss value, it was observed that the model's loss value gradually decreased from 1.96 to 0.67, with a more pronounced downward trend in the first few epochs. Although the rate of decrease in loss value slowed down later, the overall trend indicates that the model quickly mastered effective features in the early stages and gradually optimized the model parameters.

[0123] The evaluation metrics for slot identification are quite positive. The F1 score for slots improved from 0.13 to 0.63, showing significant progress, while slot precision also showed a steady increase, indicating that the model is quite accurate in slot prediction. However, slot recall consistently remained slightly lower than precision, suggesting that the model may miss some slots during identification, potentially requiring further optimization of sample balance or improvement of the model's training strategy. Increasing the amount of data or adjusting the loss function can balance precision and recall, further improving overall performance. These optimization measures help enhance the model's generalization ability and adaptability to complex tasks.

[0124] In summary, the experimental results on the SES-ID dataset demonstrate that BSJ-BERT achieves high accuracy, precise slot filling, and excellent semantic understanding in joint tasks. This performance indicates that BSJ-BERT possesses better robustness and generalization ability, making it suitable for diverse natural language understanding scenarios and a powerful tool for question answering in elementary science education.

[0125] This study evaluates the impact of the proposed intent-aware retrieval enhancement generation method on various tasks by conducting experiments on two widely recognized datasets: StrategyQA (a multi-step reasoning task) and TruthfulQA (a truth verification task). The results show that the model has several baseline models (Llama2-7b, Llama3-8b, ChatGLM3-6b, and Qwen2.5-7b).

[0126] Tables 5 and 6 show the performance differences between the original generative model and the model optimized by the intent-aware strategy on the StrategyQA and TruthfulQA datasets, respectively.

[0127] Table 5. Experimental results of the baseline model in StrategyQA.

[0128]

[0129] By comparing the models in the table, the IAM-RAG optimization strategy significantly outperformed its baseline version in multiple models, especially in terms of precision and recall. The optimized model effectively improved the accuracy of correct answers and the ability to identify positive classes. Figure 8 This provides a more intuitive comparison between the original model and the model optimized using the IAM-RAG strategy.

[0130] By observing the various indicators, the following analysis can be drawn:

[0131] The IAM-RAG optimization strategy significantly improved the accuracy of all models, with particularly outstanding performance on the Qwen2.5-7b model, where accuracy increased from 0.6246 to 0.7747, and Llama3-8b from 0.6327 to 0.7342. The accuracy improvement of ChatGLM3-6b was slightly lower than other models, possibly because its baseline model already had a high recall, limiting the optimization space. All models showed improvements of over 8%, indicating that the introduction of the intent-aware mechanism effectively enhanced the model's comprehensive reasoning ability for complex problems. Compared to traditional fine-tuning methods, the optimization magnitude of IAM-RAG highlights the advantages of the dual-module collaborative mechanism. The IAM-RAG-optimized models generally performed better in terms of accuracy, especially the Llama series models, with Llama2-7b's accuracy increasing from 0.6221 to 0.7105, and Llama3-8b from 0.6285 to 0.7196. The precision improvement of Qwen2.5-7b was relatively small, possibly because its baseline value was already close to the theoretical upper limit, leaving limited room for optimization; however, its recall improved from 0.4936 to 0.5490, indicating that IAM-RAG can expand the knowledge coverage while maintaining high precision. This phenomenon stems from the accurate modeling of the essence of the question by the intent-aware module: by dynamically identifying the core concepts in student questions, the model can filter irrelevant or ambiguous information, thereby reducing false positive errors. This shows that IAM-RAG helps reduce the probability of the model generating incorrect answers, making the prediction results more reliable.

[0132] In terms of recall, IAM-RAG significantly enhances the model's ability to identify positive samples. For example, the recall of Llama3-8b increased from 0.6982 to 0.8037, while ChatGLM3-6b increased from 0.8163 to 0.8571. This improvement is attributed to the dynamic knowledge expansion of the retrieval enhancement module: by integrating cutting-edge resources in the discipline, the model can associate more potential correct answers. Simultaneously, the intent-aware module guides the retrieval direction by analyzing the implicit goals of student questions, avoiding knowledge redundancy.

[0133] The F1 score combines precision and recall, reflecting the overall generation quality of the model. The improvement in F1 score by IAM-RAG validates its ability to synergistically optimize precision and recall. For example, the F1 score of Llama2-7b improved from 0.6636 to 0.7480, while that of Qwen2.5-7b improved from 0.6450 to 0.6950. This result demonstrates that IAM-RAG effectively alleviates the trade-off between "high precision and low recall" or "high recall and low precision" in traditional methods through a closed-loop feedback mechanism of intent awareness and retrieval enhancement. Although the F1 improvement of Qwen2.5-7b is lower than other models, its baseline precision is extremely high, making the recall improvement more significant, indicating that IAM-RAG can still maintain performance gains in extremely skewed data distributions.

[0134] In summary, experimental results on the StrategyQA dataset demonstrate that the IAM-RAG optimization strategy significantly improves the model's multi-step reasoning ability, particularly in the key metrics of accuracy and precision. IAM-RAG not only optimizes the model's understanding of multi-step reasoning tasks but also enhances the accuracy and reliability of answers while ensuring comprehensive coverage.

[0135] Table 6. Experimental results of the baseline model in Truthful QA

[0136]

[0137] Experimental results on the TruthfulQA dataset validate the effectiveness of the IAM-RAG strategy in improving the performance of various models. Although TruthfulQA is a challenging task overall and the original models generally perform poorly, the introduction of IAM-RAG improves all metrics to varying degrees. Figure 9 The comparison shows the performance of the original model with that of the model after applying the IAM-RAG optimization strategy.

[0138] Most notably, the model accuracy has significantly improved. For example, ChatGLM3-6b's accuracy jumped from 0.7717 to 0.9038, an increase of over 13 percentage points. Llama3-8b showed an even more significant improvement in accuracy, reaching a relative increase of 16.47%. This improvement primarily stems from the dual advantages of the IAM-RAG architecture: the intent-aware module effectively identifies potential misleading information in questions, improving the accuracy of misleading question identification by approximately 40% through real-time analysis of the question's semantic features and logical structure; while the retrieval enhancement module provides reliable external knowledge support to the model by dynamically accessing a validated knowledge base.

[0139] In balancing precision and recall, IAM-RAG optimization demonstrates a unique advantage. The optimized ChatGLM3-6b achieves a high precision of 0.9265, meaning the model provides accurate answers in the vast majority of cases; simultaneously, its recall remains at 0.9038, indicating the model can accurately capture the correct answer. This balance is achieved through an innovative dynamic weight adjustment mechanism: for clearly defined questions, the system prioritizes precision; while for open-ended questions, it appropriately increases the weight of recall. This differentiated optimization strategy allows the model to maintain optimal performance across different question types.

[0140] An improved F1 score indicates that the optimized model achieves a more balanced performance across precision and recall, enabling it to provide higher-quality answers, especially when faced with complex or misleading questions. For example, ChatGLM3-6b's F1 score improved from 0.8109 to 0.9145. In-depth analysis reveals that this improvement is primarily attributed to the retrieval enhancement module, which reduces the logical reasoning steps required by the model when answering questions, significantly decreasing the likelihood of error accumulation.

[0141] In summary, the IAM-RAG strategy not only effectively improves the performance of all baseline models on the TruthfulQA dataset, but the improvement becomes more significant as the model's capabilities increase. This further validates the broad applicability and robustness of IAM-RAG, making the model more competitive in complex reasoning and fact-checking tasks.

[0142] The intelligent question-and-answer system for elementary science education provided by this invention is described below, and can be referred to in conjunction with the method described above. For example... Figure 10 As shown, the system includes:

[0143] The encoding module 1001 is used to input the user's question sample into the BERT model and obtain the encoding result of the question sample output by the BERT model;

[0144] The recognition module 1002 is used to input the encoding result of the question sample into the slot labeling module and the intent recognition module to obtain the slot information of the question sample output by the slot labeling module and the intent type of the question sample output by the intent recognition module.

[0145] The training module 1003 is used to jointly train the slot labeling module and the intent recognition module based on the slot information and intent type of the question sample.

[0146] The question-answering module 1004 is used to input the user's current question into the BERT model and the intent recognition module in sequence to obtain the intent type of the current question, and to obtain the answer to the current question based on the intent type of the current question.

[0147] 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. A primary school science education intelligent question and answer method, characterized in that, The method comprises the following steps: inputting a user's question sample into a BERT model to obtain an encoding result of the question sample output by the BERT model; inputting the encoding result of the question sample into a slot labeling module and an intent recognition module to obtain slot information of the question sample output by the slot labeling module and an intent type of the question sample output by the intent recognition module; jointly training the slot labeling module and the intent recognition module according to the slot information and the intent type of the question sample; inputting a current question of a user into the BERT model and the intent recognition module in sequence to obtain an intent type of the current question, and obtaining an answer to the current question according to the intent type of the current question; the intent recognition module comprises [CLS] and a full connection layer in the BERT model, the encoding result of the question sample is inputted into the intent recognition module to obtain the intent type of the question sample output by the intent recognition module, which comprises the following steps: marking a hidden state of the question sample by using [CLS] according to the encoding result of the question sample; after linear transformation and dropout operation of the hidden state of the question sample by using a CapNet module, mapping the hidden state to an intent label space to obtain the intent type of the question sample; the slot labeling module comprises a WordPiece segmentation module, linear transformation and a softmax layer in the BERT model, the encoding result of the question sample is inputted into the slot labeling module to obtain the slot information of the question sample output by the slot labeling module, which comprises the following steps: after inputting the encoding result of the question sample and a hidden state of a first subword of each word into the WordPiece segmentation module, mapping the hidden state of the first subword to a slot label space by using the linear transformation and the softmax layer to obtain the slot information of the question sample; adjusting the slot information of the question sample based on a conditional random field, and training the model according to the intent type of the question sample and the adjusted slot information; jointly training the slot labeling module and the intent recognition module according to the slot information and the intent type of the question sample by using the following formula: ; wherein, is the conditional probability of the intent type is the conditional probability of the slot information, is the conditional probability of the nth slot information annotation, N is the number of slot information, and X is the encoding result, is the conditional probability of the joint intent type and slot information.

2. The primary school science education intelligent question and answer method according to claim 1, characterized in that, jointly training the slot labeling module and the intent recognition module according to the slot information and the intent type of the question sample by using the following formula: ; ; Where L is the loss function, These are loss weights based on intent type. It is the loss weight of slot information. Is it an intent type? The conditional probability, X represents the conditional probability of labeling the information in the nth slot, where N is the number of slots and X is the encoding result. It is the loss weight for the t-th iteration of the task of identifying the target area or the slot labeling task. It is a preset weight. It is the loss of the (t-1)th iteration of the intention recognition task or slot labeling task. This represents the Sigmoid function. To adjust the parameters. 3.The primary school science education intelligent question-answering method according to claim 1 or 2, characterized in that, jointly training the slot labeling module and the intent recognition module according to the slot information and the intent type of the question sample further comprises the following steps: updating parameters in the slot labeling module and the intent recognition module by using a stochastic gradient descent method according to gradients accumulated for multiple iterations.

4. The primary school science education intelligent question-answering method according to claim 1 or 2, characterized in that, jointly training the slot labeling module and the intent recognition module according to the slot information and the intent type of the question sample further comprises the following steps: updating parameters of an AdamW optimizer by using the AdamW optimizer to jointly train the slot labeling module and the intent recognition module, and the updating is performed by using the following formula: ; wherein, is the parameter of the tth iteration of the AdamW optimizer, is the parameter of the t-1th iteration of the AdamW optimizer, is the learning rate, and are the gradient first-moment estimate and the second-moment estimate, respectively, is the weight decay coefficient, is a preset constant.

5. The primary school science education intelligent question-answering method according to claim 4, characterized in that, in a preheating stage at the beginning of training, the learning rate is linearly increased by using the following formula: ; wherein, is the learning rate for the tth iteration, is the initial learning rate, t is the current iteration number, is the iteration number corresponding to the warm-up phase; When the preheating phase ends, the learning rate is linearly decayed with iteration number by the following formula: ; wherein is a preset maximum number of iterations.

6. The primary school science education intelligent question and answer method according to claim 1 or 2, characterized in that, According to the intent type of the current question, the answer to the current question is obtained, including: Using Bing Search v7, the preliminary answer to the current question is obtained according to the intent type of the current question; On the basis of the original security filtering of Bing Search v7, a content screening model in the BERT model is introduced to eliminate inappropriate content in the search content; The rationality and completeness of the preliminary answer are verified, the rationality verification includes consistency comparison with the primary school science textbook knowledge base; the completeness verification detects reasoning faults through reverse questioning, and the preliminary answer is modified according to the verification result.

7. An intelligent question and answer system for primary school science education, characterized in that, The primary school science education intelligent question and answer method is applied to any one of claims 1-6, comprising: The encoding module is used for inputting the user's question sample into the BERT model to obtain the encoding result of the question sample output by the BERT model; The recognition module is used for inputting the encoding result of the question sample into the slot labeling module and the intent recognition module to obtain the slot information of the question sample output by the slot labeling module and the intent type of the question sample output by the intent recognition module; The training module is used for joint training of the slot labeling module and the intent recognition module according to the slot information and intent type of the question sample; The question and answer module is used for inputting the user's current question into the BERT model and the intent recognition module in turn to obtain the intent type of the current question, and the answer to the current question is obtained according to the intent type of the current question.

Citation Information

Patent Citations

  • Intention recognition and slot value filling combined prediction method and system

    CN117217237A

  • Method, apparatus, device and storage medium for training dialogue understanding model

    US20220198327A1