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

By identifying the input and historical dialogues of children's education users, building a knowledge base that conforms to educational values, and generating reply information under constraints, the problem of generative big models being out of control in children's education is solved, and the controllability and accuracy of reply information is achieved.

CN120277199BActive Publication Date: 2025-08-22KUAISHANGYUN (SHANGHAI) NETWORK TECHNOLOGY CO LTD

Patent Information

Application Number
CN202510772173.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-11
Publication Date
2025-08-22
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, a knowledge base is built to store standard answers that meet educational values, and generate reply information under constraints to ensure that the reply information is consistent with the target answer.

Benefits of technology

It improves the accuracy of intention recognition, ensures that the reply information fits the target user's input and Q&A intention, 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 CN120277199B_ABST
    Figure CN120277199B_ABST
Patent Text Reader

Abstract

The present application discloses a method, system and device for managing the knowledge boundary of children's education based on a large model, which relates to the field of intelligent education technology. The method includes: performing intent recognition on the input and historical conversations of the target user to obtain the question and answer intention of the target user; retrieving the target answer from a pre-built knowledge base; wherein the target answer is the standard answer most relevant to the question and answer intention, and each of the standard answers conforms to the educational values ​​required by the target age group; generating reply information under constraints based on the question and answer intention and the target answer; wherein the constraints are used to control the reply information to be consistent with the content of the target answer; the present application can ensure that the knowledge boundary management of the reply information is 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 boundaries of children's education knowledge based on a large model (large language model). Background Art

[0002] In the field of intelligent education, interactive systems based on large language models have become mainstream. Leveraging artificial intelligence, these systems provide a highly interactive and educational learning and entertainment environment for age-restricted users, such as children and adolescents. These systems can be widely used in storytelling, knowledge quizzes, language learning, and emotional support.

[0003] However, existing interaction technologies (methods and / or systems) based on large language models are based on generative large models, which generate responses to user input in real time. However, the responses generated by the generative large models may involve content that does not conform to the educational values ​​of users with age restrictions (sensitive issues or incorrect values), and there is a problem that knowledge boundaries are easily managed out of control. Summary of the Invention

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

[0005] To achieve the above objectives, this application provides the following solutions:

[0006] In the first aspect, this application provides a method for managing the knowledge boundaries of children's education based on a large model, including:

[0007] Perform intent recognition on the target user's input and historical conversations to obtain the target user's question-answering intent;

[0008] Retrieving target answers from a pre-built knowledge base; wherein the target answers are standard answers that are most relevant to the question-answering intent, and the standard answers are analysis results obtained by analyzing each target material, and each standard answer conforms to the educational values ​​of the target user;

[0009] Through a generative model based on a large language model, reply information is generated under constraints according to the question-answering intent and the target answer; wherein the constraints are used to control the reply information to remain consistent with the content of the target answer.

[0010] Optionally, the knowledge base is constructed according to the following steps:

[0011] Analyze each target material through the target material analysis model to obtain several analysis results;

[0012] Eliminate analysis results that do not conform to the educational values ​​of the target users from the plurality of analysis results to obtain a plurality of standard answers;

[0013] Several of the standard answers are stored in a database to obtain the knowledge base.

[0014] Optionally, the target material analysis small model is constructed according to the following steps:

[0015] Select target material and base model;

[0016] Generate several question-answer pairs for vertical educational scenarios based on the target materials, and filter out the question-answer pairs that meet the requirements;

[0017] Performing data preprocessing on the question-answer pair data that meets the requirements to obtain a training data set; wherein the preprocessing includes at least one of template filling, semi-supervised labeling, and sample enhancement processing;

[0018] Perform a training operation, the training operation comprising:

[0019] The base model is semi-supervised trained using the training data set to obtain a pre-trained model; wherein the loss function of the semi-supervised training includes a cross entropy loss function and a knowledge distillation loss function;

[0020] Benchmarking the pre-trained model;

[0021] If the pre-trained model obtained by performing the training operation fails the benchmark test, repeatedly performing the training operation until the pre-trained model passes the benchmark test;

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

[0023] Optionally, generating a plurality of question-answer pair data of vertical educational scenarios based on the target material specifically includes:

[0024] Based on the target material, selfQA is used to generate a number of question-answer pair data for vertical education scenarios, wherein the question-answer pair data includes desensitized QA pairs;

[0025] The sample enhancement processing at least includes synonym replacement, back translation and / or sentence transformation of the question-answer pair data.

[0026] Optionally, the large model-based children's education knowledge boundary management method further includes:

[0027] Before retrieving the target answer from the pre-built knowledge base, filtering the question-answering intent for sensitive words;

[0028] The target answer is the standard answer that is most relevant to the question-answering intent filtered by the sensitive words.

[0029] Optionally, retrieving a target answer from a pre-built knowledge base specifically includes:

[0030] Calculate the similarity score between the question-answering intent and each standard answer in the knowledge base through a sparse retrieval method to obtain a sparse retrieval score;

[0031] Calculate the semantic similarity score between the question-answering intent and each standard answer in the knowledge base through an intensive retrieval method to obtain an intensive retrieval score;

[0032] Normalizing the sparse search score and the dense search score;

[0033] Performing a weighted summation of the normalized sparse search score and the dense search score of the question-answering intention and each standard answer in the knowledge base to obtain a mixed score of the question-answering intention and each standard answer in the knowledge base;

[0034] A standard answer with the largest sparse retrieval score, dense retrieval score, or mixed score is selected from the knowledge base to obtain the target answer.

[0035] Optionally, generating reply information under constraints based on the question-answering intention and the target answer specifically includes:

[0036] Dynamically adjust the basic prompt template according to the question-answering intention to obtain a dynamic prompt template;

[0037] According to the dynamic prompt template and the target answer, reply information is generated under constraints through a generative model based on a large language model; wherein the constraints are used to control the reply information to be consistent with the content of the target answer.

[0038] Optionally, the constraints include:

[0039] A retrieval consistency penalty function in the generation probability of the generative model based on the large language model.

[0040] In the second aspect, this application provides a children's education knowledge boundary management system based on a large model, including:

[0041] A knowledge base for storing standard answers, wherein 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;

[0042] An intent recognition module is used to recognize the target user's input and historical conversations to obtain the target user's question-answering intent;

[0043] A retrieval module is used to retrieve a target answer from a pre-built knowledge base; wherein the target answer is the standard answer that is most relevant to the question-answering intent;

[0044] A generation module, configured to generate a reply message based on the question-answering intent and the target answer under constraints using a generation model based on a large language model; wherein the constraints are used to ensure that the reply message remains consistent with the content of the target answer;

[0045] A log module, used to store the historical conversations of the target user;

[0046] The communication module is used to obtain the input and historical conversations of the target user, display the reply information to the target user, and send the input and reply information of the target user to the log module.

[0047] In a third aspect, the present application provides a computer device comprising: a memory, a processor, and a computer program stored on the memory and runnable on the processor, wherein the processor executes the computer program to implement the steps of any one of the above-mentioned methods for managing children's education knowledge boundaries based on a large model.

[0048] According to the specific embodiments provided in this application, this application discloses the following technical effects:

