Children education knowledge boundary management method, system and equipment based on large model

By identifying the input and historical dialogue of children's education users and generating reply information under constraints, the problem of out-of-control knowledge boundary management of generative big models in children's education is solved, ensuring that the reply information conforms to educational values and achieving controllable knowledge boundary management.

CN120277199AActive Publication Date: 2025-07-08KUAISHANGYUN (SHANGHAI) NETWORK TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510772173.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-07-08
Estimated Expiration
2045-06-11

AI Technical Summary

Technical Problem

Existing interactive technologies based on generative big models have the problem that knowledge boundary management is prone to get out of control in children's education, and the generated responses may involve content that does not meet the educational values of users with age restrictions.

Method used

By identifying the input and historical dialogue of the target user, storing standard answers using a pre-built knowledge base, and generating reply information under constraints, ensuring that the reply information is consistent with the content of the target answer and conforming to the user's educational values.

Benefits of technology

It improves the accuracy of intention recognition, ensures that the generated reply information fits the user's input and question-and-answer intentions, avoids content that does not conform to educational values, and realizes controllable management of knowledge boundaries.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120277199A_ABST
    Figure CN120277199A_ABST
Patent Text Reader

Abstract

The invention discloses a children education knowledge boundary management method, system and device based on a large model, and relates to the technical field of intelligent education, and the method comprises the steps: carrying out the intention recognition of the input and historical dialogues of a target user, and obtaining the question and answer intention of the target user; retrieving the target answer from a pre-constructed knowledge base; wherein the target answers are standard answers most related to the question and answer intention, and each standard answer conforms to the education value required by the target age group; generating reply information under constraint conditions according to the question and answer intention and the target answer; wherein the constraint condition is used for controlling the reply information to be consistent with the content of the target answer; the knowledge boundary management of the reply information can be ensured to be controllable.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of intelligent education technology, and in particular to a method, system and device for managing the knowledge boundary of children's education based on a large model (large language model). Background Art

[0002] In the field of intelligent education, an interaction system based on a large language model has become the mainstream education interaction system. The interaction system based on a large language model utilizes artificial intelligence technology to provide a highly interactive and educational learning and entertainment environment for age-restricted users such as children and teenagers, and can be widely applied to multiple aspects such as storytelling, knowledge Q&A, language learning, and emotional support.

[0003] However, the existing interaction technologies (methods and / or systems) based on a large language model are based on a generative large model. The generative large model generates responses in real time for the user's input, but the responses generated by the generative large model may involve content that does not conform to the educational values of age-restricted users (sensitive issues or incorrect values), and there is a problem that the knowledge boundary is prone to get out of control in management. Summary of the Invention

[0004] The purpose of the present application is to provide a method, system and device for managing the knowledge boundary of children's education based on a large model, so as to solve the problem that the knowledge boundary management of the existing interaction technology based on a generative large model is prone to get out of control.

[0005] To achieve the above purpose, the present application provides the following solutions: In a first aspect, the present application provides a method for managing the knowledge boundary of children's education based on a large model, including: Performing intent recognition on the input of a target user and historical conversations to obtain the Q&A intent of the target user; Retrieving a target answer from a pre-constructed knowledge base; wherein, the target answer is the standard answer most relevant to the Q&A intent, and the standard answer refers to the analysis result obtained by analyzing each target material, and each standard answer conforms to the educational values of the target user; Generating a response message according to the Q&A intent and the target answer under constraint conditions through a generative model based on a large language model; wherein, the constraint conditions are used to control the content of the response message to be consistent with the target answer.

[0006] Optionally, the knowledge base is constructed according to the following steps: Parsing each target material through a target material analysis small model to obtain a number of analysis results; Eliminating the analysis results that do not conform to the educational values of the target user from the number of analysis results to obtain a number of standard answers; Store several pieces of the standard answers in a database to obtain the knowledge base.

[0007] Optionally, the target material analysis small model is constructed according to the following steps: Select a target material and a base model; Generate several pairs of question-and-answer data in the vertical education scenario based on the target material, and filter out the question-and-answer data that meet the requirements; Perform data preprocessing on the qualified question-and-answer data to obtain a training data set; wherein, the preprocessing includes at least one of template filling, semi-supervised annotation, and sample augmentation processing; Execute a training operation, and the training operation includes: Perform semi-supervised training on the base model through the training data set to obtain a pre-trained model; wherein, the loss function of the semi-supervised training includes two parts: cross-entropy loss function and knowledge distillation loss function; Conduct a benchmark test on the pre-trained model; If the pre-trained model obtained by executing the training operation fails the benchmark test, repeat the training operation until the pre-trained model passes the benchmark test; If the pre-trained model obtained by executing the training operation passes the benchmark test, the pre-trained model that passes the benchmark test is the target material analysis small model.

[0008] Optionally, the generation of several pairs of question-and-answer data in the vertical education scenario based on the target material specifically includes: Generate several pairs of question-and-answer data in the vertical education scenario based on the target material through selfQA, and the question-and-answer data includes desensitized QA pairs; The sample augmentation processing at least includes synonym replacement, back translation, and / or sentence pattern transformation of the question-and-answer data.

[0009] Optionally, the method for managing the knowledge boundary of children's education based on a large model further includes: Before retrieving the target answer from the pre-constructed knowledge base, perform sensitive word filtering on the question-and-answer intention; The target answer is the standard answer that is most relevant to the question-and-answer intention after the sensitive word filtering.

[0010] Optionally, the retrieval of the target answer from the pre-constructed knowledge base specifically includes: Calculate the similarity score between the question-and-answer intention and each standard answer in the knowledge base through a sparse retrieval method to obtain a sparse retrieval score; By means of a dense retrieval method, calculate the semantic similarity score between the question-and-answer intention and each standard answer in the knowledge base to obtain a dense retrieval score; Normalize the sparse retrieval score and the dense retrieval score; Perform weighted summation on the sparse retrieval score and the dense retrieval score of the question-and-answer intention and each standard answer in the knowledge base after normalization to obtain a mixed score of the question-and-answer intention and each standard answer in the knowledge base; Select the standard answer with the largest sparse retrieval score, dense retrieval score or mixed score from the knowledge base to obtain the target answer.

[0011] Optionally, the generating the reply information according to the question-and-answer intention and the target answer under the constraint conditions specifically includes: Dynamically adjust the basic prompt template according to the question-and-answer intention to obtain a dynamic prompt template; According to the dynamic prompt template and the target answer, generate reply information through a generation model based on a large language model under constraint conditions; wherein, the constraint conditions are used to control the content of the reply information to be consistent with the target answer.

[0012] Optionally, the constraint conditions include: The retrieval consistency penalty function in the generation probability of the generation model based on the large language model.

[0013] In a second aspect, the present application provides a large model-based children's education knowledge boundary management system, including: A knowledge base for storing standard answers, where the standard answers refer to the analysis results obtained by analyzing each target material, and each standard answer conforms to the educational values of the target user; An intention recognition module for recognizing the intention of the input and historical conversation of the target user to obtain the question-and-answer intention of the target user; A retrieval module for retrieving a target answer from a pre-constructed knowledge base; wherein, the target answer is the standard answer most relevant to the question-and-answer intention; A generation module for generating reply information through a generation model based on a large language model according to the question-and-answer intention and the target answer under constraint conditions; wherein, the constraint conditions are used to control the content of the reply information to be consistent with the target answer; A log module for storing the historical conversation of the target user; A communication module for obtaining the input and historical conversation of the target user, displaying the reply information to the target user, and sending the input and the reply information of the target user to the log module.

[0014] In a third aspect, the present application provides a computer device, including: a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method for managing the knowledge boundary of children's education based on a large model as described in any one of the above.

