Method and device for generating problem solving model, equipment and medium
Through training problem-solving models, the explanation video data for answering questions using line segment diagrams is solved, and the problem of low video generation efficiency in the existing technology is achieved, which achieves fast and efficient video generation and improves video quality.
Patent Information
- Application Number
- CN202411403905.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-09
- Publication Date
- 2025-01-03
- Estimated Expiration
- 2044-10-09
AI Technical Summary
The efficiency of generating explanation videos in the prior art is low, and a method of quickly generating explanation videos is needed to improve students' learning efficiency.
By obtaining the questions to be answered, determining their explanation information, generating training data, using training data to train problem-solving models, obtaining the training problem-solving model, which is used to generate explanation video data to solve questions using line segment diagrams, and then quickly generate explanation videos.
It avoids manual writing of explanation video data, reduces manual operations, improves the generation efficiency of explanation videos, and ensures the generated video quality.
Smart Images

Figure CN119252084A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of this specification relate to the field of computer technology, and more particularly to a method, apparatus, device and medium for generating a problem-solving model. Background Art
[0002] With the development of the times, the use of computer technology to assist teaching has become a trend. In particular, the use of videos to explain topics can greatly improve students' learning interest and comprehension ability, and has been sought after by people.
[0003] The efficiency of generating explanation videos can affect students' learning efficiency, so there is a need to provide a method for quickly generating explanation videos. Summary of the invention
[0004] In view of this, an embodiment of this specification provides a method for generating a problem-solving model. One or more embodiments of this specification also relate to a method for solving a problem, a device for generating a problem-solving model, a device for solving a problem, a computing device, a computer-readable storage medium, and a computer program to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of this specification, a method for generating a problem-solving model is provided, comprising: Obtaining a question to be answered; the question to be answered is a question that can be answered using a line segment graph; Determining explanation information for the question to be answered; the explanation information includes video data of the explanation for the question to be answered; Generate training data based on the questions to be answered and the explanation information; The training data is used to train a problem-solving model to obtain a trained problem-solving model; the trained problem-solving model is used to generate explanation video data for solving problems using line segment graphs.
[0006] According to a second aspect of an embodiment of this specification, a method for answering a question is provided, comprising: Get the target question to be answered; The target unanswered question is input into the trained problem-solving model to obtain target explanation information; the target explanation information includes target video data for generating an explanation video for solving the target unanswered question using a line segment graph; the trained problem-solving model is obtained by training the problem-solving model using the training data; the training data is generated based on the explanation information of the unanswered question that can be solved using the line segment graph and the unanswered question; The target video data is rendered using a video rendering tool to obtain a target explanation video of the target question to be answered.
[0007] According to a third aspect of an embodiment of this specification, there is provided a device for generating a problem-solving model, comprising: A question acquisition module is configured to acquire a question to be answered; the question to be answered is a question that can be answered using a line segment diagram; A determination module is configured to determine explanation information of the question to be answered; the explanation information includes explanation video data for the question to be answered; A data generation module, configured to generate training data based on the questions to be answered and the explanation information; The model training module is configured to train the problem-solving model using the training data to obtain a trained problem-solving model; the trained problem-solving model is used to generate explanation video data for solving problems using line segment graphs.
[0008] According to a fourth aspect of the embodiments of this specification, there is provided a device for answering a question, comprising: A target example question acquisition module is configured to acquire a target question to be answered; An input module is configured to input the target unanswered question into the trained problem-solving model to obtain target explanation information; the target explanation information includes target video data for generating an explanation video for solving the target unanswered question using a line segment graph; the trained problem-solving model is obtained by training the problem-solving model using the training data; the training data is generated based on the explanation information of the unanswered question that can be solved using a line segment graph and the unanswered question; The rendering module is configured to render the target video data using a video rendering tool to obtain a target explanation video of the target question to be answered.
[0009] According to a fifth aspect of an embodiment of this specification, a computing device is provided, including: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the above method are implemented.
[0010] According to a sixth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and the instructions implement the steps of the above method when executed by a processor.
[0011] According to a seventh aspect of the embodiments of this specification, a computer product is provided, including a computer program / instruction, which implements the steps of the above method when executed by a processor.
[0012] At least one embodiment of the present specification achieves the following beneficial effects: obtaining unanswered questions that can be answered using line segment graphs; determining explanation information for the unanswered questions, the explanation information including explanation video data for the unanswered questions; generating training data based on the unanswered questions and the explanation information; using the training data to train a problem-solving model to obtain a trained problem-solving model. Thus, the trained problem-solving model can be used to generate explanation video data for solving problems using line segment graphs, and then the explanation video can be obtained more quickly, avoiding the situation of manually writing explanation video data, reducing manual operations, and thus improving the generation efficiency of explanation videos. BRIEF DESCRIPTION OF THE DRAWINGS
[0013] Figure 1 is a flow chart of a method for generating a problem-solving model provided by an embodiment of this specification; Figure 2 is a schematic diagram of an image frame of an explanation video provided by an embodiment of the present specification; Figure 3 is a flow chart of a method for answering a question provided by an embodiment of this specification; Figure 4 It is a structural schematic diagram of a device for generating a problem-solving model provided by an embodiment of this specification; Figure 5 It is a structural schematic diagram of a device for answering questions provided by an embodiment of this specification; Figure 6 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0014] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0015] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0016] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0017] In addition, it should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in one or more embodiments of this specification are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0018] First, the terms involved in one or more embodiments of this specification are explained.
[0019] Large Language Model (LLM): Also known as a large language model or large model, it is a deep learning model that uses autoregression to pre-train on a large corpus in the field of natural language processing. It can understand and generate natural language text. The large language model can predict the next word or sentence by learning the statistical laws and semantic information of natural language text. As the input data set and parameter space continue to expand, the capabilities of the large language model will also expand accordingly. It can be applied to a variety of fields such as machine learning, machine translation, speech recognition, and image processing.
[0020] Retrieval-Augmented Generation (RAG): is a model that combines language models and information retrieval technology. It generates answers or content by referencing information from external knowledge bases. It has strong interpretability and customization capabilities and is suitable for multiple natural language processing tasks such as question-answering systems, document generation, and intelligent assistants. The advantage of RAG is that it is highly versatile and can achieve instant knowledge updates, thereby providing more efficient and accurate information services.
[0021] GPT (Generative Pre-Trained): is a deep learning model for text generation based on the Internet and available data for training. It has been trained with a large amount of Internet text and is a large language model that can generate coherent sentences or paragraphs in a human style.
[0022] Prompt: refers to the command or instruction provided by the user when interacting with the large language model. It can be a question, keyword, context information, etc., which is used to indicate the action that the large language model needs to perform or the output it generates. Users can provide clear prompts to guide the large language model to generate the expected response, thereby improving the effect and quality of the interaction.
[0023] Prompt Template: It is a structured text used to generate prompt words. Generating prompt words based on the prompt template can help users interact with the large language model. The large language model can better understand the user's intention and generate more accurate responses that better meet the user's needs.
[0024] Supervised Fine-Tuning (SFT) of large models: is a machine learning strategy. SFT mainly involves further parameter tuning of pre-trained models using labeled datasets that contain the correct answers or labels. During the SFT process, the parameters of some layers (or all layers) of the model will be updated based on this new task so that the model can perform this specific task better.
[0025] Manim (Mathematical Animation Engine): is an open source Python library for creating high-quality mathematical animations. Manim allows users to precisely control the details of animations through programming, which is very suitable for education and popular science. Manim provides many internal classes such as Dot, VGroup, Brace, etc., which are very helpful for solving queuing problems by drawing.
[0026] Few-Shot Learning: Few-Shot Learning is a term in the field of machine learning that refers to the ability to train a model with only a small amount of labeled data. This method is particularly suitable for scenarios where it is costly or infeasible to obtain a large amount of labeled data. It is one of the key methods to solve the problem of data scarcity and has promoted the application of machine learning technology in a wider range of fields, especially when data acquisition is limited.
[0027] In this specification, a method for generating a problem-solving model is provided. This specification also relates to a method for solving a problem, a device for generating a problem-solving model, a device for solving a problem, a computing device, a computer-readable storage medium, and a computer program product, which are described in detail one by one in the following embodiments.
[0028] See also Figure 1 , Figure 1A flowchart of a method for generating a problem-solving model according to an embodiment of the present specification is shown. From a program perspective, the execution subject of the process can be a program installed on a server or a training platform. From a hardware perspective, the execution subject of the process can be a server or a training platform capable of model training. The method can specifically include the following steps.
[0029] Step 102: Obtain a question to be answered; the question to be answered is a question that can be answered using a line segment graph.
[0030] In the embodiment of the present specification, the problem to be solved may be a problem in one or more mathematical applications that can be solved using a line segment graph.
[0031] Questions that can be solved using line graphs can refer to questions involving the relationship between values or variables. For example, "The price of a banana is 1 yuan, and the price of an apple is 2 yuan. What is their total price?" For this question, you can use line graphs to represent the 1 yuan and 2 yuan segments respectively, and then add them together to intuitively get the answer to the question.
[0032] In actual applications, there are many ways to obtain questions to be answered. For example, questions to be answered can be written based on expert experience; can be generated based on a large language model; can also be obtained from a known question bank using a retrieval-augmented generation (RAG) model, etc., and no specific restrictions are made here.
[0033] In the embodiments of this specification, the obtained unanswered questions can be used to train the problem-solving model. In order to improve the accuracy of the problem-solving model training, multiple types of questions that can be answered using line segment graphs and / or a large number of questions that can be answered using line segment graphs can be obtained.
[0034] Step 104: Determine explanation information for the question to be answered; the explanation information includes explanation video data for the question to be answered.
[0035] In the embodiments of the present specification, the explanation video data for the question to be answered contained in the explanation information may be a code for generating the explanation video for the question to be answered, or may be other forms of digital information.
[0036] In the embodiments of this specification, the explanation information may be obtained based on expert experience. For example, the explanation information may be obtained by manually answering the questions to be answered. In addition, the explanation information may also be generated using a large language model. It is understandable that in actual applications, the large language model may be used to answer the questions to be answered first to obtain a preliminary answer, and then the preliminary answer may be adjusted by manual or preset rules to obtain the explanation information used by the training model, and so on.
[0037] Step 106: Generate training data based on the questions to be answered and the explanation information.
[0038] The training data of the embodiments of this specification may include questions to be answered and explanation information. For example, the questions to be answered and the explanation information may be concatenated to generate training data. Specifically, the questions to be answered may be placed before the explanation information, or after the explanation information.
[0039] In the embodiments of this specification, the training data may include multiple training data. For example, multiple questions to be answered may be obtained at one time, and multiple training data may be generated using the multiple questions to be answered according to the above method of generating training data.
[0040] For another example, you can obtain unanswered questions multiple times, and process the unanswered questions obtained each time according to the above method of generating training data. In this way, you can also generate multiple training data based on the unanswered questions obtained multiple times.
[0041] Step 108: Use the training data to train a problem-solving model to obtain a trained problem-solving model; the trained problem-solving model is used to generate explanation video data for solving problems using line segment graphs.
[0042] The explanation video data of using line segment graphs to solve problems generated by the trained problem-solving model may include the code of the explanation video of using line segment graphs to solve problems.
[0043] The code of the explanation video can be compiled to generate the explanation video. In practical applications, the code of the explanation video output by the trained problem-solving model can be compiled using compilation software such as Manim to generate the explanation video.
[0044] In the embodiments of the present specification, the trained problem-solving model can generate explanation video data for solving problems using line segment graphs. By using the trained problem-solving model to solve problems, the code for the explanation video can be obtained more quickly, avoiding the situation of manually writing video code, and improving the efficiency of obtaining explanation information, thereby improving the efficiency of generating explanation videos.
[0045] On the other hand, since the trained problem-solving model is obtained by training with questions that can be solved using line segment graphs, it is targeted at questions that can be solved using line segment graphs, and can more accurately generate the code for the explanation video of such questions, thereby ensuring the quality of the generated explanation video.
[0046] For example, when users such as online teaching institutions or book publishing institutions need to generate explanation videos for a large number of questions in the database, for questions that can be answered using line graphs, they can directly use the trained problem-solving model to output the explanation video data of the questions, and then generate explanation videos based on the explanation video data, avoiding the tedious process of manually writing scripts and manually making animations, and improving the efficiency of explanation video production.
[0047] In addition, when users such as teachers, students or parents use teaching software for online learning and need to obtain an explanation video of a problem that can be solved using a line segment graph, the teaching software can be loaded with the above-mentioned trained problem-solving model or can call the above-mentioned trained problem-solving model. After the user enters a problem that can be solved using a line segment graph in the teaching software, the teaching software can use the trained problem-solving model to generate explanation video data of the above-mentioned problem. The teaching software can also use video compilation software to compile the explanation video data, and then obtain and display the explanation video of the above-mentioned problem, thereby avoiding long waiting times for users, improving problem-solving efficiency, and thus improving user experience.
[0048] based on Figure 1 The method, the examples of this specification also provide some specific implementation plans of the method, which are described below.
[0049] In order to ensure the accuracy of the problem-solving model training, a large amount of training data is usually required. However, it is too cumbersome to manually generate a large amount of training data. To solve this problem, in the embodiment of this specification, the explanation information of the problem to be solved can specifically include: The large language model is used to generate explanation information for the question to be answered.
[0050] The large language model is used to generate explanation information for the questions to be answered, and then training data can be obtained based on the explanation information generated by the large language model, without having to manually generate the explanation information to obtain the training data, thereby improving the efficiency of generating training data.
[0051] Specifically, the large language model used can be a model of the GPT series, such as GPT-3.5, GPT-4, and GPT-4o. Of course, other series of models can also be used, such as the Tongyi Qianwen model, the Ant Bailing large model, etc., which are not limited here.
[0052] Generally speaking, the common method used by those skilled in the art is to find ways to collect videos that can be used as training data, and then use these videos to train the problem-solving model; but it is not easy to think of using information in other formats to generate training data. The large language model can process the data to obtain information in text format, and it cannot directly generate videos. Therefore, it is even more difficult for those skilled in the art to think of using a large language model to generate training data for training the problem-solving model. However, in the present application, a large language model can be used to process the questions to be answered to generate information in text format. This information in text format may include video data of explanations of the questions to be answered, and then the problem-solving model is trained using the training data containing the video data of the explanations. It is no longer necessary to manually record the corresponding answer videos based on the questions to be answered, which reduces the cost of generating training data and improves the training efficiency of the problem-solving model after training.
[0053] In prompt engineering, prompts can refer to text or sentences used to guide the large language model to generate specific responses. Prompts can help the large language model better understand user needs, thereby facilitating the large language model to generate content that better meets user needs.
[0054] In the embodiment of this specification, the explanation information corresponding to the question to be answered can be obtained by constructing the prompt words of the large language model. Among them, the prompt words in the embodiment of this specification can specifically be text used to guide the large language model to generate the explanation information of the question to be answered. The method of generating the problem-solving model can also include: Determine a reference example question that has the same characteristics as the question to be answered; the characteristics include at least one of the characteristics of the number of line segments contained in the line segment graph involved in the question, the characteristics of the number of questions contained in the question, the characteristics of the number of solution results corresponding to the question, the characteristics of the number of drawings required for the question, and the characteristics of the type of line segment graph required for the question; the reference example question includes the example question title and video data for generating an explanation video of the example question title.
[0055] The generating of explanation information of the to-be-answered question by using the large language model may specifically include: Prompt words are generated based on the reference example questions and the questions to be answered.
[0056] The prompt word is input into the large language model to obtain explanation information corresponding to the question to be answered.
[0057] In the embodiments of the present specification, the reference examples may include example questions and explanation video data used to generate the example questions, wherein the explanation video data may be the code of the explanation video or other forms of digital information.
[0058] In the embodiments of this specification, the reference examples may be selected from a reference example set. For example, a semantic matching model may be used to select a preset number of reference examples that match the question to be answered from the reference example set. Alternatively, a retrieval enhancement generation model may be used to select a preset number of reference examples that match the question to be answered from the reference example set. In addition, reference examples may be selected from the reference example set in accordance with keyword matching or other matching methods, and so on.
[0059] It is understandable that the reference examples can also be written based on expert experience. Of course, it is also possible to extract the code of the existing explanation video about the questions that can be solved using line segment graphs by reverse engineering, and then use the obtained questions and the code of the explanation video as reference examples, etc.
[0060] The embodiments of this specification may select a preset number of reference examples, such as one reference example, three reference examples, ten reference examples, etc., which are not limited here.
[0061] In the embodiments of this specification, a large amount of explanation information can be obtained by using Few-Shot Learning in prompt engineering to guide a large language model to generate explanation information, thereby facilitating obtaining a large amount of training data.
[0062] Furthermore, the selected reference example may be an example having the same characteristics as the question to be answered. The characteristics may include at least one of the number of line segments contained in the line segment graph involved in the question, the number of questions contained in the question, the number of answer results corresponding to the question, the number of drawings required for the question, and the type of line segment graph required for the question.
[0063] Among them, the feature of the number of line segments contained in the line segment graph involved in the question can represent the feature of the number of line segments contained in the line segment graph used when solving the question. For example, if the line segment graph used when solving the question contains one line segment, the feature of the number of line segments contained in the line segment graph involved in the question can be one line segment; for example, if the line segment graph used when solving the question contains two line segments, the feature of the number of line segments contained in the line segment graph involved in the question can be two line segments.
[0064] The feature of the number of questions contained in the question can represent the feature of the total number of questions contained in the question. For example, if the question contains one question, the feature of the number of questions contained in the question can be one question; if the question contains two questions, the feature of the number of questions contained in the question can be two questions.
[0065] The feature of the number of questions contained in the question can also represent the feature of the number of question types contained in the question. For example, if the question contains one question type, such as the "quantity sum" type, then the feature of the number of questions contained in the question can be one question type. For example, if the question contains two question types, such as the "quantity sum" type and the "quantity subtraction" type, then the feature of the number of questions contained in the question can be two question types.
[0066] The feature of the number of answer results corresponding to the question may represent the feature of the total number of answer results included in the answer result of the question. The feature of the number of drawings required for the question may represent the feature of the number of line segment graphs used when solving the question. For example, if one line segment graph is used when solving the question, the feature of the number of drawings required for the question may be one line segment graph; if multiple line segment graphs are used when solving the question, the feature of the number of drawings required for the question may be multiple line segment graphs.
[0067] The characteristics of the type of line segment graph required for the question can represent the characteristics of the type of line segment graph used to solve the question. For example, if the line segment graph used to solve the question is a line segment, then the characteristics of the type of line segment graph required for the question can be a line segment. If the line segment graph used to solve the question is a circle, then the characteristics of the type of line segment graph required for the question can be a circle. If the line segment graph used to solve the question is a rectangle, then the characteristics of the type of line segment graph required for the question can be a rectangle, and so on.
[0068] Typically, in addition to the example questions and explanation video data, the reference examples may also include other content, so that the explanation information output by the large language model also includes the above-mentioned other content, thereby assisting teaching.
[0069] Optionally, the reference example question may also include at least one of step-by-step analysis information for answering the example question step by step, knowledge point information corresponding to the example question, and answer information corresponding to the example question.
[0070] and / or, The explanation information also includes at least one of step-by-step analysis information for answering the question to be answered step by step, knowledge point information corresponding to the question to be answered, and answer information of the question to be answered.
[0071] Among them, the step-by-step analysis information can represent the distributed explanation for the question, and the distributed explanation can include a line segment diagram corresponding to each step; the knowledge point information can represent the knowledge point tested by the question; and the answer information can represent the answer to the question.
[0072] For ease of understanding, this specification provides an example of a reference question, which can be specifically shown as follows:
topic
Knowledge Points
[0073]
Step-by-step analysis
[0074] The second step is that since there are \(\frac{1}{4}\) more radish buns than red bean paste buns, we can mark the extra part of the radish buns on the line segment, which is exactly 8.
[0075] In the third step, we know that the part of the radish buns that is larger than the red bean paste buns accounts for \(\frac{1}{4}\) of the red bean paste buns, so the number of red bean paste buns is 4 times 8: \(8 \times 4 = 32\) (pieces).
[0076]
Answer
Code
[0077] audio_text = "First, we use a line segment to represent the number of red bean paste buns." with self.voiceover(text=audio_text): # Use line segments to represent the number of red bean paste buns (32) text_dousha = self.create_text("dousha bag:") dot_l = Dot([-1, 1, 0]) dot_r = Dot([-1 + 32 * scale, 1, 0]) line_dousha = Line(dot_l.get_center(), dot_r.get_center()) text_dousha.next_to(line_dousha, LEFT) self.play(Create(line_dousha), Write(text_dousha), Create(dot_l),Create(dot_r)) audio_text = "Then, we use another line segment to represent the number of carrot packets." with self.voiceover(text=audio_text): # Use a line segment to represent the number of carrot buns (40) text_luobo = self.create_text("Luobo bag:") dot_l = Dot([-1, -1, 0]) dot_r = Dot([-1 + 40 * scale, -1, 0]) line_luobo = Line(dot_l.get_center(), dot_r.get_center()) text_luobo.next_to(line_luobo, LEFT) self.play(Create(line_luobo), Write(text_luobo), Create(dot_l),Create(dot_r)) # Step 2. Since there are \(\frac{1}{4}\) more carrot buns than red bean buns, we can mark the extra part of the carrot buns on the line segment, which is exactly 8.
[0078] audio_text = "There are more carrot buns than red bean paste buns\\frac{1}{4}, exactly 8 more." with self.voiceover(text=audio_text): # Divide the line segment of the red bean paste bun into four equal parts, each of which occupies 8 units of length for distance in range(0, 32, 8): dot = Dot([-1 + distance * scale, 1, 0]) self.play(Create(dot)) # Mark the extra 8 (32~40) on the line segment of the carrot bag dot_l = Dot([-1 + 32 * scale, -1, 0]) dot_r = Dot([-1 + 40 * scale, -1, 0]) line_dousha_to_luobo=DashedLine(dot_l.get_center(),dot_r.get_cet er()) self.play(Create(line_dousha_to_luobo),Create(dot_l),Create(dot_r)) brace_dousha_to_luobo = Brace(line_dousha_to_luobo, direction=UP) text_dousha_to_luobo = self.create_text("8 more") brace_dousha_to_luobo.put_at_tip(text_dousha_to_luobo) self.play(Create(brace_dousha_to_luobo),Write(text_dousha_to_luobo)) brace_dousha_to_luobo=Brace(line_dousha_to_luobo,direction=DOWN) text_dousha_to_luobo = self.create_text("More$\\frac{1}{4}$") brace_dousha_to_luobo.put_at_tip(text_dousha_to_luobo) self.play(Create(brace_dousha_to_luobo),Write(text_dousha_to_luobo)) # Step 3. We know that the part of the radish bun that is larger than the red bean paste bun accounts for \(\frac{1}{4}\) of the red bean paste bun, so the number of red bean paste buns is 4 times 8: \(8 \times 4 = 32\) (pieces). audio_text = "So the number of red bean paste buns is 4 times 8, that is, 8 times 4 equals 32" with self.voiceover(text=audio_text): brace_dousha = Brace(line_dousha, direction=UP) text_dousha = self.create_text("32") brace_dousha.put_at_tip(text_dousha) self.play(Create(brace_dousha), Write(text_dousha)) self.play_text_left(r"The number of red bean paste buns is 4 times 8: $8 \times 4 = 32$ (each)") def get_scale(self): # The first step is to collect all quantity information dousha_count = 32 luobo_count = 32 + 8 # The second step is to find the largest value in the quantity max_len = max(dousha_count, luobo_count) # Calculate the scaling ratio and scale the line segment length to within 4 units scale = 4 / max_len return scale Under the guidance of the prompt words, the explanation information generated by the large language model will also include information corresponding to the information included in the reference example, so as to meet the requirements of step-by-step explanation, overall summary and other related requirements in the teaching process and improve the teaching quality.
[0079] In the embodiments of this specification, a large language model is used to automatically generate information including step-by-step analysis information, knowledge point information, answer information, explanation information, etc., which reduces the tedious process of manually writing the above content information, improves the efficiency of obtaining explanation information for the questions to be answered, and thus improves the efficiency of obtaining training data. Based on this, the embodiments of this specification have a high problem-solving model training efficiency.
[0080] In the embodiment of the present specification, the prompt word can be generated based on the prompt word template. The generating of the prompt word based on the reference example question and the question to be answered can specifically include: Prompt words are generated by using a prompt word template based on the reference example questions and the questions to be answered.
[0081] A prompt word template is a structured text used to generate prompt words. Generating prompt words based on the prompt word template can help the large language model interact with users, so that the large language model can better understand user intentions and generate more accurate responses that better meet user needs.
[0082] In the embodiment of this specification, the prompt word template may include a system prompt word. The system prompt word may be description information for this task. The description information may specifically include one or more of the role information of the large language model, task information indicating the completion of the large language model, task requirement information, and output data format information.
[0083] The role information of the large language model may be the role information that the large language model needs to play for this task. For example, if the large language model is required to play a math teacher, the role information of the large language model may be "You are a math teacher". The task information that indicates the large language model to complete may be the task information that the large language model needs to complete for this task. The task requirement information may be the requirement information for this task. The task requirement information may include various information of the explanation video data, such as at least one of code type information, voice format information, and voice playback format information.
[0084] In the embodiment of the present specification, the prompt word template may further include a first area to be filled and a second area to be filled. The first area to be filled may be used to fill in reference examples, and the second area to be filled may be used to fill in questions to be answered.
[0085] The server or training platform can add system prompt words to the prompt word template, add reference examples to the first area to be filled, add questions to be answered to the second area to be filled, etc., and the prompt words generated using the prompt word template can include system prompt words, reference examples, and questions to be answered.
[0086] In order to improve the richness of training data and thus improve the accuracy of the problem-solving model, in the embodiments of this specification, multiple categories of unanswered questions and explanation information corresponding to the multiple categories of unanswered questions can be used to generate training data. Optionally, the unanswered questions include multiple unanswered questions; the generating of training data based on the unanswered questions and the explanation information can specifically include: The multiple questions to be answered are classified according to question features to obtain multiple question sets; one question set includes several questions of the same category; the question features include at least one of the features of the number of line segments contained in the line segment graph involved in the question, the features of the number of questions included in the question, the features of the number of answer results corresponding to the question, the features of the number of drawings required for the question, and the features of the type of line segment graph required for the question.
[0087] At least one question to be answered is selected from each question set in the multiple question sets.
[0088] The selected questions to be answered and the corresponding explanation information containing the video data are used as the training data.
[0089] In the embodiments of the present specification, multiple questions to be answered may be classified based on question features using algorithms such as a naive Bayes algorithm, a k-nearest neighbor algorithm, and a clustering algorithm.
[0090] For any set of questions, questions to be answered can be randomly selected from the set of questions, and the randomly selected questions to be answered can be used as training data.
[0091] It can be understood that, for any set of questions, one can select one question to be answered or multiple questions to be answered, and there is no limitation here.
[0092] In practical applications, a question to be answered may have multiple features. In this way, different question sets may contain the same question to be answered. In order to avoid affecting the richness of training data by selecting the same question to be answered from multiple question sets, in the implementation of this specification, if the multiple question sets include a first question set and a second question set; the step of selecting at least one question to be answered from each question set in the multiple question sets may specifically include: A first number of first topics are selected from the first set of topics.
[0093] If the second topic set includes the first topic, a second number of second topics are selected from other topics in the second topic set; the other topics are topics in the second topic set except the first topic.
[0094] The first number of first questions may be one first question, three first questions, or all questions in the first question set, etc. The second number of second questions may be one second question, three second questions, or all questions in the second question set except the first question, etc.
[0095] In addition, the first number and the second number may be equal or unequal.
[0096] In the embodiment of this specification, in order to ensure the quality of training data, explanation information that meets the problem-solving requirements and corresponding questions to be answered can be selected to generate training data. The method of generating a problem-solving model in the embodiment of this specification can also include: Based on the explanation video data for the question to be answered contained in the explanation information, an explanation video for the question to be answered is generated.
[0097] Determine whether the explanation video meets the problem-solving requirements.
[0098] The generating of training data based on the to-be-answered questions and the explanation information may specifically include: If the explanation video meets the problem-solving requirements, the question to be answered and the corresponding explanation information are used as training data.
[0099] In the embodiments of the present specification, video compiling software may be used to compile video data of explanations of the questions to be answered, thereby obtaining videos of explanations of the questions to be answered.
[0100] In practical applications, the explanation information may include a variety of different information, such as step-by-step analysis information of the question to be answered, knowledge point information corresponding to the question to be answered, and answer information corresponding to the question to be answered, etc. Therefore, when it is necessary to generate an explanation video of the question to be answered, the explanation video data can be filtered out from the explanation information.
[0101] Optionally, the method may further include: The explanation video data contained in the explanation information is determined by using a regular expression.
[0102] In the embodiments of this specification, a regular expression is a tool for describing a string pattern, and a regular expression can be used to search, match and replace a specific string in a text. The regular expression in the embodiments of this specification is a regular expression that can extract the explanation video data in the explanation information. For example, a regular expression can contain a code identification character, such as Python, which can start with the code identification character and extract the information after the code identification character. Commonly used regular expressions in Python include if...print, etc.
[0103] In the embodiment of this specification, video compiling software can be used to compile video data of explanations of the questions to be answered, and obtain explanation videos of the questions to be answered. Specifically, the video compiling software can include: The target video data is saved as a Python file.
[0104] Use the manim command to compile the Python file.
[0105] In the embodiments of this specification, the video compilation software used may be Manim software. The manim (Mathematical Animation Engine) command is a Python library for making animations; using the manim command to compile Python files can generate explanation videos.
[0106] It is understandable that, in addition to using Manim software to compile the explanation video, other software such as HandBrake software and FFmpeg software can also be used to compile the explanation video. This is not limited here.
[0107] Furthermore, the embodiments of this specification can also optimize the video compilation software, and use the optimized video compilation software to compile the video. The optimized video compilation software has a built-in optimized logic module, and for the compilation of explanation video data, it can use a small amount of code to complete the work that required a large amount of code before optimization. For example, if it is necessary to display distribution analysis information on the left side of the video and a line segment graph on the right side of the video, the video compilation software before optimization needs to accurately determine the distribution analysis information and the absolute coordinate information of the line segment graph. The optimized video compilation software, based on the optimized logic module, can execute "display distribution analysis information on the left side and display line segment graph on the right side", and can automatically find the specific position on the left side and the specific position on the right side, and then display analysis and parsing information on the left side and display line segment graph on the right side, without having to accurately determine the distribution analysis information and the absolute coordinate information of the line segment graph. Therefore, the video compilation efficiency of the optimized video compilation software is higher.
[0108] In the embodiment of this specification, the explanation video may include an image and voice synchronized with the image.
[0109] Furthermore, the explanation video may also include video content that explains the problem-solving process step by step. A portion of the video display page of the explanation video is used to display the blackboard content, and another portion of the blackboard content is used to display the line segment graph content. The blackboard content may be at least one of the step-by-step analysis information of the problem to be solved, the knowledge point information corresponding to the problem to be solved, and the answer information corresponding to the problem to be solved.
[0110] Figure 2 FIG. 1 is a schematic diagram of an image frame of a video explanation provided by an embodiment of the present specification. Figure 2 As shown, Figure 2 The distribution analysis information is shown on the left side of the explanation video, and the line segment graph is shown on the right side of the explanation video.
[0111] In the embodiment of this specification, the explanation video data can be video data including topic introduction, knowledge point introduction, topic explanation and concluding remarks. Based on the topic introduction video data, a topic introduction video can be obtained, based on the knowledge point introduction video data, a knowledge point introduction video can be obtained, based on the concluding remarks video data, a concluding remarks video can be obtained, and so on. The topic introduction video can be a video that introduces the topic. For example, the topic introduction video can include a display of the topic, accompanied by a voice: "Let me explain the following question to you", and then the topic can be broadcasted by voice. The knowledge point introduction video can be a video that introduces the knowledge point information involved in the topic. The knowledge point information involved in the topic can be the distribution analysis information involved in the topic. The ending video can be a video used to end the video explanation, for example, it can be a voice broadcast: "This question has been explained, have you learned it, students?"
[0112] In addition, the explanation video data may also include video data introducing the identity of the teaching software that loads or calls the trained problem-solving model, and based on the video data, a video introducing the identity of the teaching software that loads or calls the trained problem-solving model may be obtained. For example, it may be a voice broadcast: "Hi, I am an AI smart math teacher."
[0113] Since the explanation video is compiled from the explanation video data, by judging whether the explanation video meets the problem-solving requirements, it is possible to determine whether the explanation video data meets the problem-solving requirements, thereby determining whether the explanation information meets the problem-solving requirements.
[0114] In the embodiments of the present specification, the explanation information of the explanation video that can generate the problem-solving requirements and the corresponding questions to be answered are used as training samples, which can reduce the interference of erroneous training samples on the problem-solving model and improve the accuracy of the problem-solving model after training. Then, the problem-solving model after training can more accurately answer the questions that are solved by line segment graphs.
[0115] It can be understood that after determining the explanation information that meets the problem-solving requirements based on the explanation video, the unanswered questions corresponding to the explanation information that meets the problem-solving requirements can be determined based on the explanation information that meets the problem-solving requirements, so that positive sample training data can be generated based on the determined explanation information and the unanswered questions.
[0116] Of course, after selecting the explanation information that meets the problem-solving requirements from all the explanation information in the above manner, the explanation video data in the explanation information that does not meet the problem-solving requirements can also be modified to obtain the correct explanation video data. The correct explanation information after modification and the unanswered questions corresponding to the correct explanation information after modification are used to generate positive sample training data.
[0117] In practical applications, the explanation video can be a question explanation using distribution analysis information, so the last frame image of the explanation video often contains more content than other frames of the explanation video. In order to conveniently and accurately determine whether the explanation video meets the problem-solving requirements, it can be determined based on the last frame image of the explanation video. The determination of whether the explanation video meets the problem-solving requirements may specifically include: Get the last frame image of the explanation video.
[0118] Determine whether at least one of the following conditions exists in the last frame of image: There is no correct answer in the last frame of image.
[0119] There is no line segment graph in the last frame image.
[0120] The line segment graph displayed in the last frame of image is incomplete.
[0121] There is overlap in the content displayed in the last frame of image.
[0122] The line segment diagram displayed in the last frame of image is inconsistent with the explanation text information included in the explanation information.
[0123] The quantitative relationship represented by the line segment graph displayed in the last frame of image is inconsistent with the quantitative relationship contained in the question to be answered.
[0124] The position of the diagram parameter included in the line segment diagram displayed in the last frame of image does not conform to the preset position; the diagram parameter includes at least one of a number and a bracket.
[0125] If not, it is determined that the explanation video meets the problem-solving requirements.
[0126] In the embodiments of this specification, one or more models such as a semantic analysis model and a word vector model can be used to analyze whether the question matches the explanation content displayed in the last frame of the explanation video to determine whether there is a correct answer in the explanation video. Correctly answer the question.
[0127] Furthermore, image recognition technology can be used to identify whether there is a line segment graph in the last frame image of the explanation video to determine whether there is a line segment graph in the last frame image.
[0128] In practical applications, in addition to ensuring that the line segment graph exists in the last frame of the explanation video, it is also necessary to ensure that the line segment graph is qualified.
[0129] Specifically, one or more of an edge detection algorithm, a contour detection algorithm, and a hash algorithm can be used to detect the boundary of the image to identify whether the line segment graph is complete, so as to determine whether the line segment graph is qualified. Of course, other methods can also be used to identify whether the line segment graph is complete, which is not specifically limited here.
[0130] One or more methods among a bounding box detection method, an image segmentation method, and a deep learning model can be used to detect whether there is overlap in the line segment graph in the last frame image, so as to determine whether the line segment graph is qualified.
[0131] Furthermore, a semantic recognition model can be used to identify whether the line segment diagram displayed in the last frame image corresponds to the explanation text information, to determine whether the line segment diagram displayed in the last frame image is consistent with the explanation text information contained in the explanation information, and thus to determine whether the line segment diagram is qualified. A semantic recognition model can be used to detect whether the quantitative relationship represented by the line segment diagram displayed in the last frame image is consistent with the quantitative relationship contained in the question to be answered, to determine whether the line segment diagram is qualified. Of course, other models or methods can also be used for detection and recognition, which are not specifically limited here.
[0132] In addition, the position of the diagram parameter contained in the line segment diagram displayed in the last frame image can also be identified by using methods such as key point matching, so as to determine whether the position of the diagram parameter contained in the line segment diagram is at a preset position. If so, the line segment diagram can be considered qualified. Otherwise, the line segment diagram can be considered unqualified. The diagram parameter can include at least one of a number and a bracket.
[0133] It can be understood that, in addition to using the last frame image of the explanation video to determine whether the explanation video meets the problem-solving requirements, other frame images of the explanation video can also be used to determine whether the explanation video meets the problem-solving requirements. The specific process of using other frame images of the explanation video to determine whether the explanation video meets the problem-solving requirements can refer to the aforementioned content related to using the last frame image of the explanation video to determine whether the explanation video meets the problem-solving requirements, which will not be repeated here.
[0134] In order to ensure the teaching quality, it is also necessary to synchronize the drawing animation displayed in the explanation video with the voice explanation to avoid affecting the teaching experience. The judgment of whether the explanation video meets the problem-solving requirements may specifically include: Determine whether the drawing animation displayed in the explanation video is synchronized with the voice explanation.
[0135] If the drawing animation displayed in the explanation video is synchronized with the voice explanation, it is determined that the explanation video meets the problem-solving requirements.
[0136] Specifically, a model for determining whether the drawing animation and the voice explanation content are synchronized can be pre-trained, and then the trained model can be used to identify whether the drawing animation and the voice explanation content are synchronized. Of course, relevant video editing software or audio analysis tools can also be used to analyze the synchronization of video and audio.
[0137] In the embodiments of the present specification, the training data used to train the problem-solving model may be data in a predetermined format, so that the problem-solving model can understand the training data and improve the training efficiency and model accuracy of the problem-solving model.
[0138] Optionally, generating training data based on the questions to be answered and the explanation information may specifically include: Based on the training data format, the to-be-answered questions and the explanation information are converted into training data that conforms to the training data format.
[0139] In the embodiments of the present specification, the questions to be answered and the explanation information of the questions to be answered can be spliced in a preset order to generate training data.
[0140] Specifically, the question to be answered can be placed before the explanation information, and the question to be answered and the explanation information are separated by a first preset character. In addition, a second preset character can be set before the question to be answered, so that the problem-solving model can understand the training data and improve the training efficiency and model accuracy of the problem-solving model. Among them, the first preset character and the second preset character can be set according to actual needs, and are not specifically limited here.
[0141] For ease of understanding, the embodiments of this specification provide specific descriptions of the training data format.
[0142] Optionally, the training data format may include a role definition part, a question part and a parsing part.
[0143] The role definition part includes information for defining the role played by the problem-solving model.
[0144] The question part includes information of the question to be answered.
[0145] The analysis part includes the knowledge point information corresponding to the question to be answered, step-by-step analysis information, answer information and explanation video data.
[0146] In the embodiment of the present specification, the training data format may include multiple identifiers with different meanings, and the problem-solving model may learn the training data from different perspectives based on the identifiers.
[0147] Specifically, the identifiers may include a first identifier, such as [SYSTEM], which can be used to define the role of the model and describe the model's current task. The first identifier may be located at the beginning of the role definition part. The identifier may also include a second identifier, such as [USER], which may be a question to be answered. The identifier may also include a third identifier, such as [ASSISTANT], which may be the parsed part of the question to be answered. Of course, the above identifiers may also be words or texts in other fields, which are not specifically limited here.
[0148] Furthermore, the problem-solving model can understand the model's current task based on the content after the first identifier, so the first identifier can be used to distinguish different business scenarios. In addition, based on the first identifier, the problem-solving model can also clarify the identity of the model performing this task, for example, the problem-solving model is a math teacher. The second identifier and the third identifier can be understood as a set of dialogues. Among them, the second identifier can be a question asked by the user as a user, and the content after the second identifier can be the content of the user's question. The third identifier can be the answer given by the problem-solving model as an assistant to the user's question, and the content after the third identifier can be the assistant's answer. The above three identifiers are spliced in order and can be used as training data to train the problem-solving model.
[0149] It is understandable that [ASSISTANT] may be the first preset character mentioned above, and [USER] may be the second preset character mentioned above.
[0150] For example, the format and content of the training data can be as follows: [SYSTEM] You are a math teacher. Please use Manim to write a code to make a teaching video for the following question.
[0151] [USER]Xiaoli has 8 apples, and Xiaoming has 2 more apples than Xiaoli. How many apples do Xiaoli and Xiaoming have in total?
[0152] [ASSISTANT] [Knowledge point] xxx, [Step-by-step analysis] xxx, [Answer information] xxx, and [Code information] xxx.
[0153] Usually, we hope that the trained problem-solving model can output accurate explanation information for the question after obtaining the question. Specifically, when using the training data to train the problem-solving model, the problem-solving model can output prediction data based on the role definition part and the question part proposed by the user. The problem-solving model can also use the analysis part of the question as reference data to obtain the trained problem-solving model.
[0154] In the embodiments of this specification, supervised fine-tuning can be used to train the problem-solving model. During the training process, the problem-solving model can adjust its own hyperparameters according to the training data to obtain a trained problem-solving model.
[0155] The goal of training the problem-solving model is to minimize the difference between the reference data and the predicted data, that is, to reduce the loss between the reference data and the predicted data. Therefore, the parameters of the problem-solving model can be continuously adjusted during the training process to reduce the loss. When the loss no longer decreases or decreases to within the preset range, it can be said that the problem-solving model training is complete.
[0156] To improve training efficiency, the problem-solving model in the embodiments of this specification may be a pre-trained model, such as a YunLLM70B model, a Multimodal-CoT model, or a Mixtral8x7B model, etc. Of course, other types of pre-trained models may also be used, which are not specifically limited here.
[0157] In the embodiments of this specification, the obtained training data can be used to train the problem-solving model.
[0158] Assuming that multiple training data are obtained, each piece of training data may include questions to be answered, knowledge point information, step-by-step analysis information, answer information, and the code of the corresponding explanation video, etc. In addition, the training data should include various types of questions to be answered and other information corresponding to the various types of questions to be answered, so as to improve the generalization ability of the problem-solving model.
[0159] After obtaining the training data, the training data can also be cleaned and formatted to ensure the consistency and standardization of the data, so as to facilitate the training of the problem-solving model. Specifically, the training data can be segmented, denoised, and the explanation video data can be formatted. If the knowledge point information, step-by-step analysis information, answer information, and corresponding explanation video data in the training data are generated using a large language model, since the data generated by the large language model is usually standardized and in a unified format, data cleaning and formatting are not required at this time.
[0160] When the problem-solving model training starts, you can initialize the problem-solving model and set some training parameters. For example, for the YunLLM70B model, you can load the YunLLM70B model and configure the training parameters, such as the learning rate, batch size, and number of training rounds.
[0161] In addition, the problem-solving model can be fine-tuned using training data. Specifically, the problem to be solved can be used as input, and the generation of accurate knowledge point information, step-by-step analysis information, answer information, and explanation video data can be used as the goal. During the training process, the problem-solving model continuously adjusts parameters through back propagation to minimize the difference between the generated explanation video data and the annotated explanation video data.
[0162] During the problem-solving model training process, the validation set can be used to evaluate the model performance regularly or irregularly to adjust the problem-solving model parameters and training strategies to ensure the stability and accuracy of the problem-solving model.
[0163] After the problem-solving model training is completed, the model parameters and structure of the trained problem-solving model can be saved for subsequent use and deployment.
[0164] In practical applications, model evaluation is an important step in verifying the quality and reliability of the lecture video data generated by the trained problem-solving model. As an implementation method, the embodiment of this specification can evaluate the performance of the trained problem-solving model through the following steps.
[0165] Get a test set. Specifically, 100 questions can be randomly selected from the test question bank, and it is ensured that the test set questions do not overlap with the training data. In addition, the test set usually needs to ensure that the questions cover various types and complexities of questions that can be solved using line graphs, so as to fully evaluate the performance of the problem-solving model.
[0166] The trained problem-solving model is used to generate corresponding explanation video data for each question in the test set. The generation process is similar to the training stage. Specifically, the question can be input into the trained problem-solving model, and the trained problem-solving model can output knowledge point information, step-by-step analysis information, and explanation video data.
[0167] The generated explanation video data is input into the video compiling software to compile the explanation video.
[0168] Furthermore, the performance of the trained problem-solving model can be evaluated based on the compiled explanation video. Specifically, the explanation video can be evaluated using predetermined evaluation criteria. The evaluation criteria may include the accuracy of the video, such as whether the problem-solving steps and results are correct, the intuitiveness of the video, such as whether the video is clear and easy to understand, the vividness of the video, such as whether the explanation process is vivid and interesting, and the technicality of the video, such as whether the code generation is efficient and the video playback is smooth.
[0169] In addition, the generated video can also be evaluated using the method mentioned above to determine whether the explanation video meets the problem-solving requirements. Professional teachers and technical experts can also be organized to manually evaluate the generated video and record the evaluation results. Of course, the above-mentioned methods can also be combined, and no specific restrictions are made here.
[0170] Furthermore, the evaluation results can be statistically analyzed to evaluate the performance of the trained model. Based on the analysis results, the strengths and weaknesses of the trained problem-solving model can be determined, thus providing a basis for further optimizing the problem-solving model.
[0171] Through the above evaluation steps, we ensure that the problem-solving model after training has the ability to generate high-quality explanation video data and provide reliable technical support for practical applications.
[0172] Corresponding to the above method embodiment, this specification also provides an embodiment of a method for answering a question. Figure 3 This is a flowchart of a method for solving a problem provided by an embodiment of this specification. Figure 3 As shown, the method may include: Step 302: Obtain the target question to be answered.
[0173] In the embodiments of the present specification, the target question to be answered may be a question input by a user, and specifically may be a question that can be answered using a line segment graph.
[0174] Step 304: Input the target unanswered question into the trained problem-solving model to obtain target explanation information; the target explanation information includes target video data for generating an explanation video for solving the target unanswered question using a line segment graph; the trained problem-solving model is obtained by training the problem-solving model using the training data; the training data is generated based on the explanation information of the unanswered question that can be solved using a line segment graph and the unanswered question.
[0175] The process of obtaining the problem-solving model after training can be found in the method of generating the problem-solving model mentioned above, which will not be elaborated here.
[0176] In the embodiments of this specification, based on the target question to be answered, the target explanation information can be directly obtained by using the trained problem-solving model. Compared with using a large language model to obtain the target explanation information, since the trained problem-solving model is obtained after training with questions that can be answered using line segment graphs, it is targeted at questions that can be answered using line segment graphs, and the explanation information of such questions can be generated more accurately, thereby ensuring the quality of the generated explanation video.
[0177] In addition, when using the trained problem-solving model to solve problems, there is no need to preset templates to obtain a large number of prompt words similar to those used by the above-mentioned large language model, which can also improve problem-solving efficiency.
[0178] Step 306: Render the target video data using a video rendering tool to obtain a target explanation video of the target question to be answered.
[0179] In the embodiment of the present specification, the target video data may be the code of the target explanation video of the target question to be answered, or may be other forms of digital information.
[0180] In the embodiment of the present specification, the target explanation video includes an image and a voice synchronized with the image; the target explanation video includes video content of step-by-step explanation of the problem-solving process, a part of the area of the video display page of the target explanation video is used to display the blackboard content, and another part of the area is used to display the line segment graph content. Among them, the blackboard content can be at least one of the step-by-step analysis information of the target problem to be solved, the knowledge point information corresponding to the target problem to be solved, and the answer information corresponding to the target problem to be solved.
[0181] The process of selecting target video data from target information to be explained can refer to the specific process of selecting explanation videos from explanation information in the embodiment of the method for generating a problem-solving model, which will not be described in detail here.
[0182] The process of rendering the target video data using the video rendering tool can refer to the specific process of compiling the explanation video data using the video compilation software in the embodiment of the method for generating the problem-solving model, which will not be described in detail here.
[0183] In a specific embodiment, the target video data may also be the code of the animation in the explanation video. In practical applications, the text information in the target explanation information may be converted into speech using the text-to-speech (TTS) technology, the code of the animation in the explanation video may be rendered into animation using the video compilation software, and then the animation and speech may be synthesized using the audio synthesis technology, thereby obtaining the target explanation video of the target question to be answered.
[0184] Corresponding to the above-mentioned method embodiment for generating a problem-solving model, this specification also provides an embodiment of a device for generating a problem-solving model. Figure 4 FIG. 1 shows a schematic diagram of a structure of a device for generating a problem-solving model provided by an embodiment of the present specification. Figure 4 As shown, the device comprises: The question acquisition module 402 is configured to acquire questions to be answered; the questions to be answered are questions that can be answered using line segment graphs.
[0185] The determination module 404 is configured to determine explanation information of the question to be answered; the explanation information includes explanation video data for the question to be answered.
[0186] The data generation module 406 is configured to generate training data based on the questions to be answered and the explanation information.
[0187] The model training module 408 is configured to train the problem-solving model using the training data to obtain a trained problem-solving model; the trained problem-solving model is used to generate explanation video data for solving problems using line segment graphs.
[0188] Optionally, the determining module 404 may be specifically configured as follows: The large language model is used to generate explanation information for the question to be answered.
[0189] Optionally, the device may further include: The example question determination module is configured to determine a reference example question having the same characteristics as the question to be answered; the characteristics include at least one of the characteristics of the number of line segments contained in the line segment diagram involved in the question, the characteristics of the number of questions contained in the question, the characteristics of the number of answer results corresponding to the question, the characteristics of the number of drawings required for the question, and the characteristics of the type of line segment diagram required for the question; the reference example question includes the example question title and video data for generating an explanation video of the example question title.
[0190] The generating of explanation information of the to-be-answered question by using the large language model may specifically include: Prompt words are generated based on the reference example questions and the questions to be answered.
[0191] The prompt word is input into the large language model to obtain explanation information corresponding to the question to be answered.
[0192] Optionally, determining a reference example having the same characteristics as the question to be answered may specifically include: Using the semantic matching model, a preset number of reference examples matching the question to be answered are selected from the reference example set.
[0193] Optionally, the question to be answered includes a plurality of questions to be answered; the data generating module 406 may be specifically configured as follows: The multiple questions to be answered are classified according to question features to obtain multiple question sets; one question set includes several questions of the same category; the question features include at least one of the features of the number of line segments contained in the line segment graph involved in the question, the features of the number of questions included in the question, the features of the number of answer results corresponding to the question, the features of the number of drawings required for the question, and the features of the type of line segment graph required for the question.
[0194] At least one question to be answered is selected from each question set in the multiple question sets.
[0195] The selected questions to be answered and the corresponding explanation information containing the video data are used as the training data.
[0196] Optionally, the device may further include: The explanation video generation module is configured to generate an explanation video for the question to be answered based on the explanation video data for the question to be answered contained in the explanation information.
[0197] The judgment module is configured to judge whether the explanation video meets the problem-solving requirements.
[0198] The data generation module 406 may be specifically configured as follows: If the explanation video meets the problem-solving requirements, the question to be answered and the corresponding explanation information are used as training data.
[0199] Optionally, the judgment module may be specifically configured as follows: Get the last frame image of the explanation video.
[0200] Determine whether the last frame of image contains at least one of the following conditions: There is no correct answer in the last frame of image.
[0201] There is no line segment graph in the last frame image.
[0202] The line segment graph displayed in the last frame of image is incomplete.
[0203] There is overlap in the content displayed in the last frame of image.
[0204] The line segment diagram displayed in the last frame of image is inconsistent with the explanation text information included in the explanation information.
[0205] The quantitative relationship represented by the line segment graph displayed in the last frame of image is inconsistent with the quantitative relationship contained in the question to be answered.
[0206] The position of the diagram parameter included in the line segment diagram displayed in the last frame of image does not conform to the preset position; the diagram parameter includes at least one of a number and a bracket.
[0207] If not, it is determined that the explanation video meets the problem-solving requirements.
[0208] Optionally, the explanation information also includes at least one of step-by-step analysis information for answering the question to be answered step by step, knowledge point information corresponding to the question to be answered, and answer information of the question to be answered.
[0209] Optionally, the explanation video data is video data including topic introduction, knowledge point introduction, topic explanation and conclusion.
[0210] The above is a schematic scheme of a device for generating a problem-solving model of this embodiment. It should be noted that the technical scheme of the device for generating a problem-solving model and the technical scheme of the method for generating a problem-solving model are of the same concept, and the details of the technical scheme of the device for generating a problem-solving model that are not described in detail can be found in the description of the technical scheme of the method for generating a problem-solving model.
[0211] Corresponding to the above-mentioned method embodiment for solving a problem, this specification also provides an embodiment of a device for solving a problem. Figure 5FIG. 1 is a schematic diagram showing a structure of a device for answering questions provided by an embodiment of the present specification. Figure 5 As shown, the device comprises: The target question acquisition module 502 is configured to acquire a target question to be answered.
[0212] The input module 504 is configured to input the target unanswered question into the trained problem-solving model to obtain target explanation information; the target explanation information includes target video data for generating an explanation video for solving the target unanswered question using a line segment graph; the trained problem-solving model is obtained by training the problem-solving model using the training data; the training data is generated based on the explanation information of the unanswered question that can be solved using a line segment graph and the unanswered question.
[0213] The rendering module 506 is configured to render the target video data using a video rendering tool to obtain a target explanation video of the target question to be answered.
[0214] The above is a schematic scheme of a device for solving a question in this embodiment. It should be noted that the technical scheme of the device for solving a question and the technical scheme of the method for solving a question belong to the same concept, and the details of the technical scheme of the device for solving a question that are not described in detail can be referred to the description of the technical scheme of the device for solving a question.
[0215] Figure 6 The block diagram of a computing device 600 according to an embodiment of the present specification is shown. The components of the computing device 600 include but are not limited to a memory 610 and a processor 620. The processor 620 is connected to the memory 610 via a bus 630, and the database 650 is used to store data.
[0216] The computing device 600 also includes an access device 640 that enables the computing device 600 to communicate via one or more networks 660. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 540 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0217] In one embodiment of the present specification, the above components of the computing device 600 and Figure 6 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 6 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0218] The computing device 600 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 600 may also be a mobile or stationary server.
[0219] Among them, the processor 620 is used to execute the following computer-executable instructions, which, when executed by the processor, can implement the steps of the above-mentioned method for generating a problem-solving model and / or the steps of the above-mentioned method for solving a problem.
[0220] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the method of the problem-solving model and / or the technical scheme of the method of solving the problem belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be found in the description of the technical scheme of the method of the problem-solving model and / or the technical scheme of the method of solving the problem.
[0221] An embodiment of the present specification also provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the method for generating a problem-solving model and / or the steps of the method for answering a problem.
[0222] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the method of the problem-solving model and / or the technical scheme of the method of solving the problem belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the method of the problem-solving model and / or the technical scheme of the method of solving the problem.
[0223] An embodiment of the present specification also provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the method for generating a problem-solving model and / or the steps of the method for answering a problem.
[0224] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the method of the problem-solving model and / or the technical scheme of the method of solving the problem belong to the same concept, and the details of the technical scheme of the computer program that are not described in detail can be found in the description of the technical scheme of the method of the problem-solving model and / or the technical scheme of the method of solving the problem.
[0225] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0226] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of patent practice. For example, in some regions, according to patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0227] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0228] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0229] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A method for generating a problem-solving model, characterized in that: include: Get the questions to be answered; The to-be-solved problem is a problem that can be solved using a line segment diagram; Determining explanation information of the question to be answered; The explanation information includes video data of explanations for the questions to be answered; Generate training data based on the questions to be answered and the explanation information; Using the training data to train a problem-solving model to obtain a trained problem-solving model; The trained problem-solving model is used to generate explanation video data for solving problems using line segment graphs.
2. The method according to claim 1, characterized in that: The step of determining the explanation information of the question to be answered specifically includes: The large language model is used to generate explanation information for the question to be answered.
3. The method according to claim 2, characterized in that The method further comprises: Determine a reference example having the same characteristics as the problem to be solved; the characteristics include at least one of the number of line segments contained in the line segment graph involved in the problem, the number of questions contained in the problem, the number of answer results corresponding to the problem, the number of drawings required for the problem, and the type of line segment graph required for the problem; the reference example includes the example title and video data for generating an explanation video of the example title; The generating of explanation information of the to-be-answered question by using the large language model specifically includes: Generate prompt words based on the reference example questions and the questions to be answered; The prompt word is input into the large language model to obtain explanation information corresponding to the question to be answered.
4. The method according to claim 3, characterized in that The determining of the reference example having the same characteristics as the question to be answered specifically includes: Using the semantic matching model, a preset number of reference examples matching the question to be answered are selected from the reference example set.
5. The method according to claim 1, characterized in that The to-be-answered questions include a plurality of to-be-answered questions; and generating training data based on the to-be-answered questions and the explanation information specifically includes: Classifying the multiple questions to be answered according to question features to obtain multiple question sets; one of the question sets includes a plurality of questions of the same category; the question features include at least one of the features of the number of line segments included in the line segment graph involved in the question, the number of questions included in the question, the number of answer results corresponding to the question, the number of drawings required for the question, and the type of line segment graph required for the question; Selecting at least one question to be answered from each of the multiple question sets; The selected questions to be answered and the corresponding explanation information containing the video data are used as the training data.
6. The method according to claim 1, characterized in that The method further comprises: Generate an explanation video of the question to be answered based on the explanation video data for the question to be answered contained in the explanation information; Determine whether the explanation video meets the problem-solving requirements; The generating of training data based on the to-be-answered questions and the explanation information specifically includes: If the explanation video meets the problem-solving requirements, the question to be answered and the corresponding explanation information are used as training data.
7. The method according to claim 6, characterized in that The determining whether the explanation video meets the problem-solving requirements specifically includes: Obtain the last frame image of the explanation video; Determine whether at least one of the following conditions exists in the last frame of image: There is no correct answer in the last frame of image; There is no line segment graph in the last frame of image; The line segment graph displayed in the last frame of image is incomplete; There is overlap in the contents displayed in the last frame of image; The line segment diagram displayed in the last frame of image is inconsistent with the explanation text information contained in the explanation information; The quantitative relationship represented by the line segment graph displayed in the last frame of image is inconsistent with the quantitative relationship contained in the question to be answered; The position of the diagram parameter included in the line segment diagram displayed in the last frame of image does not conform to the preset position; the diagram parameter includes at least one of a number and a bracket; If not, it is determined that the explanation video meets the problem-solving requirements.
8. The method according to claim 1, characterized in that The explanation information also includes at least one of step-by-step analysis information for answering the question to be answered step by step, knowledge point information corresponding to the question to be answered, and answer information of the question to be answered.
9. The method according to claim 1, characterized in that: The explanation video data is video data including topic introduction, knowledge point introduction, topic explanation and conclusion.
10. A method for solving a problem, characterized in that: include: Get the target question to be answered; Inputting the target question to be answered into the trained problem-solving model to obtain target explanation information; The target explanation information includes target video data for generating an explanation video for solving the target to-be-solved problem using a line segment graph; The trained problem-solving model is obtained by training the problem-solving model using training data; the training data is generated based on explanation information of the problem to be solved that can be solved using line segment graphs and the problem to be solved; The target video data is rendered using a video rendering tool to obtain a target explanation video of the target question to be answered.
11. The method according to claim 10, characterized in that The target explanation video includes images and voice synchronized with the images; the target explanation video includes video content that explains the problem-solving process step by step, a part of the area of the video display page of the target explanation video is used to display the blackboard content, and another part of the area is used to display the line segment diagram content.
12. A device for generating a problem-solving model, characterized in that: include: A question acquisition module is configured to acquire questions to be answered; The to-be-solved problem is a problem that can be solved using a line segment diagram; A determination module, configured to determine explanation information of the question to be answered; The explanation information includes video data of explanations for the questions to be answered; A data generation module, configured to generate training data based on the questions to be answered and the explanation information; A model training module is configured to train a problem-solving model using the training data to obtain a trained problem-solving model; The trained problem-solving model is used to generate explanation video data for solving problems using line segment graphs.
13. A device for solving a problem, characterized in that: include: A target example question acquisition module is configured to acquire a target question to be answered; An input module is configured to input the target problem to be solved into the trained problem-solving model to obtain target explanation information; The target explanation information includes target video data for generating an explanation video for solving the target to-be-solved problem using a line segment graph; The trained problem-solving model is obtained by training the problem-solving model using training data; the training data is generated based on explanation information of the problem to be solved that can be solved using line segment graphs and the problem to be solved; The rendering module is configured to render the target video data using a video rendering tool to obtain a target explanation video of the target question to be answered.
14. A computing device, characterized in that include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method described in any one of claims 1 to 11 are implemented.
15. A computer-readable storage medium, characterized in that: It stores computer executable instructions, which, when executed by a processor, implement the steps of the method described in any one of claims 1 to 11.
16. A computer program product, characterized in that The invention comprises a computer program / instruction, which, when executed by a processor, implements the steps of the method according to any one of claims 1 to 11.
Citation Information
Patent Citations
Question explanation method and device and electronic equipment
CN112966674A
Automatic problem solving method for plane geometry mathematical problem
CN116028888A
Geometric problem solving animation display method and device, equipment, medium and program product
CN116934909A
Question solving video generation method and device, equipment and storage medium
CN117893158A
Video information acquisition method and device, equipment and storage medium
CN118338073A
Cited By
Data set creation method, computer equipment and storage medium
CN120806169A