[0049] The present application provides a method, system, and device for managing the knowledge boundaries of children's education based on a large model. By performing intent recognition on the input and historical conversations of the target user, the target user's input and historical conversations (contextual information of the interaction) are simultaneously considered when performing intent recognition, thereby improving the accuracy of intent recognition and ensuring that the question and answer intention of the target user is accurately obtained; by pre-building a knowledge base to store standard answers, and limiting the standard answers to conform to the educational values ​​of the target user, it is avoided that the target answers retrieved from the pre-built knowledge base involve content that does not conform to the educational values ​​of the target user; by generating reply information under constraints based on the question and answer intention and the target answer, it is ensured that the reply information is more in line with the input and question and answer intention of the target user. Since the target answer conforms to the educational values ​​of the target user, by further limiting the content of the reply information to be consistent with the content of the target answer, it is possible to avoid the reply information from containing information that is irrelevant to the target user's intention or has incorrect educational values, ensuring that the generated reply information conforms to the educational values ​​of the target user, thereby ensuring that the knowledge boundary management of the reply information is controllable, and solving the problem that the knowledge boundary management of the existing interaction technology based on generative large models is prone to getting out of control. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0051] Figure 1 This is an application environment diagram of a method for managing children's educational knowledge boundaries based on a large model in one embodiment of the present application;

[0052] Figure 2 A flowchart of a method for managing children's educational knowledge boundaries based on a large model provided in one embodiment of the present application;

[0053] Figure 3 A schematic diagram of the functional modules of a large-scale model-based children's education knowledge boundary management system provided in one embodiment of the present application;

[0054] Figure 4 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION

[0055] The following will be combined with the drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.

[0056] In order to make the above-mentioned purposes, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.

[0057] The children's education knowledge boundary management method based on the large model provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the 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, or placed on the cloud or 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 and historical conversations of the target user through the intent recognition model based on the large language model, obtains the question and answer intention of the target user, retrieves the standard answer most relevant to the question and answer intention from the pre-built knowledge base, and generates reply information based on the question and answer intention and the standard answer most relevant to the question and answer intention. The server 104 can feed back the obtained reply information to the terminal 102 to display the reply information to the target user. In addition, in some embodiments, the interaction method based on the large language model can also be implemented separately by the server 104 or the terminal 102, such as the terminal 102 can directly reply to the interaction method based on the large language model.

[0058] Terminal 102 may include, but is not limited to, various desktop computers, laptops, smartphones, tablet computers, IoT devices, and portable wearable devices. IoT devices may include smart speakers, smart TVs, smart air conditioners, etc. Portable wearable devices may include smart watches, smart bracelets, head-mounted devices, etc. Server 104 may be implemented as a standalone server or a server cluster consisting of multiple servers, or may be a cloud server.

[0059] In an exemplary embodiment, Figure 2 As shown, a method for managing the knowledge boundary of children's education based on a large model is provided. The method is executed by a computer device, specifically, it can be executed by the computer device of the terminal alone, or it can be executed by the terminal and the server together. In the embodiment of the present application, the method is applied to Figure 1Taking the server 104 in FIG. 1 as an example, the method includes the following steps 201 to 203. In which:

[0060] Step 201: perform intent recognition on the target user's input and historical conversations to obtain the target user's question-answering intent.

[0061] In an embodiment of the present application, by simultaneously performing intent recognition on the target user's input and historical conversations, contextual information can be taken into account when performing intent recognition, thereby improving the accuracy of intent recognition.

[0062] Step 202, retrieve target answers from a pre-built knowledge base; wherein the target answers are standard answers that are most relevant to the question-answering intent, and each standard answer conforms to the educational values ​​of the target user.

[0063] In the embodiments of this application, the standard answer refers to the analysis results obtained from analyzing various target materials, including classic works, language materials, and / or educational materials for the target user. Language materials include at least fairy tales, popular science books, children's songs, and classical Chinese texts (such as ancient poetry, Three Character Classic, Thousand Character Classic, and classical Chinese texts). Educational materials include at least teaching materials, test questions, related knowledge points, encyclopedia knowledge, and papers related to the target user's education. Educational values ​​refer to the basic beliefs and goals upheld in the educational process, guiding the formulation of educational policies, curriculum design, and the selection of teaching methods. They reflect society's understanding of the purpose of education, namely, the personal and social development goals hoped to be achieved through education. Content that does not align with the target user's educational values ​​includes at least sensitive issues or content with incorrect values. Standard answers are limited to those that align with the target user's educational values ​​to avoid the target answers retrieved from the knowledge base containing content that does not align with the target user's educational values, which could lead to uncontrolled knowledge boundary management. Target users include at least children.

[0064] Step 203: Generate reply information under preset conditions according to the question-answering intent and the target answer through a generative model based on a large language model; wherein the constraint conditions are used to control the reply information to be consistent with the content of the target answer.

[0065] In the embodiment of the present application, the reply information is generated based on the question-and-answer intent and the target answer. The target answer is organized into a reply information that responds to the target user's input (question) based on the question-and-answer intent, so that the reply information is more consistent with the target user's input and the question-and-answer intent. The content of the reply information is limited to be consistent with the content of the target answer, avoiding the reply information from containing information that is irrelevant to the target user's intent or has incorrect educational values, thereby ensuring that the knowledge boundary management of the reply information is controllable. The target answer or reply information is returned to the target user.

[0066] Implement the above steps 201 to 203, and perform intent recognition on the input and historical conversations of the target user. When performing intent recognition, the input and historical conversations of the target user are simultaneously considered (contextual information of the interaction), thereby improving the accuracy of intent recognition and ensuring that the question and answer intention of the target user is accurately obtained; by pre-building a knowledge base to store standard answers, and limiting the standard answers to conform to the educational values ​​of the target user, avoid the target answers retrieved from the pre-built knowledge base from involving content that does not conform to the educational values ​​of the target user; by generating reply information under constraints based on the question and answer intention and the target answer, ensure that the reply information is more in line with the input and question and answer intention of the target user. Since the target answer conforms to the educational values ​​of the target user, by further limiting the content of the reply information to be consistent with the content of the target answer, it is possible to avoid the reply information from containing information that is irrelevant to the intention of the target user or has incorrect educational values, and ensure that the generated reply information conforms to the educational values ​​of the target user, thereby ensuring that the knowledge boundary management of the reply information is controllable, and solving the problem that the knowledge boundary management of the existing interaction technology based on generative large models is prone to being out of control.

[0067] In another exemplary embodiment of the present application, in order to quickly identify the intent of the target user's input and historical conversations, the above step 201 includes:

[0068] Through the pre-built intent recognition model, the target user's input and historical conversations are used to identify the intent and obtain the target user's question and answer intent.

[0069] In an embodiment of the present application, the intent recognition model can be a pre-built small intent recognition model, or it can be an intent recognition model based on a large language model.

[0070] In another exemplary embodiment of the present application, the process of building a knowledge base includes the following steps 301 to 303.

[0071] Step 301 : Analyze each target material using a target material analysis model to obtain a number of analysis results.

[0072] In the embodiment of the present application, compared with using a large language model suitable for the vertical scenario of education, a small target material analysis model is used to analyze each target material, thereby improving the analysis efficiency while reducing the demand for resources.

[0073] Step 302 , eliminating analysis results that do not conform to the educational values ​​of the target user from the plurality of analysis results, and obtaining a plurality of standard answers.