[0015] According to the specific embodiments provided by the present application, the following technical effects are disclosed: The present application provides a method, system, and device for managing the knowledge boundary of children's education based on a large model. By performing intent recognition on the input and historical conversations of the target user, and considering both the input and historical conversations (interactive context information) of the target user during intent recognition, the accuracy of intent recognition is improved, ensuring that the question-and-answer intent of the target user is accurately obtained. By pre-constructing a knowledge base to store standard answers and restricting the standard answers to conform to the educational values of the target user, content that does not conform to the educational values of the target user is avoided in the target answers retrieved from the pre-constructed knowledge base. By generating response information based on the question-and-answer intent and the target answer under constraints, it is ensured that the response information is more in line with the input and question-and-answer intent of the target user. Since the target answer conforms to the educational values of the target user, further restricting the content of the response information to be consistent with the content of the target answer can avoid information in the response information that is irrelevant to the intent of the target user or has incorrect educational values, ensuring that the generated response information conforms to the educational values of the target user, thereby ensuring controllable management of the knowledge boundary of the response information and solving the problem that the knowledge boundary management of existing interactive technologies based on generative large models is prone to getting out of control. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application or in the prior art, the following will briefly introduce the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative efforts.

[0017] Figure 1 It is an application environment diagram of a method for managing the knowledge boundary of children's education based on a large model in an embodiment of the present application; Figure 2 It is a flow diagram of a method for managing the knowledge boundary of children's education based on a large model provided in an embodiment of the present application; Figure 3 It is a functional module diagram of a system for managing the knowledge boundary of children's education based on a large model provided in an embodiment of the present application; Figure 4 It is a structural diagram of a computer device provided in an embodiment of the present application. Detailed implementation manners

[0018] The following will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments in the present application without making creative efforts belong to the scope of protection of the present application.

[0019] To make the above objects, features and advantages of the present application more obvious and understandable, the present application will be further described in detail below with reference to the drawings and specific implementation manners.

[0020] The method for managing the knowledge boundary of children's education based on a large model provided by the embodiments of the present application can be applied to an application environment as Figure 1 shown. Among them, the terminal 102 communicates with the server 104 through a network. The data storage system can store the data that the server 104 needs to process. The data storage system can be set up separately, integrated on the server 104, placed in the cloud or on other servers. The terminal 102 can send the input of the target user to the server 104. After receiving the input of the target user, the server 104 performs intent recognition on the input of the target user and the historical conversation through an intent recognition model based on a large language model to obtain the Q&A intent of the target user, retrieves the standard answer most relevant to the Q&A intent from a pre-constructed knowledge base, and generates a reply message according to the Q&A intent and the standard answer most relevant to the Q&A intent. The server 104 can feedback the obtained reply message to the terminal 102 to display the reply message to the target user. In addition, in some embodiments, the interaction method based on a large language model can also be implemented by the server 104 or the terminal 102 alone. For example, the terminal 102 can directly reply to the interaction method based on a large language model.

[0021] Among them, the terminal 102 can be, but is not limited to, various desktop computers, laptop computers, smart phones, tablet computers, Internet of Things devices and portable wearable devices. The Internet of Things devices can be smart speakers, smart TVs, smart air conditioners, etc. The portable wearable devices can be smart watches, smart bracelets, head-mounted devices, etc. The server 104 can be implemented by an independent server or a server cluster composed of multiple servers, and can also be a cloud server.

[0022] In an exemplary embodiment, as Figure 2As shown, a method for managing the knowledge boundary of children's education based on a large model is provided. This method is executed by a computer device, which can be specifically executed by the computer device of the terminal alone or jointly executed by the terminal and the server. In the embodiments of the present application, taking the application of this method to Figure 1 the server 104 in as an example for illustration, it includes the following steps 201 to step 203. Among them:

[0023] In the embodiments of the present application, by simultaneously performing intent recognition on the input and historical conversations of the target user, context information can be considered during intent recognition, improving the accuracy of intent recognition.

[0024] Step 202, retrieve the target answer from the pre-constructed knowledge base; where the target answer is the standard answer most relevant to the question-and-answer intent, and each standard answer conforms to the educational values of the target user.

[0025] In the embodiments of the present application, the standard answer refers to the analysis result obtained by analyzing each target material. The target materials include classic works, language materials, and / or educational materials of the target user. The language materials include at least fairy tales, popular science readings, children's songs, ancient texts (such as ancient poems, the Three-Character Classic, the Thousand-Character Essay, classical Chinese, etc.). The educational materials include at least textbooks, test questions, related knowledge points, encyclopedic knowledge, and papers related to the education of the target user. Educational values refer to the basic beliefs and goals adhered to during the education process, guiding the formulation of education policies, the design of courses, and the selection of teaching methods, reflecting society's understanding of the purpose of education, that is, the personal and social development goals hoped to be achieved through education. Content that does not conform to the educational values of the target user includes at least sensitive issues or content with incorrect values. Limiting the standard answer to conform to the educational values of the target user can avoid the content that does not conform to the educational values of the target user from being involved in the target answer retrieved from the knowledge base, resulting in out-of-control knowledge boundary management. The target user includes at least children.

[0026] Step 203, through a generation model based on a large language model, generate a reply message according to the question-and-answer intent and the target answer under preset conditions; where the constraint conditions are used to control the content of the reply message to be consistent with the target answer.

[0027] In the embodiments of the present application, generating a response message based on the question-and-answer intention and the target answer means organizing the target answer into a response message that answers the input (question) of the target user according to the question-and-answer intention, so that the response message is more in line with the input of the target user and the question-and-answer intention. The content of the response message is limited to be the same as the content of the target answer, avoiding information in the response message that is irrelevant to the intention of the target user or has incorrect educational values, thereby ensuring controllable management of the knowledge boundary of the response message. The target answer or the response message is returned to the target user.

[0028] Implementing the above steps 201 to 203, by performing intention recognition on the input of the target user and the historical conversation, and considering both the input of the target user and the historical conversation (the interactive context information) during intention recognition, the accuracy of intention recognition is improved, ensuring that the question-and-answer intention of the target user is accurately obtained; by pre-constructing a knowledge base to store standard answers and limiting the standard answers to conform to the educational values of the target user, avoiding content in the target answers retrieved from the pre-constructed knowledge base that does not conform to the educational values of the target user; by generating a response message based on the question-and-answer intention and the target answer under constraints, ensuring that the response message is more in line with the input of the target user and the question-and-answer intention. Since the target answer conforms to the educational values of the target user, further limiting the content of the response message to be the same as the content of the target answer can avoid information in the response message that is irrelevant to the intention of the target user or has incorrect educational values, ensuring that the generated response message conforms to the educational values of the target user, thereby ensuring controllable management of the knowledge boundary of the response message, and solving the problem that the knowledge boundary management of existing interactive technologies based on generative large models is prone to getting out of control.

[0029] In another exemplary embodiment of the present application, in order to quickly perform intention recognition on the input of the target user and the historical conversation, the above step 201 includes: Performing intention recognition on the input of the target user and the historical conversation through a pre-constructed intention recognition model to obtain the question-and-answer intention of the target user.

[0030] In the embodiments of the present application, the intention recognition model can be a pre-constructed small intention recognition model or an intention recognition model based on a large language model.

[0031] In another exemplary embodiment of the present application, the construction process of the knowledge base includes the following steps 301 to 303. Among them: Step 301, analyzing each target material through a target material analysis small model to obtain a number of analysis results.

[0032] In the embodiments of the present application, compared with using a large language model applicable to the educational vertical scenario, using a small target material analysis model to analyze each target material can improve the analysis efficiency while reducing the resource requirements.

