Digital teaching resource library optimization method and system based on artificial intelligence
Through two stages of debugging the resource indexing neural network, the problem of computing resources in the existing technologies is not precise, and the more efficient teaching resource classification and retrieval are solved in the existing technologies.
Patent Information
- Application Number
- CN202411458920.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-18
- Publication Date
- 2025-01-24
- Estimated Expiration
- 2044-10-18
AI Technical Summary
The existing neural network-based teaching resource management methods consume a lot of computing resources when dealing with large-scale teaching resources and are not accurate enough in semantic understanding, resulting in inefficient resource classification and retrieval.
Two stages of debugging by resource indexing neural networks: preliminary debugging and refinement debugging. Preliminary debugging based on the semantic table of text fragments to extract the overall semantic representation of the text, refining the parameters of the correlation of the association based on the training data set.
It reduces the needs of neural networks for computing resources, improves the classification and retrieval accuracy of teaching resources, and enhances the recall rate of the network.
Smart Images

Figure CN118964965B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to an optimization method and system for a digital teaching resource library based on artificial intelligence. Background Art
[0002] With the widespread application of information technology in the field of education, the scale of digital teaching resource libraries continues to expand. Various educational institutions, online learning platforms, etc. have accumulated a large amount of teaching resources, including but not limited to textbooks, courseware, teaching cases, exercises, etc. of various subjects. These digital teaching resources are diverse in form and complex in content, which brings huge challenges to the effective management and accurate retrieval of resources.
[0003] Traditional teaching resource management methods mainly rely on manual classification and simple keyword retrieval. Manual classification has many disadvantages, such as low efficiency. As the number of resources increases, the time and labor cost required for manual classification increase exponentially. In addition, it is easy to have inaccurate classification. Different classifiers may have different understandings and classification standards of teaching resources, which will lead to confusion in resource classification and affect subsequent retrieval and utilization.
[0004] Although simple keyword search can help users find relevant resources to a certain extent, it has serious limitations. Since keywords can only reflect the surface information of the text and cannot deeply understand the semantic content of the text, the search results are often inaccurate and incomplete. For example, when a user enters a relatively broad keyword, a large number of irrelevant resources are obtained; when a professional term with a special meaning is entered, many resources that are actually relevant but do not contain the exact keyword may be missed.
[0005] In order to meet these challenges, artificial intelligence technology has been gradually introduced into teaching resource management. As one of the core technologies of artificial intelligence, neural network has powerful pattern recognition and data processing capabilities and is widely used in tasks such as classification, indexing and retrieval of teaching resources.
[0006] However, the existing teaching resource management methods based on neural networks still have many problems. On the one hand, a large amount of computing resources are required in the training process of neural networks. In order to extract the semantic features of text, many methods use complex feature extraction components. These components require extremely high computing power of hardware devices when processing large-scale teaching resources. This not only increases the cost of equipment, but also limits the application of technology in some educational scenarios with limited resources, such as schools in remote areas or small educational institutions.
[0007] On the other hand, existing neural network models are not accurate enough in processing the semantic understanding of teaching resources. Although they can classify texts to a certain extent, they perform poorly in terms of recall, that is, they cannot accurately identify all teaching resources related to the query. This is because existing models often cannot capture the semantic details in the text well, especially for complex teaching texts containing multiple semantic fragments. It is difficult for the model to fully understand its semantic content and accurately index it. Summary of the invention
[0008] In view of this, the present application provides a method and system for optimizing a digital teaching resource library based on artificial intelligence. The technical solution of the present application is implemented as follows:
[0009] On the one hand, the present application provides an artificial intelligence-based digital teaching resource library optimization method, the method comprising: based on a teaching training text resource library, performing preliminary network debugging on a resource index neural network to obtain a first resource index neural network, the teaching training text resource library comprising a plurality of teaching training text resources and a plurality of resource content labels of the teaching training text resources, the resource content labels representing the actual resource content classification of the plurality of teaching training text resources, the preliminary network debugging being used to infer the overall text semantic representation of the text based on the text segment semantic representation vector of the text; generating a plurality of training data according to the estimated resource content of the plurality of teaching training text resources by the first resource index neural network; According to the plurality of training data sets, the training data set of each teaching training text resource includes the teaching training text resource, a matching teaching training text resource and a plurality of non-matching teaching training text resources, the actual resource content classification of the matching teaching training text resource is consistent with the teaching training text resource, and the actual resource content classification of the plurality of non-matching teaching training text resources is inconsistent with the teaching training text resource; according to the plurality of training data sets, the first resource index neural network is subjected to network refinement debugging to obtain a second resource index neural network, the network refinement debugging is used to match the text segment semantic representation of the text based on the correlation between the text segment semantic representation vectors of the text in the training data set;
[0010] Wherein, the estimated resource content of the plurality of teaching training text resources by the first resource indexing neural network is used to generate a plurality of training data sets, including:
[0011] For each teaching and training text resource, on the premise that the estimated resource content of the teaching and training text resource is consistent with the actual resource content classification of the teaching and training text resource, the first resource component library of the teaching and training text resource library is arbitrarily extracted to obtain the matching teaching and training text resource, wherein the first resource component library includes a plurality of teaching and training text resources that are consistent with the actual resource content classification;
[0012] The second resource component library and the third resource component library of the teaching and training text resource library are equally extracted to obtain the plurality of non-matching teaching and training text resources, wherein the second resource component library includes a plurality of teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource contents are the actual resource content classification, and the third resource component library includes a plurality of teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource contents are not the actual resource content classification;
[0013] The teaching training text resource, the matching teaching training text resource and the multiple non-matching teaching training text resources constitute a training data set of the teaching training text resource.
[0014] On the other hand, the present application provides a computer system, including a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps in the above method when executing the program.
[0015] The beneficial effects of the present application are as follows: the optimization method and system of the digital teaching resource library based on artificial intelligence provided by the present application debugs the resource index neural network based on two processes. In the first process, the network of the resource index neural network is initially debugged according to the teaching training text resource library including multiple teaching training text resources, so that the debugged first resource index neural network can extract the overall semantic representation of the text of the teaching training text resource based on the text segment semantic representation vector of the teaching training text resource. Then, according to the first resource index neural network, the resource content classification and estimation are respectively performed on the multiple teaching training text resources, and the network refinement and debugging is performed on the first resource index neural network according to the multiple teaching training text resource sub-libraries generated by the estimated resource content, so that the debugged second resource index neural network can extract the text segment semantic representation of the teaching training text resource based on the text segment semantic representation vector of the text in the training data set, so that the overall semantic representation of the text of the teaching training text resource includes more recognizable text segments, and improves the recall rate of the network. In the debugging and application links of the neural network, the present application does not need to take too many feature extraction components to extract the text segment semantic representation of the text, which can reduce the computing power requirements of the network and save costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] Figure 1 A schematic diagram of the implementation process of an artificial intelligence-based digital teaching resource library optimization method provided in an embodiment of the present application.
[0017] Figure 2 A hardware entity diagram of a computer system provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] In order to make the purpose, technical solutions and advantages of the present application clearer, the technical solutions of the present application are further elaborated in detail below in conjunction with the drawings and embodiments. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application.
[0019] The embodiment of the present application provides a method for optimizing a digital teaching resource library based on artificial intelligence, which can be executed by a processor of a computer system. The computer system may refer to a device with data processing capabilities such as a server, a laptop, a tablet computer, a desktop computer, a mobile device, etc. Figure 1 As shown, the method includes:
[0020] Step S110: Based on the teaching and training text resource library, the resource index neural network is initially debugged to obtain a first resource index neural network. The teaching and training text resource library includes multiple teaching and training text resources and resource content labels of multiple teaching and training text resources. The resource content labels represent the actual resource content classification of multiple teaching and training text resources. The initial network debugging is used to infer the overall semantic representation of the text based on the text fragment semantic representation vector of the text.
[0021] In step S110, the teaching and training text resource library is a collection of numerous teaching and training text resources and resource content labels corresponding to these resources. The teaching and training text resources here can be various document contents related to teaching, such as the content of textbook chapters in mathematics courses, the operation guide of physical experiments and other text materials. The resource content label clearly indicates the actual resource content classification of these teaching and training text resources. For example, the mathematics textbook chapter may be marked as a specific classification such as "Algebra-Quadratic Equation", and the physical experiment operation guide may be marked as "Mechanics-Friction Experiment" and other classifications.
[0022] The resource indexing neural network is a neural network model specifically used to process text indexing tasks. The computer system uses this neural network to process multiple teaching and training text resources in the teaching and training text resource library.
[0023] Specifically, the computer system represents the text as a vector. For a text content in a teaching training text resource, the computer system converts it into a vector form so that the neural network can process it. For example, for a teaching text content about solving a quadratic equation in mathematics, the system will map each word or phrase in the text into a vector according to certain rules. This vector can represent the semantic information of the word or phrase to a certain extent.
[0024] The neural network then processes these vectors to obtain relevant representations of the text. One possible technical approach is to use word embedding technology, such as the Word2Vec model. Word2Vec learns a low-dimensional vector representation for each word by studying a large-scale text corpus. Suppose there is the word "equation" in our teaching training text, Word2Vec, for example, represents it as a 100-dimensional vector, such as [0.1, -0.2, 0.3, ...] (this is just a simple example, the actual dimension may be higher and the value depends on the model learning results).
[0025] On this basis, the computer system processes multiple teaching training text resources through a resource indexing neural network to infer the overall semantic representation of the text. In this process, the computer system considers the semantic representation vector of the text fragment (i.e., local text features). For example, in a teaching text about quadratic equations, there may be different text fragments about equation definitions, derivation of solution formulas, examples, etc. Each text fragment has its corresponding semantic representation vector. The neural network will combine the semantic representation vectors of these text fragments to infer the overall semantic representation of the entire text about the teaching content of quadratic equations.
[0026] The computer system estimates the resource content classification of these teaching and training text resources based on the processing results of the resource indexing neural network on multiple teaching and training text resources. This estimation is based on the overall semantic representation of the text obtained previously. For example, for a new teaching text, the overall semantic representation obtained after the neural network processing is very similar to the semantic representation of the teaching text previously marked as "Algebra-Quadratic Equation" under a certain metric, then the computer system will estimate this new teaching text as belonging to the resource content classification of "Algebra-Quadratic Equation".
[0027] Finally, the computer system performs preliminary debugging of the resource indexing neural network based on the estimated resource content and actual resource content classification of these teaching and training text resources. The purpose of debugging is to optimize the parameters of the neural network so that it can make more accurate classification estimates of teaching and training text resources. This debugging process uses some feasible optimization algorithms, such as the Stochastic Gradient Descent (SGD) algorithm. Assume that the parameter of the neural network is θ and the loss function is L(θ), which represents the degree of difference between the estimated resource content and the actual resource content classification. The basic formula of the stochastic gradient descent algorithm is: θ=θ-η * ∇L(θ), where η is the learning rate and ∇L(θ) is the gradient of the loss function L(θ) with respect to the parameter θ. By continuously adjusting θ, the loss function L(θ) is gradually reduced, thereby improving the accuracy of the neural network in classifying teaching and training text resources, and finally obtaining the first resource indexing neural network.
[0028] Through such a preliminary network debugging process, the computer system can preliminarily optimize the resource indexing neural network, so that it can better process and classify teaching and training text resources in subsequent operations, laying the foundation for further network refinement and debugging and other operations.
[0029] Step S120: Generate multiple training data sets based on the estimated resource content of multiple teaching training text resources by the first resource index neural network, wherein the training data set of each teaching training text resource includes a teaching training text resource, a matching teaching training text resource, and multiple non-matching teaching training text resources, wherein the actual resource content classification of the matching teaching training text resource is consistent with the teaching training text resource, and the actual resource content classification of the multiple non-matching teaching training text resources is inconsistent with the teaching training text resource.
[0030] In step S120, the first resource index neural network is a neural network obtained through preliminary debugging in step S110, which can perform a certain degree of resource content classification estimation on the teaching and training text resources. The teaching and training text resources are the basis for constructing the training data set. These resources each have actual resource content classification, and have corresponding estimated resource content after being processed by the first resource index neural network.
[0031] In this process, the computer system constructs a training data set for each teaching training text resource. A training data set includes the teaching training text resource itself, matching teaching training text resources, and multiple non-matching teaching training text resources. The actual resource content classification of the matching teaching training text resource here is consistent with the teaching training text resource currently being processed, while the actual resource content classification of the non-matching teaching training text resource is inconsistent with the teaching training text resource.
[0032] For example, suppose there is a teaching text on "Algebra-Function Concept" in the teaching and training text resource library, and its actual resource content is classified as "Algebra-Function Concept". After being processed by the first resource index neural network, the estimated resource content of this text is obtained. If the estimated resource content is also "Algebra-Function Concept", then the computer system performs an extraction operation from the resource composition library corresponding to the classification of "Algebra-Function Concept" (that is, a collection of all teaching and training text resources actually classified as "Algebra-Function Concept") to obtain matching teaching and training text resources. This extraction operation can adopt random extraction technology. For example, under the condition of satisfying certain random number generation rules, a text is selected from this resource composition library as a matching teaching and training text resource.
[0033] For the acquisition of non-matching teaching and training text resources, the computer system extracts from other resource composition libraries of different classifications. The actual resource content classification of the texts in these resource composition libraries is inconsistent with the teaching and training text resources currently being processed. The computer system can use probability-based sampling technology to implement the extraction operation. For example, suppose there are resource composition libraries A, B, C, etc., which correspond to different resource content classifications. The computer system extracts multiple texts from these resource composition libraries as non-matching teaching and training text resources according to a pre-set probability distribution. This probability distribution can be set according to actual needs, such as a uniform distribution, which means that each resource composition library has the same probability of being extracted.
[0034] When constructing a training data set, the computer system combines the teaching training text resources, the matching teaching training text resources, and a plurality of non-matching teaching training text resources. The training data set constructed in this way is of great significance for subsequent network refinement and debugging. By putting the matching teaching training text resources with the same actual resource content classification together with the current teaching training text resources, and introducing non-matching teaching training text resources with different actual resource content classifications, the neural network can better learn the differences between different classifications and the commonalities between the same classifications.
[0035] In the embodiment of the present application, in order to ensure the accuracy and effectiveness of the extraction operation, the computer system effectively manages and indexes the resource composition library. A database management system can be used to store and manage these teaching and training text resources and their corresponding resource content classification information. When performing the extraction operation, the computer system can obtain qualified text resources by querying the database.
[0036] In the process of constructing the training data set, it is also necessary to consider how to balance the number of matching teaching training text resources and non-matching teaching training text resources. If there are too many matching teaching training text resources, for example, the neural network will pay too much attention to the similarities between the same categories and ignore the differences between different categories; conversely, if there are too many non-matching teaching training text resources, for example, it will make it difficult for the neural network to accurately learn the common features of the same category. Therefore, the computer system reasonably determines the extraction ratio of matching teaching training text resources and non-matching teaching training text resources based on specific circumstances, such as the total amount of teaching training text resources, the number of resource content categories, and other factors.
[0037] For example, if the total amount of teaching training text resources is 1,000, they are divided into 10 different resource content categories, and each category has an average of 100 text resources. When constructing a training data set for a certain teaching training text resource, assuming that the number of matching teaching training text resources to be extracted is set to 5, then the number of non-matching teaching training text resources to be extracted can be determined based on the overall proportion and the situation of different resource composition libraries. If it is set that a total of 15 non-matching teaching training text resources are extracted, and they are extracted from 3 different non-matching resource composition libraries according to a uniform distribution, then each resource composition library may extract 5 non-matching teaching training text resources.
[0038] In addition, when determining the proportion of non-matching teaching training text resources extracted from different resource composition libraries, adjustments can also be made based on the semantic relevance between different categories. If the semantic relevance between certain categories is high, such as "algebra-function concept" and "algebra-function image", then when extracting non-matching teaching training text resources from the corresponding resource composition library, the extraction ratio can be appropriately reduced; while for categories with lower semantic relevance, such as "algebra-function concept" and "geometry-sum of triangle interior angles", the extraction ratio can be appropriately increased. This allows the neural network to more accurately learn the degree of difference between different categories.
[0039] Step S130: Based on multiple training data sets, the first resource indexing neural network is refined and debugged to obtain a second resource indexing neural network, wherein the network refinement and debugging is used to match the semantic representations of text fragments of the text based on the correlation between the semantic representation vectors of the text fragments in the training data sets.
[0040] In step S130, the training data set is constructed in step S120, and each set includes a teaching training text resource, a matching teaching training text resource (the actual resource content classification is the same), and multiple non-matching teaching training text resources (the actual resource content classification is different). This structure provides a rich data foundation for network refinement and debugging.
[0041] When performing network refinement and debugging, the goal of the computer system is to further optimize the performance of the first resource indexing neural network. This involves considering the correlation between the semantic representation vectors of the text segments in the training data set, and matching the semantic representations of the text segments based on this correlation, thereby improving the accuracy of the network's classification of text resource content.
[0042] For each training data set, the computer system processes the teaching training text resources, matching teaching training text resources, and multiple non-matching teaching training text resources. One of the technical means adopted by the computer system is implicit representation extraction. For example, for a teaching training text resource about "Newton's Second Law" in physical mechanics, the computer system converts this text into an implicit representation form through a specific layer structure or algorithm in the neural network. This implicit representation contains multiple text segment semantic representation vectors, each of which represents the semantic information of a segment in the text to a certain extent. Assuming that this teaching training text resource contains text segments such as the explanation of the law, formula derivation, and practical application, then each segment will have a corresponding semantic representation vector.
[0043] The computer system estimates the resource content classification and determines the error by analyzing these implicit representations. Taking mathematics teaching training text resources as an example, suppose a text is about "solving the general formula of a sequence". After the computer system extracts the implicit representation of this text, it estimates the resource content classification based on this implicit representation. If the estimation result classifies it as "series summation", but in fact it is "series general formula solution", this will produce an estimation error. This estimation error reflects the inaccuracy of the first resource index neural network in classifying the text resource in its current state.
[0044] In determining data set errors, the computer system considers the difference between the implicit representation of text segments of the teaching and training text resources and the implicit representation of text segments of the matching teaching and training text resources and non-matching teaching and training text resources. For example, for a historical teaching and training text resource about "ancient Roman civilization", its matching teaching and training text resource is also about "ancient Roman civilization", and there should be certain commonalities between their implicit representations of text segments. The computer system can measure this commonality by calculating the distance or similarity between the semantic representation vectors of their text segments. If the Euclidean distance formula is used to calculate the distance between vectors, for two vectors A=[a_1,a_2, …, a_n] and B=[b_1, b_2, …, b_n], the Euclidean distance . Smaller distances indicate higher commonality.
[0045] For non-matching teaching and training text resources, such as a text about "ancient Chinese civilization", it has a large semantic difference from the text of "ancient Roman civilization". The computer system also calculates the distance between the semantic representation vectors of their text fragments. This distance should be relatively large, indicating that the commonality between them is low. By combining these differences between the matching and non-matching teaching and training text resources, the computer system determines the data set error of the training data set. This data set error is directly related to the commonality evaluation results between the matching teaching and training text resources (the higher the commonality, the smaller the error), and is inversely related to the commonality evaluation results between the non-matching teaching and training text resources (the higher the commonality, the larger the error).
[0046] When optimizing the first resource indexing neural network, the computer system adjusts the parameters of the network based on the estimation error and the data set error. One possible optimization technique is to use the backpropagation algorithm. Assume that the loss function of the neural network is L, which is a combination of the estimation error and the data set error, for example ,in is the estimation error, is the data set error, and is the weight coefficient, which indicates the relative importance of the two in the total loss. By calculating the gradient of the loss function L for each parameter in the neural network, the parameter is updated in the direction of gradient descent. For example, for a parameter in the neural network , the update formula is ,in is the learning rate, which determines the step size of the parameter update. By continuously performing such a parameter update process based on the training data set, the computer system gradually optimizes the first resource index neural network and finally obtains the second resource index neural network.
[0047] This process is an iterative process. The computer system performs the above operations on multiple training data sets in sequence, and continuously adjusts the network parameters so that the network can better classify the content of teaching training text resources as a whole. In the whole process, the effective processing of the semantic representation vector of the text fragment and the accurate evaluation and utilization of the error are the key factors to improve the network performance. Through network refinement and debugging, the second resource indexing neural network can show better performance than the first resource indexing neural network in processing the content classification task of teaching training text resources.
[0048] In one implementation, in step S120, generating multiple training data sets based on the estimated resource content of multiple teaching training text resources by the first resource indexing neural network may specifically include:
[0049] Step S121: for each teaching and training text resource, on the premise that the estimated resource content of the teaching and training text resource is consistent with the actual resource content classification of the teaching and training text resource, arbitrarily extract the first resource component library of the teaching and training text resource library to obtain a matching teaching and training text resource, wherein the first resource component library includes a plurality of teaching and training text resources that are consistent with the actual resource content classification;
[0050] Step S122: Equally extract the second resource component library and the third resource component library of the teaching and training text resource library to obtain multiple non-matching teaching and training text resources, the second resource component library includes multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource content is the actual resource content classification, and the third resource component library includes multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource content is not the actual resource content classification;
[0051] Step S123: The teaching training text resources, the matching teaching training text resources and a plurality of non-matching teaching training text resources constitute a training data set of the teaching training text resources.
[0052] When the computer system executes step S121, it operates on each teaching and training text resource. The teaching and training text resources here are basic elements in the teaching and training text resource library, and each resource has its own estimated resource content (derived by the first resource index neural network) and actual resource content classification. The task of the computer system is to extract matching teaching and training text resources from the corresponding resource composition library under specific conditions. This specific condition is that the estimated resource content of the teaching and training text resources is consistent with the actual resource content classification. For example, suppose there is a teaching text resource about "chemistry-oxidation-reduction reaction" in the teaching and training text resource library. After being processed by the first resource index neural network, its estimated resource content is also determined to be "chemistry-oxidation-reduction reaction".
[0053] The computer system randomly extracts the first resource component library of the teaching and training text resource library to obtain matching teaching and training text resources. The first resource component library here contains multiple teaching and training text resources that are consistent with the actual resource content classification. For example, for the above-mentioned "chemistry-oxidation-reduction reaction" example, the first resource component library is a collection of all teaching text resources marked as "chemistry-oxidation-reduction reaction". When extracting, the computer system can use random sampling technology. For example, it can be implemented by using a random number generation function in a programming language combined with an index operation. Assume that the resources in this first resource component library are stored in the form of an array, and the array index ranges from 0 to n-1 (n is the total number of resources). The computer system can use a random number generation function to generate a random integer between 0 and n-1 as an index, and then select the teaching and training text resource corresponding to the index as the matching teaching and training text resource. This random extraction method can ensure the fairness and randomness of the extraction to a certain extent, so that the matching teaching and training text resources extracted each time are representative.
[0054] In step S122, the computer system performs equal opportunity extraction on the second resource component library and the third resource component library in the teaching and training text resource library, with the purpose of obtaining multiple non-matching teaching and training text resources. The actual resource content classification of these non-matching teaching and training text resources is inconsistent with the teaching and training text resources being processed. The second resource component library contains multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource content is the actual resource content classification. For example, for the teaching text resource of "Chemistry-Redox Reaction" mentioned above, although the text resources in the second resource component library are not actually the content of "Chemistry-Redox Reaction", they are mistakenly estimated as "Chemistry-Redox Reaction" by the first resource index neural network. The third resource component library includes multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource content is not the actual resource content classification. Continuing with "Chemistry-Redox Reaction" as an example, the text resources in the third resource component library are neither the actual content of "Chemistry-Redox Reaction" nor are they estimated as "Chemistry-Redox Reaction" by the first resource index neural network.
[0055] The computer system adopts an equal chance extraction method. For example, if expressed in terms of probability, the second resource library and the third resource library are given the same probability of being extracted. Assuming that there are m resources in the second resource library and k resources in the third resource library, the probability of extracting a resource from the second resource library is 1 / (m+k), and the probability of extracting a resource from the third resource library is also 1 / (m+k).
[0056] In specific implementation, the total number of resources N=m+k of the two resource libraries can be calculated first, and then a random number generation function can be used to generate a random number between 1 and N. If this random number is less than or equal to m, it is extracted from the second resource library; if it is greater than m, it is extracted from the third resource library. Repeat this process until a sufficient number of non-matching teaching and training text resources are extracted. For example, if 5 non-matching teaching and training text resources need to be extracted, the computer system will repeat the extraction operation according to the above rules until 5 resources are obtained.
[0057] In step S123, after the computer system completes the extraction of matching teaching training text resources in step S121 and the extraction of non-matching teaching training text resources in step S122, the teaching training text resources, matching teaching training text resources and multiple non-matching teaching training text resources constitute the training data set of the teaching training text resources. This training data set is of great significance for the subsequent network refinement and debugging (such as step S130). Taking a teaching training text resource about "biology-cellular respiration" as an example, its training data set includes itself ("biology-cellular respiration"), matching teaching training text resources extracted from the first resource composition library (also about "biology-cellular respiration"), and non-matching teaching training text resources extracted from the second and third resource composition libraries (for example, about "biology-photosynthesis" or other biological-related but not "cellular respiration" content).
[0058] The training data set constructed in this way can provide rich information for the first resource indexing neural network. In the subsequent network refinement and debugging, the neural network can better learn how to accurately distinguish different resource content classifications by analyzing different types of resources in the training data set. For example, by comparing the similarities between the teaching and training text resources of "Biology-Cellular Respiration" and the matching teaching and training text resources, as well as the differences between the teaching and training text resources and non-matching teaching and training text resources, the neural network can adjust its own parameters to improve the accuracy of resource content classification.
[0059] In terms of data storage, the training data set can be stored in a specific data structure. For example, the teaching training text resources, matching teaching training text resources, and non-matching teaching training text resources can be stored as different fields in the structure or different attributes of the object in the form of a structure or object. This makes it convenient to access and process the training data set in subsequent steps.
[0060] In another implementation, step S120, generating multiple training data sets according to the estimated resource content of multiple teaching training text resources by the first resource indexing neural network, may include:
[0061] Step S120A: For each teaching and training text resource, on the premise that the estimated resource content of the teaching and training text resource is inconsistent with the actual resource content classification of the teaching and training text resource, arbitrarily extract the fourth resource composition library of the teaching and training text resource to obtain a matching teaching and training text resource, the fourth resource composition library including a plurality of teaching and training text resources whose classification is consistent with the actual resource content classification and whose estimated resource content is the actual resource content classification;
[0062] Step S120B: Equally extract the second resource component library, the fifth resource component library, and the sixth resource component library of the teaching and training text resource library to obtain multiple non-matching teaching and training text resources, the second resource component library includes multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource content is the actual resource content classification, the fifth resource component library includes multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource content is the set resource content classification, and the sixth resource component library includes multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource content is neither the actual resource content classification nor the set resource content classification;
[0063] Step S120C: The teaching training text resources, the matching teaching training text resources and a plurality of non-matching teaching training text resources constitute a training data set of the teaching training text resources.
[0064] In step S120A, the computer system operates for each teaching and training text resource. In the entire teaching and training text resource library, each teaching and training text resource has its own unique attributes, including the actual resource content classification and the estimated resource content obtained by the first resource indexing neural network. This step is performed under a specific prerequisite, that is, the estimated resource content of the teaching and training text resource is inconsistent with the actual resource content classification.
[0065] The computer system arbitrarily extracts the fourth resource component library of the teaching and training text resources to obtain matching teaching and training text resources. The fourth resource component library here contains multiple teaching and training text resources that are consistent with the actual resource content classification and whose estimated resource content is the actual resource content classification. For example, suppose there is a teaching text resource about "physics-electromagnetic induction" in the teaching and training text resource library, and its actual classification is "physics-electromagnetic induction", but it is estimated to be other content (such as "physics-electric field") after the first resource indexing neural network. The fourth resource component library is a collection of teaching text resources that truly belong to "physics-electromagnetic induction" and are correctly estimated to be "physics-electromagnetic induction".
[0066] When extracting matching teaching and training text resources, the computer system can adopt a random extraction method. In an embodiment of the present application, if the teaching and training text resources in the fourth resource composition library are stored in a certain data structure, such as array storage, the computer system can use a random number generation function to achieve random extraction. For example, if the resource index in the fourth resource composition library ranges from 0 to n-1 (n is the total number of resources), the computer system generates a random integer between 0 and n-1 as an index, thereby selecting the corresponding teaching and training text resource as the matching teaching and training text resource. This random extraction method ensures the fairness and randomness of the extraction, so that the extracted matching teaching and training text resources are representative and can provide valid data for the subsequent construction of the training data set.
[0067] In step S120B, the computer system performs equal opportunity extraction on the second resource component library, the fifth resource component library, and the sixth resource component library of the teaching and training text resource library to obtain multiple non-matching teaching and training text resources. First, the second resource component library contains multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource content is the actual resource content classification. For example, for the teaching text resource of "physics-electromagnetic induction" mentioned above, the text resource in the second resource component library is actually not "physics-electromagnetic induction", but is estimated to be "physics-electromagnetic induction".
[0068] The fifth resource composition library includes a plurality of teaching and training text resources whose resource content is inconsistent with the actual resource content classification and whose estimated resource content is the set resource content classification. Assuming that the set resource content classification is "physics-optics", the teaching and training text resources in the fifth resource composition library are actually not "physics-electromagnetic induction" and are estimated to be "physics-optics".
[0069] The sixth resource component library contains multiple teaching and training text resources that are inconsistent with the actual resource content classification and the estimated resource content is not the actual resource content classification and the set resource content classification. For example, for the teaching text resource of "Physics-Electromagnetic Induction", the text resources in the sixth resource component library are neither "Physics-Electromagnetic Induction" nor are they estimated to be the set resource content classification mentioned above ("Physics-Optics"), but are estimated to be teaching text resources of other contents (such as "Physics-Thermal").
[0070] The computer system adopts an equal chance extraction method. From a probability perspective, it gives the second resource pool, the fifth resource pool, and the sixth resource pool the same probability of being extracted. Assuming that there are m resources in the second resource pool, p resources in the fifth resource pool, and q resources in the sixth resource pool, the probability of extracting a resource from each resource pool is 1 / (m+p+q).
[0071] In specific implementation, the computer system can first calculate the total number of resources N=m+p+q of the three resource libraries. Then, the computer system uses a random number generation function to generate a random number between 1 and N. If this random number is less than or equal to m, it is extracted from the second resource library; if this random number is greater than m and less than or equal to m+p, it is extracted from the fifth resource library; if this random number is greater than m+p, it is extracted from the sixth resource library. By repeating this process continuously, the computer system can extract a sufficient number of non-matching teaching and training text resources. For example, if 10 non-matching teaching and training text resources need to be extracted, the computer system will continue to perform extraction operations according to the above rules until 10 resources are obtained. This equal opportunity extraction method can ensure that the non-matching teaching and training text resources extracted from different types of resource libraries are balanced, which helps to provide comprehensive information when constructing the training data set in the future.
[0072] In step S120C, the computer system forms a training data set of the teaching training text resource with the teaching training text resource, the matching teaching training text resource and a plurality of non-matching teaching training text resources. For example, for the teaching text resource of "physics-electromagnetic induction" mentioned above, the training data set includes itself (the resource of "physics-electromagnetic induction" but with wrong estimation), the matching teaching training text resource extracted from the fourth resource composition library (the resource that truly belongs to "physics-electromagnetic induction" and is correctly estimated), and the non-matching teaching training text resource extracted from the second resource composition library, the fifth resource composition library and the sixth resource composition library (resources that belong to the non-"physics-electromagnetic induction" in different situations mentioned above).
[0073] The training data set constructed in this way is of vital importance for the subsequent network refinement and debugging of the first resource indexing neural network (such as step S130). In this training data set, the relationship between the teaching training text resources and the matching teaching training text resources and the differences between the teaching training text resources and the non-matching teaching training text resources can provide the neural network with rich information to adjust its internal parameters. For example, by analyzing the data in the training data set, the neural network can better learn how to distinguish the boundaries between different resource content classifications. When faced with a new teaching text resource, the neural network can more accurately estimate its resource content classification based on the patterns learned in this training data set.
[0074] In terms of data storage, the computer system can use a specific data structure to store this training data set. For example, a multi-layer nested data structure can be used, with the teaching training text resource as an element in the outermost layer, the matching teaching training text resource as a sub-layer element, and multiple non-matching teaching training text resources as another sub-layer element. Such a storage structure facilitates access to and processing of each element in the training data set in subsequent operations. At the same time, in order to facilitate management and operation, the computer system can add corresponding tags to each element, such as marking the original index of the teaching training text resource, the source of the matching teaching training text resource (i.e., from which resource composition library), and the source of the non-matching teaching training text resource. This helps to clearly track and utilize the information in the training data set in the subsequent neural network training process, and improve the training effect and accuracy of the neural network.
[0075] In one implementation, step S130, performing network refinement and debugging on the first resource index neural network according to multiple training data sets to obtain the second resource index neural network, may specifically include:
[0076] Step S131: for any training data set, according to the first resource indexing neural network, the teaching training text resource, the matching teaching training text resource and the multiple non-matching teaching training text resources are respectively subjected to implicit representation extraction, and the text segment implicit representation of the teaching training text resource, the text segment implicit representation of the matching teaching training text resource and the text segment implicit representation of the multiple non-matching teaching training text resources are obtained, and the text segment implicit representation includes multiple text segment semantic representation vectors;
[0077] Step S132: performing resource content classification estimation on the teaching and training text resource according to the implicit representation of the text segment of the teaching and training text resource, and obtaining the estimation error of the teaching and training text resource;
[0078] Step S133: determining a data set error of the training data set according to a difference between an implicit representation of a text segment of the teaching training text resource and an implicit representation of a text segment of a matching teaching training text resource and a difference between an implicit representation of a text segment of the teaching training text resource and an implicit representation of a text segment of a plurality of non-matching teaching training text resources;
[0079] Step S134: Optimize the first resource indexing neural network according to the estimation error and the data set error to obtain the second resource indexing neural network.
[0080] In step S131, the computer system operates on any training data set. In the previous steps, a training data set including teaching training text resources, matching teaching training text resources and multiple non-matching teaching training text resources has been constructed. These resources need to be converted into a form that is more suitable for analysis and processing during the processing of the neural network. This is the purpose of implicit representation extraction. Implicit representation can mine deep semantic information in the text, thereby helping the neural network to better understand the characteristics of the text in order to perform subsequent operations such as classification.
[0081] The computer system extracts implicit representations of the teaching training text resources, matching teaching training text resources, and multiple non-matching teaching training text resources according to the first resource index neural network. For example, for a teaching training text resource about "history-ancient civilization communication", the computer system inputs it into the first resource index neural network, and the neural network processes the text through a series of layer structures and algorithms.
[0082] In an embodiment of the present application, the neural network includes structures such as a convolution layer, a pooling layer, and a fully connected layer. In the convolution layer, the convolution kernel performs a convolution operation on the vector representation of the text (for example, the representation after conversion through the word vector) to extract local features. Assume that the text vector is represented as a two-dimensional matrix (where the rows represent word vectors and the columns represent a dimension of the text, such as position information, etc.), and the convolution kernel slides on this matrix to perform convolution calculations. For example, a 3×3 convolution kernel slides on this matrix from the upper left corner, and each time the sum of the products of the elements in the 3×3 window and the corresponding elements of the convolution kernel is calculated to obtain a new value, thereby extracting local text features.
[0083] After the convolution layer, the pooling layer performs dimensionality reduction operations, such as maximum pooling, which selects the maximum value in the local area as the representative value, further reducing the amount of data and retaining important features. Finally, the fully connected layer integrates the previously obtained features and outputs an implicit representation. This implicit representation contains multiple text segment semantic representation vectors, each of which represents the semantic information of a segment in the text to a certain extent. For the teaching and training text resource "History-Ancient Civilization Exchange", for example, there are semantic representation vectors corresponding to text segments about different civilization exchange events (such as Silk Road trade, cultural envoy exchanges, etc.).
[0084] The same operation is also applied to matching teaching and training text resources and multiple non-matching teaching and training text resources. For example, if the matching teaching and training text resources are also about "history-ancient civilization communication", after the same neural network processing, the implicit representation is obtained, and the semantic representation vector of the text fragments in it will also be related to different text fragments under this topic; for non-matching teaching and training text resources, such as about "history-modern wars", the semantic representation vector of the text fragments in its implicit representation will be related to various aspects of modern wars (such as the cause of the war, the course of the battle, etc.).
[0085] In step S132, the computer system performs resource content classification estimation on the teaching and training text resource according to the implicit representation of the text segment of the teaching and training text resource obtained in step S131. The implicit representation of the text segment contains semantic feature vectors of various parts of the teaching and training text resource, and these vectors can reflect the semantic information of the entire text when combined.
[0086] For example, for the teaching and training text resource mentioned above about "history-communication of ancient civilizations", the vector in the implicit representation of its text fragment may contain semantic information related to trade, cultural communication, personnel exchanges, etc. The computer system compares this implicit representation with the previously learned models for classifying the content of different resources (these models are also built based on a large number of teaching and training text resources and their classification). Suppose there is a classification model about "history-communication of ancient civilizations" and a classification model about "history-ancient political system".
[0087] The computer system can make an estimate by calculating the distance or similarity between the implicit representation and the two classification models. One feasible method is to calculate the cosine similarity. For the implicit representation vector A=[a_1, a_2, …, a_n] of the teaching training text resource and the vector B=[b_1, b_2, …, b_n] of the "history-ancient civilization communication" classification model, the cosine similarity If the cosine similarity value is high, it indicates that the teaching training text resource is more likely to belong to the category of "History-Ancient Civilization Communication".
[0088] The computer system compares the estimated resource content classification with the actual resource content classification of the teaching and training text resources to determine the estimation error. Continuing with the above example, if the actual resource content classification is "History-Ancient Civilization Exchange" and the estimated result is also "History-Ancient Civilization Exchange", then the estimation error is 0. However, if the estimated result is "History-Ancient Political System", an estimation error is generated. This estimation error reflects the inaccuracy of the first resource index neural network in the classification of the teaching and training text resources in the current state, and it will serve as one of the important bases for the subsequent optimization of the neural network.
[0089] In step S133, the computer system determines the data set error of the training data set according to the difference between the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of the matching teaching training text resource and the difference between the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of multiple non-matching teaching training text resources. This data set error can reflect the relationship between the relationship between each element in the training data set and the connection between the classification accuracy of the neural network.
[0090] Taking the teaching and training text resources of "History-Ancient Civilization Exchange" as an example, assuming that the matching teaching and training text resources are also about "History-Ancient Civilization Exchange", their implicit representations of text fragments should have a high similarity. For example, the implicit representation vectors of text fragments about trade may be relatively close. For non-matching teaching and training text resources, such as content about "History-Modern Wars", there should be a big difference between the implicit representation of text fragments and the teaching and training text resources of "History-Ancient Civilization Exchange". For example, the implicit representation vectors of text fragments in military terms, war-related concepts, etc. are very different from those related to ancient civilization exchanges.
[0091] The computer system determines the data set error by quantifying these differences. If the difference between the matching teaching training text resource and the teaching training text resource is small, it means that the neural network performs well in identifying texts of the same category; if the difference between the non-matching teaching training text resource and the teaching training text resource is large, it also means that the neural network performs well in distinguishing texts of different categories, so the data set error should be small. Conversely, if there is a mismatch, such as the difference between the matching teaching training text resource and the teaching training text resource is large, or the difference between the non-matching teaching training text resource and the teaching training text resource is small, then the data set error will be large. This calculation of the data set error helps the computer system evaluate the performance of the current neural network and provide an accurate basis for subsequent optimization operations.
[0092] Computer systems can use a variety of techniques to quantify these differences. One approach is to calculate a distance metric between vectors, such as the Euclidean distance. For two vectors A=[a_1, a_2, …, a_n] and B=[b_1, b_2, …, b_n], the Euclidean distance The computer system may calculate the Euclidean distance between the teaching training text resource and the implicit representation vector of the text segment that matches the teaching training text resource, and the Euclidean distance between the teaching training text resource and the implicit representation vector of the text segment of each non-matching teaching training text resource.
[0093] At the same time, when determining the data set error, it is also necessary to consider the weights of different distance metrics in the overall error calculation. For example, the weight can be determined based on the ratio of the number of matching teaching training text resources and non-matching teaching training text resources in the training data set. If the number of matching teaching training text resources is large, then the weight of the difference between them and the teaching training text resources in the data set error calculation can be relatively large; if the number of non-matching teaching training text resources is large, then the weight of the difference between them and the teaching training text resources in the data set error calculation will also be adjusted accordingly. This can more accurately reflect the impact of each element in the training data set on the performance of the neural network, thereby more reasonably determining the data set error.
[0094] In step S134, the estimation error reflects the inaccuracy of the first resource indexing neural network in classifying and estimating a single teaching and training text resource. For example, in a teaching and training text resource about "mathematics-geometry proof", if the estimated resource content classification is "mathematics-algebraic operation" and it is actually "mathematics-geometry proof", then an estimation error is generated. This error indicates that the neural network has problems in distinguishing these two different mathematical content classifications.
[0095] The data set error considers the performance of the neural network reflected by the relationship between the teaching training text resources and the matching teaching training text resources and the non-matching teaching training text resources from the perspective of the entire training data set. Taking the history subject as an example, suppose there is a teaching training text resource about "ancient civilization communication", its matching teaching training text resource is also about "ancient civilization communication", and the non-matching teaching training text resource is about "modern war". If the data set error is large, it means that the neural network is insufficient in identifying the difference between "ancient civilization communication" and other content classifications.
[0096] When optimizing the first resource index neural network, the computer system may use a gradient-based optimization algorithm, such as stochastic gradient descent (SGD). Assume that the parameters of the neural network are , the loss function L is a combination of the prediction error and the data set error. For example, ,in is the estimation error, is the data set error, and is a weight coefficient used to adjust the relative importance of the estimation error and the data set error in the total loss.
[0097] During the optimization process, the computer system first calculates the loss function L with respect to the neural network parameters Gradient L( ). For a simple linear neural network layer, assume that the output y = x+b (x is the input, b is the bias term), if the mean square error (MSE) is used as the loss function ( is the true value), then .
[0098] Then, according to the stochastic gradient descent algorithm, the parameters of the neural network are updated , the formula is ,in is the learning rate, which determines the step size of parameter updates. For example, if =[0.5,0.3], , learning rate =0.01, then the updated .
[0099] By continuously calculating the estimated error and data set error based on the new training data set, and then updating the parameters of the neural network, the computer system gradually optimizes the performance of the first resource indexing neural network. This process is iterative, and each iteration makes the neural network more accurate in processing the classification task of teaching training text resources. As the number of iterations increases, the parameters of the neural network are continuously adjusted, so that its ability to distinguish between different resource content classifications is gradually enhanced, and finally the optimized second resource indexing neural network is obtained. This optimized neural network can better adapt to the classification task of teaching training text resources and provide more accurate results for subsequent indexing and application.
[0100] In one implementation, step S133, determining the data set error of the training data set according to the difference between the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of the matching teaching training text resource and the difference between the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of multiple non-matching teaching training text resources, may specifically include:
[0101] Step S1331: determining a first difference metric according to the implicit representation of the text segment of the teaching and training text resource and the implicit representation of the text segment of the matching teaching and training text resource, wherein the first difference metric represents a commonality evaluation result between the teaching and training text resource and the matching teaching and training text resource;
[0102] Step S1332: for any non-matching teaching and training text resource, determine a second difference metric based on the implicit representation of the text segment of the teaching and training text resource and the implicit representation of the text segment of the non-matching teaching and training text resource, wherein the second difference metric represents the commonality evaluation result between the teaching and training text resource and the non-matching teaching and training text resource;
[0103] Step S1333: Determine a data set error based on the first difference metric and the second difference metric, wherein the data set error is directly associated with the first difference metric and the data set error is inversely associated with the second difference metric.
[0104] In step S1331, the purpose of the computer system executing step S1331 is to determine a first difference metric based on the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of the matching teaching training text resource. This first difference metric characterizes the commonality evaluation result between the teaching training text resource and the matching teaching training text resource. By quantifying this commonality, the computer system can better understand the performance of the neural network when processing texts of the same resource content classification, thereby providing a basis for determining the error of the training data set.
[0105] After the previous processing, the teaching training text resources and the matching teaching training text resources have their own implicit representations of text fragments, which contain multiple text fragment semantic representation vectors. For example, assuming that the teaching training text resource is about "biology-cell structure", the vectors in its text fragment implicit representation may correspond to different structural parts of the cell, such as the nucleus, cytoplasm, cell membrane and other related semantic information. The matching teaching training text resource is also about "biology-cell structure", and its text fragment implicit representation also contains similar semantic representation vectors related to cell structure.
[0106] In order to determine the first difference measure, the computer system needs to process these vectors. A feasible technical means is to calculate the distance or similarity measure between the vectors. For example, methods such as cosine similarity or Euclidean distance can be used.
[0107] If cosine similarity is used, for a vector A=[a_1, a_2, …, a_n] in the implicit representation of a text segment of a teaching training text resource and a vector B=[b_1, b_2, …, b_n] in the implicit representation of a text segment of a matching teaching training text resource, the cosine similarity The closer this value is to 1, the closer the directions of the two vectors are, that is, the more similar the semantics of the two texts are in this text segment.
[0108] If we use Euclidean distance, for the same vectors A and B, the Euclidean distance The smaller this value is, the closer the two vectors are, that is, the smaller the semantic difference between the two texts in this text segment is.
[0109] The computer system calculates this distance or similarity measure for the vectors in the implicit representation of all text fragments of the teaching training text resource and the matching teaching training text resource, and then combines these results to determine the first difference measure. For example, the average value or weighted average value of the cosine similarity of all vectors can be calculated as the first difference measure. If the average value is high (close to 1), it means that the commonality between the teaching training text resource and the matching teaching training text resource is high on the whole, that is, the neural network performs better in this training data set when processing texts of the same category; if the average value is low, it means that the commonality between the two is low, which may mean that the neural network has some problems in recognizing texts of the same category.
[0110] In step S1332, the computer system operates on any non-matching teaching training text resource in step S1332. The significance of this step is to further analyze the performance of the neural network in distinguishing texts of different resource content classifications by determining the commonality evaluation results (second difference metric) between the teaching training text resource and the non-matching teaching training text resource. Corresponding to the processing of the matching teaching training text resource in step S1331, the difference between the teaching training text resource and the non-matching teaching training text resource is examined in detail here.
[0111] Assuming that the teaching training text resource is about "geography-mountain terrain", the vector in the implicit representation of its text fragment contains semantic information related to the height, direction, geological structure, etc. of the mountain. The non-matching teaching training text resource is about "geography-river ecology", and the vector in the implicit representation of its text fragment contains semantic information related to the flow, flow rate, aquatic life, etc. of the river.
[0112] The computer system determines a text segment semantic representation vector (third text segment semantic representation vector) in the non-matching teaching and training text resource that has the smallest difference from the teaching and training text resource based on a difference measure between multiple text segment semantic representation vectors in the implicit representation of the text segment of the non-matching teaching and training text resource and a vector in the implicit representation of the text segment of the teaching and training text resource (for example, a representative vector involved in determining the first difference measure previously).
[0113] Similarly, the difference metric can be calculated using methods such as Euclidean distance or cosine similarity. If Euclidean distance is used, for a vector A=[a_1, a_2, …, a_n] of a teaching training text resource and a vector C=[c_1, c_2, …, c_n] of a non-matching teaching training text resource, calculate The computer system calculates the Euclidean distance between each vector in the non-matching teaching training text resource and the representative vector of the teaching training text resource, and then finds the vector with the smallest distance as the semantic representation vector of the third text segment.
[0114] The difference measure between the semantic representation vector of the third text segment and the representative vector of the teaching training text resource is the second difference measure. This measure reflects the degree of difference between the teaching training text resource and the non-matching teaching training text resource in a certain closest semantic segment. If this value is small, it means that the difference between texts of different categories is not obvious enough in this local area, which may suggest that the neural network has difficulty in distinguishing these two different categories of text; if this value is large, it means that the difference between texts of different categories is relatively obvious in this local area, which is a manifestation of the neural network's good ability to distinguish texts of different categories.
[0115] In step S1333, the computer system determines the data set error based on the first difference metric and the second difference metric. The data set error is directly associated with the first difference metric and inversely associated with the second difference metric. This means that when the first difference metric indicates that the commonality between the teaching training text resource and the matching teaching training text resource is high (for example, the value of the first difference metric is close to 1, such as when the cosine similarity metric is used), the data set error should be small, because this indicates that the neural network performs better when processing texts of the same classification.
[0116] On the contrary, when the second difference metric indicates that the commonality between the teaching training text resources and the non-matching teaching training text resources is higher (for example, the value of the second difference metric is smaller, such as the distance is closer when the Euclidean distance metric is used), the data set error should be larger because it means that the neural network performs worse in distinguishing texts of different categories.
[0117] One way to construct the data set error can be through a simple formula. For example, let the first difference metric be D_1, the second difference metric be D_2, and the data set error E_d=1-D_1+D_2. Here, the 1-D_1 part reflects the impact of the commonality with the matching teaching and training text resources on the data set error, and the D_2 part reflects the impact of the commonality with the non-matching teaching and training text resources on the data set error.
[0118] Another possible way is to use a weighted method. Let w_1 and w_2 be the weights of the first difference metric and the second difference metric respectively, and the data set error E_d=w_1(1-D_1)+ w_2D_2. The weights w_1 and w_2 can be set according to the characteristics of the training data set. For example, if the number of matching teaching training text resources is large, then w_1 can be set larger; if the number of non-matching teaching training text resources is large, w_2 can be set larger. In this way, the data set error can be determined more flexibly according to the specific situation of the training data set, thereby more accurately reflecting the performance of the neural network when processing this training data set.
[0119] In practical applications, the computer system evaluates the performance of the first resource index neural network on the training data set based on the determined data set error, thereby providing a basis for subsequent neural network optimization (such as step S134). If the data set error is large, it means that the neural network needs to further adjust parameters to improve the classification accuracy on this training data set; if the data set error is small, it means that the neural network performs well on this training data set, but may still need to continue to optimize to improve the performance on other training data sets or the overall data.
[0120] In one implementation, step S1331, determining a first difference metric according to an implicit representation of a text segment of a teaching and training text resource and an implicit representation of a text segment of a matching teaching and training text resource, may specifically include:
[0121] Step S13311: performing absolute value penalties on the implicit representation of text segments of the teaching and training text resources and the implicit representation of text segments that match the teaching and training text resources, respectively, to obtain a first text segment semantic representation vector set and a second text segment semantic representation vector set, wherein the first text segment semantic representation vector set includes multiple text segment semantic representation vectors of the teaching and training text resources, and the second text segment semantic representation vector set includes multiple text segment semantic representation vectors that match the teaching and training text resources;
[0122] Step S13312: according to the difference measure between the multiple text segment semantic representation vectors in the first text segment semantic representation vector set and the multiple text segment semantic representation vectors in the second text segment semantic representation vector set, the first text segment semantic representation vector is determined in the teaching training text resource, and the second text segment semantic representation vector is determined in the matching teaching training text resource, and the difference measure between the first text segment semantic representation vector and the second text segment semantic representation vector is closest;
[0123] Step S13313: Determine the difference measure between the first text segment semantic representation vector and the second text segment semantic representation vector as a first difference measure.
[0124] In step S13311, the purpose of the computer system executing step S13311 is to perform absolute value penalties on the implicit representations of text segments of the teaching and training text resources and the implicit representations of text segments that match the teaching and training text resources, respectively, so as to obtain a first text segment semantic representation vector set and a second text segment semantic representation vector set. When processing the implicit representations of text segments of the teaching and training text resources and the matching teaching and training text resources, the vectors in these representations may have different value ranges and distributions. The absolute value penalty operation helps to adjust the value of the vector to a range that is more suitable for difference metric calculations, and can highlight the absolute value information of the elements in the vector, so as to more accurately determine the difference in the semantic representation vector between the two texts later.
[0125] Assume that the teaching training text resource is about "Literature-Classical Novel Analysis", and its text segment implicit representation contains multiple text segment semantic representation vectors. For example, one of the vectors may be related to the characterization of the novel, and this vector is assumed to be A=[-0.3, 0.5, -0.1, …]. The matching teaching training text resource is also about "Literature-Classical Novel Analysis", and the corresponding text segment semantic representation vector may be B=[0.2, -0.4, 0.3, …].
[0126] The computer system performs an absolute value penalty operation on vector A. For each element a_i in vector A, the element after the absolute value penalty Then the vector A' after the absolute value penalty becomes [0.3, 0.5, 0.1,…]. Similarly, for vector B, the vector B' after the absolute value penalty becomes [0.2, 0.4, 0.3, …].
[0127] Through this absolute value penalty operation, the computer system obtains a first text segment semantic representation vector set (including all text segment semantic representation vectors of the processed teaching training text resources) and a second text segment semantic representation vector set (including all text segment semantic representation vectors of the processed matching teaching training text resources). The vectors in these sets can more effectively reflect the semantic relationship between texts in subsequent difference metric calculations.
[0128] In the embodiment of the present application, this absolute value penalty operation is relatively easy to implement in programming. It can be done by simply looping through each element in the vector and taking its absolute value. The potential significance of this operation is that it can eliminate the interference of the positive and negative signs of the elements in the vector on the difference metric calculation to a certain extent. For example, in some difference metric calculation methods, such as Euclidean distance calculation, if the vector elements are not processed, the positive and negative signs, for example, affect the final distance value, and the vector after the absolute value penalty can more purely reflect the size information of the elements, thereby more accurately measuring the difference between the two vectors, and then better characterizing the semantic relationship between the teaching and training text resources and the matching teaching and training text resources.
[0129] In step S13312, the computer system determines the first text segment semantic representation vector in the teaching and training text resource and determines the second text segment semantic representation vector in the matching teaching and training text resource based on the difference measure between the multiple text segment semantic representation vectors in the first text segment semantic representation vector set and the multiple text segment semantic representation vectors in the second text segment semantic representation vector set. The purpose of this operation is to find a pair of vectors with the closest difference measure in the vector set of the two text resources after absolute value penalty. By finding this pair of vectors, the local semantic similarity between the teaching and training text resource and the matching teaching and training text resource can be determined more specifically, providing a key basis for the subsequent calculation of the first difference measure.
[0130] For each vector in the first text segment semantic representation vector set (where i represents the index of the vector in the set) and each vector in the second text segment semantic representation vector set , the computer system can use Euclidean distance to calculate the difference metric. The Euclidean distance formula is .
[0131] For example, suppose there are three vectors A'_1, A'_2, A'_3 in the first text segment semantic representation vector set, and there are three vectors B'_1, B'_2, B'_3 in the second text segment semantic representation vector set. The computer system calculates the Euclidean distances d(A'_1, B'_1), d(A'_1, B'_2), d(A'_1, B'_3), d(A'_2, B'_1), d(A'_2, B'_2), d(A'_2, B'_3), d(A'_3, B'_1), d(A'_3, B'_2), d(A'_3, B'_3), respectively.
[0132] Then, the computer system finds the group with the smallest distance from these calculation results, assuming that d(A'_2, B'_1) is the smallest. Then the corresponding vector A'_2 in the teaching training text resource is determined as the semantic representation vector of the first text segment, and the corresponding vector B'_1 in the matching teaching training text resource is determined as the semantic representation vector of the second text segment. This pair of vectors has the smallest difference measure among all possible vector combinations, which means that in these two text resources, the text segments represented by these two vectors are the most semantically similar local parts.
[0133] Determining this pair of vectors (the first text segment semantic representation vector and the second text segment semantic representation vector) is very important for the subsequent calculation of the first difference measure. Because the first difference measure is intended to characterize the commonality evaluation results between the teaching and training text resources and the matching teaching and training text resources, and finding the most similar local parts of the two text resources (represented by this pair of vectors) is a key link in evaluating the commonality. In this way, starting from the most similar local parts, we can gradually build an evaluation of the commonality between the entire text resources, making the calculation of the first difference measure more accurate and targeted.
[0134] In step S13313, the computer system determines the difference measure between the first text segment semantic representation vector and the second text segment semantic representation vector as the first difference measure in step S13313. This first difference measure represents the commonality evaluation result between the teaching and training text resource and the matching teaching and training text resource. Through the previous steps, a pair of vectors with the closest difference measure in the two text resources has been found. The difference measure between this pair of vectors can reflect the difference between the two texts in the most similar local parts to a certain extent, and can then serve as an important reference for the commonality between the entire text resources.
[0135] Let's continue with the above teaching training text resources and matching teaching training text resources about "Literature-Classical Novel Analysis". Assume that the semantic representation vector of the first text segment A'_2=[0.3, 0.5, 0.1] and the semantic representation vector of the second text segment B'_1=[0.2, 0.4, 0.3] are determined. If the Euclidean distance is used as the difference metric and calculated, (The calculation result is a specific value, assuming it is 0.14), and this 0.14 is determined as the first difference metric.
[0136] The smaller the value of this first difference measure is, the smaller the difference between the most similar local parts (text segments represented by these two vectors) found in the two text resources is, which suggests to some extent that the entire teaching training text resource and the matching teaching training text resource may have a high commonality. On the contrary, if this value is large, it means that there are large differences even in the most similar local parts, so the commonality between the entire text resources may be low.
[0137] The first difference metric provides an important basis for the subsequent determination of the error of the training data set (such as in step S1333). It is directly related to the error of the training data set and is a key indicator for evaluating the performance of the neural network when processing texts of the same category. If the value of the first difference metric meets expectations (for example, during the training process, it is hoped that the value of this metric between texts of the same category is smaller), it means that the neural network is relatively accurate in grasping this local similarity when identifying texts of the same category; if it does not meet expectations, it may be necessary to adjust the neural network, such as adjusting the parameters of the network or improving the method of text representation.
[0138] In one implementation, step S1332, for any non-matching teaching and training text resource, determining a second difference metric according to the implicit representation of a text segment of the teaching and training text resource and the implicit representation of a text segment of the non-matching teaching and training text resource, may specifically include:
[0139] Step S13321: for any non-matching teaching training text resource, according to the difference measure between multiple text segment semantic representation vectors in the text segment implicit representation of the non-matching teaching training text resource and the first text segment semantic representation vector, a third text segment semantic representation vector is determined in the non-matching teaching training text resource, and the difference measure between the third text segment semantic representation vector and the first text segment semantic representation vector is the smallest;
[0140] Step S13322: Determine the difference measure between the first text segment semantic representation vector and the third text segment semantic representation vector as the second difference measure.
[0141] In step S13321, the purpose of the computer system executing step S13321 is to determine a third text segment semantic representation vector in the non-matching teaching training text resource for any non-matching teaching training text resource based on the difference measure between multiple text segment semantic representation vectors in its text segment implicit representation and the first text segment semantic representation vector determined in step S13312 (the vector comes from the teaching training text resource). This third text segment semantic representation vector is the vector with the smallest difference from the first text segment semantic representation vector of the teaching training text resource in the non-matching teaching training text resource. Determining this vector helps the computer system to more accurately measure the difference relationship between the teaching training text resource and the non-matching teaching training text resource, providing a key basis for the subsequent calculation of the second difference measure, and then evaluating the performance of the neural network in distinguishing texts of different resource content classifications.
[0142] Assume that the teaching training text resource is about "Physics-Electrical Basics", and the first text segment semantic representation vector (determined by the previous step) in its text segment implicit representation is A=[0.3, -0.2, 0.1]. The non-matching teaching training text resource is about "Physics-Mechanics Principles", and its text segment implicit representation contains multiple vectors, for example, one vector C_1=[0.2, -0.1, 0.2], another vector C_2=[-0.1, 0.3, -0.1], etc.
[0143] The computer system uses Euclidean distance to calculate the difference metric. For vectors A and C_1, the Euclidean distance , for vectors A and C_2, the Euclidean distance .
[0144] The computer system calculates the Euclidean distance between each vector in the non-matching teaching training text resource and the vector A according to the above formula. Assuming that after calculation, d(A, C_1) is the minimum value among all distances, then the vector C_1 in the non-matching teaching training text resource is determined as the third text segment semantic representation vector. This vector is semantically closest to the first text segment semantic representation vector A of the teaching training text resource among all vectors of non-matching teaching training text resources, although they come from texts of different resource content classifications.
[0145] In an embodiment of the present application, the computer system performs a loop traversal operation on each vector in the non-matching teaching and training text resource, and calculates the difference measure (such as the Euclidean distance) between it and the semantic representation vector of the first text segment. This process involves the subtraction, squaring, summing and square root operations of the vector elements one by one. From the perspective of algorithm efficiency, these calculation processes can be optimized. For example, when calculating the Euclidean distance, the sum of the squares of the differences between the vector elements can be calculated first, and then the square root can be taken to avoid repeated calculations of the same intermediate results. At the same time, in order to avoid precision problems in numerical calculations, especially when processing large amounts of text data, it may be necessary to use appropriate data types and numerical calculation libraries to ensure the accuracy of the calculation results.
[0146] In step S13322, the computer system determines the difference measure between the first text segment semantic representation vector and the third text segment semantic representation vector as the second difference measure in step S13322. This second difference measure represents the commonality evaluation result between the teaching training text resource and the non-matching teaching training text resource. Since the third text segment semantic representation vector is the vector closest to the teaching training text resource in the non-matching teaching training text resource, this difference measure can reflect the degree of difference between texts of different resource content classifications even in the closest case. This is very important for evaluating the performance of neural networks in distinguishing texts of different classifications, because it provides an indicator for measuring the differences between texts of different classifications from the perspective of local similarity.
[0147] Continuing with the above examples of "Physics-Electrical Foundations" and "Physics-Mechanics Principles", assume that the semantic representation vector of the first text segment is A=[0.3, -0.2, 0.1], and the semantic representation vector of the third text segment is C_1=[0.2, -0.1, 0.2]. The second difference metric is calculated using the Euclidean distance. (Assume the calculated result is 0.14), this 0.14 is the second difference measure.
[0148] If this value is small, it means that even the closest parts of the texts in the two different resource content categories are not very different, which may suggest that the neural network has difficulty distinguishing the two categories, because the texts of different categories should be semantically distinct. On the contrary, if this value is large, for example, the calculated result is 0.5, it means that even in the closest parts, there are large differences between the texts of the two different categories, which shows that the neural network performs well in distinguishing the two categories.
[0149] The second difference metric is closely related to the error of the training data set determined later (such as in step S1333). It is inversely correlated with the error of the training data set, that is, the smaller the second difference metric is (indicating that the local similarity of different classified texts is higher), the larger the error of the training data set may be, because this means that the neural network may be insufficient in distinguishing different classified texts; and the larger the second difference metric is (indicating that the local similarity of different classified texts is lower), the smaller the error of the training data set may be, indicating that the neural network has better performance in distinguishing different classified texts. This relationship helps the computer system to comprehensively evaluate the performance of the neural network and provides an important basis for further optimizing the neural network (such as in step S134).
[0150] In one implementation, step S110, based on the teaching training text resource library, performs preliminary network debugging on the resource index neural network to obtain the first resource index neural network, which may specifically include:
[0151] Step S111: extracting implicit representations of multiple teaching and training text resources according to the resource indexing neural network to obtain implicit representations of text segments of the multiple teaching and training text resources, where the implicit representations of the text segments include multiple text segment semantic representation vectors;
[0152] Step S112: determining the overall text semantic representation of the plurality of teaching and training text resources according to the implicit representation of the text segments of the plurality of teaching and training text resources;
[0153] Step S113: classifying and estimating the resource contents of multiple teaching and training text resources according to the overall semantic representation of the text, and obtaining the estimated resource contents of the multiple teaching and training text resources;
[0154] Step S114: According to the estimated resource content and the actual resource content classification, the resource index neural network is initially debugged to obtain a first resource index neural network.
[0155] In step S111, the purpose of the computer system executing step S111 is to extract implicit representations of multiple teaching and training text resources based on the resource indexing neural network. When processing teaching and training text resources, the original text form is difficult for the neural network to directly and effectively analyze and process. Therefore, it is necessary to convert the text into an implicit representation form that is more suitable for neural network processing. This implicit representation can mine deep semantic information in the text, thereby providing a basis for subsequent operations such as resource content classification and estimation.
[0156] Assume that there is a teaching text about "Chemistry-Organic Chemical Reactions" in the teaching training text resource library. This text contains various organic chemical concepts, reaction equations, reaction conditions, etc. The computer system inputs this text into the resource indexing neural network.
[0157] In an embodiment of the present application, for each word or phrase in the text, the computer system first converts it into a vector representation, for example. For example, a pre-trained word vector model (such as Word2Vec or GloVe) is used. Assume that the phrase "organic chemistry" is represented as a vector with a dimension of 100 in the Word2Vec model, such as [0.1, -0.2, 0.3, ...]. Then, the neural network processes these vectors through its internal structure.
[0158] Neural networks may contain structures such as convolutional layers, pooling layers, and fully connected layers. In the convolutional layer, the convolution kernel performs a convolution operation on the text vector representation. For example, a 3×100 (assuming the text vector dimension is 100) convolution kernel slides on the text vector matrix, and each time calculates the sum of the products of 3 word vectors and the corresponding elements of the convolution kernel to extract local features. After the convolution layer, the pooling layer (such as maximum pooling) is used to reduce the dimension, and the maximum value in the local area is selected as the representative value. Finally, the fully connected layer integrates the features obtained previously and outputs an implicit representation. This implicit representation contains multiple text fragment semantic representation vectors, each of which represents the semantic information of a fragment in the text to a certain extent. For example, for the text "organic chemical reaction", there are semantic representation vectors corresponding to text fragments of different reaction types (such as addition reaction, substitution reaction, etc.).
[0159] The computer system performs such operations on multiple teaching and training text resources in the teaching and training text resource library, thereby obtaining an implicit representation of the text segment of each teaching and training text resource.
[0160] When extracting implicit representations, in addition to the neural network structure and word vector conversion mentioned above, some technical details need to be considered. For example, in the selection of word vector models, different models may be suitable for different text types and tasks. If the teaching training text resources involve multiple languages, it may be necessary to select a word vector model that supports multiple languages or process different languages separately.
[0161] The hyperparameter settings of the neural network, such as the convolution kernel size and step size of the convolution layer, the pooling method and size of the pooling layer, and the number of neurons in the fully connected layer, need to be adjusted according to the characteristics of the teaching training text resources. For example, if the sentences in the teaching training text resources are long, a larger convolution kernel may be required to capture more contextual information; if the semantics of the text resources are more complex, more fully connected layer neurons may be required to better integrate features. At the same time, in order to avoid overfitting or underfitting, regularization techniques such as L1 or L2 regularization may be required, and their formulas are respectively and (where w_i is the weight parameter of the neural network) by adding a regularization term to the loss function to constrain the size of the weight and improve the generalization ability of the model.
[0162] In step S112, after obtaining the implicit representation of the text segments of multiple teaching and training text resources, the computer system needs to determine the overall text semantic representation of these texts. The significance of this step is to integrate the semantic information of the text segments, so as to obtain a representation that can fully reflect the semantic content of the entire teaching and training text resource. The overall text semantic representation can provide a more comprehensive basis for subsequent accurate resource content classification estimation, avoiding the problem of inaccurate classification caused by relying solely on local semantic information.
[0163] Continuing with the above teaching text of "Chemistry-Organic Chemical Reactions", its implicit representation of text fragments includes semantic representation vectors of text fragments about different reaction types, etc. The computer system uses a specific algorithm to integrate these vectors to obtain the overall semantic representation of the text.
[0164] One feasible method is weighted summation. Assume that there are n text segment semantic representation vectors V_1, V_2, …, V_n in the implicit representation of the text segment, and the computer system assigns a weight w_1, w_2, …, w_n to each vector (these weights can be determined based on factors such as the importance of the vector or its position in the text). Then, the overall semantic representation of the text For example, if the semantic representation vector V_1 of a text segment about an important reaction type (such as addition reaction) is considered more important, then it may be assigned a larger weight w_1.
[0165] Another method is to use structures such as recurrent neural networks (RNNs) or long short-term memory networks (LSTMs). If the vectors in the implicit representation of the text fragment are input into the LSTM network in the order of the text, the LSTM network will process each vector step by step according to its internal memory units and gating mechanisms, and finally output a vector representing the semantics of the entire text as the overall semantic representation of the text. This method can better process the sequential information in the text and is more suitable for teaching and training text resources with a certain logical order (such as chemical experiment steps, etc.).
[0166] When determining the overall semantic representation of a text, choosing the right integration algorithm is key. Different algorithms are suitable for different types of text and task requirements. The weighted summation method is relatively simple and direct, but the determination of weights requires certain prior knowledge or adjustment through experiments. Although structures such as RNN or LSTM can better process sequential information, the computational cost is relatively high, and when processing long texts, problems such as gradient vanishing or gradient exploding may occur.
[0167] To solve these problems, some improved techniques such as gradient clipping can be used to prevent gradient explosion when using RNN or LSTM. The basic idea of gradient clipping is to set a gradient threshold. If the calculated gradient exceeds this threshold, the gradient is limited to this threshold. For example, when calculating the gradient during back propagation, if the calculated gradient g satisfies , then update g to At the same time, for long texts, the truncation method can be used to divide the long text into several shorter segments for processing, and then integrate the processing results.
[0168] In step S113, the computer system estimates the resource content classification of multiple teaching and training text resources based on the overall semantic representation of the text obtained in step S112. The basis for this operation is that different resource content classifications should have different feature representations in the semantic space. By comparing the overall semantic representation of the text of the teaching and training text resource with the feature representation of the known resource content classification, the resource content classification to which the teaching and training text resource is most likely to belong can be determined. Its goal is to preliminarily determine the category of the teaching and training text resource so that the resource index neural network can be debugged later to improve its classification accuracy.
[0169] Assume that the resource content categories in the teaching training text resource library include "Chemistry-Organic Chemistry", "Chemistry-Inorganic Chemistry", "Chemistry-Physical Chemistry", etc. For the teaching text on "Chemistry-Organic Chemical Reactions" mentioned above, the overall semantic representation of the text is V_{total}. The computer system compares V_{total} with the feature representation of each resource content category.
[0170] One comparison method can be to calculate the cosine similarity. Assuming that the feature of the resource content category "Chemistry-Organic Chemistry" is represented by C_{organic}, the cosine similarity Similarly, the computer system calculates the cosine similarity between V_{total} and the feature representations of resource content categories such as "Chemistry-Inorganic Chemistry" (C_{inorganic}) and "Chemistry-Physical Chemistry" (C_{physical}).
[0171] if ) is the highest, then the computer system will estimate this teaching and training text resource as belonging to the resource content classification of "Chemistry-Organic Chemistry".
[0172] When estimating resource content classification, in addition to cosine similarity, other distance measurement methods can also be used, such as Euclidean distance. (where v_i is an element in V_{total} and c_i is an element in C, a resource content classification feature representation.) Different distance metrics may perform differently in different data distributions and task scenarios.
[0173] In order to improve the accuracy of classification prediction, the feature representation of resource content classification can be optimized. For example, a clustering algorithm can be used to cluster multiple teaching and training text resources in each resource content classification, and then the cluster center can be taken as the feature representation of the resource content classification. This can better represent the typical semantic features of the resource content classification. At the same time, the overall semantic representation of the text can also be further refined, such as by adding more neural network layers or using more complex feature extraction methods, so that the overall semantic representation of the text can more accurately reflect the semantic content of the text.
[0174] In step S114, the computer system performs preliminary network debugging on the resource indexing neural network according to the estimated resource content and the actual resource content classification. The significance of this step is to adjust the parameters of the neural network by comparing the difference between the estimated results and the actual results, so that the neural network can better classify the resource content of the teaching and training text resources accurately. The preliminary network debugging is an important part of improving the performance of the resource indexing neural network, and lays the foundation for subsequent further debugging (such as steps S120, S130, etc.).
[0175] Assume that the stochastic gradient descent (SGD) algorithm is used for preliminary debugging of the network. First, a loss function needs to be defined to measure the difference between the estimated resource content and the actual resource content classification. A feasible loss function is the cross entropy loss function. For a multi-classification problem (such as resource content classification of teaching training text resources), if there are K categories, let the actual category be y (y is a K-dimensional one-hot encoding vector, only the element corresponding to the correct category is 1, and the others are 0), the estimated category probability distribution is ( is also a K-dimensional vector, representing the estimated probability of each category), cross entropy loss function .
[0176] For example, for the aforementioned teaching text on "Chemistry-Organic Chemical Reactions", if the actual classification is "Chemistry-Organic Chemistry" (assuming that the corresponding index in the one-hot encoding is 1), and the estimated class probability distribution is (Here, the probability of "Chemistry-Inorganic Chemistry" is 0.1, the probability of "Chemistry-Organic Chemistry" is 0.7, and the probability of "Chemistry-Physical Chemistry" is 0.2), then the cross entropy loss .
[0177] The computer system calculates the gradient of the loss function with respect to the neural network parameters and then updates the parameters using the stochastic gradient descent algorithm. , the update formula is ,in is the learning rate, which determines the step size of the parameter update. For example, if , learning rate = 0.01, then the updated .
[0178] By continuously calculating the loss function and updating the parameters based on the estimated resource content and actual resource content classification of the teaching and training text resources, the computer system gradually optimizes the resource index neural network and finally obtains the first resource index neural network. This process requires multiple iterations of the multiple teaching and training text resources in the teaching and training text resource library to ensure that the neural network can improve the accuracy of resource content classification as a whole. At the same time, in order to avoid overfitting, some regularization techniques (such as the L1 or L2 regularization mentioned above) or early stopping methods (stop training when the loss on the validation set no longer decreases) and other strategies can be used to improve the generalization ability of the neural network.
[0179] In one implementation, the method may further include:
[0180] Step S140: When the second resource indexing neural network meets the preset convergence condition, the debugging is stopped to obtain the target resource indexing neural network.
[0181] The embodiment of the present application also includes an application process of the target resource indexing neural network, specifically including:
[0182] Step S150: Obtain target index text;
[0183] Step S160: loading the target index text into the target resource index neural network, and extracting the text segment semantic representation of the target index text through the target resource index neural network;
[0184] Step S170: using a target resource indexing neural network, based on the text segment semantic representation of the target index text, indexing at least one target teaching text that meets the matching requirements in a preset teaching text resource library;
[0185] Step S180: Output at least one target teaching text.
[0186] In step S140, the computer system stops debugging when the second resource index neural network meets the preset convergence condition, and obtains the target resource index neural network. The convergence condition is a criterion for judging whether the neural network has been trained to a sufficiently good state. Its purpose is to avoid the overfitting problem caused by overtraining, and at the same time ensure that the neural network can achieve satisfactory accuracy and generalization ability when processing the resource content classification task of the teaching training text resources.
[0187] One possible convergence condition is based on the value of the loss function. For example, in the previous network debugging step (such as S130), the cross entropy loss function ( ), where K is the number of categories, y is the actual category, is the estimated category probability distribution). If the change in the value of the loss function is less than a preset threshold within n consecutive iterations (the iteration cycle here can be a complete traversal of the entire teaching training text resource library), ,For example =0.001, the network is considered to have converged.
[0188] Assume that during the training process, the initial loss function value is L_1=2.5. As the training progresses, after several iterations, the loss function value becomes L_2=0.0008. In the next n=5 iterations, the loss function value fluctuates around 0.0008, with a fluctuation range of less than =0.001, then the computer system determines that the second resource indexing neural network meets the convergence condition.
[0189] Another convergence condition can be based on the accuracy of resource content classification. The computer system calculates the accuracy of resource content classification on the validation set (a part of the text resource collection divided from the teaching and training text resource library for verification). The accuracy calculation formula is Accuracy={number of correctly classified samples} / {total number of samples}. If the accuracy reaches a preset high level value, such as Accuracy=0.95 (indicating that 95% of the samples are correctly classified), and there is no significant improvement within a certain number of subsequent iterations, it can also be considered that the network has converged. For example, the initial accuracy on the validation set is 0.8, and it reaches 0.95 after training, and the accuracy fluctuates around 0.95 in the next few iterations, then the convergence condition is met.
[0190] When the convergence condition is met, the computer system stops debugging the second resource indexing neural network. The neural network obtained at this time is the target resource indexing neural network. This target resource indexing neural network has been trained and debugged in the previous multiple steps (such as S110-S130), and has optimized its resource content classification ability for teaching training text resources to a certain extent. It will be used for subsequent indexing operations (such as step S170), and can more accurately index teaching text resources that meet the matching requirements in the preset teaching text resource library.
[0191] In step S150, the computer system obtains the target index text. This target index text is input by the user or other system, and is used as a basis for searching for relevant teaching text resources in a preset teaching text resource library. The target index text can be any content related to teaching, such as a problem about solving a specific mathematical concept, a brief description of a historical event, or an explanation of a physical experimental phenomenon. Obtaining the target index text is the starting point of the entire indexing process. It will be input into the target resource index neural network for processing to find relevant teaching text resources.
[0192] The input sources of the target index text can be varied. For example, it can be a query directly entered by the user through an input device (such as a keyboard), or a search request passed from other education-related systems (such as the search box of an online learning platform). In terms of format, the target index text usually exists in the form of a text string, but some preprocessing operations may be required, such as removing unnecessary punctuation, unifying capitalization, etc., to ensure that it can be correctly processed by the target resource index neural network.
[0193] For example, if the target index text is "how to solve a quadratic equation", the computer system converts it into a unified format, such as "how to solve a quadratic equation" (removing possible unnecessary punctuation marks and changing the first letter from capital to lowercase) for subsequent processing.
[0194] In step S160, the computer system loads the target index text obtained in step S150 into the target resource index neural network. This process is similar to the previous processing of teaching training text resources in the training process. First, the words or phrases in the target index text need to be converted into vector representations. For example, if a pre-trained word vector model (such as Word2Vec) is used, each word in the target index text will be mapped to a corresponding vector. Assume that the phrase "quadratic equation" is represented as a vector with a dimension of 100 in the Word2Vec model, such as [0.1, -0.2, 0.3,…].
[0195] Then, the convolutional layer, pooling layer, and fully connected layer in the target resource index neural network process these vectors. The convolutional layer performs convolution operations by sliding the convolution kernel on the text vector representation to extract local features. For example, a 3×100 (assuming the text vector dimension is 100) convolution kernel slides on the vector matrix of the target index text, and each time calculates the sum of the products of 3 word vectors and the corresponding elements of the convolution kernel. After the convolutional layer, the pooling layer (such as maximum pooling) performs dimensionality reduction operations and selects the maximum value in the local area as the representative value. Finally, the fully connected layer integrates the features obtained previously to extract the semantic representation of the text fragment of the target index text. This text fragment semantic representation contains multiple text fragment semantic representation vectors, each of which represents the semantic information of a fragment in the target index text to a certain extent. For example, for the target index text "How to solve a quadratic equation", there are semantic representation vectors corresponding to text fragments such as "solving" and "quadratic equation".
[0196] The semantic representation of the text fragment of the target index text plays a key role in the entire indexing process. It is a semantic representation form of the target index text inside the neural network, which can be compared and matched with the semantic representation of the teaching text resources in the preset teaching text resource library. In this way, the target resource indexing neural network can find the teaching text resources that are most semantically relevant to the target index text, thereby achieving accurate indexing operations.
[0197] Step S170, the computer system uses the target resource indexing neural network to index at least one target teaching text that meets the matching requirements in the preset teaching text resource library based on the text segment semantic representation of the target index text. In the preset teaching text resource library, each teaching text resource has its own semantic representation (which may be obtained in the previous training or preprocessing process). The target resource indexing neural network calculates the similarity or distance measurement between the text segment semantic representation of the target index text and the semantic representation of each teaching text resource in the teaching text resource library.
[0198] For example, cosine similarity is used for calculation. For the semantic representation vector A=[a_1,a_2, …, a_n] of the target index text segment and the semantic representation vector B=[b_1, b_2, …, b_n] of a teaching text resource in the teaching text resource library, cosine similarity The computer system performs such calculations on each teaching text resource in the teaching text resource library.
[0199] If the cosine similarity value exceeds a preset threshold (For example =0.8), the teaching text resource is considered to be semantically matched with the target index text, and is thus used as the target teaching text that meets the matching requirements. This process will continue until at least one teaching text resource that meets the matching requirements is found.
[0200] Setting the matching requirements (such as the cosine similarity threshold mentioned above) ) is determined according to specific application scenarios and needs. If you require higher accuracy of the index results, for example, set a higher threshold; if you want to get more relevant results, for example, lower the threshold appropriately. At the same time, the matching requirements can also be adjusted based on user feedback or system performance evaluation. For example, if it is found that the index results contain too many irrelevant teaching text resources, the threshold can be increased; if it is found that there are too few index results, the threshold can be lowered or other matching parameters can be adjusted (such as using different distance measurement methods or adjusting certain parameters of the neural network).
[0201] When indexing the target teaching text, in addition to considering the degree of semantic matching with the target index text, it may also be necessary to consider the diversity of the index results. For example, under a target index text about "mathematics", it is not desirable for all target teaching texts to be concentrated in a specific subfield of mathematics (such as only "algebra"), but rather it is desirable to cover relevant teaching text resources in other subfields such as "geometry" and "probability", as long as they have a certain semantic relevance to the target index text. To achieve this, the computer system can use different weights or adjust the matching strategy for teaching text resources in different subfields when calculating similarity or distance metrics to ensure that the index results are both relevant and diverse.
[0202] In step S180, the computer system outputs at least one target teaching text indexed in step S170 in step S180. The output target teaching text will be presented to the user or used by other systems. The significance of this operation is to provide the user with teaching resources related to the target index text to meet the user's query needs. For example, if the target index text is "How to solve a quadratic equation", the output target teaching text may be a teaching document containing a method for solving a quadratic equation, examples, explanations of related concepts, etc., which helps the user acquire knowledge or solve problems encountered in the learning process.
[0203] The output form can vary depending on the specific application scenario. It can be directly displayed on the user interface in text form, or it can be provided to other systems in a certain data format (such as JSON format) for further processing. For example, in an online learning platform, the output target teaching text can be integrated into the learning page and presented to the user together with other learning resources (such as exercises, explanation videos, etc.) to facilitate comprehensive learning. At the same time, the output target teaching text can also be used as basic data for further analysis of user learning behavior and improvement of teaching resource recommendation systems.
[0204] The following is a summary of the technical effects of the method provided in the embodiments of the present application:
[0205] In the first debugging process, the resource indexing neural network was initially debugged based on the teaching and training text resource library. In this way, the neural network can learn to extract the overall semantic representation of the text from the semantic representation vectors of the text fragments of the teaching and training text resources. The construction of this capability lays the foundation for more accurate resource content classification estimation in the future. For example, for a text resource containing rich teaching content, such as the teaching text on the "Law of Electromagnetic Induction" in the physics subject, it will involve multiple text fragments such as concept explanation, experimental phenomena, and formula derivation. After preliminary debugging, the neural network can identify the semantic representation vectors of these different text fragments and integrate them into an overall semantic representation of the entire "Law of Electromagnetic Induction" teaching content.
[0206] This accurate extraction of the overall semantic representation of the text helps to improve the accuracy of resource content classification. In the teaching resource library, different teaching contents have different classifications, such as "mechanics", "thermal", "electromagnetism" and other classifications under the physics subject. After preliminary debugging, the neural network can better distinguish these differently classified teaching text resources and avoid classification errors caused by incomplete understanding of the text semantics. For example, a text mainly about the "law of electromagnetic induction" (belonging to electromagnetism) will not be mistakenly classified as "thermal" related content.
[0207] On the basis of preliminary network debugging, multiple teaching and training text resource sub-libraries are generated based on the estimated resource content of multiple teaching and training text resources by the first resource index neural network, and then the network is refined and debugged, which brings remarkable results. The second resource index neural network after refinement and debugging can extract the semantic representation of the text fragment of the teaching and training text resource based on the text fragment semantic representation vector of the text in the training data set. This means that the neural network can capture the semantic information of the text fragment more carefully when processing the text.
[0208] Taking the teaching text resources of history as an example, for a text about "Exchange of Ancient Civilizations", it contains multiple text fragments such as trade exchanges, cultural dissemination, and migration of people. After refinement and debugging, the neural network can accurately extract the semantic representation of these different text fragments, so that the overall semantic representation of the text of the teaching training text resources contains more recognizable text fragments. This not only enriches the semantic understanding of the text, but also improves the recall rate of the network. Recall rate is an important indicator for measuring the performance of neural networks in retrieving relevant resources. When querying teaching resources related to "Exchange of Ancient Civilizations", since the neural network can accurately identify more text fragments, it is more likely to recall all relevant teaching text resources without missing important resources.
[0209] In the debugging phase of the neural network, the technical solution of the present application does not need to use too many feature extraction components to extract the semantic representation of the text fragment. Traditional methods may require a large number of complex feature extraction components, which consume a lot of computing resources when processing text. For example, some methods use multiple different convolutional layers and complex feature splicing techniques to extract the semantic features of the text, which not only increases the structural complexity of the neural network, but also requires more computing power to run.
[0210] This solution, through a specific debugging process, enables the neural network to effectively use the semantic representation vectors of text fragments to construct the overall semantic representation of the text, reducing the reliance on additional feature extraction components. This directly reduces the computing power requirements of the network. From a cost perspective, reducing computing power requirements means reducing investment in hardware equipment. Whether it is server deployment in a data center or in edge computing scenarios such as mobile devices, the cost of computing resources can be saved. For example, in a large-scale online education platform, if this solution is adopted, there is no need to purchase overly powerful computing equipment to meet the operating requirements of the text resource indexing neural network, thereby saving hardware procurement and maintenance costs.
[0211] In addition, in the entire digital teaching resource library system, the resource indexing neural network optimized by this solution can improve the efficiency of teaching resource management and retrieval. For educational institutions or online learning platforms, there are a large number of teaching text resources, such as textbooks, courseware, learning notes, etc. It is very important to accurately classify and index these resources. Through the optimization method of this solution, the neural network can quickly and accurately classify teaching resources, and can efficiently recall relevant resources when users search.
[0212] This solution reduces network computing power requirements and saves costs while improving the optimization effect of digital teaching resource libraries based on artificial intelligence. This achievement helps promote the sustainable development of artificial intelligence in the field of education. With the continuous enrichment of educational resources and the continuous growth of the number of users, solutions with low computing power requirements and low costs are more likely to be widely used.
[0213] An embodiment of the present application provides a computer system, including a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0214] Figure 2 A hardware entity diagram of a computer system provided in an embodiment of the present application is shown in FIG. Figure 2 As shown, the hardware entity of the computer system 1000 includes: a processor 1001 and a memory 1002, wherein the memory 1002 stores a computer program that can be run on the processor 1001, and the processor 1001 implements the steps in the method of any of the above embodiments when executing the program.
Claims
1. A method for optimizing a digital teaching resource library based on artificial intelligence, characterized in that: The method comprises: Based on a teaching and training text resource library, a resource index neural network is preliminarily debugged to obtain a first resource index neural network, wherein the teaching and training text resource library includes a plurality of teaching and training text resources and resource content labels of the plurality of teaching and training text resources, wherein the resource content labels represent actual resource content classifications of the plurality of teaching and training text resources, and the network preliminarily debugged is used to infer the overall text semantic representation of the text based on the text segment semantic representation vector of the text; Generate multiple training data sets based on the estimated resource content of the multiple teaching training text resources by the first resource index neural network, wherein the training data set of each teaching training text resource includes the teaching training text resource, a matching teaching training text resource, and a plurality of non-matching teaching training text resources, the actual resource content classification of the matching teaching training text resource is consistent with the teaching training text resource, and the actual resource content classification of the plurality of non-matching teaching training text resources is inconsistent with the teaching training text resource; According to the plurality of training data sets, performing network refinement and debugging on the first resource indexing neural network to obtain a second resource indexing neural network, wherein the network refinement and debugging is used to match text segment semantic representations of texts based on the correlation between text segment semantic representation vectors of texts in the training data sets; Wherein, the estimated resource content of the plurality of teaching training text resources by the first resource indexing neural network is used to generate a plurality of training data sets, including: For each teaching and training text resource, on the premise that the estimated resource content of the teaching and training text resource is consistent with the actual resource content classification of the teaching and training text resource, the first resource component library of the teaching and training text resource library is arbitrarily extracted to obtain the matching teaching and training text resource, wherein the first resource component library includes a plurality of teaching and training text resources that are consistent with the actual resource content classification; The second resource component library and the third resource component library of the teaching and training text resource library are equally extracted to obtain the plurality of non-matching teaching and training text resources, wherein the second resource component library includes a plurality of teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource contents are the actual resource content classification, and the third resource component library includes a plurality of teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource contents are not the actual resource content classification; The teaching training text resource, the matching teaching training text resource and the multiple non-matching teaching training text resources constitute a training data set of the teaching training text resource.
2. The method according to claim 1, characterized in that The generating of multiple training data sets based on the estimated resource contents of the multiple teaching training text resources by the first resource indexing neural network includes: For each teaching and training text resource, on the premise that the estimated resource content of the teaching and training text resource is inconsistent with the actual resource content classification of the teaching and training text resource, the fourth resource composition library of the teaching and training text resource is arbitrarily extracted to obtain the matching teaching and training text resource, wherein the fourth resource composition library includes a plurality of teaching and training text resources whose classification is consistent with the actual resource content classification and whose estimated resource content is the actual resource content classification; The second resource component library, the fifth resource component library and the sixth resource component library of the teaching and training text resource library are extracted with equal opportunity to obtain the multiple non-matching teaching and training text resources, wherein the second resource component library includes multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource contents are the actual resource content classification, the fifth resource component library includes multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource contents are the set resource content classification, and the sixth resource component library includes multiple teaching and training text resources that are inconsistent with the actual resource content classification and whose estimated resource contents are neither the actual resource content classification nor the set resource content classification; The teaching training text resource, the matching teaching training text resource and the multiple non-matching teaching training text resources constitute a training data set of the teaching training text resource.
3. The method according to claim 1, characterized in that The method of performing network refinement and debugging on the first resource index neural network according to the multiple training data sets to obtain a second resource index neural network includes: For any training data set, according to the first resource indexing neural network, the teaching training text resource, the matching teaching training text resource and the multiple non-matching teaching training text resources are respectively subjected to implicit representation extraction to obtain the text segment implicit representation of the teaching training text resource, the text segment implicit representation of the matching teaching training text resource and the text segment implicit representation of the multiple non-matching teaching training text resources, wherein the text segment implicit representation includes multiple text segment semantic representation vectors; According to the implicit representation of the text fragment of the teaching and training text resource, the resource content classification of the teaching and training text resource is estimated to obtain the estimated error of the teaching and training text resource; Determine the data set error of the training data set according to the difference between the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of the matching teaching training text resource and the difference between the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of the plurality of non-matching teaching training text resources; The first resource indexing neural network is optimized according to the estimation error and the data set error to obtain the second resource indexing neural network.
4. The method according to claim 3, characterized in that Determining the data set error of the training data set according to the difference between the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of the matching teaching training text resource and the difference between the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segments of the multiple non-matching teaching training text resources includes: Determining a first difference metric according to the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of the matching teaching training text resource, wherein the first difference metric represents a commonality evaluation result between the teaching training text resource and the matching teaching training text resource; For any non-matching teaching and training text resource, a second difference metric is determined according to an implicit representation of a text segment of the teaching and training text resource and an implicit representation of a text segment of the non-matching teaching and training text resource, wherein the second difference metric represents a commonality evaluation result between the teaching and training text resource and the non-matching teaching and training text resource; The data set error is determined based on the first difference metric and the second difference metric, the data set error is directly associated with the first difference metric, and the data set error is inversely associated with the second difference metric.
5. The method according to claim 4, characterized in that The determining of a first difference metric according to the implicit representation of the text segment of the teaching training text resource and the implicit representation of the text segment of the matching teaching training text resource comprises: Performing absolute value penalties on the implicit representation of the text segments of the teaching and training text resource and the implicit representation of the text segments of the matching teaching and training text resource, respectively, to obtain a first text segment semantic representation vector set and a second text segment semantic representation vector set, wherein the first text segment semantic representation vector set includes multiple text segment semantic representation vectors of the teaching and training text resource, and the second text segment semantic representation vector set includes multiple text segment semantic representation vectors of the matching teaching and training text resource; According to the difference measure between a plurality of text segment semantic representation vectors in the first text segment semantic representation vector set and a plurality of text segment semantic representation vectors in the second text segment semantic representation vector set, a first text segment semantic representation vector is determined in the teaching training text resource, and a second text segment semantic representation vector is determined in the matching teaching training text resource, wherein the difference measure between the first text segment semantic representation vector and the second text segment semantic representation vector is closest; A difference measure between the first text segment semantic representation vector and the second text segment semantic representation vector is determined as the first difference measure.
6. The method according to claim 5, characterized in that The determining of a second difference metric for any one non-matching teaching training text resource according to the implicit representation of a text segment of the teaching training text resource and the implicit representation of a text segment of the non-matching teaching training text resource comprises: For any non-matching teaching training text resource, according to the difference measure between a plurality of text segment semantic representation vectors in the text segment implicit representation of the non-matching teaching training text resource and the first text segment semantic representation vector, a third text segment semantic representation vector is determined in the non-matching teaching training text resource, and the difference measure between the third text segment semantic representation vector and the first text segment semantic representation vector is the smallest; A difference measure between the first text segment semantic representation vector and the third text segment semantic representation vector is determined as the second difference measure.
7. The method according to claim 1, characterized in that The method of performing preliminary network debugging on the resource index neural network based on the teaching training text resource library to obtain the first resource index neural network includes: According to the resource indexing neural network, the plurality of teaching and training text resources are subjected to implicit representation extraction to obtain implicit representations of text segments of the plurality of teaching and training text resources, wherein the implicit representations of text segments include a plurality of text segment semantic representation vectors; Determining the overall text semantic representation of the multiple teaching and training text resources according to the implicit representation of the text segments of the multiple teaching and training text resources; According to the overall semantic representation of the text, classify and estimate the resource contents of the multiple teaching and training text resources to obtain the estimated resource contents of the multiple teaching and training text resources; According to the estimated resource content and the actual resource content classification, the resource index neural network is initially debugged to obtain the first resource index neural network.
8. The method according to any one of claims 1 to 7, characterized in that: The method further comprises: When the second resource index neural network meets a preset convergence condition, debugging is stopped to obtain a target resource index neural network; Get the target index text; Loading the target index text into the target resource index neural network, and extracting a text segment semantic representation of the target index text through the target resource index neural network; By means of the target resource indexing neural network, at least one target teaching text meeting the matching requirements is indexed in a preset teaching text resource library based on the text segment semantic representation of the target index text; The at least one target teaching text is output.
9. A computer system comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, wherein: When the processor executes the program, the steps in the method according to any one of claims 1 to 8 are implemented.
Citation Information
Patent Citations
Model distillation improvement method and device based on individual learning and storage medium
CN111126573A
Training method of semi-supervised learning model, image processing method and equipment
CN112183577A