[0074] In an embodiment of the present application, the standard answer is ensured to be consistent with the educational values ​​of the target user by eliminating analysis results that do not conform to the educational values ​​of the target user from several analysis results. 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 analysis results containing sensitive words.

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

[0076] In another exemplary embodiment of the present application, the process of building the knowledge base further includes:

[0077] Update target materials according to the set deadlines;

[0078] The knowledge base is updated according to steps 301 to 303 using the updated target material.

[0079] In another exemplary embodiment of the present application, the target material analysis model is constructed according to the following steps 401 to 404.

[0080] Step 401: Select target material and base model.

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

[0082] Step 402: Generate several pieces of question-answer data for vertical educational scenarios based on the target material, and filter out the question-answer data that meet the requirements.

[0083] In the embodiment of the present application, based on the target material, generating a number of question-answer pairs for vertical education scenarios includes:

[0084] Based on the target materials, selfQA is used to generate several question-and-answer pairs for vertical educational scenarios, including desensitized QA pairs.

[0085] In this embodiment of the present application, generating question-answer data through selfQA (self-question-answering) refers to generating questions and corresponding answers using a pre-trained language model (such as GPT, T5, BART, or a full-scale large language model). For example, if the input text is "There are eight planets in the solar system," the pre-trained language model may generate questions such as "How many planets are there in the solar system?" or "What planets are there in the solar system?" and provide the answers.

[0086] Desensitizing Q&A pairs involves identifying sensitive information in questions (Q) and answers (A) and replacing, masking, encrypting, or generalizing it (converting specific values ​​into broader categories, such as converting a specific age into an age range) to protect personal privacy or sensitive data from being leaked. Sensitive information includes information that could expose personal information, trade secrets, or other sensitive data.

[0087] The following methods can be used to filter out the question-answer pair data that meets the requirements from the generated vertical education scenario question-answer pair data:

[0088] Keyword matching: Check whether the keywords mentioned in the question of the question-answer pair data exist in the answer. If so, select the question-answer pair data as the one that meets the requirements;

[0089] Similarity calculation: Use cosine similarity, Jaccard similarity coefficient, etc. to measure the similarity between the question and answer in the question-answer pair data. If the similarity exceeds the preset threshold, the question-answer pair data is selected as the question-answer pair data that meets the requirements.

[0090] Step 403: preprocess the question-answer pair data that meets the requirements to obtain a training data set; wherein the preprocessing includes at least one of template filling, semi-supervised labeling, and sample enhancement processing.

[0091] In the embodiments of this application, template filling refers to the use of scripts (such as Python) or tools (template engines (such as sample data) or data generation tools (such as Mockaroo, Faker, etc., based on predefined rules)) to batch generate sample data based on qualified question-answer pairs using a defined domain template, thereby increasing the quantity of sample data. A domain template is a set of rules or formats designed based on the needs of the education field to generate text data that conforms to the characteristics of that education field. Sample data refers to sample question-answer pair data. To improve the diversity and adaptability of generated samples, during the batch generation of sample data, certain words from the synonym domain template can be used. Diversity can be increased by adjusting sentence structure (such as active-passive conversion, inserting modifiers), and background information or context descriptions can be added to each piece of data (context expansion). The generated sample data is subject to quality checks to ensure its accuracy and consistency. Quality checks include checking the format, logic, and grammar of the generated sample data and removing duplicate or low-quality sample data. Semi-supervised annotation uses a pre-trained model to pseudo-label the generated question-answer pair data (data labels that are not displayed to the user). The pseudo-labels are used for semi-supervised training of the base model. Sample augmentation processing includes at least synonym replacement, back translation, and sentence structure transformation of question-answer pairs. Synonym replacement can increase the vocabulary diversity in questions and answers, allowing the pre-trained model to recognize different expressions of the same concept. Back translation exploits the asymmetry of the translation system. By first translating the original question or answer of the question-answer pair data from the source language into an intermediate language, and then translating from the intermediate language back to the source language, the obtained question-answer pair data has the same meaning as the original text but different wording. Sentence structure transformation changes the structure of the sentence without changing its basic meaning, enhancing the model's ability to handle different sentence patterns. Changing the sentence structure includes adjusting the position of sentence components (such as the subject-verb-object order, the transition between passive and active voice, etc.) and / or introducing changes to question words (such as changing "what" to "which one" and "who" to "which one").

[0092] Step 404: Perform a training operation. The training operation includes the following steps 4041 to 4042.

[0093] In step 4041, semi-supervised training is performed on the base model using the training data set to obtain a pre-trained model; wherein the loss function of the semi-supervised training includes two parts: a cross entropy loss function and a knowledge distillation loss function.

[0094] In an embodiment of the present application, a semi-supervised training is performed on the base model through a training data set to obtain a pre-trained model; wherein, the loss function of the semi-supervised training includes two parts: a cross-entropy loss function and a knowledge distillation loss function, which realizes the knowledge distillation of a full-size large language model suitable for the vertical scenario of education, so that the pre-trained model learns the knowledge of the teacher model while reducing the computing 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 base model is trained using the loss function, and the performance of the full-size large language model is continuously approached during the training, and the pre-trained model is obtained after the training is completed.

[0095] Step 4042, benchmark the pre-trained model.