[0033] Step 302: Eliminate the analysis results that do not conform to the educational values of the target user from several analysis results to obtain several standard answers.

[0034] In the embodiments of the present application, by eliminating the analysis results that do not conform to the educational values of the target user from several analysis results, it is ensured that the standard answers conform to the educational values of the target user. The analysis results that do not conform to the educational values of the target user can be eliminated manually or automatically. The analysis results that do not conform to the educational values of the target user include the analysis results with sensitive words.

[0035] Step 303: Store several of the standard answers in a database to obtain a knowledge base.

[0036] In another exemplary embodiment of the present application, the construction process of the knowledge base further includes: Update the target materials according to the set deadline; Based on the updated target materials, update the knowledge base according to steps 301 to 303.

[0037] In another exemplary embodiment of the present application, the small target material analysis model is constructed according to the following steps 401 to 404. Among them: Step 401: Select the target materials and the base model.

[0038] The present application does not specifically limit the base model, and an efficient small-sized base model can be selected according to actual needs. For example, the base model uses the qwen2.5 model.

[0039] Step 402: Generate several question-and-answer pair data for the vertical education scenario based on the target materials, and screen out the question-and-answer pair data that meet the requirements.

[0040] In the embodiments of the present application, generating several question-and-answer pair data for the vertical education scenario based on the target materials includes: Generate several question-and-answer pair data for the vertical education scenario through selfQA based on the target materials. The question-and-answer pair data includes de-sensitized QA pairs.

[0041] In the embodiments of the present application, generating Q&A pair data through self-QA (self-questioning and self-answering) means generating questions through self-QA, which can be generating questions and corresponding answers using pre-trained language models (such as GPT, T5, BART, full-scale large language models). For example, if the input text is "There are eight planets in the solar system.", the questions generated by the pre-trained language model are "How many planets are there in the solar system?" or "What are the planets in the solar system?", and the answers to the questions are given.

[0042] The de-sensitized Q&A pair refers to identifying and replacing / masking / encrypting / generalizing (converting specific values into broader classifications, such as converting a specific age into an age range) the sensitive information in the question (Q) and answer (A) to protect personal privacy or sensitive data from being leaked. Sensitive information includes information that may expose personal information, trade secrets, or other sensitive data.

[0043] The Q&A pair data that meets the requirements can be screened from the generated Q&A pair data of the vertical education scenario through the following methods: Keyword matching: Check whether the keywords mentioned in the question of the Q&A pair data exist in the answer. If so, select the Q&A pair data as the Q&A pair data that meets the requirements; Similarity calculation: Use cosine similarity, Jaccard similarity coefficient, etc. to measure the similarity between the question and answer of the Q&A pair data. If the similarity exceeds the preset threshold, select the Q&A pair data as the Q&A pair data that meets the requirements.

[0044] Step 403: Perform data preprocessing on the Q&A pair data that meets the requirements to obtain a training data set; wherein, the preprocessing includes at least one of template filling, semi-supervised annotation, and sample enhancement processing.

[0045] In the embodiments of the present application, template filling refers to batch generating sample data through a defined domain template according to compliant question-and-answer pair data by using a script (such as Python) or a tool (a template engine (such as sample data) or a data generation tool (such as Mockaroo, Faker, etc. according to predefined rules)) to increase the quantity of sample data. The domain template is a set of rules or formats designed according to the requirements of the education field to generate text data conforming to the characteristics of the education field. The sample data refers to sample question-and-answer pair data. To improve the diversity and adaptability of the generated samples, during the process of batch generating sample data, certain words in the synonym domain template can be used, the diversity can be increased by adjusting the sentence structure (such as active-passive conversion, inserting modifiers), or background information or context description (context expansion) can be added to each piece of data. The generated sample data needs to undergo quality inspection to ensure its accuracy and consistency. The quality inspection includes checking whether the format, logic, and grammar of the generated sample data are correct and removing duplicate or low-quality sample data. Semi-supervised annotation is to use a pre-trained model to assign pseudo-labels (data labels not shown to users) to the generated question-and-answer pair data, and the pseudo-labels are used for semi-supervised training of the base model. The sample enhancement process at least includes synonym replacement, back translation, and sentence pattern transformation for the question-and-answer pair data. Synonym replacement can increase the diversity of words in the question and answer, enabling the pre-trained model to recognize different expressions of the same concept. Back translation is to utilize the asymmetry of the translation system to obtain question-and-answer pair data with the same meaning as the original text but different diction by first translating the original question or answer of the question-and-answer pair data from the source language into an intermediate language and then translating it back from the intermediate language to the source language. Sentence pattern transformation changes the structure of the sentence without changing its basic meaning, enhancing the model's ability to process different sentence patterns. Changing the structure of the sentence includes adjusting the positions of sentence components (such as the order of subject, verb, and object, conversion between passive voice and active voice, etc.) and / or introducing changes in interrogative words (such as changing "what" to "which", "who" to "whom", etc.).

[0046] Step 404, perform a training operation, and the training operation includes the following steps 4041 to 4042. Among them: Step 4041, perform semi-supervised training on the base model through the training data set to obtain a pre-trained model; among them, the loss function for semi-supervised training includes two parts: a cross-entropy loss function and a knowledge distillation loss function.

[0047] In the embodiments of the present application, a pre-trained model is obtained by semi-supervised training of a base model using a training dataset. Among them, the loss function of semi-supervised training includes two parts: a cross-entropy loss function and a knowledge distillation loss function, realizing the knowledge distillation of a full-size large language model applicable to the education vertical scenario, enabling the pre-trained model to learn the knowledge of the teacher model while reducing computational and storage requirements. The cross-entropy loss function is used to measure the difference between the output of the base model and the true label during the training process. The knowledge distillation loss function is used to measure the difference between the output of the base model and the pseudo-label of the full-size large language model during the training process. During the training process, the loss function is used to train the base model, continuously approaching the performance of the full-size large language model during the process, and obtaining a pre-trained model after the training is completed.

[0048] Step 4042, conduct a benchmark test on the pre-trained model.

