Teaching dialogue generation method and device, storage medium and electronic equipment
By generating structured teaching scripts and building a script library through multi-round adversarial interactions, combined with intent recognition and real-time compliance review, the system solves the problems of interactivity and personalized guidance in serious teaching scenarios in online education systems. This achieves content security and controllability, as well as a structured teaching process, thereby improving teaching quality and user experience.
Patent Information
- Application Number
- CN202511794113.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-01
- Publication Date
- 2026-03-03
AI Technical Summary
Existing online education systems struggle to balance interactivity, personalized guidance, content security and controllability, and structured teaching processes in serious teaching scenarios. Search-based services lack deep semantic understanding, while general-purpose large-model products are prone to factual errors and deviations from the teaching theme.
By generating structured teaching scripts, and utilizing multi-round adversarial interactions between user-simulated intelligent agents and script-running intelligent agents, a script library is constructed. Combined with intent recognition and real-time compliance review, personalized and secure teaching responses are generated.
It achieves an organic unity of interactive and personalized guidance with safe and controllable content in serious teaching scenarios, avoiding factual errors and thematic deviations, and providing progressive teaching value.
Smart Images

Figure CN121597804A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of intelligent education technology, and in particular to a method, apparatus, storage medium and electronic device for generating teaching dialogues. Background Technology
[0002] With the deep integration of artificial intelligence technology and the online education industry, intelligent teaching dialogue systems have become a key technological carrier for breaking through traditional tutoring models and realizing personalized teaching. Their application scenarios widely cover multiple educational scenarios requiring structured interaction, such as K-12 after-school tutoring, vocational qualification training Q&A, and language learning dialogue practice. Driven by the demand for serious teaching, the industry has placed higher requirements on teaching dialogue systems: they not only need to accurately understand users' learning intentions and simulate Socratic heuristic teaching, but also need to ensure the accuracy, compliance, and security of teaching content, as well as the logic and completeness of the teaching process, in order to adapt to the personalized needs of different learners and meet the strict regulations of the education industry.
[0003] Currently, two main technical solutions have emerged in the online education field for teaching and question-and-answer scenarios. One type is the search-and-match service, whose core technical logic is to extract the key features of the user-input question, match them with a pre-set static question bank, and then return the corresponding question answer and explanation. The other type is the companion-style interactive product based on a general big model, which leverages the powerful natural language generation capabilities of the big model to provide users with flexible dialogue responses, mainly focusing on non-serious companion-style communication scenarios.
[0004] However, search-based services rely on the coverage of static question banks, lacking deep semantic understanding and reasoning capabilities for user questions. They cannot provide progressive, guided instruction based on user responses and offer insufficient support for natural language questions not included in the database or with varied wording. While general-purpose model-based products offer flexible responses, they lack strict constraints on teaching objectives and knowledge points, making them prone to factual errors (i.e., "illusions"), deviations from the teaching theme, or direct answers that lose their heuristic teaching value. In summary, both types of solutions are ill-suited to the core needs of serious teaching scenarios. They cannot simultaneously guarantee interactivity while addressing the core requirements of personalized guidance, content security and controllability, and a structured teaching process, thus limiting the reliable application of intelligent teaching dialogue systems in serious educational settings. Summary of the Invention
[0005] In view of this, this application provides a method, apparatus, storage medium, and electronic device for generating teaching dialogues, which can ensure the quality and security of teaching content while guaranteeing interactivity.
[0006] According to a first aspect of this application, a method for generating instructional dialogues is provided, comprising: It receives user responses in real time during the current teaching dialogue task; The user's intent type is determined by performing intent recognition processing on the response content. Based on the user intent type, the corresponding candidate response scripts are matched from the script library. The script library contains response scripts for different preset intent types. The process of generating the script library includes: generating a structured teaching script based on the teaching topic information; and controlling the user simulation agent and the script running agent to conduct multi-round adversarial interaction based on the structured teaching script to generate a script library covering multiple preset intent types. The candidate response scripts are subject to real-time compliance review, and once the review is passed, the candidate response scripts are output to the user.
[0007] According to a second aspect of this application, a teaching dialogue generation device is provided, comprising: The receiving module is used to receive the user's input responses in the current teaching dialogue task in real time; The recognition module is used to perform intent recognition processing on the response content to determine the user's intent type; The matching module is used to match corresponding candidate response scripts from the script library based on the user intent type. The script library contains response scripts for different preset intent types. The generation process of the script library includes: generating a structured teaching script based on the teaching topic information; controlling the user simulation agent and the script running agent to conduct multi-round adversarial interaction based on the structured teaching script to generate a script library covering multiple preset intent types. The review module is used to conduct real-time compliance review of the candidate response scripts, and output the candidate response scripts to the user after the review is passed.
[0008] According to a third aspect of this application, a storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the above-described teaching dialogue generation method.
[0009] According to a fourth aspect of this application, an electronic device is provided, including a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, wherein the processor executes the program to implement the above-described teaching dialogue generation method.
[0010] By employing the aforementioned technical solutions, this application provides a teaching dialogue generation method, apparatus, storage medium, and electronic device. Through the use of a dialogue library generated based on structured teaching scripts and multi-round adversarial interactions between user-simulated intelligent agents and script-running intelligent agents, it can overcome the dependence on static question banks in search-based services. It can cover various real-world teaching scenarios, including correct answers, incorrect answers, requests for help, and irrelevant answers. Furthermore, the scripts provide structured constraints on teaching objectives and knowledge points, avoiding factual errors and topic deviations that are common in general large-scale model products. Simultaneously, relying on the intent-adaptive responses of the dialogue library, it enables a gradual progression in user responses. The system provides guidance and imbues instruction with value; furthermore, by processing the intent of responses, it can deeply understand user semantics and needs, overcoming the limitations of search-based services that lack deep semantic reasoning. This allows for personalized guidance responses for users with different intent types, balancing interactive teaching with personalized needs. In addition, real-time compliance review further ensures the security and compliance of the output content, ultimately achieving an organic unity of interactivity, personalized guidance, content security and controllability, and a structured teaching process. This effectively adapts to the core needs of serious teaching scenarios and overcomes the limitations of existing solutions on the reliable application of intelligent teaching dialogue systems in serious educational settings.
[0011] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description
[0012] Figure 1 A flowchart illustrating a teaching dialogue generation method provided in an embodiment of this application is shown; Figure 2 A flowchart illustrating a speech script generation method according to another embodiment of this application is shown; Figure 3 This illustration shows a schematic diagram of the principle process for generating a structured instructional script according to an embodiment of this application; Figure 4 This illustration shows an example diagram of an adversarial content generation process provided in an embodiment of this application; Figure 5 A flowchart illustrating a teaching dialogue generation method according to another embodiment of this application is shown; Figure 6 This illustration shows a schematic diagram of the structure of a teaching dialogue generation device provided in an embodiment of this application; Figure 7 A schematic diagram of another teaching dialogue generation device provided in an embodiment of this application is shown. Detailed Implementation
[0013] The present application will be described in detail below with reference to the accompanying drawings and embodiments. It should be noted that, unless otherwise specified, the embodiments and features described in the embodiments of the present application can be combined with each other.
[0014] Currently, two main technical solutions have emerged in the online education field for teaching and question-and-answer scenarios. One type is the search-and-match service, whose core technical logic is to extract the key features of the user-input question, match them with a pre-set static question bank, and then return the corresponding question answer and explanation. The other type is the companion-style interactive product based on a general big model, which leverages the powerful natural language generation capabilities of the big model to provide users with flexible dialogue responses, mainly focusing on non-serious companion-style communication scenarios.
[0015] However, search-based services rely on the coverage of static question banks, lacking deep semantic understanding and reasoning capabilities for user questions. They cannot provide progressive, guided instruction based on user responses and offer insufficient support for natural language questions not included in the database or with varied wording. While general-purpose model-based products offer flexible responses, they lack strict constraints on teaching objectives and knowledge points, making them prone to factual errors (i.e., "illusions"), deviations from the teaching theme, or direct answers that lose their heuristic teaching value. In summary, both types of solutions are ill-suited to the core needs of serious teaching scenarios. They cannot simultaneously guarantee interactivity while addressing the core requirements of personalized guidance, content security and controllability, and a structured teaching process, thus limiting the reliable application of intelligent teaching dialogue systems in serious educational settings.
[0016] To address the above problems, embodiments of the present invention provide a method for generating teaching dialogues, such as... Figure 1 As shown, the method includes: Step 110: Receive the user's input in real time during the current teaching dialogue task.
[0017] The current teaching dialogue task refers to a structured teaching interaction scenario that revolves around a specific teaching objective (such as explaining a single knowledge point, answering questions about specific exercises, or consolidating learning outcomes) and has a preset interaction scope, process, and objectives. Examples include "Question and Answer Task on the Application of the Formula for Calculating the Volume of a Rectangular Prism in Grade 5" and "Guidance Task on Understanding the Basic Concepts of Ohm's Law in Junior High School Physics." The user's input response refers to the text information that the user provides in response to the teaching questions (such as question answering requirements or knowledge point comprehension questions) initiated by the system in the current teaching dialogue task. This may include various forms such as correct answers, incorrect answers, requests for help (such as "I don't understand this step"), and irrelevant content (such as "The weather is very nice today").
[0018] Step 120: Perform intent recognition processing on the response content to determine the user's intent type.
[0019] Intent recognition processing refers to the technical process of semantic parsing, feature extraction, and purpose judgment of user responses using technologies such as natural language processing and model reasoning (e.g., keyword matching, lightweight model classification, and large model thought chain analysis). The core is to uncover the user's core needs behind the content. User intent type refers to the classification result of the user's core needs after intent recognition processing. Common types include correct answers (providing accurate answers that meet teaching requirements), incorrect answers (answers that are biased or wrong), requests for help (expressing confusion and seeking guidance), and irrelevant answers (content that is not related to the current teaching topic).
[0020] By performing intent recognition processing on responses to determine the type of user intent, the technology can accurately capture the core needs of users, avoid responses that deviate from the teaching objectives due to misjudgment of intent, and solve the problems of inaccurate and off-topic responses that are common in existing general-purpose large-scale model products. At the same time, clear intent types can provide a basis for subsequent targeted matching of response scripts, enabling personalized teaching feedback for users with different needs (such as praise for correct answers, correction for incorrect answers, and guidance for requests for help), ensuring the structured and effective teaching process, meeting the core requirements of precise and personalized interaction in serious teaching scenarios, and improving the overall quality of teaching interaction and user learning experience.
[0021] Step 130: Based on the user intent type, match the corresponding candidate response scripts from the script library. The script library contains response scripts for different preset intent types.
[0022] The script library refers to a database pre-generated before the intelligent dialogue system goes online, used to store standardized / personalized teaching response texts for different teaching scenarios and user intent types. Its content must be adapted to teaching objectives and user needs, ensuring that responses are guiding, accurate, and compliant. Preset intent types refer to user need categories pre-defined based on common teaching interaction scenarios before the script library is generated. These serve as the basis for script library content classification and generation, corresponding one-to-one with the user intent types subsequently identified, such as preset "correct answer - praise script" and "incorrect answer - error correction guidance script," etc.
[0023] For the embodiments of this disclosure, the corresponding candidate response scripts can be matched from the script library based on the user intent type. This requires the high-quality script library built in the early stage to form a coherent technical link of "script library generation - intent matching application": First, when the user intent type is identified in the actual teaching dialogue, the response text that matches the intent type and the current teaching topic (such as the corresponding knowledge point or question type) can be directly retrieved from the script library based on the intent type and determined as the candidate response script.
[0024] This technology, based on a precise matching mechanism for user intent types, can quickly locate suitable candidate response scripts. It can ensure personalized teaching feedback (such as praising correct answers and providing error correction guidance for incorrect answers), and reduce the error rate and delay of real-time response generation through the pre-construction and verification of the script library. Ultimately, it can achieve accuracy, relevance and fluency in teaching interaction, effectively adapting to the core needs of serious teaching scenarios for controllable content, personalized guidance and efficient interaction.
[0025] In specific application scenarios, before the intelligent dialogue system goes online, a structured teaching script containing teaching logic, question sequence and knowledge point constraints can be generated first based on the information of the topic to be taught (such as topic, difficulty of knowledge points, and expected teaching objectives). Then, the user simulation agent (simulating user feedback of different intention types) and the script running agent (initiating teaching questions according to the script and generating initial responses) are controlled to conduct multiple rounds of adversarial interaction. For preset intention types such as "correct answer, incorrect answer, request for help, irrelevant answer", appropriate response scripts are generated and filtered, and finally a script library covering multiple preset intention types is formed.
[0026] Correspondingly, when pre-generating the script library, such as Figure 2 As shown, the steps in the embodiment may include: Step 210: Generate a structured teaching script based on the information of the topic to be taught.
[0027] For embodiments of this disclosure, such as Figure 3 As shown, when generating a structured teaching script, the system first obtains the topic information to be taught, including the expected number of dialogue rounds and supplementary teaching information. After input validity checks, this information is imported into a preset script generation prompt template (i.e., a prompt template) to form a script generation instruction containing the logical order of teaching (i.e., integrated into the final prompt). Subsequently, the script generation agent (i.e., the large model agent) executes this instruction to generate an initial teaching script containing multiple dialogue nodes according to a multi-level structure of task, scene, dialogue, and response. Finally, the initial teaching script is checked for knowledge accuracy and teaching compliance, and dialogue nodes with knowledge point errors or guiding violations are removed. After output validity checks and script post-processing, the final structured teaching script is obtained.
[0028] Accordingly, step 210 of the embodiment may include the following steps: Step 210-1: Obtain the information on the topic to be taught. The information on the topic to be taught should include at least the topic of the topic to be taught, the expected number of dialogue rounds, and supplementary teaching information.
[0029] The teaching topic theme is the core direction of the teaching content information, referring to the specific scope of teaching content. It needs to be specified down to the subdivided knowledge points or skill points, rather than a general subject area. For example, "Solution to practical application problems of the formula for calculating the volume of a cuboid in fifth grade" or "Understanding and judging the conditions for the occurrence of double displacement reaction in junior high school chemistry". The expected number of dialogue rounds is the number of teaching interactions preset according to the complexity of the teaching topic theme (such as the depth of knowledge points and whether it contains multiple sub-problems). It is used to control the pace of the teaching process and avoid the interaction being too short, resulting in insufficient teaching, or too long, resulting in user attention being distracted. For example, 3-5 rounds are set for simple knowledge points, and 5-8 rounds are set for complex knowledge points. Supplementary teaching information is detailed data that plays a supporting and guiding role in the teaching process and is used to improve the teaching relevance. It usually includes the difficulty level of knowledge points (such as easy, medium, and difficult), common mistakes (such as "finding the least common multiple in fraction addition and subtraction"), teaching focus (such as "prioritizing the explanation of the formula derivation logic rather than just memorizing the conclusion"), and the appropriate grade level (such as "third grade of primary school" or "first year of high school").
[0030] Step 210-2: Import the information of the topic to be taught into the preset script generation prompt template to form a script generation instruction containing the logical order of teaching.
[0031] The script generation prompt template is a pre-designed standardized format framework with built-in structured requirements for teaching logic (such as the order of knowledge point explanation and the progressive manner of questioning). It is used to transform the information of the topic to be taught into a prompt word structure that can be understood by the generation model. The teaching logic order is the progressive law and process arrangement of the teaching content, such as the order from concept explanation to example analysis, from basic questioning to in-depth exploration, which must conform to the laws of cognition and learning. The script generation instruction is a complete prompt word formed after filling in the information of the topic to be taught. It includes the teaching theme, number of rounds, supplementary information and teaching logic requirements. It is the input basis for driving the script generation agent (such as a large model) to produce a structured teaching script.
[0032] In this embodiment of the disclosure, after obtaining the information of the teaching topic, this information can be filled in according to the format of a preset script generation prompt template, and the scattered information can be integrated into structured prompt words containing a clear teaching logical order (such as the order of knowledge point explanation and the progressive relationship of questions), that is, script generation instructions. These instructions can provide clear input constraints for the subsequent script generation agent to generate a multi-level teaching script with a task-act-dialogue-reply structure, ensuring that the generated script has coherence and teaching rationality in the teaching process and knowledge transmission.
[0033] By importing the information of the topics to be taught into a preset template and generating scripts with a logical order, the generated teaching scripts can have a unified structural framework and logical flow, avoiding messy content or discontinuous teaching processes. At the same time, the teaching logic (such as from concept to application, from easy to difficult) aligns with the learning pattern, ensuring that the generated teaching scripts are more scientific and effective in knowledge transfer and interactive design. This lays a core foundation for the subsequent generation of high-quality dialogue libraries based on script adversarial interaction and the realization of precise teaching interaction.
[0034] Step 210-3: The script generation agent executes the script generation instructions and generates an initial teaching script containing multiple rounds of dialogue nodes according to the multi-level structure of tasks, acts, dialogues, and repetitions.
[0035] The script generation agent is a software entity (such as a large model) with the ability to generate natural language and construct structured content. It is used to receive script generation instructions and output multi-level teaching scripts that conform to the teaching logic. The script generation instructions are structured prompts containing information about the topics to be taught and the order of teaching logic. They are the input basis for driving the script generation agent. The multi-level structure of tasks, acts, dialogues and echoes is the organizational framework of the teaching script. A dialogue task contains N>=1 acts, an act contains M>=1 dialogues, and each dialogue can have K>=1 rounds of dialogue. "Task" refers to the overall teaching objective (e.g., "Mastering the calculation method of multiplying a two-digit number by a one-digit number"); "Scene" is a major teaching stage under the task (e.g., "Explanation of units digit calculation" and "Tens digit calculation and result combination"); "Dialogue" is a single round of teacher-student interaction (e.g., the teacher asks, "What is 2 × 3 in the units digit of 12?"); "Response" is an extension or feedback of the dialogue (e.g., "Yes, 2 × 3 = 6, so what about 1 × 3 in the tens digit?"); the initial teaching script is a teaching script directly output by the script generation agent and has not been verified. It contains multiple rounds of dialogue nodes and requires subsequent compliance and accuracy verification.
[0036] In this embodiment of the disclosure, after receiving a script generation instruction containing the teaching logic sequence, the script generation agent can, according to the multi-level structure logic of "task-scene-dialogue-response", first clarify the overall teaching task (such as the mastery target of a certain knowledge point), then divide it into several teaching scenes (each scene focuses on a teaching sub-target or stage), and design multiple rounds of dialogue nodes in each scene (including teacher-guided questions, possible student response directions and teacher response feedback), and finally generate an initial teaching script containing multiple rounds of coherent interaction, providing a complete process framework for the structured development of subsequent teaching interactions.
[0037] By generating initial teaching scripts in a multi-level structure through a script-generating intelligent agent, the teaching process can have a clear hierarchical structure of objectives and interactive rhythm. "Tasks" ensure that teaching does not deviate from the core objectives, "scenes" enable the orderly advancement of teaching stages, and "dialogue-response" ensure the continuity and guidance of teacher-student interaction. This makes the teaching process structured and controllable from macro to micro, avoiding fragmented teaching content or chaotic processes. It lays a foundation for subsequent script-based adversarial dialogue library generation and actual teaching interaction with a compliant process and logical coherence.
[0038] Step 210-4: Verify the accuracy of knowledge and compliance of teaching in the initial teaching script, and remove dialogue nodes with knowledge errors or leading violations to obtain the final structured teaching script.
[0039] Among them, the structured teaching script refers to a structured teaching framework constructed based on the information of the topic to be taught, which includes clear teaching objectives (such as mastery of knowledge points and improvement of problem-solving ability), core knowledge points, a pre-set question sequence (such as step-by-step problem-solving guidance questions), expected user responses, and basic guidance direction. It can provide a unified teaching logic constraint for subsequent intelligent agent interaction. Knowledge accuracy verification is the process of verifying the authenticity and correctness of the knowledge points involved in the teaching script (such as concept definitions, formula derivations, calculation logic, principle explanations, etc.) to ensure that the content is free of factual errors. Teaching compliance verification is the compliance check of the guidance direction and interactive content in the teaching script, including whether it deviates from the pre-set teaching objectives, whether there are misleading statements, and whether it contains illegal information unrelated to teaching, to ensure that the content complies with teaching norms.
[0040] In this embodiment of the disclosure, after the script generation agent outputs an initial teaching script containing multiple rounds of dialogue nodes, it can first check the accuracy of the knowledge point descriptions (such as formula application, calculation logic, and concept explanation) in each dialogue node against an authoritative knowledge system (such as subject textbooks or standard knowledge point databases). Then, based on the preset teaching objectives, it can be judged whether the content deviates from the topic, provides inappropriate guidance, or contains illegal information. Dialogue nodes that are confirmed to have knowledge point errors (such as calculation logic errors or concept confusion) or guidance violations (such as ignoring teaching steps and directly giving answers or containing irrelevant entertainment information) are eliminated. At the same time, it is ensured that the remaining dialogue nodes can still maintain the multi-level structure of "task-scene-dialogue-response". Finally, a structured teaching script with complete logic, compliant content, and accurate knowledge is formed, providing a reliable process basis for the subsequent driving of the agent to generate a dialogue library through adversarial interaction.
[0041] This technical process eliminates problematic nodes by verifying the accuracy of knowledge and compliance with teaching standards. It can prevent incorrect knowledge points from misleading teaching from the source, prevent content that violates regulations or deviates from the objectives from affecting teaching quality, and ensure the reliability of teaching content.
[0042] Step 220: Based on the structured teaching script, control the user's simulated agent to conduct multiple rounds of adversarial interaction with the script running agent to generate a script library covering multiple preset intent types.
[0043] Among them, the user simulation agent refers to a software entity used to simulate various behavioral responses of real users in teaching scenarios. It can generate diverse simulated responses (such as correct answers, incorrect answers, and requests for help) according to preset intent types, and is used to test and generate scripts adapted to different user needs. The script execution agent refers to a software entity used to load and execute structured teaching scripts. It can initiate teaching interactions according to preset question sequences in the script, receive simulated responses from the user simulation agent, and generate initial response scripts. It is the teaching role in multi-round adversarial interactions. Multi-round adversarial interactions refer to the multi-round simulated teaching interaction process between the user simulation agent and the script execution agent around the structured teaching script. By simulating feedback of different user intent types, it generates, verifies, and accumulates response scripts adapted to various scenarios, ultimately forming a script library with wide coverage and strong adaptability.
[0044] For embodiments of this disclosure, such as Figure 4 As shown, when controlling the user simulation agent (i.e., the user simulation agent) and the script execution agent (script execution agent) to conduct multi-round adversarial interactions and generate a script library covering multiple preset intent types, based on a structured teaching script, the script execution agent first initiates questions according to the script's preset teaching logic (e.g., "What are the seasons in a year?"); the user simulation agent simulates multiple preset intent types such as "partially correct, seeking help, irrelevant answer, correct" to answer (e.g., "Spring, summer", "Can I give you a hint?", "I like ginkgo leaves", "I know, it's autumn and winter"); the script execution agent generates appropriate guidance or feedback responses for these different intent responses (e.g., "Think again, what are the other two seasons?", "When are the seasons when the leaves turn yellow and it snows?", "Let's go back to the previous question", "Great..."); through such multi-round adversarial interactions, the simulated answers of various user intents are associated and stored with the corresponding appropriate responses, ultimately generating a script library covering multiple preset intent types such as "partially correct, seeking help, irrelevant answer, correct".
[0045] Accordingly, step 220 of the embodiment may include the following steps: Step 220-1: Configure the user simulation agent's preset intent types when the model user behaves. The preset intent types include at least correct answer, incorrect answer, request for help, and irrelevant answer.
[0046] Step 220-2: Load the structured teaching script into the script running agent, and control the script running agent to send preset questions to the user simulation agent according to the dialogue content of each round in the structured teaching script.
[0047] Among them, the pre-set questions are teaching guidance questions designed in advance in the structured teaching script, arranged in the order of teaching logic, and used to promote the interactive process and guide users to think about and provide feedback on knowledge points.
[0048] In this embodiment of the disclosure, a structured teaching script containing a multi-level dialogue structure and teaching logic can be loaded into the script running agent. The agent parses the content and order of each round of dialogue in the script, and, in the role of the teaching guide, sends corresponding preset questions to the user simulated agent according to the preset teaching rhythm and logic of the script, thereby initiating multi-round adversarial interaction and providing a scenario-based interactive foundation for the subsequent generation of response scripts adapted to different user intentions.
[0049] By loading structured teaching scripts and controlling the script's running agent to send preset questions, it is ensured that teaching interactions always revolve around clear teaching objectives and knowledge points, and that the questioning logic conforms to learning patterns (such as the progression from concept to application), avoiding interactions that deviate from the topic or lack teaching value. At the same time, it provides standardized interaction trigger points for the user's simulated agent, ensuring the scenario coverage and teaching effectiveness of adversarial interactions, and ultimately helping to generate a script library that is accurate and adaptable to various teaching scenarios, combining guidance and accuracy.
[0050] For example, taking the teaching of "Application of the Formula for Calculating the Volume of a Cuboid (Volume = Length × Width × Height) in Fifth Grade" as an example, the structured teaching script includes structures such as "Task: Master the practical application of the formula for calculating the volume of a cuboid; Act 1: Review of the formula principle; Act 2: Example calculation guidance," with pre-set questions such as "A cuboid is 5 cm long, 3 cm wide, and 2 cm high. How do you calculate its volume?" and "If the length increases by 1 cm, how much will the volume change?" After loading the script into the script-running intelligent agent, the agent sends these questions to the user-simulated intelligent agent in sequence according to the script logic. The user-simulated intelligent agent may generate answers according to pre-set intent types such as "Correct answer (5 × 3 × 2 = 30 cubic centimeters)," "Incorrect answer (5 + 3 + 2 = 10 cubic centimeters)," and "Request for help (How to distinguish the corresponding data for length, width, and height?)." The script-running intelligent agent generates appropriate responses (such as error correction guidance and explanation of principles) based on these responses and stores them in the script database.
[0051] Step 220-3: Control the user's simulated intelligent agent to generate simulated answers to preset questions based on the current dialogue node and different preset intent types.
[0052] Among them, the simulated response content is text content generated by the user's simulated intelligent agent based on the current dialogue node and preset intent type, which simulates the feedback of real users. It is used to trigger the response of the script running intelligent agent, and then accumulate the content of the dialogue database.
[0053] In this embodiment of the disclosure, after the script-running intelligent agent sends a preset question according to the structured teaching script, the user simulation intelligent agent generates simulated response content (such as correct answer, incorrect deduction, request for help, irrelevant answer, etc.) corresponding to the preset question based on the current dialogue node (clearly defining the interaction link and teaching progress) and different configured preset intent types (correct, incorrect, request for help, irrelevant answer, etc.). This provides scenario-based user behavior samples for the script-running intelligent agent to generate suitable response scripts, and promotes the continuous development of multi-round adversarial interaction.
[0054] By controlling the user-simulated intelligent agent to generate simulated responses covering various preset intent types, it is possible to comprehensively simulate various behavioral feedbacks of users in real teaching scenarios. This ensures that the subsequently generated script library can accurately address different needs such as "praise for correct responses, correction for incorrect responses, guidance for requests for help, and retrieval of irrelevant responses from the topic," avoiding a lack of relevance in the script library due to insufficient coverage of user behavior. At the same time, it can provide diverse interactive triggering conditions for the script-running intelligent agent, ensuring the richness of adversarial interaction scenarios, and ultimately helping to generate a high-quality script library with strong adaptability that can effectively support personalized teaching guidance.
[0055] Step 220-4: Receive the initial response script returned by the script running agent for the simulated answer content, and determine whether the initial response script is compatible with the corresponding preset intent type through intent recognition.
[0056] In this embodiment of the disclosure, after the user-simulated intelligent agent generates simulated response content, the script-running intelligent agent can generate an initial response script based on the structured teaching script. The system receives the initial response script, analyzes its semantics and guidance logic through intent recognition technology, and determines whether it matches the preset intent type that triggered the response (such as error correction guidance for incorrect answers and step explanation for requests for help). In this way, response scripts with teaching value are selected, providing a basis for subsequent accumulation in the script library.
[0057] By identifying the compatibility between the initial response script and the preset intent type, we can accurately select response scripts that can effectively address various user needs, avoiding invalid or off-target content from entering the script library and ensuring the targeting and effectiveness of the script library. At the same time, it provides reliable support for quickly matching user intent and outputting high-quality teaching feedback in subsequent actual teaching, ensuring the accuracy and guiding value of teaching interaction.
[0058] Step 220-5: If the initial response script matches the corresponding preset intent type, then associate the simulated response content with the initial response script and store it in the script library.
[0059] For example, taking the teaching of "addition and subtraction of fractions in elementary school mathematics (such as 1 / 2 + 1 / 3)" as an example, the user-simulated agent generates "1 / 2 + 1 / 3 = 2 / 5" (the correct answer should be 5 / 6) according to the intention of "incorrect answer". The script running agent returns the initial response, "When adding fractions, you need to find a common denominator first. Try finding a common denominator after that." The system receives this response and judges it through intent recognition. It finds that it provides error correction guidance on finding a common denominator for incorrect answers, which matches the preset intent type of "correct answer needs to be corrected". Therefore, the simulated answer "1 / 2 + 1 / 3 = 2 / 5" can be associated with the initial response "When adding fractions, you need to find a common denominator first. Try finding a common denominator after that." It is stored in the response database according to the "incorrect answer" type. When a real user makes the same mistake later, the system can directly retrieve this response to quickly explain the structure and usage of the present continuous tense to the user, achieving accurate error correction guidance.
[0060] Step 220-6: If the initial response script does not match the corresponding preset intent type, then after adjusting the expression of the simulated response content or the response logic of the script running agent, the interaction is repeated until an appropriate response is generated and associated with the script library.
[0061] For example, taking the teaching of "elementary school math fraction addition and subtraction (such as 1 / 2 + 1 / 3)" as an example, the user-simulated agent still generates "1 / 2 + 1 / 3 = 2 / 5" (the correct answer should be 5 / 6) according to the "incorrect answer" intention. However, at this time, the script running agent returns the initial response "Great, the answer is correct". When the system receives this response and judges it through intent recognition, it finds that it does not point out the error in the answer and does not match the preset intent type of "incorrect answer needs to be corrected". At this time, the interaction can be restarted after adjusting the expression of the simulated answer or the response logic of the script running agent until an appropriate response is generated and associated and stored in the speech library.
[0062] Step 140: Conduct real-time compliance review of the candidate response scripts, and output the candidate response scripts to the user after the review is passed.
[0063] Among them, candidate response texts refer to the teaching feedback texts that are matched from a preset script library based on the user's intent type and are intended to be output to the user. The content of these texts must be compatible with the user's needs (such as praising correct answers and correcting incorrect answers) and the current teaching theme (such as specific knowledge points and exercise types). Real-time compliance review refers to the technical process of checking the candidate response texts in real time before they are output, through preset rules (such as factual knowledge verification, filtering of illegal information, and judgment of relevance to the teaching theme). The core is to ensure that the output content is error-free, non-compliant, and closely related to the teaching objectives, and to avoid delays that affect the smoothness of the interaction.
[0064] In this embodiment, candidate response scripts matched based on user intent type are first received and immediately passed to the compliance review module. The review module quickly analyzes the candidate response scripts using a built-in fact verification library (to verify the accuracy of knowledge point descriptions), a violation word library (to filter inappropriate content), and a topic association model (to determine whether the content deviates from the current teaching task). If the review result is compliant, the alternative mechanism is skipped, and the candidate response script is directly output to the user in real time through a user interaction channel (such as a text interface or voice system) to complete the teaching feedback. If the review fails (e.g., due to deviations in knowledge point descriptions or the inclusion of irrelevant entertainment information), a preset security response mechanism is triggered (e.g., by calling the security response library to generate compliant guidance content) to ensure that the final output content always meets the teaching requirements.
[0065] This technical step, through real-time compliance review and pre-control, can promptly identify factual errors, violations, or thematic deviations in candidate responses before outputting them. This avoids content quality defects affecting teaching effectiveness or posing security risks, addressing the shortcomings of some solutions that lack content security control. Furthermore, the accurate output after approval further ensures that teaching responses closely align with user needs and teaching objectives, strengthening the standardization and reliability of the teaching process. This effectively meets the core requirements of serious teaching scenarios for "accurate content, security and controllability, and smooth interaction," enhancing the user learning experience and trust in the teaching system.
[0066] In summary, the teaching dialogue generation method provided by this invention, by leveraging a dialogue library generated through multi-round adversarial interaction between a structured teaching script and a user-simulated intelligent agent and a script-running intelligent agent, can eliminate the dependence on static question banks in search-based services. It can cover various real-world teaching scenarios, including correct answers, incorrect answers, requests for help, and irrelevant answers. Furthermore, through the structured constraints of the script on teaching objectives and knowledge points, it avoids factual errors and topic deviations that are prone to occur in general large-scale model products. Simultaneously, relying on the intent-adaptive responses of the dialogue library, it can provide gradual guidance to users' responses, thus imbuing teaching with a heuristic approach. It offers educational value; and through intent recognition processing of responses, it can deeply understand user semantics and needs, overcoming the limitations of search-based services that lack deep semantic reasoning, providing personalized guidance responses for users with different intent types, and balancing interactive teaching with personalized needs; in addition, the real-time compliance review process can further ensure the security and compliance of the output content, ultimately achieving an organic unity of interactivity, personalized guidance, content security and controllability, and structured teaching process, effectively adapting to the core needs of serious teaching scenarios, and breaking through the limitations of existing solutions on the reliable application of intelligent teaching dialogue systems in serious educational scenarios.
[0067] Furthermore, as a refinement and extension of the specific implementation of the above embodiments, and to fully illustrate the implementation of this embodiment, this embodiment also provides another method for generating teaching dialogues, such as... Figure 5 As shown, the method includes: Step 510: Receive the user's input in real time during the current teaching dialogue task.
[0068] Step 520: For the answer content, perform keyword matching, model intent recognition and model thought chain intent recognition sequentially or in parallel to obtain the corresponding first user intent recognition result, second user intent recognition result and third user intent recognition result.
[0069] Keyword matching employs natural language processing technology to extract core words from the answer content, calculates similarity with the keywords in the standard answer of the corresponding question in the current teaching task, and preliminarily judges the user's intent (e.g., "correct answer" or "incorrect answer") based on the results. Model intent recognition inputs the answer content into a first intent recognition model (with relatively low computing power, focusing on rapid classification), extracts intent features, and directly outputs the intent type. Model thought chain intent recognition inputs the answer content into a second intent recognition model (with greater computing power than the first intent recognition model and possessing reasoning capabilities), and infers the user's deeper intent by gradually parsing the semantic logic of the answer content. The process (e.g., deriving the composite intent of "incorrect answer + request for help" from "incorrect answer + question"); the first user intent recognition result, the second user intent recognition result, and the third user intent recognition result correspond to the output results of keyword matching, model intent recognition, and model thought chain intent recognition, respectively, and are the basis for comprehensively judging the user's final intent; the first intent recognition model is a model used for fast intent classification, with relatively low computing power (e.g., a lightweight classification model), which is suitable for the intent recognition needs of conventional scenarios; the second intent recognition model is a reasoning model with greater computing power than the first model (e.g., a large language model), which processes complex semantics or scenarios with multiple intertwined intents through thought chain reasoning.
[0070] By sequentially or in parallel executing keyword matching, model intent recognition, and model thought chain intent recognition, this approach achieves rapid initial screening of intent through keyword matching, improves recognition efficiency in common scenarios through the first model, and handles complex semantics or multi-intent scenarios through thought chain reasoning of the second model. The synergistic effect of these three methods can significantly improve the accuracy and adaptability of user intent recognition, providing a reliable basis for subsequent matching of personalized teaching responses. This effectively solves the problems of low efficiency, poor generalization, and difficulty in handling complex scenarios with single recognition methods.
[0071] In specific application scenarios, the keyword matching process includes: extracting answer keywords from the answer content using natural language processing technology, calculating the similarity between the answer keywords and the standard answer keywords of the corresponding questions in the current teaching dialogue task, and determining the first user intent recognition result based on the similarity calculation result; the model intent recognition process includes: inputting the answer content into the first intent recognition model for intent feature extraction, and performing intent recognition based on the intent features to obtain the second user intent recognition result; the model thought chain intent recognition process includes: inputting the answer content into the second intent recognition model, performing intent recognition through thought chain reasoning, and determining the third user intent recognition result. The model computing power of the second intent recognition model is greater than that of the first intent recognition model.
[0072] Step 530: Determine the user intent type based on at least one of the first user intent recognition result, the second user intent recognition result, and the third user intent recognition result.
[0073] In this embodiment of the disclosure, after obtaining the first, second, and third user intent recognition results sequentially or in parallel based on the user's response, the criteria can be flexibly selected according to the effectiveness of different recognition results (such as whether the similarity of keyword matching meets the standard, whether the confidence of model recognition is sufficient, and whether the consistency of thought chain reasoning meets the requirements): if a certain recognition result (such as keyword matching similarity far exceeding the preset threshold) can clearly and reliably reflect the user's needs, then the intent corresponding to that result is directly used as the user intent type; if a single result is ambiguous (such as model recognition confidence being close to the threshold), then two or three results are combined for cross-validation (such as referring to the initial direction of keyword matching and the deep logic of thought chain reasoning), and finally, a comprehensive determination is made of the user intent type that can accurately respond to the user's needs, providing precise guidance for subsequent speech matching.
[0074] By determining the user's intent type based on at least one intent recognition result, it retains the efficiency advantage of direct use when a single result is clear, while also providing the reliability guarantee of cross-validation of multiple results. It can flexibly adapt to answering scenarios of different complexities (such as simple correct / incorrect answers can be quickly judged by keyword matching, while complex compound intents can be combined with the results of thought chain reasoning). It can effectively avoid the problems of low efficiency in simple scenarios or inaccurate judgment in complex scenarios caused by relying on a single recognition method. It can significantly improve the accuracy and scenario adaptability of user intent recognition, laying a core foundation for generating teaching responses that meet user needs.
[0075] Accordingly, step 530 in the embodiment may include the following steps: Step 530-1: If the keyword similarity in the first user intent recognition result is greater than the preset threshold, then the intent type corresponding to the first user intent recognition result is determined as the user intent type.
[0076] Keyword similarity is a quantitative indicator used to measure the semantic correlation between keywords extracted from user responses and keywords in the standard answer. Higher similarity indicates a higher degree of fit between the response and the standard answer, and vice versa. The preset threshold is a pre-set critical value used to determine whether keyword similarity is sufficient to support the determination of user intent. This threshold is set according to factors such as teaching scenarios and the difficulty of knowledge points, and is the core basis for distinguishing between valid and invalid keyword matching results. Intent type is a classification of the core needs behind user responses, such as correct response, incorrect response, request for help, irrelevant response, etc., and is the key basis for subsequent matching and adaptation of response scripts from the script database.
[0077] In this embodiment of the present disclosure, after completing keyword matching for the user's answer and obtaining the first user intent recognition result, the system extracts the keyword similarity value in the result and compares it with a preset threshold. If the similarity value is greater than the preset threshold, it indicates that the correlation between the answer keywords and the standard answer keywords is high enough, and the first user intent recognition result can accurately reflect the user's core needs. Therefore, the intent type corresponding to the result is directly determined as the final user intent type, providing clear guidance for matching accurate reply scripts from the script library. At the same time, the subsequent implementation steps 530-2 and 530-3 are no longer executed, thus avoiding the waste of resources caused by calling more complex recognition methods.
[0078] By using the comparison result of keyword similarity with a preset threshold as the criterion for judging whether the first user intent recognition result is usable, the accuracy of intent recognition can be ensured while giving full play to the advantages of keyword matching method, which is simple to calculate and has a fast response speed. This allows for the rapid determination of the user intent type and greatly improves the overall efficiency of intent recognition. At the same time, the rigid constraint of the preset threshold avoids misjudgment of intent due to insufficient similarity, ensuring the accuracy of subsequent response word matching and achieving a balance between efficiency and accuracy.
[0079] Step 530-2: If the keyword similarity is less than or equal to the preset threshold, then obtain the second user intent recognition result. If the intent confidence of the second user intent recognition result is greater than the preset confidence threshold, then determine the intent type corresponding to the second user intent recognition result as the user intent type.
[0080] Among them, the intent confidence is a quantitative indicator of the reliability of the first intent recognition model's output of the second user intent recognition result. The higher the confidence, the stronger the certainty of the model's judgment of the intent. The preset confidence threshold is a pre-set critical value used to determine whether the intent confidence of the second user intent recognition result is high enough. It is the core standard for judging whether the model's recognition result is effective.
[0081] In this embodiment of the disclosure, after keyword matching is completed for the user's answer, if the calculated keyword similarity is less than or equal to a preset threshold, it indicates that the user's intent cannot be accurately determined by keyword matching alone. At this time, the system will obtain the second user intent recognition result generated by the first intent recognition model and extract the intent confidence from the result. The intent confidence is compared with the preset confidence threshold. If the intent confidence is greater than the preset confidence threshold, it indicates that the model's certainty in judging the intent is high enough to accurately reflect the user's core needs. Therefore, the intent type corresponding to the second user intent recognition result is directly determined as the final user intent type, providing a basis for matching accurate teaching response scripts in the future.
[0082] By employing a progressive logic that activates model recognition and confidence verification when keyword matching fails, the first intent recognition model can improve the accuracy of intent recognition by leveraging its feature extraction and classification capabilities when keyword matching fails. Furthermore, it can filter out recognition results with insufficient model certainty through a pre-set confidence threshold, avoiding misjudgments. Simultaneously, as a lightweight model, the first intent recognition model balances recognition accuracy and response efficiency, eliminating the need to directly call models with greater computational power. This ensures the reliability of intent recognition while saving computational resources, achieving a balance between accuracy, efficiency, and resource costs.
[0083] Step 530-3: If the confidence level of the second user intent recognition result is less than or equal to the preset confidence threshold, then obtain the third user intent recognition result. If the inference consistency of the third user intent recognition result is greater than the preset consistency threshold, then determine the intent type corresponding to the third user intent recognition result as the user intent type.
[0084] Among them, reasoning consistency refers to the degree of self-consistency between reasoning steps and conclusions and the degree of fit between reasoning logic and teaching scenario requirements in the reasoning process of the second intent recognition model. It is the core quantitative indicator for measuring the reliability of the third user intent recognition result. The preset consistency threshold is a pre-set critical value used to determine whether the reasoning consistency of the third user intent recognition result is high enough. It is the core standard for judging the validity of the reasoning result of the thinking chain.
[0085] In this embodiment of the disclosure, after keyword matching (invalid result, similarity ≤ preset threshold) and first model recognition are completed for the user's answer, if the confidence level of the second user intent recognition result is less than or equal to the preset confidence threshold, it indicates that the lightweight model cannot accurately determine the user's intent. At this time, the system will obtain the third user intent recognition result generated by the second intent recognition model (a reasoning model with greater computing power) and extract the reasoning consistency index from the result. The reasoning consistency is compared with the preset consistency threshold. If the reasoning consistency is greater than the preset consistency threshold, it indicates that the model's thought chain reasoning process is logically consistent and fits the needs of the teaching scenario. The third user intent recognition result can accurately reflect the user's deep needs. Therefore, the intent type corresponding to the result is directly determined as the final user intent type, providing a reliable basis for subsequent matching of targeted teaching response scripts.
[0086] In addition, as a possible implementation, if the reasoning consistency of the third user intent recognition result is less than or equal to the preset consistency threshold, it means that the user intent cannot be reliably determined by reasoning through the thought chain. At this time, the system will backtrack and integrate the effective information of the first user intent recognition result (keyword matching) and the second user intent recognition result (lightweight model recognition) for cross-validation. For example, if the similarity of keyword matching is close to the preset threshold (e.g., threshold 80%, similarity 75%), and the confidence of the second model's intent is also close to the preset confidence threshold (e.g., threshold 0.85, confidence 0.82), both pointing to the intent related to "incorrect answer," then the intent type pointed to by this commonality is initially determined as the user intent type. If no clear commonality is found after cross-validation (e.g., keyword matching points to "irrelevant answer," the second model points to "request for help"), then the preset "general intent classification rules" (e.g., based on whether the answer content contains "question words," "incorrect expressions," etc.) are called, and the user intent type is temporarily set as "needs to be clarified + guided interaction." The appropriate guiding dialogue is then matched from the dialogue library (e.g., "Do you have questions about the calculation steps for this question, or are you unsure about the result? Can you tell me more about it?"). At the same time, the fuzzy data of this intent recognition is recorded for subsequent optimization of the threshold settings and model training of the three recognition methods, gradually improving the reliability of intent recognition in complex scenarios.
[0087] By employing a progressive logic of invalid keyword matching → activating a lightweight model for recognition → activating an inference-based model for recognition and consistency verification when model confidence is insufficient, this strategy can leverage the first two efficient methods in simple scenarios, while overcoming recognition bottlenecks in complex scenarios (such as semantic ambiguity and complex intents) by utilizing the reasoning capabilities of the second model. Simultaneously, it filters out logically contradictory reasoning results through a reasoning consistency threshold to avoid misjudgments. This layered recognition strategy ensures accuracy in intent recognition under complex scenarios while saving computational resources by calling high-performance models on demand, achieving an optimal balance between recognition accuracy, efficiency, and resource costs. This provides high-quality intent evidence for subsequent personalized teaching responses.
[0088] Step 540: Based on the user intent type, match the corresponding candidate response scripts from the script library.
[0089] In this embodiment of the disclosure, after determining the user intent type through multi-level identification, the corresponding category subset in the script library can be located based on the intent type (such as the "Incorrect Answer - Request for Help" folder in the script library). Then, the scripts in the subset can be further filtered in combination with the specific scenario of the current teaching dialogue task (such as the knowledge point type and the details of the user's incorrect answer) (such as excluding error correction scripts that are not related to the current knowledge point). Finally, one or more candidate response scripts that can accurately respond to the user's needs are matched, which prepares for the subsequent real-time compliance review and output process.
[0090] Matching candidate response scripts from a script library based on user intent type allows for rapid location of suitable content by leveraging the script library's intent-based categorization structure, significantly improving response efficiency and avoiding delays in real-time script generation. Furthermore, because the script library is generated through multi-round adversarial interactions, covering various intent types and teaching scenarios, the matched candidate responses accurately meet user needs (e.g., error correction and step-by-step explanation for incorrect answers, detailed guidance for requests for help), effectively ensuring the relevance and effectiveness of teaching responses. This addresses the issues of responses being disconnected from user intent and generic scripts lacking educational value.
[0091] Step 550: Input the candidate response text into the content review module to check whether the content contains factual errors, illegal information, or statements that deviate from the teaching topic.
[0092] In this embodiment of the disclosure, after matching candidate response scripts corresponding to the user's intent type from the script library, the candidate scripts can be input into the content review module. The content review module will simultaneously or sequentially perform multiple checks: First, it will check whether the scripts contain factual errors that contradict the knowledge points by comparing them with the subject knowledge point library (such as a mathematical formula library or a scientific principle library) corresponding to the current teaching task; second, it will check whether the scripts contain illegal expressions based on a preset violation information screening library (such as a sensitive word library or a violation content feature library); third, it will determine whether the script content focuses on the teaching objectives and whether there are any irrelevant expressions that deviate from the topic, in conjunction with the current teaching theme; finally, through multi-dimensional checks, it will preliminarily determine whether the candidate response scripts meet the output standards of accuracy, compliance, and relevance to teaching.
[0093] Step 560: If the review is approved, the candidate response scripts will be output to the user in real time.
[0094] In specific application scenarios, as a preferred approach, after the system outputs a candidate response that has passed the initial review to the user, if a preset content withdrawal condition is subsequently triggered (such as the system's backend self-check discovering a formula error in the response that was not detected during the initial review, or the user actively reporting that "the response is different from the textbook knowledge"), the content withdrawal procedure is immediately initiated. The output response is marked "There is a deviation, it has been withdrawn" through the user interaction interface (such as the learning platform dialog box), and the erroneous content is hidden. At the same time, the original candidate response is resubmitted to the content review module for a more rigorous second review than the initial review (such as verifying knowledge points against authoritative textbooks and expanding the scope of the violation word database). After correcting the problems (such as correcting formula errors and deleting irrelevant expressions), a compliant response is generated. Finally, the response that has been confirmed to be correct after the second review is supplemented and output to the user to ensure the accuracy and compliance of the teaching feedback.
[0095] Accordingly, the steps of the embodiment may further include: after outputting the candidate reply, in response to triggering the content withdrawal condition, initiating the content withdrawal procedure to withdraw the sent candidate reply and supplementing the user with a compliant reply that has undergone secondary review.
[0096] The content withdrawal conditions are pre-defined specific scenarios or judgment criteria that trigger the withdrawal of output responses. Common examples include system self-checks finding hidden factual errors in the response, receiving user feedback that the response is incorrect, and manual inspections identifying violations / deviations from the topic. These are the core triggering criteria for initiating the withdrawal procedure. The content withdrawal procedure is a functional process / module used to revoke candidate response texts sent to users. It is usually implemented through interactive interface operations (such as marking "retracted" and hiding the erroneous content, and pushing a withdrawal prompt to the user) to ensure that erroneous / violation responses no longer affect the user's learning. The compliant response for secondary review is a response text that has been resubmitted to the content review module for more detailed multi-dimensional checks (such as supplementing cross-knowledge point verification and increasing in-depth screening of violation information) after the candidate response texts have been corrected. This response text is generated after the issues have been corrected and meets the standards of no factual errors, no violation information, and adherence to the teaching topic.
[0097] By employing a closed-loop mechanism of recall triggering, error correction, secondary review, and supplementary output, oversights in the initial review (such as errors in implicit knowledge points or borderline violations) can be promptly addressed, preventing erroneous responses from misleading users' learning. Simultaneously, proactively recalling and supplementing compliant responses reduces user confusion caused by receiving incorrect information, enhancing user trust in the teaching system. Furthermore, the stricter standards of the secondary review further improve the reliability of the response content, effectively mitigating potential risks in a one-time review and output model, and providing dual protection for the professionalism and security of teaching interactions.
[0098] Step 570: If the review fails, the preset security response library will be invoked to output compliant guidance content to the user.
[0099] The pre-built safe response library is a database that stores a large amount of general guiding content that is free of factual errors and violations and fits the teaching scenario. The content is categorized according to teaching scenarios (such as knowledge point Q&A guidance and interactive connection guidance), and is specifically designed to deal with scenarios where candidate response scripts fail the review. The compliant guiding content is a response text that is called from the safe response library, meets teaching standards and content security requirements, and can guide users to continue to focus on teaching tasks or clarify their needs. This can both avoid outputting illegal / erroneous content and ensure the continuity of teaching interaction.
[0100] By calling the secure response library to output compliant guiding content when candidate response scripts fail the review, the negative impact of erroneous, illegal, or irrelevant content on teaching can be fundamentally eliminated, ensuring the safety and standardization of teaching content. It can also avoid the interruption of interaction due to failure to pass the review, and maintain the user's learning focus and interaction continuity through guiding content. This can solve the problem of teaching process being blocked due to lack of appropriate responses when the review fails, and can improve the fault tolerance of the teaching system and the user experience.
[0101] As one possible implementation, during the execution of the current teaching dialogue task, the steps of the embodiment may further include: reading the total preset number of rounds and the number of completed rounds of the current teaching dialogue task; comparing the number of completed rounds with the total preset number of rounds; if the number of completed rounds is equal to the total preset number of rounds, then controlling the termination of the current teaching dialogue task.
[0102] The total preset number of rounds is the total number of interaction rounds required to complete the task before the current teaching dialogue task is started, based on the complexity of the teaching objectives and the requirements for knowledge point coverage ("rounds" refers to the complete interactive loop of "system asking questions - user answering - system replying"); the number of completed dialogue rounds is the number of interactive loops that have actually been completed during the execution of the current teaching dialogue task, which is recorded by the system in real time.
[0103] In this embodiment of the disclosure, when it is determined that the number of completed dialogue rounds has reached the total preset number of rounds, the system will stop the subsequent interaction of the current teaching dialogue (no longer initiate new questions) and provide feedback to the user on the task completion status, marking the official end of the teaching task.
[0104] Clearly defined learning rounds allow users to clearly perceive their learning progress, enhancing their sense of purpose and accomplishment. Furthermore, terminating tasks according to preset rounds ensures the efficient allocation of teaching resources (such as system computing power and user learning time), avoids excessive consumption on a single task, and guarantees the orderliness and goal orientation of the overall teaching process.
[0105] In summary, the technical solution in this application, by leveraging a dialogue library generated through multi-round adversarial interaction between a structured teaching script and a user-simulated intelligent agent and a script-running intelligent agent, can break free from the dependence on static question banks in search-based services. It can cover various real teaching scenarios such as correct answers, incorrect answers, requests for help, and irrelevant answers. Furthermore, through the structured constraints of the script on teaching objectives and knowledge points, it avoids factual errors and topic deviations that are prone to occur in general large-scale model products. At the same time, relying on the intent-adaptive response of the dialogue library, it can achieve gradual guidance for users' answers and endow it with heuristic teaching value. Furthermore, by processing the intent of the responses, it can deeply understand the user's semantics and needs, overcoming the limitations of search-based services that lack deep semantic reasoning. This allows for personalized guidance responses for users with different intent types, balancing interactive teaching with personalized needs. In addition, the real-time compliance review process further ensures the security and compliance of the output content, ultimately achieving an organic unity of interactivity, personalized guidance, content security and controllability, and a structured teaching process. This effectively adapts to the core needs of serious teaching scenarios and overcomes the limitations of existing solutions on the reliable application of intelligent teaching dialogue systems in serious educational settings.
[0106] Furthermore, as Figure 1 and Figure 5 The specific implementation of the method shown in this embodiment provides a teaching dialogue generation device, such as... Figure 6 As shown, the device includes: a receiving module 61, an identification module 62, a matching module 63, and an verification module 64; The receiving module 61 can be used to receive the user's input answers in the current teaching dialogue task in real time; The recognition module 62 can be used to perform intent recognition processing on the answer content to determine the user's intent type; The matching module 63 can be used to match corresponding candidate response scripts from the script library based on the user intent type. The script library contains response scripts for different preset intent types. The script library generation process includes: generating a structured teaching script based on the teaching topic information; controlling the user simulation agent and the script running agent to conduct multi-round adversarial interaction based on the structured teaching script to generate a script library covering multiple preset intent types. The review module 64 can be used to conduct real-time compliance reviews of candidate response scripts, and output candidate response scripts to users after the review is passed.
[0107] In some embodiments of this application, such as Figure 7 As shown, the device may further include: a generation module 65; When generating a structured teaching script based on the information of the topic to be taught, the generation module 65 can be used to obtain the information of the topic to be taught, which includes at least the topic of the topic to be taught, the expected number of dialogue rounds, and supplementary teaching information; import the information of the topic to be taught into a preset script generation prompt template to form a script generation instruction containing the teaching logic sequence; execute the script generation instruction through the script generation agent to generate an initial teaching script containing multiple dialogue nodes according to a multi-level structure of task, scene, dialogue, and response; verify the knowledge accuracy and teaching compliance of the initial teaching script, remove dialogue nodes with knowledge point errors or guiding violations, and obtain the final structured teaching script.
[0108] In some embodiments of this application, when controlling the user simulation agent and the script running agent to conduct multi-round adversarial interactions based on a structured teaching script to generate a script library covering multiple user intent types, the generation module 65 can also be used to configure the user simulation agent's preset intent types when modeling user behavior. The preset intent types include at least correct answers, incorrect answers, requests for help, and irrelevant answers. The structured teaching script is loaded into the script running agent, and the script running agent is controlled to send preset questions to the user simulation agent according to the dialogue content of each round in the structured teaching script. The user simulation agent is controlled to generate simulated answer content corresponding to the preset questions based on the current dialogue node and different preset intent types. The initial reply script returned by the script running agent for the simulated answer content is received, and the initial reply script is judged to be compatible with the corresponding preset intent type through intent recognition. If compatible, the simulated answer content is associated with the initial reply script and stored in the script library. If incompatible, the interaction is restarted after adjusting the expression of the simulated answer content or the response logic of the script running agent until an compatible reply is generated and associated with the script library.
[0109] In some embodiments of this application, the identification module 62 can be used to perform keyword matching, model intent recognition, and model thought chain intent recognition sequentially or in parallel for the answer content, to obtain the corresponding first user intent recognition result, second user intent recognition result, and third user intent recognition result; and to determine the user intent type based on at least one of the first user intent recognition result, second user intent recognition result, and third user intent recognition result.
[0110] In some embodiments of this application, the keyword matching process includes: extracting answer keywords from the answer content using natural language processing technology, calculating the similarity between the answer keywords and the standard answer keywords of the corresponding questions in the current teaching dialogue task, and determining the first user intent recognition result based on the similarity calculation result; the model intent recognition process includes: inputting the answer content into the first intent recognition model for intent feature extraction, and performing intent recognition based on the intent features to obtain the second user intent recognition result; the model thought chain intent recognition process includes: inputting the answer content into the second intent recognition model, performing intent recognition through thought chain reasoning, and determining the third user intent recognition result, wherein the model computing power of the second intent recognition model is greater than that of the first intent recognition model.
[0111] In some embodiments of this application, when determining the user intent type based on at least one of the first user intent recognition result, the second user intent recognition result, and the third user intent recognition result, the recognition module 62 can be specifically used to: if the keyword similarity in the first user intent recognition result is greater than a preset threshold, then determine the intent type corresponding to the first user intent recognition result as the user intent type; if the keyword similarity is less than or equal to the preset threshold, then obtain the second user intent recognition result; if the intent confidence of the second user intent recognition result is greater than a preset confidence threshold, then determine the intent type corresponding to the second user intent recognition result as the user intent type; if the intent confidence of the second user intent recognition result is less than or equal to the preset confidence threshold, then obtain the third user intent recognition result; if the reasoning consistency of the third user intent recognition result is greater than a preset consistency threshold, then determine the intent type corresponding to the third user intent recognition result as the user intent type.
[0112] In some embodiments of this application, the review module 64 can be used to input candidate response scripts into the content review module to check whether the content contains factual errors, illegal information, or statements that deviate from the teaching topic; if the review is passed, the candidate response scripts are output to the user in real time; if the review is not passed, a preset safe response library is called to output compliant guiding content to the user.
[0113] In some embodiments of this application, such as Figure 7 As shown, the device also includes: an output module 66; The output module 66 can be used to initiate a content withdrawal procedure to withdraw the sent candidate reply after outputting candidate reply statements in response to the triggering content withdrawal condition, and to supplement the user with a compliant reply that has undergone secondary review.
[0114] In some embodiments of this application, such as Figure 7 As shown, the device also includes: a control module 67; The control module 67 can be used to read the total preset number of rounds and the number of rounds completed in the current teaching dialogue task; compare the number of rounds completed with the total preset number of rounds; if the number of rounds completed is equal to the total preset number of rounds, then control the termination of the current teaching dialogue task.
[0115] It should be noted that other corresponding descriptions of the functional units involved in the teaching dialogue generation device provided in this embodiment can be found in [reference needed]. Figure 1 and Figure 5 The corresponding descriptions in [the document] will not be repeated here.
[0116] Based on the above, Figure 1 and Figure 5 Accordingly, this embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the above-described method. Figure 1 and Figure 5 The teaching dialogue generation method shown.
[0117] Based on this understanding, the technical solution of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as CD-ROM, USB flash drive, mobile hard drive, etc.) and includes several instructions to cause an electronic device (such as personal computer, server, or network device, etc.) to execute the methods of various implementation scenarios of this application.
[0118] Based on the above, Figure 1 and Figure 5 The method shown, and Figure 6 and Figure 7 To achieve the above objectives, the present application also provides an electronic device, specifically a personal computer, tablet computer, server, or other network device, as shown in the virtual device embodiment. This device includes a storage medium and a processor; the storage medium stores a computer program; the processor executes the computer program to achieve the above-described objectives. Figure 1 and Figure 5 The teaching dialogue generation method shown.
[0119] Optionally, the aforementioned physical devices may also include a user interface, a network interface, a camera, radio frequency (RF) circuitry, sensors, audio circuitry, a Wi-Fi module, etc. The user interface may include a display screen, input units such as a keyboard, etc., and optional user interfaces may also include USB interfaces, card reader interfaces, etc. The network interface may optionally include standard wired interfaces, wireless interfaces (such as Wi-Fi interfaces), etc.
[0120] Those skilled in the art will understand that the physical device structure provided in this embodiment does not constitute a limitation on the physical device, and may include more or fewer components, or combine certain components, or have different component arrangements.
[0121] The storage medium may also include an operating system and a network communication module. The operating system is a program that manages the hardware and software resources of the aforementioned physical device, supporting the operation of information processing programs and other software and / or programs. The network communication module is used to enable communication between the various components within the storage medium, as well as communication with other hardware and software in the information processing physical device.
[0122] Through the above description of the embodiments, those skilled in the art can clearly understand that this application can be implemented by means of software plus necessary general-purpose hardware platform, or it can be implemented by hardware.
[0123] This invention, through its embodiment, utilizes a dialogue library generated by a multi-round adversarial interaction between a structured teaching script and a user-simulated intelligent agent and a script-running intelligent agent. This eliminates the reliance on static question banks in search-based services, covering various real-world teaching scenarios such as correct answers, incorrect answers, requests for help, and irrelevant responses. Furthermore, the script's structured constraints on teaching objectives and knowledge points prevent factual errors and topic deviations common in general-purpose large-scale models. The dialogue library's intent-adaptive responses provide progressive guidance to user responses, imbuing them with heuristic teaching value. Moreover, by processing the intent of responses, it deeply understands user semantics and needs, overcoming the limitations of search-based services that lack deep semantic reasoning. This allows for personalized guidance responses for users with different intent types, balancing interactive teaching with personalized needs. Additionally, real-time compliance review further ensures the security and compliance of output content, ultimately achieving an organic unity of interactivity, personalized guidance, content security and controllability, and a structured teaching process. This effectively adapts to the core needs of serious teaching scenarios, overcoming the limitations of existing solutions on the reliable application of intelligent teaching dialogue systems in serious educational settings.
[0124] Those skilled in the art will understand that the accompanying drawings are merely schematic diagrams of a preferred embodiment, and the modules or processes shown in the drawings are not necessarily essential for implementing this application. Those skilled in the art will understand that the modules in the apparatus of the embodiment can be distributed within the apparatus of the embodiment as described, or can be modified to be located in one or more apparatuses different from this embodiment. The modules of the above-described embodiment can be combined into one module, or further divided into multiple sub-modules.
[0125] The serial numbers in this application are for descriptive purposes only and do not represent the superiority or inferiority of any particular implementation scenario. The above disclosures are merely a few specific implementation scenarios of this application; however, this application is not limited thereto, and any variations conceived by those skilled in the art should fall within the protection scope of this application.
Claims
1. A method for generating instructional dialogues, characterized in that, include: It receives user responses in real time during the current teaching dialogue task; The user's intent type is determined by performing intent recognition processing on the response content. Based on the user intent type, the corresponding candidate response scripts are matched from the script library. The script library contains response scripts for different preset intent types. The process of generating the script library includes: generating a structured teaching script based on the teaching topic information; and controlling the user simulation agent and the script running agent to conduct multi-round adversarial interaction based on the structured teaching script to generate a script library covering multiple preset intent types. The candidate response scripts are subject to real-time compliance review, and once the review is passed, the candidate response scripts are output to the user.
2. The method according to claim 1, characterized in that, The process of generating a structured teaching script based on the information of the topic to be taught includes: Obtain information about the topic to be taught, which includes at least the topic of the topic to be taught, the expected number of dialogue rounds, and supplementary teaching information; The information of the topic to be taught is imported into a preset script generation prompt template to form a script generation instruction containing the logical order of teaching. The script generation agent executes the script generation instructions to generate an initial teaching script containing multiple rounds of dialogue nodes, according to a multi-level structure of tasks, scenes, dialogues, and repetitions. The initial teaching script is verified for accuracy of knowledge and compliance with teaching regulations. Dialogue nodes containing knowledge errors or leading violations are removed to obtain the final structured teaching script.
3. The method according to claim 1, characterized in that, Based on the structured teaching script, the user-simulated agent and the script-running agent engage in multi-round adversarial interactions, generating a script library covering various user intent types, including: Configure the user simulation agent to perform preset intent types when the model user behaves, and the preset intent types include at least correct answer, incorrect answer, request for help and irrelevant answer; The structured teaching script is loaded into the script execution agent, and the script execution agent is controlled to send preset questions to the user simulation agent according to the dialogue content of each round in the structured teaching script; The user-simulated intelligent agent is controlled to generate simulated responses to the preset questions based on the current dialogue node and different preset intent types. Receive the initial response script returned by the script running agent in response to the simulated answer content, and determine whether the initial response script is compatible with the corresponding preset intent type through intent recognition; If compatible, the simulated response content is associated with the initial response script and stored in the script library; If the response is not suitable, the interaction will be repeated after adjusting the wording of the simulated response or the response logic of the script-running agent until a suitable response is generated and associated with the script library.
4. The method according to claim 1, characterized in that, The user's response is processed to determine the type of user intent, including: For the given answer, keyword matching, model intent recognition, and model thought chain intent recognition are performed sequentially or in parallel to obtain the corresponding first user intent recognition result, second user intent recognition result, and third user intent recognition result; The user intent type is determined based on at least one of the first user intent recognition result, the second user intent recognition result, and the third user intent recognition result.
5. The method according to claim 4, characterized in that, The keyword matching process includes: extracting answer keywords from the answer content using natural language processing technology, calculating the similarity between the answer keywords and the standard answer keywords of the corresponding questions in the current teaching dialogue task, and determining a first user intent recognition result based on the similarity calculation result; the model intent recognition process includes: inputting the answer content into a first intent recognition model for intent feature extraction, and performing intent recognition based on the intent features to obtain a second user intent recognition result; the model thought chain intent recognition process includes: inputting the answer content into a second intent recognition model, performing intent recognition through thought chain reasoning, and determining a third user intent recognition result, wherein the model computing power of the second intent recognition model is greater than that of the first intent recognition model.
6. The method according to claim 4, characterized in that, Determining the user intent type based on at least one of the first user intent recognition result, the second user intent recognition result, and the third user intent recognition result includes: If the keyword similarity in the first user intent recognition result is greater than a preset threshold, then the intent type corresponding to the first user intent recognition result is determined as the user intent type. If the keyword similarity is less than or equal to the preset threshold, the second user intent recognition result is obtained; if the intent confidence of the second user intent recognition result is greater than the preset confidence threshold, the intent type corresponding to the second user intent recognition result is determined as the user intent type. If the confidence level of the second user intent recognition result is less than or equal to the preset confidence threshold, then the third user intent recognition result is obtained. If the inference consistency of the third user intent recognition result is greater than the preset consistency threshold, then the intent type corresponding to the third user intent recognition result is determined as the user intent type.
7. The method according to claim 1, characterized in that, The candidate response scripts undergo real-time compliance review. Once the review is passed, the candidate response scripts are output to the user, including: The candidate response scripts are input into the content review module to check whether there are any factual errors, illegal information, or statements that deviate from the teaching topic. If the review is approved, the candidate response scripts will be output to the user in real time. If the review fails, a pre-set security response library will be invoked to output compliant guidance content to the user.
8. The method according to claim 7, characterized in that, The method further includes: After outputting the candidate response, in response to the triggering of the content withdrawal condition, the content withdrawal procedure is initiated to withdraw the sent candidate response and to supplement the user with a compliant response that has undergone secondary review.
9. The method according to any one of claims 1 to 8, characterized in that, The method further includes: Read the total preset number of rounds and the number of completed rounds of the current teaching dialogue task; Compare the number of completed dialogue rounds with the total preset number of rounds; If the number of completed rounds equals the total preset number of rounds, then the current teaching dialogue task is terminated.
10. A teaching dialogue generation device, characterized in that, include: The receiving module is used to receive the user's input responses in the current teaching dialogue task in real time; The recognition module is used to perform intent recognition processing on the response content to determine the user's intent type; The matching module is used to match corresponding candidate response scripts from the script library based on the user intent type. The script library contains response scripts for different preset intent types. The generation process of the script library includes: generating a structured teaching script based on the teaching topic information; controlling the user simulation agent and the script running agent to conduct multi-round adversarial interaction based on the structured teaching script to generate a script library covering multiple preset intent types. The review module is used to conduct real-time compliance review of the candidate response scripts, and output the candidate response scripts to the user after the review is passed.
11. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 9.
12. An electronic device comprising a storage medium, a processor, and a computer program stored on the storage medium and executable on the processor, characterized in that, When the processor executes the computer program, it implements the method of any one of claims 1 to 9.