[0096] In an embodiment of the present application, the pre-trained model can be benchmarked using OpenCompass, which is an open source benchmarking framework. Benchmarking includes performance evaluation and triggering active learning. Performance includes at least accuracy, recall and / or F1 score. Benchmarking the pre-trained model. Triggering active learning includes identifying Bad Cases, marking the correct answers to the collected Bad Cases (ensuring the accuracy and consistency of the data), enhancing the marked data (synonym replacement, back translation and / or sentence transformation, increasing the diversity of samples), and adding the enhanced data to the training data set. Bad Case refers to incorrect predictions or low-quality outputs generated by the pre-trained model during the reasoning process, such as generation errors, missing information (failure to correctly answer the user's questions) and / or leakage of sensitive information. When the performance of the pre-trained model meets the requirements, the pre-trained model passes the benchmark test; otherwise, the pre-trained model fails the benchmark test.

[0097] The parameters of the training process can be set according to the following parameter requirements:

[0098] Learning rate: low learning rate to prevent overfitting, 1e-5 to 5e-5, batch size: 4-16, training rounds: 3-5 epochs, patience=2, Dropout rate increased to 0.3-0.5, weight decay: 0.01, loss function: Span Loss.

[0099] Step 405: If the pre-trained model obtained by performing the training operation fails the benchmark test, the training operation is repeated until the pre-trained model passes the benchmark test.

[0100] 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 model.

[0101] In another exemplary embodiment of the present application, the above-mentioned method for managing the boundary of children's education knowledge based on a large model further includes:

[0102] The standard answer in step 302 is structured and converted into a form that is easy to retrieve.

[0103] In the embodiment of the present application, the format for easy retrieval is not specifically limited and can be set according to actual needs. For example, the standard answer can be converted into a FAQ format or a database entry.

[0104] In another exemplary embodiment of the present application, the above-mentioned method for managing the boundary of children's education knowledge based on a large model further includes:

[0105] Before step 202, sensitive words are filtered for the question-answering intent.

[0106] Accordingly, the target answer is the standard answer that is most relevant to the question-answering intent after filtering out sensitive words.

[0107] In another exemplary embodiment of the present application, filtering sensitive words for question-answering intent includes:

[0108] Identify keywords for question-answering intent;

[0109] Using rule matching technology, we retrieve sensitive words (such as vulgar language and offensive words) that are most relevant to the keywords in the question-answering intent from a pre-built sensitive word library.

[0110] If the most relevant sensitive word for any of the keywords in the Q&A intent is found in the sensitive word library, the keyword or Q&A intent is filtered out. If the Q&A intent is filtered out, a response message indicating that the question cannot be answered is displayed to the target user.

[0111] In another exemplary embodiment of the present application, the above step 202 includes the following steps a1 to a2. Among them:

[0112] In step a1, a sparse retrieval method is used to calculate the similarity score between the question-answering intent and each standard answer in the knowledge base to obtain a sparse retrieval score.

[0113] In the embodiment of the present application, the sparse search method includes the TF-IDF method or the BM25 method. The similarity score calculation formula of the TF-IDF method is:

[0114] ;

[0115] ;

[0116] TF-IDF(t,d)=TF(t,d) IDF(t);

[0117] S sparse (q,d)= ;

[0118] Among them, TF(t,d) represents the frequency of word t appearing in standard answer d, word t is any keyword in the question-answering intent, and standard answer d is any standard answer in the knowledge base; IDF(t) represents 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 word t to standard answer d; S sparse (q,d) is the similarity score between the question-answering intention q and the standard answer d.

[0119] The similarity score calculation formula of the BM25 method is:

[0120] ;

[0121] ;

[0122] TF-IDF(t,d)=TF(t,d) IDF(t);

[0123] BM25(q,d)= TFComponent(t,d);

[0124] 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 question-answering intent q and the standard answer d, that is, the similarity score between the question-answering intent q and the standard answer d.

[0125] Step a2: Select the standard answer with the largest sparse retrieval score from the knowledge base to obtain the target answer.

[0126] In another exemplary embodiment of the present application, the above step 202 includes the following steps b1 to b2. In which:

[0127] Step b1, using an intensive retrieval method, calculates the semantic similarity score between the question-answering intent and each standard answer in the knowledge base to obtain an intensive retrieval score.

[0128] In the embodiment of the present application, the intensive search method includes:

[0129] Use a pre-trained language model (such as BERT, Qwen, etc.) to encode the question-answering intent and each standard answer into a fixed-length vector to obtain the intent vector and the standard answer vector;

[0130] Calculate the similarity between the intent vector and each standard answer vector (such as cosine similarity, Euclidean distance, etc.), obtain the similarity score between the intent vector and each standard answer, and obtain the dense retrieval score.

[0131] Step b2: Select the standard answer with the largest intensive retrieval score from the knowledge base to obtain the target answer.

[0132] In an embodiment of the present application, all standard answer vectors may be stored in an efficient vector index so as to quickly retrieve the standard answer with the highest score.

[0133] In another exemplary embodiment of the present application, the above step 202 includes the following steps c1 to c5. Among them:

[0134] In step c1, a sparse retrieval method is used to calculate the similarity score between the question-answering intent and each standard answer in the knowledge base to obtain a sparse retrieval score.

[0135] Step c2: Calculate the semantic similarity score between the question-answering intent and each standard answer in the knowledge base through an intensive retrieval method to obtain an intensive retrieval score.

[0136] Step c3: normalize the sparse retrieval score and the dense retrieval score.

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

[0138] In step c4, a weighted sum is performed on the normalized question-answering intention and the sparse retrieval score and the dense retrieval score of each standard answer in the knowledge base to obtain a mixed score of the question-answering intention and each standard answer in the knowledge base.

[0139] In the embodiment of the present application, the mixed score of the question-answering intention and each standard answer in the knowledge base is calculated according to the following formula:

[0140] ;

[0141] Among them, S hybrid is a mixed score, S sparse is the normalized sparse retrieval score, S dense is the normalized dense retrieval score; α is S sparse The weight range is [0, 1], 1-α is S dense The weight of .

[0142] Step c5: Select the standard answer with the largest mixed score from the knowledge base to obtain the target answer.

[0143] In another exemplary embodiment of the present application, the above step 202 further includes:

[0144] Before selecting the standard answer with the largest sparse retrieval score, dense retrieval score or hybrid score from the knowledge base, all standard answers in the knowledge base are sorted according to the sparse retrieval score, dense retrieval score or hybrid score through a cross encoder.

[0145] Accordingly, the standard answer with the largest sparse retrieval score, dense retrieval score, or mixed score is selected from the knowledge base, including:

[0146] Select the standard answer with the largest sparse retrieval score, dense retrieval score, or mixed score from the sorted standard answers.

[0147] In another exemplary embodiment of the present application, the above step 203 includes the following steps 501 to 502. Among them:

[0148] Step 501: Dynamically adjust the preset basic prompt template according to the question-answering intention to obtain a dynamic prompt template.

[0149] In the embodiments of the present application, basic prompt templates are 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 about [X]." For an opinion query: "What do you think about [Y]?", [X] and [Y] are placeholders.

[0150] Dynamically adjust the pre-set basic prompt template according to the question and answer intent and the target answer. First, select the basic prompt template that is most relevant to the question and answer intent from the preset basic prompt templates according to the question and answer intent, and then fill in the specific keywords in the question and answer intent (such as the query object) into the placeholder position in the template.

[0151] In addition, if previous conversations provide relevant background information, this context can be added to the prompt to help the model better understand the current problem. The prompt content can also be appropriately modified to provide a more personalized response based on the target user's preferences or historical conversation records.

[0152] To continuously improve the effectiveness of your prompt templates, collect user feedback on their responses and use this data to update and optimize your prompt generation strategy. For example, if you find that a certain type of prompt frequently leads to inaccurate responses, try adjusting the structure or wording of that prompt. Analyze successful cases to understand which prompt templates and adjustment strategies are most effective and apply them to similar scenarios.

[0153] Step 502 : Generate reply information under constraints based on the dynamic prompt template and the target answer through a generative model based on a large language model; wherein the constraints are used to control the reply information to be consistent with the content of the target answer.

[0154] In another exemplary embodiment of the present application, in step 502, the constraint conditions include:

[0155] Retrieval consistency penalty function in generation probability for generative models based on large language models.

[0156] In another exemplary embodiment of the present application, the above step 502 includes the following steps 5021 to 5025. Among them:

[0157] Step 5021: extract keywords from the target answer to obtain a search keyword set.

[0158] Step 5022, for the current time step t , according to the input dynamic prompt template and target answer, the candidate words are generated by the generative model based on the large language model , for each , calculate each The probability of generating :

[0159] ;

[0160] ;

[0161] ;

[0162] in, ( | < t ,P) represents a given generated sequence <t and dynamic prompt templates P Generated under the conditions The original probability, Q i Indicates the i The query vector of the attention head, generated by the decoder layer of the Transformer; KP Indicates a dynamic prompt template P The key vector of (the content of the prompt template), V i Indicates the i The value vector of the 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 Dimensions, n is the total number of attention heads. The input is converted into an embedding vector and generated by linearly transforming the embedding vector Q i 、 K P 、 K input and V i , query weight matrix used by linear transformation, dynamic prompt template P The key weight matrix of , the key weight matrix of the target answer, and the value weight matrix are automatically adjusted 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 Softmax is a normalization function used to convert the attention score into a probability distribution so that the output values ​​are between [0, 1] and the sum of all output values ​​is equal to 1. This represents the application of a multi-head attention mechanism. Each attention head independently computes an attention score and generates a corresponding contextual representation. Ultimately, the results of multiple attention heads are concatenated to form a richer representation. Different attention heads can focus on different parts of the input. By collaborating across multiple attention heads, the model can better understand complex semantic relationships. is the retrieval consistency penalty function, if Not in the search keyword set (not a search keyword), The value is λ, otherwise, The value is 1. λ is a penalty coefficient less than 1, which is used to reduce the probability of generating inconsistent words. This embodiment of the application does not specifically limit λ and can be set according to actual needs. For example, λ is set to 0.8. For another example, λ is set to 0.2.

[0163] Step 5023, for the current time stept , select the generation probability highest as the current generated word.

[0164] Step 5024: Add the current generated word to the generated sequence.

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

[0166] In another exemplary embodiment of the present application, the above-mentioned method for managing the boundary of children's education knowledge based on a large model further includes:

[0167] The reply information is displayed to the target user, and at the same time, the target user's input and reply information are sent to the user interaction log.

[0168] In this embodiment of the present application, the target user's input and response information in the user interaction log is used for real-time compliance review. The knowledge base can also support compliance review.

[0169] In another exemplary embodiment of the present application, in order to address the problem of multimodal intent recognition deviation, a small intent recognition model is constructed (combined with a cross-modal joint verification engine) to achieve real-time recognition of question and answer intents for voice, touch, and visual signals, thereby improving the accuracy and consistency of intent recognition.

[0170] In this embodiment of the present application, speech is converted to text using automatic speech recognition (ASR) technology, and then the text content is analyzed using natural language processing (NLP) technology to identify user intent. Touch is used to understand user intent by analyzing gestures or other interaction modes on the touchscreen. Visual signals use computer vision technology to analyze objects, actions, and environmental features in video streams or images to infer user intent. The cross-modal joint verification engine integrates and verifies information from different modalities to ensure that the final intent recognition results are more accurate and reliable. Data synchronization and alignment ensure that data from different sources (such as speech, touch, and vision) are correctly aligned on the timeline. Feature fusion algorithms are used to fuse features extracted from different modalities. These algorithms can include early fusion (direct fusion at the feature level), late fusion (processing each separately and then combining the decision results), or a hybrid approach. Consistency checks compare the analysis results of each modality to check for inconsistencies and adjust them based on specific rules or weights.

[0171] 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 large-model-based children's education knowledge boundary management method involved above. The implementation solution provided by this system is similar to the implementation solution described in the above method. Therefore, the specific limitations of one or more embodiments of the large-model-based children's education knowledge boundary management system provided below can be found in the above limitations of the large-model-based children's education knowledge boundary management method, and will not be repeated here.

[0172] In an exemplary embodiment, Figure 3 As shown, a children's education knowledge boundary management system 60 based on a large model is provided, including:

[0173] The knowledge base 601 is used to store standard answers. The standard answers refer to the analysis results obtained by analyzing each target material. Each standard answer conforms to the educational values ​​of the target user.

[0174] Intent recognition module 602, used to identify the intent of the target user's input and historical conversations to obtain the target user's question-answering intent;

[0175] Retrieval module 603 is used to retrieve a target answer from a pre-built knowledge base; wherein the target answer is the standard answer that is most relevant to the question-answering intent;

[0176] A generation module 604 is configured to generate a response message based on the question-answering intent and the target answer under constraints using a generation model based on a large language model; wherein the constraints are used to ensure that the response message remains consistent with the target answer;

[0177] Log module 605, used to store the target user's historical conversations;

[0178] The communication module 606 is used to obtain the input and historical conversations of the target user, display the reply information to the target user, and send the input and reply information of the target user to the log module.

[0179] In this embodiment of the present application, historical conversations are historical interactive information, which includes each historical input of the target user and the corresponding response information. Target materials include classic works, language materials, and / or educational materials for the target group. Language materials include at least fairy tales, popular science books, children's songs, classical Chinese texts (such as ancient poetry, Three Character Classic, Thousand Character Classic, classical Chinese texts, etc.). Educational materials include at least teaching materials, test questions, related knowledge points, encyclopedias, and papers related to the target user's education. Educational values ​​refer to the fundamental beliefs and goals upheld in the educational process. They guide the formulation of educational policies, curriculum design, and the selection of teaching methods, and reflect society's understanding of the purpose of education, namely, the personal and social development goals hoped to be achieved through education. Content that does not align with the target user's educational values ​​includes at least sensitive issues or content with incorrect values. Standard answers are limited to those that align with the target user's educational values ​​to avoid the target answers retrieved from the knowledge base containing content that does not align with the target user's educational values, which could lead to uncontrolled knowledge boundary management. Target users include at least children.

[0180] Generating responses based on the Q&A intent and target answer involves organizing the target answer into a response to the target user's input (question) based on the Q&A intent, ensuring that the response is more aligned with the target user's input and the Q&A intent. Reply content is limited to the target answer to avoid including information irrelevant to the target user's intent or inaccurate educational values, thereby ensuring controllable knowledge boundary management of the response information.

[0181] In another exemplary embodiment of the present application, the above-mentioned intention recognition module 602 is further configured to:

[0182] Through the pre-built intent recognition model, the target user's input and historical conversations are used to identify the intent and obtain the target user's question and answer intent.

[0183] In another exemplary embodiment of the present application, the above-mentioned intention recognition module 602 is further configured to:

[0184] Through a pre-built small intent recognition model (combined with a cross-modal joint verification engine), the target user's input (voice, touch, visual signals) and historical conversations are used to identify the intent and obtain the target user's question-and-answer intent.

[0185] In another exemplary embodiment of the present application, the above-mentioned large model-based children's education knowledge boundary management system 60 further includes:

[0186] The knowledge base construction module is used to build a knowledge base by following the steps below:

[0187] Analyze each target material through the target material analysis model to obtain several analysis results;

[0188] Eliminate the analysis results that do not conform to the educational values ​​of the target users from the analysis results to obtain several standard answers;

[0189] Several of the standard answers are stored in a database to obtain a knowledge base.

[0190] In this embodiment, compared to using a large language model suitable for educational vertical scenarios, a small target material analysis model is used to analyze each target material, which improves analysis efficiency while reducing resource requirements. By removing analysis results containing sensitive words from several analysis results, it is ensured that the standard answer conforms to the educational values ​​of the target user.

[0191] In another exemplary embodiment of the present application, the above-mentioned knowledge base construction module is further used to:

[0192] Update target materials according to the set deadlines;

[0193] The knowledge base is updated according to the steps of building the knowledge base through the updated target material.

[0194] In another exemplary embodiment of the present application, the above-mentioned knowledge base construction module is further used to:

[0195] Select target material and base model;

[0196] Based on the target materials, generate several question-answer pairs for vertical educational scenarios and filter out those that meet the requirements;

[0197] Performing data preprocessing on the question-answer pair data that meets the requirements to obtain a training data set; wherein the preprocessing includes at least one of template filling, semi-supervised labeling, and sample enhancement processing;

[0198] Perform a training operation, which includes:

[0199] The base model is semi-supervised trained using the training dataset to obtain a pre-trained model. The loss function of the semi-supervised training consists of two parts: the cross entropy loss function and the knowledge distillation loss function.

[0200] Benchmarking pre-trained models;

[0201] If the pre-trained model obtained by performing the training operation fails the benchmark test, the training operation is repeated until the pre-trained model passes the benchmark test.

[0202] 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 model.

[0203] In the embodiment of the present application, based on the target material, generating a number of question-answer pairs for vertical education scenarios includes:

[0204] Based on the target materials, selfQA is used to generate several question-and-answer pairs for vertical educational scenarios, including desensitized QA pairs.

[0205] In this embodiment of the present application, generating question-answer data through selfQA (self-question-answering) refers to generating questions and corresponding answers using a pre-trained language model (such as GPT, T5, BART, or a full-scale large language model). For example, if the input text is "There are eight planets in the solar system," the pre-trained language model may generate questions such as "How many planets are there in the solar system?" or "What planets are there in the solar system?" and provide the answers.

[0206] Desensitizing Q&A pairs involves identifying sensitive information in questions (Q) and answers (A) and replacing, masking, encrypting, or generalizing it (converting specific values ​​into broader categories, such as converting a specific age into an age range) to protect personal privacy or sensitive data from being leaked. Sensitive information includes information that could expose personal information, trade secrets, or other sensitive data.

[0207] The following methods can be used to filter out the question-answer pair data that meets the requirements from the generated vertical education scenario question-answer pair data:

[0208] Keyword matching: Check whether the keywords mentioned in the question of the question-answer pair data exist in the answer. If so, select the question-answer pair data as the one that meets the requirements;

[0209] Similarity calculation: Use cosine similarity, Jaccard similarity coefficient, etc. to measure the similarity between the question and answer in the question-answer pair data. If the similarity exceeds the preset threshold, the question-answer pair data is selected as the question-answer pair data that meets the requirements.

[0210] Template filling involves using a defined domain template to generate sample data in batches based on qualified question-answer pairs using scripts (such as Python) or tools (template engines (such as sample data) or data generation tools (such as Mockaroo and Faker, based on predefined rules)) to increase the amount of sample data. A domain template is a set of rules or formats designed based on the needs of the educational field to generate text data that meets the specific characteristics of that field. Sample data refers to sample question-answer pairs. To improve the diversity and adaptability of generated samples, batch sample data generation can include certain words from synonymous domain templates, adjust sentence structure (such as active-passive conversion, insert modifiers) to increase diversity, and add background information or contextual descriptions to each piece of data (context expansion). The generated sample data undergoes quality checks to ensure accuracy and consistency. This includes checking the format, logic, and grammar of the generated sample data and removing duplicate or low-quality sample data. Semi-supervised annotation uses a pre-trained model to assign pseudo-labels (data labels that are not displayed to users) to the generated question-answer pairs. Sample augmentation processing includes at least synonym replacement, back translation, and sentence structure transformation of question-answer pairs. Synonym replacement can increase the vocabulary diversity in questions and answers, allowing the pre-trained model to recognize different expressions of the same concept. Back translation exploits the asymmetry of the translation system. By first translating the original question or answer of the question-answer pair data from the source language into an intermediate language, and then translating from the intermediate language back to the source language, the obtained question-answer pair data has the same meaning as the original text but different wording. Sentence structure transformation changes the structure of the sentence without changing its basic meaning, enhancing the model's ability to handle different sentence patterns. Changing the sentence structure includes adjusting the position of sentence components (such as the subject-verb-object order, the transition between passive and active voice, etc.) and / or introducing changes to question words (such as changing "what" to "which one" and "who" to "which one").

[0211] Pre-trained models can be benchmarked using OpenCompass, an open-source benchmarking framework. Benchmarking includes performance evaluation and triggering active learning. Performance includes at least precision, recall, and / or F1 score. When benchmarking pre-trained models, triggering active learning involves identifying bad cases, labeling the collected bad cases with the correct answers (ensuring data accuracy and consistency), augmenting the annotated data (using synonym replacement, back-translation, and / or sentence transformation to increase sample diversity), and adding the augmented data to the training dataset. Bad cases refer to incorrect predictions or low-quality outputs generated by the pre-trained model during inference, such as generation errors, missing information (failure to correctly answer user questions), and / or leakage of sensitive information. If the pre-trained model's performance meets the requirements, the pre-trained model is considered to have passed the benchmark test; otherwise, the pre-trained model is considered to have failed the benchmark test.

[0212] The parameters of the training process can be set according to the following parameter requirements:

[0213] Learning rate: low learning rate to prevent overfitting, 1e-5 to 5e-5, batch size: 4-16, training rounds: 3-5 epochs, patience=2, Dropout rate increased to 0.3-0.5, weight decay: 0.01, loss function: Span Loss.

[0214] In another exemplary embodiment of the present application, the above-mentioned knowledge base construction module is further used to:

[0215] The standard answers are structured and converted into a form that is easy to retrieve.

[0216] In the embodiment of the present application, the format for easy retrieval is not specifically limited and can be set according to actual needs. For example, the standard answer can be converted into a FAQ format or a database entry.

[0217] In another exemplary embodiment of the present application, the above-mentioned large model-based children's education knowledge boundary management system 60 further includes:

[0218] The intent preprocessing module is used to filter sensitive words for question-answering intent before retrieving the target answer from the pre-built knowledge base.

[0219] Accordingly, the target answer is the standard answer that is most relevant to the question-answering intent after filtering out sensitive words.

[0220] In another exemplary embodiment of the present application, the above-mentioned intention pre-processing module is further used to:

[0221] Identify keywords for question-answering intent;

[0222] Using rule matching technology, we retrieve sensitive words (such as vulgar language and offensive words) that are most relevant to the keywords in the question-answering intent from a pre-built sensitive word library.

[0223] If the most relevant sensitive word for any of the keywords in the Q&A intent is found in the sensitive word library, the keyword or Q&A intent is filtered out. If the Q&A intent is filtered out, a response message indicating that the question cannot be answered is displayed to the target user.

[0224] In another exemplary embodiment of the present application, the above-mentioned retrieval module 603 is further configured to:

[0225] Through the sparse retrieval method, the similarity score between the question-answering intent and each standard answer in the knowledge base is calculated to obtain the sparse retrieval score;

[0226] Select the standard answer with the largest sparse retrieval score from the knowledge base to obtain the target answer.

[0227] In the embodiment of the present application, the sparse search method includes the TF-IDF method or the BM25 method. The similarity score calculation formula of the TF-IDF method is:

[0228] ;

[0229] ;

[0230] TF-IDF(t,d)=TF(t,d) IDF(t);

[0231] S sparse (q,d)= ;

[0232] Among them, TF(t,d) represents the frequency of word t appearing in standard answer d, word t is any keyword in the question-answering intent, and standard answer d is any standard answer in the knowledge base; IDF(t) represents 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 word t to standard answer d; S sparse (q,d) is the similarity score between the question-answering intention q and the standard answer d.

[0233] The similarity score calculation formula of the BM25 method is:

[0234] ;

[0235] ;

[0236] TF-IDF(t,d)=TF(t,d) IDF(t);

[0237] BM25(q,d)= TFComponent(t,d);

[0238] 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 question-answering intent q and the standard answer d, that is, the similarity score between the question-answering intent q and the standard answer d.

[0239] In another exemplary embodiment of the present application, the above-mentioned retrieval module 603 is further configured to:

[0240] By using a dense retrieval method, the semantic similarity score between the question-answering intent and each standard answer in the knowledge base is calculated to obtain a dense retrieval score;

[0241] Select the standard answer with the largest intensive retrieval score from the knowledge base to obtain the target answer.

[0242] In the embodiment of the present application, the intensive search method includes:

[0243] Use a pre-trained language model (such as BERT, Qwen, etc.) to encode the question-answering intent and each standard answer into a fixed-length vector to obtain the intent vector and the standard answer vector;

[0244] Calculate the similarity between the intent vector and each standard answer vector (such as cosine similarity, Euclidean distance, etc.), obtain the similarity score between the intent vector and each standard answer, and obtain the dense retrieval score.

[0245] In another exemplary embodiment of the present application, the above-mentioned retrieval module 603 is further configured to:

[0246] Through the sparse retrieval method, the similarity score between the question-answering intent and each standard answer in the knowledge base is calculated to obtain the sparse retrieval score;

[0247] By using a dense retrieval method, the semantic similarity score between the question-answering intent and each standard answer in the knowledge base is calculated to obtain a dense retrieval score;

[0248] Normalized sparse retrieval scores and dense retrieval scores;

[0249] Performing a weighted summation of the normalized question-answering intent and the sparse retrieval score and the dense retrieval score of each standard answer in the knowledge base to obtain a mixed score of the question-answering intent and each standard answer in the knowledge base;

[0250] Select the standard answer with the largest mixed score from the knowledge base to obtain the target answer.

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

[0252] The mixed score of the question-answering intent and each standard answer in the knowledge base is calculated according to the following formula:

[0253] ;

[0254] Among them, S hybrid is a mixed score, S sparse is the normalized sparse retrieval score, S dense is the normalized dense retrieval score; α is S sparse The weight range is [0, 1], 1-α is S dense The weight of .

[0255] In another exemplary embodiment of the present application, the above-mentioned retrieval module 603 is further configured to:

[0256] Before selecting the standard answer with the largest sparse retrieval score, dense retrieval score, or hybrid score from the knowledge base, all standard answers in the knowledge base are sorted according to the sparse retrieval score, dense retrieval score, or hybrid score by a cross encoder;

[0257] Select the standard answer with the largest sparse retrieval score, dense retrieval score, or mixed score from the sorted standard answers.

[0258] In another exemplary embodiment of the present application, the generating module 604 is further configured to:

[0259] Dynamically adjust the preset basic prompt template according to the question and answer intention to obtain a dynamic prompt template;

[0260] According to the dynamic prompt template and the target answer, a reply message is generated under constraints through a generative model based on a large language model; wherein the constraints are used to control the reply message to be consistent with the content of the target answer.

[0261] In the embodiments of the present application, basic prompt templates are 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 about [X]." For an opinion query: "What do you think about [Y]?", [X] and [Y] are placeholders.

[0262] Dynamically adjust the pre-set basic prompt template according to the question and answer intent and the target answer. First, select the basic prompt template that is most relevant to the question and answer intent from the preset basic prompt templates according to the question and answer intent, and then fill in the specific keywords in the question and answer intent (such as the query object) into the placeholder position in the template.

[0263] In addition, if previous conversations provide relevant background information, this context can be added to the prompt to help the model better understand the current problem. The prompt content can also be appropriately modified to provide a more personalized response based on the target user's preferences or historical conversation records.

[0264] To continuously improve the effectiveness of your prompt templates, collect user feedback on their responses and use this data to update and optimize your prompt generation strategy. For example, if you find that a certain type of prompt frequently leads to inaccurate responses, try adjusting the structure or wording of that prompt. Analyze successful cases to understand which prompt templates and adjustment strategies are most effective and apply them to similar scenarios.

[0265] In another exemplary embodiment of the present application, the generating module 604 is further configured to:

[0266] Extract keywords from the target answer to obtain a search keyword set;

[0267] For the current time step t , according to the input dynamic prompt template and target answer, the candidate words are generated by the generative model based on the large language model , calculate each The probability of generating :

[0268] ;

[0269] ;

[0270] in, Represents a given generated sequence < t and dynamic prompt templates P Generated under the conditions The original probability, is the retrieval consistency penalty function, if Not in the search keyword set (not a search keyword), The value is λ, otherwise, The value is 1, and λ is a penalty coefficient less than 1, which is used to reduce the probability of generating inconsistent words;

[0271] For the current time step t , select the generation probability highest As the current generated word;

[0272] Add the current generated word to the generated sequence;

[0273] Repeat the above steps until a complete response message is generated.

[0274] The embodiment of the present application does not specifically limit λ, and can be set according to actual needs. For example, set λ = 0.8. For another example, set λ = 0.2. The original probability Calculate according to the following formula:

[0275] ;

[0276] in, Q i Indicates the i The query vector of the attention head, generated by the decoder layer of the Transformer; K P Indicates a dynamic prompt template P The key vector of (the content of the prompt template), V i Indicates the i The value vector of the 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 Dimensions, n is the total number of attention heads. The input is converted into an embedding vector and generated by linearly transforming the embedding vector Q i 、 K P 、 K input and V i , query weight matrix used by linear transformation, dynamic prompt template P The key weight matrix of , the key weight matrix of the target answer, and the value weight matrix are automatically adjusted 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 inputSoftmax is a normalization function used to convert the attention score into a probability distribution so that the output values ​​are between [0, 1] and the sum of all output values ​​is equal to 1. This represents the application of a multi-head attention mechanism. Each attention head independently computes an attention score and generates a corresponding contextual representation. Ultimately, the results of multiple attention heads are concatenated to form a richer representation. Different attention heads can focus on different parts of the input. By collaborating across multiple attention heads, the model can better understand complex semantic relationships.

[0277] In another exemplary embodiment of the present application, the above-mentioned intention pre-processing module is further used to:

[0278] By constructing a small intent recognition model (combined with a cross-modal joint verification engine), real-time recognition of question and answer intent based on voice, touch, and visual signals can be achieved.

[0279] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Figure 4 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, abbreviated as I / O) and a communication interface. The processor, memory and input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. 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 computer program in the non-volatile storage medium. The database of the computer device is used to store historical conversations and a knowledge base. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, an interaction method based on a large language model is implemented.