[0049] In the embodiments of the present application, OpenCompass can be used to conduct a benchmark test on the pre-trained model. OpenCompass is an open-source benchmark test framework. The benchmark test includes performance evaluation and triggering active learning. The performance includes at least accuracy, recall rate, and / or F1 score. When conducting a benchmark test on the pre-trained model, triggering active learning includes identifying Bad Cases, annotating the correct answers for the collected Bad Cases (ensuring the accuracy and consistency of the data), enhancing the annotated data (synonym replacement, back translation, and / or sentence pattern transformation to increase the diversity of samples), and adding the enhanced data to the training dataset. Bad Cases refer to incorrect predictions or low-quality outputs generated by the pre-trained model during the inference process, such as generation errors, missing information (failure to correctly answer the user's question), and / or sensitive information leakage. When the performance of the pre-trained model meets the requirements, it is obtained that the pre-trained model passes the benchmark test; otherwise, it is obtained that the pre-trained model fails the benchmark test.

[0050] The parameters of the training process can be set according to the following parameter requirements: Learning rate: A low learning rate prevents overfitting, 1e-5 to 5e-5, batch size: 4 - 16, number of training epochs: 3 - 5 epochs, patience = 2, Dropout rate increased to 0.3 - 0.5, weight decay: 0.01, loss function: Span Loss.

[0051] Step 405, if the training operation results in the pre-trained model failing the benchmark test, repeat the training operation until the pre-trained model passes the benchmark test.

[0052] If the training operation results in the pre-trained model passing the benchmark test, the pre-trained model that passes the benchmark test is the target material analysis small model.

[0053] In another exemplary embodiment of the present application, the above-mentioned method for managing the knowledge boundary of children's education based on a large model further includes: Perform structured processing on the standard answers in step 302 to convert the standard answers into a form that is easy to retrieve.

[0054] In the embodiments of the present application, the form that is easy to retrieve is not specifically limited and can be set according to actual needs. For example, convert the standard answers into the FAQ format or database entries.

[0055] In another exemplary embodiment of the present application, the above-mentioned method for managing the knowledge boundary of children's education based on a large model further includes: Before step 202, perform sensitive word filtering on the question-and-answer intent.

[0056] Correspondingly, the target answer is the standard answer that is most relevant to the question-and-answer intent after sensitive word filtering.

[0057] In another exemplary embodiment of the present application, performing sensitive word filtering on the question-and-answer intent includes: Identify the keywords of the question-and-answer intent; Using rule matching technology, retrieve the sensitive words (such as vulgar language, offensive words, etc.) that are most relevant to the keywords of the question-and-answer intent from the pre-constructed sensitive word library; If a sensitive word that is most relevant to any keyword of the question-and-answer intent is retrieved in the sensitive word library, filter out the keyword or the question-and-answer intent. If the question-and-answer intent is filtered out, display the response information indicating that the question cannot be answered to the target user.

[0058] In another exemplary embodiment of the present application, the above-mentioned step 202 includes the following steps a1 to a2. Among them: Step a1, through a sparse retrieval method, calculate the similarity score between the question-and-answer intent and each standard answer in the knowledge base to obtain a sparse retrieval score.

[0059] In the embodiments of the present application, the sparse retrieval method includes the TF-IDF method or the BM25 method. Among them, the similarity score calculation formula of the TF-IDF method is: ; ; TF-IDF(t,d)=TF(t,d) IDF(t); S sparse (q,d)= ; Among them, TF(t, d) represents the frequency of the word t appearing in the standard answer d, where the word t is any keyword in the question-and-answer intention, and the standard answer d is any standard answer in the knowledge base; IDF(t) represents the inverse document frequency, which is used to measure the importance of a word, and the total number of standard answers refers to the total number of standard answers in the knowledge base; TF-IDF(t, d) represents the importance of the word t to the standard answer d; S sparse S(q, d) is the similarity score between the question-and-answer intention q and the standard answer d.

[0060] The formula for calculating the similarity score of the BM25 method is: ; ; TF-IDF(t, d)=TF(t, d) IDF(t); BM25(q, d)= TFComponent(t, d); Among them, TFComponent(t, d) is the term frequency, k1 controls the speed of term frequency saturation, b controls the intensity of standard answer length normalization, is the document length of all standard answers in the knowledge base; BM25(q, d) is the BM25 score between the question-and-answer intention q and the standard answer d, that is, the similarity score between the question-and-answer intention q and the standard answer d.

[0061] Step a2, select the standard answer with the largest sparse retrieval score from the knowledge base to obtain the target answer.

[0062] In another exemplary embodiment of the present application, the above step 202 includes the following steps b1 to b2. Among them: Step b1, through the dense retrieval method, calculate the semantic similarity score between the question-and-answer intention and each standard answer in the knowledge base to obtain the dense retrieval score.

[0063] In the embodiment of the present application, the dense retrieval method includes: Using a pre-trained language model (such as BERT, Qwen, etc.) to encode the question-and-answer intention and each standard answer into fixed-length vectors to obtain an intention vector and a standard answer vector; Calculate the similarity (such as cosine similarity, Euclidean distance, etc.) between the intention vector and each standard answer vector to obtain the similarity score between the intention vector and each standard answer, and obtain the dense retrieval score.

[0064] Step b2, select the standard answer with the largest dense retrieval score from the knowledge base to obtain the target answer.

[0065] In the embodiments of the present application, all standard answer vectors can be stored in an efficient vector index for quickly retrieving the standard answer with the maximum score.

[0066] In another exemplary embodiment of the present application, step 202 above includes the following steps c1 to c5. Wherein: Step c1, calculate the similarity score between the question-and-answer intention and each standard answer in the knowledge base through a sparse retrieval method to obtain a sparse retrieval score.

[0067] Step c2, calculate the semantic similarity score between the question-and-answer intention and each standard answer in the knowledge base through a dense retrieval method to obtain a dense retrieval score.

[0068] Step c3, normalize the sparse retrieval score and the dense retrieval score.

[0069] In the embodiments of the present application, no specific limitation is imposed on the normalization, and it can be selected according to actual needs. For example, Min-Max normalization or Z-Score standardization is adopted.

[0070] Step c4, perform weighted summation on the sparse retrieval score and the dense retrieval score of the normalized question-and-answer intention and each standard answer in the knowledge base to obtain a mixed score between the question-and-answer intention and each standard answer in the knowledge base.

[0071] In the embodiments of the present application, according to the following formula, calculate the mixed score between the question-and-answer intention and each standard answer in the knowledge base: ; Where, S hybrid is the mixed score, S sparse is the normalized sparse retrieval score, S dense is the normalized dense retrieval score; α is the weight of S sparse , with a range of [0, 1], and 1 - α is the weight of S dense .

[0072] Step c5, select the standard answer with the maximum mixed score from the knowledge base to obtain the target answer.

[0073] In another exemplary embodiment of the present application, step 202 above further includes: Before selecting the standard answer with the maximum sparse retrieval score, dense retrieval score, or mixed score from the knowledge base, sort all the standard answers in the knowledge base according to the sparse retrieval score, dense retrieval score, or mixed score through a cross encoder.

[0074] Correspondingly, selecting the standard answer with the maximum sparse retrieval score, dense retrieval score, or mixed score from the knowledge base specifically includes: Select the standard answer with the highest sparse retrieval score, dense retrieval score, or hybrid score from the sorted standard answers.

[0075] In another exemplary embodiment of the present application, step 203 described above includes the following steps 501 to 502. Among them: Step 501: Dynamically adjust a preset basic prompt template according to the Q&A intention to obtain a dynamic prompt template.

[0076] In the embodiments of the present application, the basic prompt template is a prompt template designed for different types of questions or tasks. Each basic prompt template contains some placeholders for filling in specific information at runtime. For example, for a fact query: "Tell me information about [X]." For an opinion inquiry: "What's your opinion on [Y]?" where [X] and [Y] are placeholders.

[0077] Dynamically adjusting the preset basic prompt template according to the Q&A intention and the target answer is to first select the basic prompt template most relevant to the Q&A intention from the preset basic prompt templates, and then fill in the specific keywords (such as the query object) in the Q&A intention into the placeholder positions in the template.

[0078] In addition, if relevant background information is provided in the previous conversation, this context can be added to the prompt to help the model better understand the current question, and the prompt content can be appropriately modified according to the preferences of the target user or the historical conversation record to provide a more personalized response.

[0079] To continuously improve the effect of the prompt template, user feedback on the answers can be collected and used to update and optimize the prompt generation strategy. For example: If it is found that a certain type of prompt often leads to inaccurate answers, the structure or wording of this type of prompt can be tried to be adjusted. Analyze successful cases to understand which prompt templates and adjustment strategies are the most effective and apply them to similar scenarios.

[0080] Step 502: Generate response information under constraints through a generative model based on a large language model according to the dynamic prompt template and the target answer; among them, the constraints are used to control the content of the response information to be consistent with the target answer.

[0081] In another exemplary embodiment of the present application, in step 502, the constraints include: The retrieval consistency penalty function in the generation probability of the generative model based on the large language model.

[0082] In another exemplary embodiment of the present application, step 502 described above includes the following steps 5021 to 5025. Among them: Step 5021: Extract keywords from the target answer to obtain a set of retrieval keywords.

[0083] Step 5022: For the current time step t , generate candidate words through a generative model based on a large language model according to the input dynamic prompt template and the target answer . For each , calculate the generation probability of each through the following formula : ; ; ; where ( | < t , P) represents the raw probability of generating <t given the generated sequence P and the dynamic prompt template . Q i represents the query vector of the i th attention head, which is generated by the decoder layer of the Transformer; K P represents the key vector (content of the prompt template) of the dynamic prompt template P . V i represents the value vector of the i th attention head. K input represents the key vector of the target answer. ⊕ represents the concatenation operation. d k represents the concatenated key vector K P ⊕ K input 's dimension. n is the total number of attention heads. The input is converted into an embedding vector, and Q i , K P , K input and V i are generated through a linear transformation of the embedding vector. The query weight matrix, the key weight matrix of the dynamic prompt template P , the key weight matrix of the target answer, and the value weight matrix are automatically adjusted and obtained through the training process of the Transformer model. represents the attention score, and calculates the query vector Q i and the concatenated key vector K P ⊕ K input The similarity between them. Softmax is a normalization function used to convert the attention score into a probability distribution, making the output values all between [0, 1], and the sum of all output values equal to 1. represents the application of the multi-head attention mechanism. Each attention head independently calculates the attention score and generates the corresponding context representation. Finally, the results of multiple attention heads are concatenated to form a richer representation. Different attention heads can focus on different parts of the input. Through the cooperation of multiple attention heads, the model can better understand complex semantic relationships. is the retrieval consistency penalty function. If is not in the retrieval keyword set (does not belong to the retrieval keyword), the value is λ, otherwise, the value is 1. λ is a penalty coefficient less than 1, used to reduce the generation probability of inconsistent words. In the embodiments of the present application, λ is not specifically limited and can be set according to actual needs. For example, set λ = 0.8. Another example is to set λ = 0.2.

[0084] Step 5023, for the current time step t , select the generation probability with the highest as the current generated word.

[0085] Step 5024, add the current generated word to the generated sequence.

[0086] Step 5025, repeat the above steps 5022 to 5024 until a complete reply message is generated.

[0087] In another exemplary embodiment of the present application, the above method for managing the knowledge boundary of children's education based on a large model further includes: Display the reply message to the target user. At the same time, send the input and reply message of the target user to the user interaction log.

[0088] In the embodiments of the present application, the input and reply message of the target user in the user interaction log are used for real-time compliance review. The knowledge base can also support compliance review.

[0089] In another exemplary embodiment of the present application, for the problem of multi-modal intent recognition deviation, through the constructed intent recognition small model (combined with a cross-modal joint verification engine), real-time recognition of the question-and-answer intent of voice, touch, and visual signals is achieved, improving the accuracy and consistency of intent recognition.

[0090] In the embodiments of the present application, speech is converted into text using automatic speech recognition (ASR) technology, and then natural language processing (NLP) technology is used to analyze the text content to identify the user's intention. Touch control analyzes gestures or other interaction patterns on the touch screen to understand the user's operation intention. Visual signals use computer vision technology to analyze objects, actions, and environmental features in the video stream or image to infer the user's intention. The role of the cross-modal joint verification engine is to integrate and verify information from different modalities to ensure that the final intention recognition result is more accurate and reliable. Data synchronization and alignment can ensure that data from different sources (such as speech, touch control, vision) can be correctly aligned on the time axis. The features extracted from different modalities are fused through a feature fusion algorithm, which can include early fusion (directly merging at the feature level), late fusion (merging decision results after separate processing), or a hybrid method. By performing consistency checks to compare the analysis results of each modality, inconsistencies are checked and adjusted according to certain rules or weights.

[0091] Based on the same inventive concept, the embodiments of the present application also provide a large model-based children's education knowledge boundary management system for implementing the above-mentioned large model-based children's education knowledge boundary management method. The implementation solutions provided by this system to solve problems are similar to those described in the above method. Therefore, the specific limitations in one or more of the following embodiments of the large model-based children's education knowledge boundary management system can refer to the limitations on the large model-based children's education knowledge boundary management method in the above text and will not be repeated here.

[0092] In an exemplary embodiment, as Figure 3 shown, a large model-based children's education knowledge boundary management system 60 is provided, including: A knowledge base 601 for storing standard answers; where the standard answer refers to the analysis result obtained by analyzing each target material, and each standard answer conforms to the educational values of the target user; An intention recognition module 602 for recognizing the intention of the target user's input and historical conversations to obtain the Q&A intention of the target user; A retrieval module 603 for retrieving target answers from a pre-constructed knowledge base; where the target answer is the standard answer most relevant to the Q&A intention; A generation module 604 for generating reply information based on the Q&A intention and the target answer under constraint conditions through a large language model-based generation model; where the constraint conditions are used to control the content of the reply information to be consistent with the target answer; A log module 605 for storing the historical conversations of the target user; A communication module 606, configured to obtain the input and historical conversations of a target user, display reply information to the target user, and send the input and reply information of the target user to a log module.

[0093] In the embodiments of the present application, the historical conversation is historical interaction information, and the interaction information includes each historical input of the target user and the reply information corresponding to the historical input. The target materials include classic works, language materials, and / or educational materials of the target group. The language materials at least include fairy tales, popular science readings, children's songs, ancient texts (such as ancient poems, the Three-Character Classic, the Thousand-Character Essay, classical Chinese, etc.). The educational materials at least include teaching materials, test questions, related knowledge points, encyclopedic knowledge, and papers related to the education of the target user. Educational values refer to the basic beliefs and goals adhered to in the process of education, which guide the formulation of educational policies, the design of courses, and the selection of teaching methods, and reflect the society's understanding of the purpose of education, that is, the personal and social development goals that are expected to be achieved through education. The content that does not conform to the educational values of the target user at least includes sensitive issues or content with wrong values. It is specified that the standard answer conforms to the educational values of the target user to avoid the content that does not conform to the educational values of the target user from being involved in the target answers retrieved from the knowledge base, resulting in out-of-control knowledge boundary management. The target user at least includes children.

[0094] Generating reply information according to the question-and-answer intention and the target answer is to organize the target answer into reply information for answering the input (question) of the target user according to the question-and-answer intention, so that the reply information is more in line with the input and question-and-answer intention of the target user. It is specified that the content of the reply information is consistent with the content of the target answer to avoid the information irrelevant to the intention of the target user or with wrong educational values from being included in the reply information, thereby ensuring controllable knowledge boundary management of the reply information.

[0095] In another exemplary embodiment of the present application, the above-mentioned intention recognition module 602 is further configured to: Perform intention recognition on the input and historical conversations of the target user through a pre-constructed intention recognition model to obtain the question-and-answer intention of the target user.

[0096] In another exemplary embodiment of the present application, the above-mentioned intention recognition module 602 is further configured to: Perform intention recognition on the input (voice, touch, visual signal) and historical conversations of the target user through a pre-constructed small intention recognition model (combined with a cross-modal joint verification engine) to obtain the question-and-answer intention of the target user.

[0097] In another exemplary embodiment of the present application, the above-mentioned large model-based children's education knowledge boundary management system 60 further includes: A knowledge base construction module, configured to construct a knowledge base according to the following steps: Analyze each target material through the small target material analysis model to obtain a number of analysis results; Eliminate the analysis results that do not conform to the educational values of the target users from the number of analysis results to obtain a number of standard answers; Store the number of said standard answers in a database to obtain a knowledge base.

[0098] In the embodiment of the present application, compared with using a large language model applicable to the educational vertical scenario, using the small target material analysis model to analyze each target material can improve the analysis efficiency while reducing the resource requirements. By eliminating the analysis results with sensitive words from the number of analysis results, it is ensured that the standard answers conform to the educational values of the target users.

[0099] In another exemplary embodiment of the present application, the above-mentioned knowledge base construction module is further configured to: Update the target material according to the set deadline; Update the knowledge base according to the steps of constructing the knowledge base through the updated target material.

[0100] In another exemplary embodiment of the present application, the above-mentioned knowledge base construction module is further configured to: Select the target material and the base model; Generate a number of question-and-answer pair data for the vertical education scenario according to the target material, and screen out the question-and-answer pair data that meet the requirements; Perform data preprocessing on the question-and-answer pair data that meet the requirements to obtain a training data set; wherein, the preprocessing includes at least one of template filling, semi-supervised annotation, and sample enhancement processing; Perform a training operation once, and the training operation includes: Perform semi-supervised training on the base model through the training data set to obtain a pre-trained model; wherein, the loss function of the semi-supervised training includes two parts: the cross-entropy loss function and the knowledge distillation loss function; Perform a benchmark test on the pre-trained model; If the pre-trained model obtained by performing the training operation fails the benchmark test, repeat the training operation until the pre-trained model passes the benchmark test.

[0101] If the pre-trained model obtained by performing the training operation passes the benchmark test, the pre-trained model that passes the benchmark test is the small target material analysis model.

[0102] In the embodiment of the present application, generating a number of question-and-answer pair data for the vertical education scenario according to the target material includes: Generate a number of question-and-answer pair data for the vertical education scenario through selfQA according to the target material, and the question-and-answer pair data includes de-sensitized QA pairs.

[0103] In the embodiments of the present application, generating question-and-answer pair data through selfQA (self-questioning and self-answering) means generating questions through selfQA, which can be generating questions and corresponding answers using pre-trained language models (such as GPT, T5, BART, full-size large language models). For example, if the input text is "There are eight planets in the solar system.", the questions generated by the pre-trained language model are "How many planets are there in the solar system?" or "What are the planets in the solar system?", and the answers to the questions are given.

[0104] A desensitized QA pair refers to identifying and replacing / masking / encrypting / generalizing (converting specific values into broader classifications, such as converting a specific age into an age range) sensitive information in the question (Q) and answer (A) to protect personal privacy or sensitive data from being leaked. Sensitive information includes information that may expose personal information, trade secrets, or other sensitive data.

[0105] The qualified question-and-answer pair data can be screened from the generated question-and-answer pair data of the vertical education scenario through the following methods: Keyword matching: Check whether the keywords mentioned in the question of the question-and-answer pair data exist in the answer. If so, select the question-and-answer pair data as the qualified question-and-answer pair data; Similarity calculation: Use cosine similarity, Jaccard similarity coefficient, etc. to measure the similarity between the question and answer of the question-and-answer pair data. If the similarity exceeds the preset threshold, select the question-and-answer pair data as the qualified question-and-answer pair data.

[0106] Template filling refers to generating sample data in batches through defined domain templates based on compliant Q&A pair data, using scripts (such as Python) or tools (template engines (such as sample data) or data generation tools (such as Mockaroo, Faker, etc. according to predefined rules)) to increase the quantity of sample data. The domain template is a set of rules or formats designed according to the requirements of the education field to generate text data that conforms to the characteristics of the education field. Sample data refers to sample Q&A pair data. To improve the diversity and adaptability of the generated samples, during the process of generating sample data in batches, certain words in the synonym domain template can be used, the diversity can be increased by adjusting the sentence structure (such as active-passive conversion, inserting modifiers), or background information or context descriptions (context expansion) can be added to each piece of data. The generated sample data needs to undergo quality checks to ensure its accuracy and consistency. Quality checks include checking whether the format, logic, and grammar of the generated sample data are correct and removing duplicate or low-quality sample data. Semi-supervised annotation is using a pre-trained model to assign pseudo-labels (data labels not shown to users) to the generated Q&A pair data. Sample augmentation processing includes at least synonym replacement, back-translation, and sentence pattern transformation for the Q&A pair data. Synonym replacement can increase the diversity of words in the questions and answers, enabling the pre-trained model to recognize different expressions of the same concept. Back-translation utilizes the asymmetry of the translation system to obtain Q&A pair data with the same meaning as the original text but different wordings by first translating the original question or answer of the Q&A pair data from the source language into an intermediate language and then translating it back from the intermediate language to the source language. Sentence pattern transformation changes the structure of the sentence without changing its basic meaning, enhancing the model's ability to process different sentence patterns. Changing the sentence structure includes adjusting the positions of sentence components (such as the order of subject, verb, and object, conversion between passive and active voices, etc.) and / or introducing changes in interrogative words (such as changing "what" to "which", "who" to "whom", etc.).

[0107] The pre-trained model can be benchmarked using OpenCompass, which is an open-source benchmarking framework. The benchmarking includes performance evaluation and triggering active learning. Performance at least includes accuracy, recall, and / or F1 score. When benchmarking the pre-trained model, triggering active learning includes identifying Bad Cases, annotating the correct answers for the collected Bad Cases (ensuring data accuracy and consistency), augmenting the annotated data (synonym replacement, backtranslation, and / or sentence pattern transformation to increase sample diversity), and adding the augmented data to the training dataset. A Bad Case refers to an incorrect prediction or low-quality output generated by the pre-trained model during the inference process, such as generation errors, missing information (failure to correctly answer the user's question), and / or sensitive information leakage. When the performance of the pre-trained model meets the requirements, it is obtained that the pre-trained model passes the benchmark test; otherwise, it is obtained that the pre-trained model fails the benchmark test.

[0108] The parameters of the training process can be set according to the following parameter requirements: Learning rate: A low learning rate prevents overfitting, 1e-5 to 5e-5; batch size: 4 - 16; number of training epochs: 3 - 5 epochs; patience = 2; Dropout rate increased to 0.3 - 0.5; weight decay: 0.01; loss function: Span Loss.

[0109] In another exemplary embodiment of the present application, the above-mentioned knowledge base construction module is further configured to: Perform structured processing on the standard answers and convert the standard answers into a form that is easy to retrieve.

[0110] In the embodiments of the present application, the form that is easy to retrieve is not specifically limited and can be set according to actual needs. For example, convert the standard answers into the FAQ format or database entries.

[0111] In another exemplary embodiment of the present application, the above-mentioned large model-based children's education knowledge boundary management system 60 further includes: An intent preprocessing module, configured to perform sensitive word filtering on the question-and-answer intent before retrieving the target answer from the pre-constructed knowledge base.

[0112] Correspondingly, the target answer is the standard answer that is most relevant to the question-and-answer intent after sensitive word filtering.

[0113] In another exemplary embodiment of the present application, the above-mentioned intent preprocessing module is further configured to: Identify the keywords of the question-and-answer intent; Using rule matching technology, retrieve the sensitive words (such as vulgar language, offensive words, etc.) that are most relevant to the keywords of the question-and-answer intent from the pre-constructed sensitive word library; If a sensitive word most relevant to any keyword of the Q&A intent is retrieved in the sensitive word library, filter out the keyword or the Q&A intent. If the Q&A intent is filtered out, display the reply information indicating that the question cannot be answered to the target user.

[0114] In another exemplary embodiment of the present application, the above-mentioned retrieval module 603 is further configured to: Calculate the similarity score between the Q&A intent and each standard answer in the knowledge base through a sparse retrieval method to obtain a sparse retrieval score; Select the standard answer with the largest sparse retrieval score from the knowledge base to obtain the target answer.

[0115] In the embodiment of the present application, the sparse retrieval method includes the TF-IDF method or the BM25 method. Among them, the similarity score calculation formula of the TF-IDF method is: ; ; TF-IDF(t,d)=TF(t,d) IDF(t); S sparse (q,d)= ; Among them, TF(t,d) represents the frequency of the word t appearing in the standard answer d, the word t is any keyword in the Q&A intent, and the standard answer d is any standard answer in the knowledge base; IDF(t) represents the inverse document frequency, which is used to measure the importance of a word, and the total number of standard answers refers to the total number of standard answers in the knowledge base; TF-IDF(t,d) represents the importance of the word t to the standard answer d; S sparse (q,d) is the similarity score between the Q&A intent q and the standard answer d.

[0116] The similarity score calculation formula of the BM25 method is: ; ; TF-IDF(t,d)=TF(t,d) IDF(t); BM25(q,d)= TFComponent(t,d); Among them, TFComponent(t,d) is the word frequency, k1 controls the speed of word frequency saturation, and b controls the intensity of standard answer length normalization. is the document length of all standard answers in the knowledge base; BM25(q, d) is the BM25 score of the Q&A intent q and the standard answer d, that is, the similarity score between the Q&A intent q and the standard answer d.

[0117] In another exemplary embodiment of the present application, the above-mentioned retrieval module 603 is further configured to: Calculate the semantic similarity score between the Q&A intent and each standard answer in the knowledge base through a dense retrieval method to obtain a dense retrieval score; Select the standard answer with the largest dense retrieval score from the knowledge base to obtain the target answer.

[0118] In the embodiment of the present application, the dense retrieval method includes: Use a pre-trained language model (such as BERT, Qwen, etc.) to encode the Q&A intent and each standard answer into fixed-length vectors to obtain an intent vector and a standard answer vector; Calculate the similarity between the intent vector and each standard answer vector (such as cosine similarity, Euclidean distance, etc.) to obtain the similarity score between the intent vector and each standard answer, and obtain the dense retrieval score.

[0119] In another exemplary embodiment of the present application, the above-mentioned retrieval module 603 is further configured to: Calculate the similarity score between the Q&A intent and each standard answer in the knowledge base through a sparse retrieval method to obtain a sparse retrieval score; Calculate the semantic similarity score between the Q&A intent and each standard answer in the knowledge base through a dense retrieval method to obtain a dense retrieval score; Normalize the sparse retrieval score and the dense retrieval score; Perform a weighted sum on the normalized sparse retrieval score and dense retrieval score of the Q&A intent and each standard answer in the knowledge base to obtain a mixed score of the Q&A intent and each standard answer in the knowledge base; Select the standard answer with the largest mixed score from the knowledge base to obtain the target answer.

[0120] In the embodiment of the present application, no specific limitation is imposed on the normalization, and it can be selected according to actual needs. For example, Min-Max normalization or Z-Score standardization is adopted.

[0121] According to the following formula, calculate the mixed score of the Q&A intent and each standard answer in the knowledge base: ; where, S hybrid is the mixed score, S sparse is the normalized sparse retrieval score, S dense is the normalized dense retrieval score; α is Ssparse The weight of [α] ranges from [0, 1], and 1 - α is the weight of S dense .

[0122] In another exemplary embodiment of the present application, the above-mentioned retrieval module 603 is further configured to: Before selecting the standard answer with the highest sparse retrieval score, dense retrieval score, or mixed score from the knowledge base, sort all the standard answers in the knowledge base according to the sparse retrieval score, dense retrieval score, or mixed score through a cross encoder; Select the standard answer with the highest sparse retrieval score, dense retrieval score, or mixed score from the sorted standard answers.

[0123] In another exemplary embodiment of the present application, the above-mentioned generation module 604 is further configured to: Dynamically adjust a preset basic prompt template according to the Q&A intention to obtain a dynamic prompt template; Generate a response message under constraint conditions through a generation model based on a large language model according to the dynamic prompt template and the target answer; wherein, the constraint conditions are used to control the content of the response message to be consistent with the target answer.

[0124] In the embodiments of the present application, the basic prompt template is a prompt template designed for different types of questions or tasks. Each basic prompt template contains some placeholders for filling specific information at runtime. For example, for a fact query: "Tell me information about [X].", for an opinion inquiry: "What's your opinion on [Y]?", where [X], [Y] are placeholders.

[0125] Dynamically adjusting the preset basic prompt template according to the Q&A intention and the target answer is to first select the basic prompt template most relevant to the Q&A intention from the preset basic prompt templates, and then fill the specific keywords (such as the query object) in the Q&A intention into the placeholder positions in the template.

[0126] In addition, if relevant background information is provided in the previous conversation, this context can be added to the prompt to help the model better understand the current question, and the prompt content can be appropriately modified according to the preferences of the target user or the historical conversation record to provide a more personalized response.

[0127] In order to continuously improve the effect of the prompt template, user feedback on the answers can be collected and used to update and optimize the prompt generation strategy. For example: If it is found that a certain type of prompt often leads to inaccurate answers, the structure or wording of this type of prompt can be tried to be adjusted. Analyze successful cases to understand which prompt templates and adjustment strategies are the most effective and apply them to similar scenarios.

[0128] In another exemplary embodiment of the present application, the above-mentioned generation module 604 is further configured to: Extract keywords from the target answer to obtain a retrieval keyword set; For the current time step t , generate candidate words through a generation model based on a large language model according to the input dynamic prompt template and the target answer , calculate the generation probability of each through the following formula : ; ; Among them, represents the original probability of generating < t given the generated sequence P and the dynamic prompt template , is a retrieval consistency penalty function. If is not in the retrieval keyword set (does not belong to the retrieval keyword), takes the value of λ, otherwise, takes the value of 1. λ is a penalty coefficient less than 1, used to reduce the generation probability of inconsistent words; For the current time step t , select the with the highest generation probability as the current generated word; Add the current generated word to the generated sequence; Repeat the above steps until a complete reply message is generated.

[0129] The present application embodiment does not specifically limit λ, which can be set according to actual needs. For example, set λ = 0.8. Another example is to set λ = 0.2. The original probability of generating is calculated according to the following formula: ; Among them, Q i represents the query vector of the i th attention head, which is generated by the decoder layer of the Transformer; K P represents the key vector (content of the prompt template) of the dynamic prompt template P , V i represents the value vector of the i th attention head, K input ​​The key vector representing the target answer, and ⊕ represents the concatenation operation. d k Represents the concatenated key vector K P ⊕ K input The dimension of n Is the total number of attention heads. The input is converted into an embedding vector, and through a linear transformation of the embedding vector, Q i 、 K P 、 K input And V i are generated. The query weight matrix, dynamic prompt template P The key weight matrix, the key weight matrix of the target answer, and the value weight matrix are automatically adjusted and obtained through the training process of the Transformer model. Represents the attention score, calculating the query vector Q i And the concatenated key vector K P ⊕ K input The similarity between them. Softmax is a normalization function used to convert the attention score into a probability distribution, so that the output values are all between [0, 1], and the sum of all output values is equal to 1. Represents the application of the multi-head attention mechanism. Each attention head independently calculates the attention score and generates the corresponding context representation. Finally, the results of multiple attention heads are concatenated to form a richer representation. Different attention heads can focus on different parts of the input. Through the cooperation of multiple attention heads, the model can better understand complex semantic relationships.

[0130] In another exemplary embodiment of the present application, the above-mentioned intent preprocessing module is further used for: Realize the real-time recognition of the question-and-answer intent of voice, touch, and visual signals through the constructed intent recognition small model (combined with the cross-modal joint verification engine).

[0131] In an exemplary embodiment, a computer device is provided. The computer device can be a server or a terminal, and its internal structure diagram can be as Figure 4As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O), and a communication interface. Among them, the processor, the memory, and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store historical conversations and knowledge bases. The input / output interface of the computer device is used to exchange information between the processor and external devices. The communication interface of the computer device is used to communicate with external terminals through a network connection. When the computer program is executed by the processor, it implements an interaction method based on a large language model.

[0132] Those skilled in the art can understand that Figure 4 the structure shown in the figure is only a block diagram of some structures related to the solution of this application, and does not constitute a limitation on the computer device to which the solution of this application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine some components, or have a different component layout.

[0133] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. A computer program is stored in the memory, and when the processor executes the computer program, the steps in the above method embodiments are implemented.

[0134] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0135] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by the processor, the steps in the above method embodiments are implemented.

