Auxiliary lesson preparation method and device based on large language model
Through an auxiliary lesson preparation method based on a large language model, combined with a vector database and a knowledge graph database, the problem of inefficiency in screening and processing teaching resources is solved, efficient and accurate lesson preparation content generation is achieved, and the reliability of teaching resources is improved.
Patent Information
- Application Number
- CN202411744545.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-01
- Publication Date
- 2025-03-21
AI Technical Summary
In the existing auxiliary lesson preparation technology, teachers need to spend a lot of time screening and processing teaching resources, resulting in inefficiency and the application of large language models in teaching scenarios has stability and reliability problems.
The auxiliary lesson preparation method based on the large language model is adopted, and efficient lesson preparation content generation is achieved by building a fine-tuned general large language model, combining a vector database and a knowledge graph database. This method includes building a large language model, processing user lesson preparation needs, building a knowledge base, retrieving and generating lesson preparation content.
It improves the quality and efficiency of lesson preparation content generation, alleviates the application stability of large language models in teaching scenarios, and enhances the accuracy of generated content and the reliability of teaching resources.
Smart Images

Figure CN119670889A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of auxiliary lesson preparation, and in particular to an auxiliary lesson preparation method and device based on a large language model. Background Art
[0002] With the rapid development of computer technology, auxiliary lesson preparation systems have become an indispensable part of the teaching process, playing a role in improving the quality of teachers' lesson preparation.
[0003] The existing technical means of assisting lesson preparation mainly include educational applications, online course platforms and Internet education platforms. Teachers can search for the required teaching materials through the above platforms to improve the quality of lesson preparation content and enrich teaching materials. Due to the large number of educational resources on the Internet or various educational platforms, coupled with the lack of effective search technology, teachers usually need to spend a lot of time to screen out usable teaching materials, courseware, videos and other materials, and further process and process them to form lesson preparation content, which reduces efficiency.
[0004] Currently, there is technology that uses large language models to assist in lesson preparation, but it is limited by the hallucination problem inherent in large models, and the application effect is unstable and unreliable. Summary of the invention
[0005] In view of the deficiencies in the prior art, the present invention proposes an auxiliary lesson preparation method and device based on a large language model to solve the above technical problems.
[0006] In a first aspect, an auxiliary lesson preparation method based on a large language model is provided, comprising:
[0007] Build a large language model;
[0008] A large language model is used to process the lesson preparation requirements input by the user to obtain the lesson preparation requirements results;
[0009] Build a knowledge base;
[0010] Performing a search process on the knowledge base according to the lesson preparation demand result to obtain a search result;
[0011] A large language model is used to perform lesson preparation processing on the retrieval results to obtain lesson preparation content.
[0012] Furthermore, the step of constructing a large language model includes:
[0013] Choose an open source general-purpose large language model;
[0014] The open source general large language model is trained to obtain a trained open source general large language model.
[0015] Furthermore, the large language model is used to process the lesson preparation requirements input by the user to obtain lesson preparation requirements results, including:
[0016] Design prompts;
[0017] Use prompt to process the lesson preparation requirements input by the user and obtain the classification results;
[0018] According to the classification results, judge the lesson preparation needs;
[0019] If it is judged as a lesson preparation requirement, the subsequent processing steps are executed;
[0020] If it is determined to be not a lesson preparation demand, the user is prompted that the demand is not related to lesson preparation.
[0021] Furthermore, the step of constructing a knowledge base includes:
[0022] Determine the knowledge storage type and database selection, and store subject materials in the knowledge graph database and vector database according to data type;
[0023] Build a knowledge graph database to store structured and relational subject knowledge;
[0024] Build a vector database to store unstructured text information and teaching materials.
[0025] Furthermore, the step of constructing a knowledge graph database includes:
[0026] Use a large language model to extract and normalize knowledge to obtain the extracted result data;
[0027] The extracted result data is stored in the knowledge graph database.
[0028] Furthermore, the step of constructing a vector database includes:
[0029] Extract text information;
[0030] Use a pre-trained language model to transform the content in the text information to obtain a vector representation;
[0031] The vector representation is stored in a vector database.
[0032] Furthermore, the knowledge base is searched according to the lesson preparation requirement result to obtain the search result, including:
[0033] Input the lesson preparation demand results into the vector database and the knowledge graph database respectively, and obtain two search results;
[0034] The search results of the two databases are summarized to obtain the final search result list.
[0035] In a second aspect, an auxiliary lesson preparation device based on a large language model is provided, comprising:
[0036] The first building module is used to build a large language model;
[0037] The demand processing module is used to process the lesson preparation requirements input by the user using a large language model to obtain the lesson preparation requirements results;
[0038] The second building module is used to build a knowledge base;
[0039] A search processing module is used to search the knowledge base according to the lesson preparation demand results to obtain search results;
[0040] The lesson preparation processing module is used to use a large language model to perform lesson preparation processing on the retrieval results to obtain lesson preparation content.
[0041] Furthermore, it includes a processor and a memory storing program instructions, and the processor is used to execute an auxiliary lesson preparation method based on a large language model as described in any one of the above when running the program instructions.
[0042] The invention adopting the above technical solution has the following advantages:
[0043] 1. The present invention improves the adaptability of the general large language model in the field of education by fine-tuning the general large language model, solves the application limitations of the general model in teaching scenarios, and achieves efficient preparation content generation quality.
[0044] 2. The present invention adopts a combination of vector database and knowledge graph database to construct a multi-dimensional knowledge base, improve the efficiency and breadth of knowledge retrieval, and has stronger knowledge association capabilities compared to a single database solution.
[0045] 3. The present invention uses a large language model to construct a knowledge graph, replacing the traditional natural language processing method, which can more accurately and efficiently extract and construct complex subject knowledge relationship networks.
[0046] 4. The present invention uses a large language model to comprehensively process multi-dimensional retrieval results and generate lesson preparation content, which helps to alleviate the hallucination problem inherent in the large language model and improve the accuracy of generated content and the reliability of teaching resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] In order to more clearly illustrate the specific implementation of the present invention, the following will briefly introduce the drawings required for use in the specific implementation. In all the drawings, each element or part is not necessarily drawn according to the actual scale.
[0048] Figure 1A flowchart of an auxiliary lesson preparation method based on a large language model of the present invention;
[0049] Figure 2 A flowchart of constructing a large language model service in an auxiliary lesson preparation method based on a large language model of the present invention;
[0050] Figure 3 A knowledge base architecture diagram of an auxiliary lesson preparation method based on a large language model of the present invention;
[0051] Figure 4 A flow chart of constructing a knowledge base in an auxiliary lesson preparation method based on a large language model of the present invention;
[0052] Figure 5 A flow chart of processing lesson preparation requirements in an auxiliary lesson preparation method based on a large language model of the present invention;
[0053] Figure 6 The present invention is a knowledge retrieval flow chart of an auxiliary lesson preparation method based on a large language model. DETAILED DESCRIPTION
[0054] The following embodiments of the technical solution of the present invention are described in detail in conjunction with the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and are therefore only used as examples, and cannot be used to limit the protection scope of the present invention.
[0055] like Figure 1 to Figure 6 As shown, an auxiliary lesson preparation method based on a large language model of the present invention includes:
[0056] Step S01, constructing a large language model;
[0057] Step S02: using a large language model to process the lesson preparation requirements input by the user to obtain lesson preparation requirements results;
[0058] Step S03: construct a knowledge base;
[0059] Step S04: search the knowledge base according to the lesson preparation demand results to obtain search results;
[0060] Step S05: Use a large language model to process the retrieval results for lesson preparation to obtain lesson preparation content.
[0061] In some embodiments, the step of building a large language model includes:
[0062] Choose an open source general-purpose large language model;
[0063] The open source general large language model is trained to obtain a trained open source general large language model.
[0064] Specifically, building a large language model service
[0065] Since various types of large language models are currently designed for general capabilities, they are often not suitable for the teaching field. In order to make the large language model focus on the teaching preparation field, the embodiment of the present invention adopts a strategy of customized fine-tuning of the open source general large language model to obtain a large language model for the teaching preparation field. The flowchart of this step is as follows Figure 2 shown.
[0066] (1.1) Select an open source general language model
[0067] Use the current mainstream open source general language model
[0068] For example, Llama 3.1, ChatGLM, Qwen, etc. In the embodiment of the present invention, Llama 3.1 is selected.
[0069] (1.2) Model Customization Training Based on Transfer Learning
[0070] In order to adapt the large model to the needs of lesson preparation, transfer learning technology is used to migrate the large language model in step (1.2) to the education field, and fine-tune it using a large-scale education dataset.
[0071] The techniques used in this step include:
[0072] (1.2.1) Constructing a dataset for educational preparation
[0073] A dataset consists of a series of entries containing instructions, inputs, and outputs, for example:
[0074] {
[0075] "instruction":"Write a lesson plan on data structures and algorithms for a college computer science course.",
[0076] "input":"Students' foundation: Sophomores majoring in computer science, who have mastered basic programming knowledge. Course objectives: To help students understand common data structures and their applications in algorithms, including arrays, linked lists, stacks, queues, trees, graphs, etc.",
[0077] "output":"Course plan:
[0078] 1. Introduction: Review the concepts of basic data structures and discuss their importance in problem solving.
[0079] 2. Arrays and linked lists: explain their implementation methods, advantages and disadvantages, and application scenarios.
[0080] 3. Stacks and queues: In-depth exploration of their characteristics and how to apply them in algorithms.
[0081] 4. Trees and Graphs: Focus on the basic concepts and traversal algorithms of binary trees, binary search trees and graphs.
[0082] 5. Algorithm analysis: Discuss the time and space complexity analysis of common algorithms in combination with data structures.
[0083] 6. Practical part: Students write code to implement different data structures and related algorithms to solve practical problems.
[0084] "
[0085] }
[0086] In the dataset format, "instruction" refers to the task instructions given to the model, telling the model the specific tasks it needs to complete; "input" refers to user questions or related information required to complete the task; and "output" refers to the expected answers that the model should produce.
[0087] The dataset format is a dataset format adapted for Llama 3.1 fine-tuning in the embodiment of the present invention. During the implementation process, the dataset format can be adjusted according to the fine-tuning requirements of different open source large language models.
[0088] (1.2.2) Fine-tuning training
[0089] The training framework uses PyTorch, the mainstream model training tool in the industry; the fine-tuning method uses LoRA (Low-Rank Adaptation). LoRA is a commonly used method for efficient parameter fine-tuning. Its technical feature is that it uses fewer training parameters to approximate the incremental parameters obtained by fine-tuning all parameters of a large language model, and has the advantage of less video memory usage.
[0090] When using LoRA fine-tuning, the hyperparameters are set to: r = 8; lora_alpha = 32; lora_dropout = 0.1. The lora hyperparameter r represents the rank; lora_alpha is the scaling factor used to adjust the impact of low-rank matrix updates on model parameters; lora_dropout is the dropout of the LoRA layer. The training hyperparameters are set to epochs = 3; learning_rate = 0.0001. epochs is the number of training rounds; learning_rate is the learning rate. LoRA hyperparameters and training hyperparameters are empirical parameters and should be set as needed during the specific implementation process. After fine-tuning training, a large language model for the field of educational preparation will be obtained.
[0091] (1.3) Deployment of large language models
[0092] To ensure the efficient operation of large language models, reasoning tools such as vLLM and Ollama are used to deploy large language models.
[0093] vLLM and Ollama are the industry's mainstream large language model inference service libraries, which have the advantages of accelerating large language model inference and improving the utilization of computing resources.
[0094] (1.4) Release large model service
[0095] In order to enable the large model service to be called by other modules of the system, the RESTful API design standard is adopted. The flexible calling and integration of large models is realized through standardized interface protocols.
[0096] Technical details of the application include:
[0097] Interface standard: RESTful API based on HTTP protocol, supporting request methods such as GET and POST.
[0098] Data format: The interface returns structured data in JSON format to facilitate other modules of the system to process and display the lesson preparation content.
[0099] Authentication mechanism: OAuth2.0 is used for interface authentication to ensure the security and access control of API calls.
[0100] In some embodiments, a large language model is used to process the lesson preparation requirements input by the user to obtain lesson preparation requirements results, including:
[0101] Design prompts;
[0102] Use prompt to process the lesson preparation requirements input by the user and obtain the classification results;
[0103] According to the classification results, judge the lesson preparation needs;
[0104] If it is judged as a lesson preparation requirement, the subsequent processing steps are executed;
[0105] If it is determined to be not a lesson preparation demand, the user is prompted that the demand is not related to lesson preparation.
[0106] Specifically, handling lesson preparation requirements
[0107] This step uses the large language model to process the lesson preparation requirements input by the user, aiming to accurately identify the user's actual intention and classify it as "lesson preparation requirements" or "non-lesson preparation requirements". Through the natural language understanding ability of the large model, the system can automatically parse the input teaching requirements and respond. The flow chart of this step is as follows Figure 5 The detailed steps are as follows:
[0108] (3.1) Prompt design
[0109] The lesson preparation needs input by users are processed through the prompt of the large language model. The prompt is designed to include input fields and output fields, which clearly instruct the model to classify user intentions into "lesson preparation needs" or "non-lesson preparation needs."
[0110] Prompt structure:
[0111] Model task: Based on the following input content, determine whether the user's intention is to prepare for class.
[0112] input: User input, indicating specific lesson preparation needs or other requests.
[0113] context: contextual prompts that assist the model in understanding, used to help large models clarify the direction of analysis.
[0114] output: system output field, directly determines the user's intention type and returns "lesson preparation need" or "no lesson preparation need".
[0115] Prompt example:
[0116] Model task: Based on the following input content, determine whether the user's intention is to prepare for class.
[0117] Input: "I need to prepare lecture notes on artificial intelligence for my university computer science class next week. Can you help me find relevant materials?"
[0118] context: The user wants to generate or search for content for teaching preparation. The intent type is: lesson preparation need or non-lesson preparation need.
[0119] output: lesson preparation requirements
[0120] (3.2) Execution Intention Classification
[0121] In this step, by analyzing the prompt of step (3.1), the user's intention is understood using a general large language model, and the corresponding intention classification result is generated. The general large language model can use Llama 3.1, ChatGLM, Qwen, etc. Llama 3.1 is used in the embodiment of the present invention. The assembled prompt is input into the large language model. The Llama 3.1 model performs natural language processing based on the context prompt and the input field of the prompt, and identifies the user's intention through deep semantic analysis.
[0122] Classification results:
[0123] ① If the input content is related to the generation or organization of courses, textbooks, handouts, and teaching resources, the model will output "lesson preparation requirements".
[0124] ②If the input involves other content unrelated to lesson preparation, such as consultation on technical issues, discussions unrelated to the course, etc., the model will output "non-lesson preparation needs".
[0125] Example classification result 1:
[0126] User input: "I need to prepare lecture notes on artificial intelligence for my university computer science class next week. Can you help me find relevant materials?"
[0127] Model output: lesson preparation requirements
[0128] Example classification result 2:
[0129] User input: "I need to learn about the latest research results in the field of artificial intelligence for my personal research."
[0130] Model output: non-lesson preparation requirements
[0131] Perform subsequent processing based on the intent classification results:
[0132] ①Lesson preparation requirements: Execute step (3.3).
[0133] ② Non-lesson preparation needs: Prompt the user that the need is not related to lesson preparation, and respond using a general large language model.
[0134] (3.3) Decomposition of user needs
[0135] In order to process the lesson preparation requirements input by the user in a more detailed manner, the fine-tuned large language model of the present invention further extracts the core contents such as the subject, lesson preparation points, and required teaching resources through step (1). The prompt designed in this step is as follows:
[0136] Prompt structure:
[0137] Task description: Extract core content such as subjects and lesson preparation points based on the user's lesson preparation needs.
[0138] input: the user's lesson preparation requirements
[0139] context: The system needs to extract key information such as "subject", "key points for lesson preparation", and "required teaching resources" to help generate subsequent teaching content.
[0140] output: Model output field, which specifies the subject, lesson preparation points, etc.
[0141] prompt example:
[0142] Input: "I need to prepare lecture notes on artificial intelligence for my university computer science class next week. Can you help me find relevant materials?"
[0143] Task: Extract the following core information based on the input content: 1. Subject 2. Key points for lesson preparation 3. Required teaching resources
[0144] Input: "I need to prepare lecture notes on artificial intelligence for my university computer science class next week. Can you help me find relevant materials?"
[0145] context: The user is preparing for a university computer science course, with a focus on artificial intelligence.
[0146] output:
[0147] ①Discipline: Computer Science
[0148] ② Key points for lesson preparation: basic concepts of artificial intelligence, key algorithms, application scenarios, and related cutting-edge technologies
[0149] ③ Required teaching resources: artificial intelligence textbooks, academic papers, code examples of classic algorithms, cutting-edge research materials
[0150] Prompt execution effect:
[0151] ① Subject: Extract "University Computer Science" as the target subject.
[0152] ② Key points for lesson preparation: Extract the core elements of the artificial intelligence topic, such as "basic concepts", "key algorithms", "application scenarios", etc.
[0153] ③ Required teaching resources: It is recommended to use resources such as "artificial intelligence textbooks", "academic papers", and "code examples".
[0154] By executing prompt, the fine-tuned large language model of the present invention can effectively decompose the user's needs and extract key information that is helpful for subsequent lesson preparation.
[0155] In some embodiments, the step of building a knowledge base includes:
[0156] Determine the knowledge storage type and database selection, and store subject materials in the knowledge graph database and vector database according to data type;
[0157] Build a knowledge graph database to store structured and relational subject knowledge;
[0158] Build a vector database to store unstructured text information and teaching materials.
[0159] Specifically, building a knowledge base
[0160] The present invention stores subject information in a knowledge graph database and a vector database according to data type.
[0161] The knowledge base includes a knowledge graph database and a vector database. Its architecture is shown in the following figure. Figure 3 As shown in Figure 2, structured and relational subject knowledge is stored in the knowledge graph database, while unstructured text information, teaching materials, etc. are stored in the vector database for fast retrieval and efficient use.
[0162] The flow chart of this step is as follows Figure 4 The specific steps are as follows:
[0163] (2.1) Determine the knowledge storage type and database selection
[0164] (2.1.1) Knowledge Graph Database
[0165] For relational knowledge in a discipline, such as concepts, definitions, formulas and the logical relationships between them, a knowledge graph database is used to store them. This type of knowledge has a highly structured nature and is suitable for management through a graph data structure. The knowledge graph can not only store factual information, but also express complex semantic relationships and reasoning rules.
[0166] Applicable scenarios: course outlines, hierarchical structures of subject knowledge points, and conceptual relationships (such as the relationship between "force" and "motion" in physics).
[0167] Technology used: Neo4j graph database.
[0168] Storage method: store nodes, relationships and attributes.
[0169] Neo4j is used as the graph database in the embodiment of the present invention. Other graph databases can be selected as needed during the specific implementation, but they must meet the knowledge graph data storage method specified in the embodiment of the present invention.
[0170] (2.1.2) Vector database
[0171] Vector databases are used to store large amounts of unstructured text data such as courseware, textbooks, and handouts. Through vectorization technology, text is converted into vector representation to support fast similarity retrieval. This database can effectively process large-scale unstructured data and provide support for subsequent large model content generation.
[0172] Applicable scenarios: course handouts, textbook content, courseware and other teaching materials.
[0173] Technologies used: Milvus, FAISS, Pinecone, Weaviate and other vector databases.
[0174] Storage method: Through language models or Embedding technology (such as BGE, BERT, Sentence-BERT), the text content is converted into a fixed-length vector and stored in the database to facilitate efficient retrieval through the vector space.
[0175] The Milvus database is used in the embodiment of the present invention. During the specific implementation, other vector databases may be selected as needed, but they must meet the vector data storage method specified in the embodiment of the present invention.
[0176] In some embodiments, the step of constructing a knowledge graph database includes:
[0177] Use a large language model to extract and normalize knowledge to obtain the extracted result data;
[0178] The extracted result data is stored in the knowledge graph database.
[0179] Specifically, (2.2) construct a knowledge graph database
[0180] In order to improve the quality of knowledge graph construction, the embodiment of the present invention adopts a technology based on a large language model to realize knowledge extraction and normalization, specifically using the open source tool GraphRAG. GraphRAG uses a large language model to complete the construction of the knowledge graph, replacing traditional natural language processing technology. The prompt for GraphRAG to extract entity relationships is as follows:
[0181] {
[0182] -Target
[0183] Given a text document that may be relevant to this activity and a list of entity types, identify all of these types of entities from the text and all the relationships between them.
[0184] -field
[0185] Education preparation
[0186] -step
[0187] Identify all entities. For each identified entity, extract the following information:
[0188] Entity Name: The name of the entity, with the first letter capitalized
[0189] Entity Type: One of: [{entity_types}]
[0190] Entity Description: A comprehensive description of the entity's attributes and activities. Each entity is formatted as ("entity"<|><entity_name> <|><entity_type> <|><entity_description> )
[0191] From the entities identified in the first step, identify all (source_entity, target_entity) pairs that are significantly related to each other.
[0192] For each pair of related entities, extract the following information:
[0193] Source entity: the source entity name identified in the first step source_entity
[0194] Target entity: the name of the target entity identified in the first step target_entity
[0195] Relationship description: Explain why you think the source and target entities are related to each other. Relationship strength: A numeric score that represents the strength of the relationship between the source and target entities. Format each relationship as ("relationship"<|><source_entity> <|><target_entity> <|><relationship_description> <|><relationship_strength> )
[0196] Use ## as the list separator to output the results.
[0197] When completed, output <|COMPLETE|>
[0198] }
[0199] The prompt and the data to be processed are input into the large language model service constructed in step (1). After the extraction is completed, the result data is stored in the knowledge graph database in step (2.1.1). The knowledge graph construction tool used in the embodiment of the present invention is GraphRAG. Other knowledge graph construction technologies based on large language model technology can be applied in the specific implementation process, but the prompt should be appropriately modified to adapt to the large language model, and must include entity name, entity type, entity description, source entity, target entity, relationship description, and relationship strength.
[0200] In some embodiments, the step of building a vector database includes:
[0201] Extract text information;
[0202] Use a pre-trained language model to transform the content in the text information to obtain a vector representation;
[0203] The vector representation is stored in a vector database.
[0204] Specifically, (2.3) construct a vector database
[0205] Extract text information from teaching materials such as textbooks and courseware, and use pre-trained language models (such as BGE, BERT, Sentence-BERT) to convert the text content into vector representation and store it in a vector database.
[0206] In the embodiment of the present invention, BGE is used as the text vectorization technology. The specific steps are as follows:
[0207] (2.3.1) Model loading and environment preparation
[0208] First, configure the necessary software environment on the computing device, including installing the deep learning framework (PyTorch) and BGE-related dependency packages.
[0209] The model can be loaded via the Hugging Face Transformers library.
[0210] (2.3.2) Initialization of model and tokenizer
[0211] When loading the BGE model, the system obtains the pre-trained model and the corresponding tokenizer through the predefined model library (such as "BAAI / bge-large-zh"). The AutoTokenizer and AutoModel modules are called to initialize the processing modules for text segmentation and vectorization.
[0212] Code example (Python):
[0213] from transformers import AutoTokenizer,AutoModel
[0214] #Load the model and tokenizer
[0215] model_name="BAAI / bge-large-zh"
[0216] tokenizer=AutoTokenizer.from_pretrained(model_name)
[0217] model=AutoModel.from_pretrained(model_name)
[0218] (2.3.3) Text preprocessing
[0219] The text input to be processed is standardized by a tokenizer, which is responsible for converting the input natural language text into the token sequence (i.e. token IDs) required by the model.
[0220] During the word segmentation process, necessary parameters should be set for the input text, such as maximum length, whether padding and truncation are required, etc. The purpose of this step is to input a standardized data format for the model.
[0221] Code example (Python):
[0222] texts = ["This is a lesson note on linear algebra.", "This course introduces the basic concepts of calculus."]
[0223] inputs=tokenizer(texts,padding=True,truncation=True,return_tensors="pt")
[0224] (2.3.4) Generate text vector
[0225] By inputting the preprocessed text data into the BGE model, the system can generate the corresponding text vector (i.e., text embedding). This process relies on multi-layer processing of deep neural networks, and the final output is a high-dimensional vector representation of the text for subsequent semantic retrieval and matching.
[0226] Code example (Python):
[0227] with torch.no_grad():
[0228] outputs = model(**inputs)
[0229] embeddings=outputs.last_hidden_state.mean(dim=1)
[0230] The generated text vector is stored in the vector database in step (2.1.2).
[0231] In some embodiments, the knowledge base is searched and processed according to the lesson preparation demand results to obtain search results, including:
[0232] Input the lesson preparation demand results into the vector database and the knowledge graph database respectively, and obtain two search results;
[0233] The search results of the two databases are summarized to obtain the final search result list.
[0234] Specifically, knowledge retrieval
[0235] According to the user needs decomposed in step (3.3), the knowledge base in step (2) is retrieved separately, including the vector database and the knowledge graph database.
[0236] The present invention uses the mainstream knowledge retrieval tools in the industry to realize knowledge retrieval.
[0237] The flow chart of this step is as follows Figure 6 As shown, the specific steps are as follows:
[0238] (4.1) Vector database retrieval
[0239] The present invention uses RAGFlow to implement vector database retrieval. RAGFlow is an open source knowledge retrieval tool based on large language model technology and retrieval enhancement generation technology. In the specific implementation process, vector database retrieval tools such as Dify and langchain can be selected as needed. The user needs decomposed in step (3.3) are used as query content, input into RAGFlow, and the retrieval results are output.
[0240] (4.2) Knowledge graph database retrieval
[0241] The present invention uses GraphRAG to implement knowledge graph database retrieval. GraphRAG is an open source knowledge retrieval tool based on large language model technology and knowledge graph. In the specific implementation, other knowledge graph retrieval tools can be selected, such as LightRAG, DB-GPT, etc. The user needs decomposed in step (3.3) are used as query content, input into GraphRAG, and the retrieval results are output.
[0242] (4.3) Summarize search results
[0243] Summarize the retrieval output from steps (4.1) and (4.2) into a list, defined as follows:
[0244] ["search result-v1", "search result-v2", ..., "search result-vn", "search result-g1", "search result-g2", ..., "search result-gk"]
[0245] "Search result-vn" represents the nth vector database search result. "Search result-gk" represents the kth knowledge graph database search result.
[0246] Since the input length of large language models is limited to varying degrees, in order to avoid the search result list containing too much content, the number of searches can be appropriately reduced. Hyperparameters n and k are empirical parameters and can be set to n = 5 and k = 5. They should be adjusted according to the actual large model service processing capacity.
[0247] Specifically, generate lesson preparation content
[0248] This step is responsible for generating lesson preparation content based on the search results of step (4.3) using the large language model of step (1). The prompt structure of the generated lesson preparation content is as follows:
[0249] Task description: Generate a detailed lesson plan based on the input search results. The content should include subject background, detailed explanation of lesson plan points, integration of teaching resources, etc.
[0250] Input: The search results obtained in step (4.3).
[0251] context: Users need a detailed lesson plan content, which combines the search results of multiple databases to generate a lesson plan document containing core lesson plan points, teaching resources and their actual application scenarios.
[0252] Output: Detailed lesson preparation content, including the following parts:
[0253] ①Discipline Background
[0254] ②Detailed explanation of lesson preparation points
[0255] ③Citation and explanation of teaching resources
[0256] ④Actual application scenarios or case analysis
[0257] The prompt for generating lesson preparation content includes task description, input, context, and output fields. Input refers to the search result obtained in step (4.3); context refers to the lesson preparation requirements; and output refers to the output requirements. The present invention generates the prompt for lesson preparation content only as an example, and the lesson preparation requirements and output content control can be adjusted according to actual conditions.
[0258] In some other embodiments, a large language model-based auxiliary lesson preparation device is provided, comprising:
[0259] The first building module is used to build a large language model;
[0260] The demand processing module is used to process the lesson preparation requirements input by the user using a large language model to obtain the lesson preparation requirements results;
[0261] The second building module is used to build a knowledge base;
[0262] The retrieval processing module is used to perform retrieval processing on the knowledge base according to the lesson preparation demand results to obtain the retrieval results;
[0263] The lesson preparation processing module is used to use a large language model to process the retrieval results and obtain the lesson preparation content.
[0264] In some embodiments, a processor and a memory storing program instructions are included, and the processor is used to execute an auxiliary lesson preparation method based on a large language model as any one of the above items when running the program instructions.
[0265] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein by equivalents. These modifications or replacements do not deviate the essence of the corresponding technical solutions from the scope of the technical solutions of the embodiments of the present invention, and they should all be included in the scope of the claims and specification of the present invention.
Claims
1. An auxiliary lesson preparation method based on a large language model, characterized in that: include: Build large language models; A large language model is used to process the lesson preparation requirements input by the user to obtain the lesson preparation requirements results; Build a knowledge base; Performing a search process on the knowledge base according to the lesson preparation demand result to obtain a search result; A large language model is used to perform lesson preparation processing on the retrieval results to obtain lesson preparation content.
2. The auxiliary lesson preparation method based on a large language model according to claim 1, characterized in that: The step of building a large language model includes: Choose an open source general-purpose large language model; The open source general large language model is trained to obtain a trained open source general large language model.
3. The auxiliary lesson preparation method based on a large language model according to claim 1, characterized in that: The large language model is used to process the lesson preparation requirements input by the user to obtain lesson preparation requirements results, including: Design prompts; Use prompt to process the lesson preparation requirements input by the user and obtain the classification results; According to the classification results, judge the lesson preparation needs; If it is judged as a lesson preparation requirement, the subsequent processing steps are executed; If it is determined to be not a lesson preparation demand, the user is prompted that the demand is not related to lesson preparation.
4. The auxiliary lesson preparation method based on a large language model according to claim 1, characterized in that: The steps of constructing the knowledge base include: Determine the knowledge storage type and database selection, and store subject materials in the knowledge graph database and vector database according to data type; Build a knowledge graph database to store structured and relational subject knowledge; Build a vector database to store unstructured text information and teaching materials.
5. The auxiliary lesson preparation method based on a large language model according to claim 4, characterized in that: The step of constructing a knowledge graph database includes: Use a large language model to extract and normalize knowledge to obtain the extracted result data; The extracted result data is stored in the knowledge graph database.
6. The auxiliary lesson preparation method based on a large language model according to claim 4, characterized in that: The step of constructing a vector database includes: Extract text information; Use a pre-trained language model to transform the content in the text information to obtain a vector representation; The vector representation is stored in a vector database.
7. The auxiliary lesson preparation method based on a large language model according to claim 1, characterized in that: The step of performing a search process on the knowledge base according to the lesson preparation requirement result to obtain a search result includes: Input the lesson preparation demand results into the vector database and the knowledge graph database respectively, and obtain two search results; The search results of the two databases are summarized to obtain the final search result list.
8. An auxiliary lesson preparation device based on a large language model, characterized in that: include: The first building module is used to build a large language model; The demand processing module is used to process the lesson preparation requirements input by the user using a large language model to obtain the lesson preparation requirements results; The second building module is used to build a knowledge base; A search processing module is used to search the knowledge base according to the lesson preparation demand results to obtain search results; The lesson preparation processing module is used to use a large language model to perform lesson preparation processing on the retrieval results to obtain lesson preparation content.
9. An auxiliary lesson preparation device based on a large language model, comprising a processor and a memory storing program instructions, characterized in that: The processor is used to execute the auxiliary lesson preparation method based on a large language model as described in any one of claims 1 to 7 when running the program instructions.
Citation Information
Cited By
Course ideological and political teaching plan generation method based on large language model
CN120278127A
Teacher lesson preparation assisting method and related device based on knowledge graph and large language model
CN120561272A
Teaching text generation method and system based on natural language processing
CN120562399A
Teaching text generation method and system based on natural language processing
CN120562399B