[0280] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0281] In an exemplary embodiment, a computer device is further provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.

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

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

[0284] 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 used 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 must comply with relevant regulations.

[0285] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the 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 above-mentioned embodiments. In particular, any reference to memory, database, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0286] The databases involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processors involved in the various embodiments provided herein may include, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic units, data processing logic units based on quantum computing, and the like.

[0287] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, 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, they should be considered to be within the scope of this specification.

[0288] This document uses specific examples to illustrate the principles and implementation methods of this application. The description of the above examples is only intended to help understand the method and core concept of this application. At the same time, for those skilled in the art, based on the concept of this application, there may be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.

Claims

1. A method for managing the knowledge boundary of children's education based on a large model, characterized by: The method for managing the knowledge boundary of children's education based on the large model includes: Perform intent recognition on the target user's input and historical conversations to obtain the target user's question-answering intent; Retrieving target answers from a pre-built knowledge base; wherein the target answers are standard answers that are most relevant to the question and answer intent, and the standard answers are analysis results obtained by analyzing each target material. Each standard answer conforms to the educational values ​​of the target user, and the standard answers that conform to the educational values ​​of the target user do not include sensitive questions or content that is inaccurate to the target user's values. Dynamically adjust the basic prompt template according to the question-answering intention to obtain a dynamic prompt template; Generate a reply message under constraints based on the dynamic prompt template and the target answer using a generative model based on a large language model, wherein the constraints are used to ensure that the reply message remains consistent with the content of the target answer; The method of generating a reply message under constraints based on the dynamic prompt template and the target answer by using a generative model based on a large language model specifically includes: Extract keywords from the target answer to obtain a search keyword set; For the current time step t , according to the input dynamic prompt template and target answer, the candidate words are generated by the generative model based on the large language model , for each , calculate each The probability of generating : ; ; ; in, Represents a given generated sequence <t and dynamic prompt templates P Generated under the conditions The original probability, Q i Indicates the i The query vector of the attention head, K P Indicates a dynamic prompt template P The key vector of V i Indicates the i The value vector of the 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 Dimensions, n is the total number of attention heads, Represents the attention score, Softmax is the normalization function, is the retrieval consistency penalty function, if Not in the search keyword set, The value is λ, otherwise, The value is 1, and λ is a penalty coefficient less than 1; For the current time step t , select the generation probability highest As the current generated word; Add the current generated word to the generated sequence; Repeat for the current time step t , according to the input dynamic prompt template and target answer, the candidate words are generated by the generative model based on the large language model and subsequent steps until a complete response message is generated.