[0136] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use, and processing of relevant data need to comply with relevant regulations.

[0137] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, database, or other medium used in the various embodiments provided in this application can include at least one of non-volatile and volatile memories. Non-volatile memories can include read-only memory (ROM), magnetic tapes, floppy disks, flash memories, optical memories, high-density embedded non-volatile memories, resistive random access memories (ReRAM), magnetoresistive random access memories (MRAM), ferroelectric random access memories (FRAM), phase change memories (PCM), graphene memories, etc. Volatile memories can include random access memory (RAM) or external cache memories, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.

[0138] The databases involved in the various embodiments provided in this application can include at least one of relational databases and non-relational databases. Non-relational databases can include distributed databases based on blockchain, etc., without limitation. The processors involved in the various embodiments provided in this application can be general-purpose processors, central processors, graphics processors, digital signal processors, programmable logic devices, data processing logics based on quantum computing, etc., without limitation.

[0139] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity of description, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, it should be considered to be within the scope described in this specification.

[0140] Specific examples are used in this article to elaborate on the principles and implementation manners of this application. The description of the above embodiments is only used to help understand the method and its core idea of this application; at the same time, for those of ordinary skill in the art, according to the idea of this application, there will be changes in the specific implementation manners and application scopes. In summary, the content of this specification should not be construed as a limitation to this application.

Claims

1. A method for managing the knowledge boundary of children's education based on large models, characterized in that, The large model-based method for managing the knowledge boundary of children's education includes: Identifying the intent of the input and historical conversations of the target user to obtain the Q&A intent of the target user; Retrieving the target answer from a pre-constructed knowledge base; wherein, the target answer is the standard answer most relevant to the Q&A intent, and the standard answer refers to the analysis result obtained by analyzing each target material, and each standard answer conforms to the educational values of the target user; Generating a response message based on the Q&A intent and the target answer under constraints through a generative model based on a large language model; wherein, the constraints are used to control the content of the response message to be consistent with the target answer.

2. The method for managing the knowledge boundary of children's education based on a large model according to claim 1, wherein The knowledge base is constructed according to the following steps: Parsing each target material through a target material analysis small model to obtain a number of analysis results; Eliminating the analysis results that do not conform to the educational values of the target user from the number of analysis results to obtain a number of standard answers; Storing the number of standard answers in a database to obtain the knowledge base.

3. The method for managing the knowledge boundary of children's education based on large models according to claim 2, wherein The target material analysis small model is constructed according to the following steps: Selecting the target material and the base model; Generating a number of Q&A pair data for vertical education scenarios according to the target material, and screening out the Q&A pair data that meet the requirements; Performing data preprocessing on the Q&A pair data that meet the requirements to obtain a training data set; wherein, the preprocessing includes at least one of template filling, semi-supervised annotation, and sample enhancement processing; Performing a training operation once, and the training operation includes: Performing semi-supervised training on the base model through the training data set to obtain a pre-trained model; wherein, the loss function of the semi-supervised training includes two parts: cross-entropy loss function and knowledge distillation loss function; Performing a benchmark test on the pre-trained model; If the pre-trained model obtained by performing the training operation fails the benchmark test, repeat the training operation until the pre-trained model passes the benchmark test; If the pre-trained model obtained by performing the training operation passes the benchmark test, the pre-trained model that passes the benchmark test is the target material analysis small model.