2. The method for managing the knowledge boundary of children's education based on a large model according to claim 1 is characterized in that: The knowledge base is constructed according to the following steps: Analyze each target material through the target material analysis model to obtain several analysis results; Eliminate analysis results that do not conform to the educational values ​​of the target users from the plurality of analysis results to obtain a plurality of standard answers; Several of the standard answers are stored in a database to obtain the knowledge base.

3. The method for managing the knowledge boundary of children's education based on a large model according to claim 2 is characterized in that: The target material analysis small model is constructed according to the following steps: Select target material and base model; Generate several question-answer pairs for vertical educational scenarios based on the target materials, and filter out the question-answer pairs that meet the requirements; Performing data preprocessing on the question-answer pair data that meets the requirements to obtain a training data set; wherein the preprocessing includes at least one of template filling, semi-supervised labeling, and sample enhancement processing; Perform a training operation, the training operation comprising: The base model is semi-supervised trained using the training data set to obtain a pre-trained model; wherein the loss function of the semi-supervised training includes a cross entropy loss function and a knowledge distillation loss function; Benchmarking the pre-trained model; If the pre-trained model obtained by performing the training operation fails the benchmark test, repeatedly performing 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.

4. The method for managing the knowledge boundary of children's education based on a large model according to claim 3 is characterized in that: The generation of multiple question-answer pairs of data for vertical educational scenarios based on the target material specifically includes: Based on the target material, selfQA is used to generate a number of question-answer pair data for vertical education scenarios, wherein the question-answer pair data includes desensitized QA pairs; The sample enhancement processing at least includes synonym replacement, back translation and / or sentence transformation of the question-answer pair data.