4. The method for managing the knowledge boundary of children's education based on large models according to claim 3, wherein, The generating a number of Q&A pair data for vertical education scenarios according to the target material specifically includes: Generating a number of Q&A pair data for vertical education scenarios through selfQA according to the target material, and the Q&A pair data includes desensitized QA pairs; The sample enhancement processing at least includes synonym replacement, back translation, and / or sentence pattern transformation of the Q&A pair data.

5. The method for managing the knowledge boundary of children's education based on large models according to claim 1, wherein It also includes: Filtering sensitive words from the Q&A intent before retrieving the target answer from the pre-constructed knowledge base; The target answer is the standard answer most relevant to the Q&A intent after the sensitive word filtering.

6. The method for managing the knowledge boundary of children's education based on a large model according to claim 1, wherein The retrieving the target answer from the pre-constructed knowledge base specifically includes: Calculating the similarity score between the Q&A intent and each standard answer in the knowledge base through a sparse retrieval method to obtain a sparse retrieval score; By means of a dense retrieval method, calculate the semantic similarity score between the Q&A intent and each standard answer in the knowledge base to obtain a dense retrieval score; Normalize the sparse retrieval score and the dense retrieval score; Perform weighted summation on the sparse retrieval score and the dense retrieval score of the Q&A intent and each standard answer in the knowledge base after normalization to obtain a mixed score of the Q&A intent and each standard answer in the knowledge base; Select the standard answer with the maximum sparse retrieval score, dense retrieval score, or mixed score from the knowledge base to obtain the target answer.

7. The method for managing the knowledge boundary of children's education based on large models according to claim 1, wherein, The generation of the reply information by the generation model based on the large language model according to the Q&A intent and the target answer under constraint conditions specifically includes: Dynamically adjust the basic prompt template according to the Q&A intent to obtain a dynamic prompt template; Generate reply information under constraint conditions through the generation model based on the large language model according to the dynamic prompt template and the target answer.

8. The method for managing the knowledge boundary of children's education based on large models according to claim 7, wherein, The constraint conditions include: The retrieval consistency penalty function in the generation probability of the generation model based on the large language model.

9. A large model-based knowledge boundary management system for children's education, characterized in that, The large model-based children's education knowledge boundary management system includes: A knowledge base for storing standard answers, where the standard answers refer to the analysis results obtained by analyzing each target material, and each standard answer conforms to the educational values of the target user; An intent recognition module for recognizing the intent of the input and historical conversations of the target user to obtain the Q&A intent of the target user; A retrieval module for retrieving target answers from a pre-constructed knowledge base; where the target answer is the standard answer most relevant to the Q&A intent; A generation module for generating reply information under constraint conditions through a generation model based on the large language model according to the Q&A intent and the target answer; where the constraint conditions are used to control the content of the reply information to be consistent with the target answer; A log module for storing the historical conversations of the target user; A communication module for obtaining the input and historical conversations of the target user, displaying the reply information to the target user, and sending the input and the reply information of the target user to the log module.

10. A computer device, comprising: A memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the large model-based children's education knowledge boundary management method according to any one of claims 1-8.

Citation Information

Patent Citations

  • Child companion robot and child companioning system

    CN105126355A

  • Generation method of question and answer knowledge base, training method and equipment of neural network

    CN107220296A

  • Intelligent robot integrating chat, knowledge and task questions and answers

    CN113515613A

  • Deep reinforcement learning-based inquiry method and system

    CN114613489A

  • Knowledge question-answering method, device and product based on space-time semantic constraint

    CN117332097A

Cited By

  • Method and device for training model, storage medium and electronic equipment

    CN120523957A

  • Story interactive active questioning method and system based on cognitive characteristics of children

    CN121119146A

  • A voice companion intelligent body safe interaction method, system and device for young children and a storage medium

    CN122658320A