5. The method for managing the knowledge boundary of children's education based on a large model according to claim 1 is characterized in that: Also includes: Before retrieving the target answer from the pre-built knowledge base, filtering the question-answering intent for sensitive words; The target answer is the standard answer that is most relevant to the question-answering intent filtered by the sensitive words.

6. The method for managing the knowledge boundary of children's education based on a large model according to claim 1 is characterized in that: The process of retrieving target answers from a pre-built knowledge base specifically includes: Calculate the similarity score between the question-answering 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 question-answering intent and each standard answer in the knowledge base through an intensive retrieval method to obtain an intensive retrieval score; Normalizing the sparse search score and the dense search score; Performing a weighted summation of the normalized sparse search score and the dense search score of the question-answering intention and each standard answer in the knowledge base to obtain a mixed score of the question-answering intention and each standard answer in the knowledge base; A standard answer with the largest sparse retrieval score, dense retrieval score, or mixed score is selected from the knowledge base to obtain the target answer.

7. A children's education knowledge boundary management system based on a large model, characterized by: The children's education knowledge boundary management system based on the large model includes: A knowledge base for storing standard answers, wherein the standard answers refer to the analysis results obtained from analyzing each target material, and each standard answer conforms to the educational values ​​of the target user. The standard answers that conform to the educational values ​​of the target user do not include sensitive issues or content that is inaccurate to the target user's values; An intent recognition module is used to recognize the target user's input and historical conversations to obtain the target user's question-answering intent; A retrieval module is used to retrieve a target answer from a pre-built knowledge base; wherein the target answer is the standard answer that is most relevant to the question-answering intent; A generation module, configured to dynamically adjust a basic prompt template according to the question-answering intent to obtain a dynamic prompt template; Generate a reply message under constraints based on the dynamic prompt template and the target answer using a generative model based on a large language model, wherein the constraints are used to ensure that the reply message remains consistent with the content of the target answer; The method of generating a reply message under constraints based on the dynamic prompt template and the target answer by using a generative model based on a large language model specifically includes: Extract keywords from the target answer to obtain a search keyword set; For the current time step t , according to the input dynamic prompt template and target answer, the candidate words are generated by the generative model based on the large language model , for each , calculate each The probability of generating : ; ; ; in, Represents a given generated sequence <t and dynamic prompt templates P Generated under the conditions The original probability, Q i Indicates the i The query vector of the attention head, K P Indicates a dynamic prompt template P The key vector of V i Indicates the i The value vector of the 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 Dimensions, n is the total number of attention heads, Represents the attention score, Softmax is the normalization function, is the retrieval consistency penalty function, if Not in the search keyword set, The value is λ, otherwise, The value is 1, and λ is a penalty coefficient less than 1; For the current time step t , select the generation probability highest As the current generated word; Add the current generated word to the generated sequence; Repeat for the current time step t , according to the input dynamic prompt template and target answer, the candidate words are generated by the generative model based on the large language model and subsequent steps until a complete response message is generated; A log module, used to store the historical conversations of the target user; The communication module is used to obtain the input and historical conversations of the target user, display the reply information to the target user, and send the input and reply information of the target user to the log module.

8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and runnable on the processor, characterized in that the processor executes the computer program to implement the steps of the large model-based children's education knowledge boundary management method described in any one of claims 1-6.

Citation Information

Patent Citations

  • Child companion robot and child companioning system

    CN105126355A

  • Question and answer processing method and device, electronic equipment and storage medium

    CN118427209A

  • Knowledge question and answer model training method and device and knowledge question and answer method and device

    CN118504681A

  • Intelligent question and answer method and device

    CN119829702A

Cited By

  • A large model-based children's education knowledge boundary management method and system

    CN122390029A