Science and education resource relationship prediction method and system based on large model zero sample prediction

By applying large-scale zero-sample prediction and self-test technology in the field of science and education, a training set with few samples was constructed and manual annotation and fine-tuning of the model was solved, and the accuracy and efficiency of knowledge graph construction were improved.

CN119597936AActive Publication Date: 2025-03-11XI AN JIAOTONG UNIV
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411737967.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-29
Publication Date
2025-03-11
Estimated Expiration
2044-11-29

AI Technical Summary

Technical Problem

In the case of scarce labeled data in the field of science and education, it is difficult to effectively build a high-quality knowledge graph, and direct reasoning and instruction fine-tuning methods based on large models have stability and efficiency problems.

Method used

The science and education resource relationship prediction method based on zero-sample prediction of large models is adopted. By obtaining labelless data, using the zero-sample prediction and self-test capabilities of large models, the data is divided into simple samples and difficult samples, a training set of few samples is constructed, and a high-quality model is trained for relationship extraction through manual labeling and large model instruction fine-tuning algorithm.

Benefits of technology

In the field of science and education where labeling data is scarce, the accuracy and efficiency of knowledge graph construction are improved, the stability and generalization ability of the model are ensured, and the relationship between science and education resources can be quickly and accurately extracted.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119597936A_ABST
    Figure CN119597936A_ABST
Patent Text Reader

Abstract

The invention provides a science and education resource relationship prediction method and system based on large model zero sample prediction, and the method comprises the steps: obtaining unlabeled science and education resource data, dividing the unlabeled science and education resource data into simple samples and difficult samples based on the zero sample prediction and self-inspection of a large model, and forming a few-sample training set; manually marking the training set with few samples; selecting a corresponding large model instruction fine tuning algorithm according to different application scenes, and performing model training on the marked few-sample training set to obtain a trained model; and loading the trained model to perform automatic relation extraction to complete relation prediction. The method comprises the following steps: acquiring unlabeled science and education resource data, and carrying out primary processing on the data by utilizing the zero sample prediction capability of a large model; dependence on a large amount of annotated data in a traditional method is avoided, and effective relation prediction can also be carried out in the science and education field with scarce annotated data.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of constructing a knowledge graph of scientific and educational resources, and in particular, relates to a method and system for predicting the relationship between scientific and educational resources based on large-model zero-sample prediction. Background Art

[0002] Software-defined science and education resources are a collection of resources consisting of educational resources, their carriers, and their relationships. Software breaks the traditional integrated science and education hardware resources and virtualizes, standardizes, and modularizes them to adapt to frequently changing application needs. In order to efficiently, accurately, and comprehensively process massive, multi-source, heterogeneous, and hardware-integrated science and education resources, it is necessary to organize and manage resources through knowledge graphs (KGs) [1], taking into full account their multi-dimensional and multi-level data characteristics. Traditional automatic knowledge graph construction methods based on fine-tuning of pre-trained models require a large amount of labeled data, so it is difficult to achieve satisfactory results in the field of science and education where labeled samples are scarce. Therefore, it is necessary to design a knowledge graph construction method for few-sample scenarios. Recently, large language models (LLMs) have provided strong support for few-sample learning with their high-dimensional representation, context awareness, and cross-domain applicability. By combining instruction fine-tuning technology, large models can quickly adapt to the task of building knowledge graphs in the field of science and education with a small number of samples.

[0003] As a new type of knowledge organization method, knowledge graph can effectively manage massive multi-source heterogeneous complex data, which has attracted widespread attention from industry and academia, and has led many large companies and teams to build large-scale knowledge bases, including Wikipedia's multilingual linked Wikidata knowledge base. Among them, a basic method to achieve automatic construction of knowledge graphs is to fine-tune a small-scale pre-trained model to achieve three subtasks in knowledge graph construction, namely entity discovery, relationship extraction, and knowledge graph completion. However, this method requires a large amount of labeled data, so it is not suitable for science and education fields where labeled samples are scarce.

[0004] As the parameter scale of large language models continues to increase, the large amount of common sense knowledge contained in them enables the large model itself to have a certain knowledge reasoning ability, and only a small amount of labeled data is needed to quickly adapt to the tasks in the vertical field. A popular method for applying large models to the construction of few-shot knowledge graphs is through direct reasoning or contextual learning. However, due to the limitations of the input length and understanding ability of large models, they can usually only accommodate 5 to 30 correct examples, and cannot play the role of all few-shot training sets. In addition, the performance of the ICL method is very unstable and easily affected by multiple factors, such as instructions, example order, and output format. In short, applying large models to the construction of few-shot knowledge graphs through direct reasoning or ICL methods either cannot adapt to the highly professional fields of science and education, or cannot play the role of all training samples, and there are multiple unstable factors. Therefore, these solutions cannot be directly applied to the construction of few-shot knowledge graphs in the fields of science and education.

[0005] Instruction fine-tuning can also be used to realize the construction of a small number of vertical domain knowledge graphs based on large models. Lilong et al. proposed an open knowledge graph construction framework AutoRE based on the large model fine-tuning algorithm (QLoRA). However, these usually perform small sample sampling through random strategies or according to a certain data distribution, ignoring the powerful zero-sample capability of the large model itself, that is, the training benefits of samples that are relatively easy for large models are limited. Therefore, how to adaptively select a small number of training samples with the greatest training benefits based on the zero-sample capability of the large model is crucial for the construction of knowledge graphs in the field of science and education with few samples.

[0006] In summary, the existing methods mainly have the following problems: 1. The automatic construction method of knowledge graph based on fine-tuning of pre-trained models requires a large amount of labeled data, and its performance is poor in the field of science and education where labeled samples are scarce.

[0007] 2. Methods based on direct reasoning or contextual learning, because they mostly use the general reasoning ability of large models, cannot be generalized to highly professional scientific and educational fields, resulting in poor performance. At the same time, due to the limitations of the large model itself, this type of method has poor stability.

[0008] 3. The method based on large model instruction fine-tuning does not take into account the zero-sample capability of the large model itself in the few-sample selection mechanism, so it cannot maximize the benefits of model training in limited samples, resulting in poor knowledge graph construction effect. Summary of the invention

[0009] The purpose of the present invention is to provide a method and system for predicting the relationship between scientific and educational resources based on large model zero-sample prediction to solve the above problems.

[0010] To achieve the above object, the present invention adopts the following technical solutions: In a first aspect, the present invention provides a method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction, comprising: Obtain unlabeled science and education resource data, and divide the unlabeled science and education resource data into simple samples and difficult samples based on zero-sample prediction and self-checking of large models to form a few-sample training set; Manually label the few-sample training set; Select the corresponding large model instruction fine-tuning algorithm according to different application scenarios, train the model on the labeled few-sample training set, and obtain the trained model; Load the trained model for automatic relationship extraction and complete relationship prediction.

[0011] Furthermore, unlabeled science and education resource data is obtained, including: obtaining multi-source heterogeneous science and education data through educational resources, and converting non-editable resources into editable resources through OCR recognition and storing them in the corpus.

[0012] Furthermore, based on the zero-sample prediction and self-checking of the large model, the unlabeled science and education resource data are divided into simple samples and difficult samples to form a few-sample training set, including: Zero-shot prediction: existing unlabeled relation extraction datasets ,for Each sample in Use the large model to make zero-sample predictions, i.e. ,in Indicates that for Prediction tips for sample designs; Sample division based on self-checking: Then, for each sample, based on the zero-sample prediction results of the large model and relationship prediction value Design large model self-check tips , and conduct a large model self-check, that is , according to the results of the large model self-test Unlabeled dataset Divide into and Two sets, of which represents a difficult sample, represents a simple sample; Uncertainty sorting: Uncertainty is used to measure The difficulty level of the difficult samples in ,in express The maximum probability distribution of the self-test result is then sorted according to the uncertainty of each self-test result, and the top samples are selected. samples as training samples to be labeled; Construction of high-quality training set: difficult samples, sort the simple samples from low to high by uncertainty, and select the first Simple samples are added to the training as regular samples. Finally, select High-quality training samples to be labeled.

[0013] Furthermore, the few-sample training set is manually labeled, including: General large model type automatic labeling: For the training samples to be labeled, the existing general large model is used for automatic labeling. Manually correct the automatically labeled data; The manually corrected data will be manually reviewed. If the review fails, the data will be corrected again.

[0014] Furthermore, the corresponding large model instruction fine-tuning algorithm is selected according to different application scenarios, including: According to different application scenarios, select the corresponding large model instruction fine-tuning algorithm, including full fine-tuning, efficient fine-tuning LoRA and model quantization fine-tuning QLoRA to train the model on the labeled few-sample training set.

[0015] Furthermore, the model is trained on the labeled few-sample training set to obtain a trained model, including: After determining the fine-tuning method, the cross entropy of each category is calculated and summed as the final loss of the model, that is, , where K represents the number of training samples and M represents the sequence length of each training sample.

[0016] Furthermore, the trained model is loaded for automatic relationship extraction and relationship prediction, including: Model loading: For models with full fine-tuning, load the fine-tuned large model; for models with efficient fine-tuning, first load the parameters of the basic model, and then load the additional model weights added during the fine-tuning process; for models with quantized fine-tuning, first load the quantized basic model, and then load the additional trained model parameters; Relation extraction prompt construction: When applying a large model to a relation extraction task, design prompts to guide the large model to complete related tasks; Relationship prediction: Input the constructed prompts into the loaded model to complete the automatic extraction of relationships.

[0017] In a second aspect, the present invention provides a scientific and educational resource relationship prediction system based on large model zero-sample prediction, comprising: The data acquisition module is used to obtain unlabeled science and education resource data. Based on the zero-sample prediction and self-checking of the large model, the unlabeled science and education resource data is divided into simple samples and difficult samples to form a few-sample training set. Data annotation module, used to manually annotate the few-sample training set; The model training module is used to select the corresponding large model instruction fine-tuning algorithm according to different application scenarios, train the model on the labeled few-sample training set, and obtain the trained model; The prediction output module is used to load the trained model for automatic relationship extraction and complete relationship prediction.

[0018] In a third aspect, the present invention provides a computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction when executing the computer program.

[0019] In a fourth aspect, the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the method for predicting the relationship between scientific and educational resources based on large-model zero-sample prediction are implemented.

[0020] Compared with the prior art, the present invention has the following technical effects: This technical solution proposes a method for predicting the relationship between scientific and educational resources based on large-scale model zero-sample prediction, aiming to solve the problem of scarce labeled data in the field of science and education and improve the accuracy of relationship prediction.

[0021] This method first obtains unlabeled scientific and educational resource data and uses the zero-sample prediction capability of the large model to preliminarily process this data. This avoids the reliance on a large amount of labeled data in traditional methods, making it possible to perform effective relationship prediction in the field of science and education where labeled data is scarce.

[0022] Through the self-checking ability of the large model, the unlabeled data is divided into simple samples and difficult samples, and high-quality training samples are further selected through uncertainty sorting. This mechanism ensures that the training set contains both challenging difficult samples and a sufficient number of simple samples, thereby improving the efficiency and accuracy of model training. The application of uncertainty sorting makes the selected training samples more representative and can better reflect the overall distribution of the data, thereby improving the generalization ability of the model.

[0023] The use of a general large model for automatic annotation, followed by manual correction and review, ensures both annotation efficiency and annotation quality. This semi-automatic annotation method reduces the burden of manual annotation and improves the accuracy of annotation.

[0024] According to different application scenarios, the corresponding large model instruction fine-tuning algorithm is selected, such as full fine-tuning, efficient fine-tuning LoRA and model quantization fine-tuning QLoRA, etc. This flexibility enables the method to adapt to different hardware resources and time requirements, improving the practicality and applicability of the method.

[0025] By calculating the cross entropy of each category and summing them as the final loss of the model, this method can effectively measure the performance of the model during the training process and guide the optimization direction of the model. This helps to ensure that the trained model has high accuracy in relationship prediction tasks.

[0026] After loading the trained model, the relationship extraction can be completed automatically by constructing the relationship extraction prompt and inputting it into the model. This automated process greatly improves the efficiency of relationship prediction, enabling this method to quickly and accurately extract the relationship between scientific and educational resources in practical applications.

[0027] This method comprehensively utilizes the zero-sample prediction and self-checking capabilities of the large model, as well as the flexible fine-tuning strategy, to construct an efficient scientific and educational resource relationship prediction method. This is of great significance for building a high-quality scientific and educational knowledge graph, and can promote the level of knowledge management and application in the field of science and education.

[0028] In summary, this technical solution effectively solves the problem of scarce labeled data in the field of science and education through a series of innovative methods and technical means, improves the accuracy of relationship prediction, and provides strong support for building high-quality science and education knowledge graphs. BRIEF DESCRIPTION OF THE DRAWINGS

[0029] Figure 1 It is a flow chart of the present invention.

[0030] Figure 2 This is a schematic diagram of the system for automatically constructing the knowledge graph in the field of science and education of the present invention. DETAILED DESCRIPTION

[0031] The present invention is further described below in conjunction with the accompanying drawings: Example 1, please refer to Figure 1 The present invention provides a method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction, comprising: Obtain unlabeled science and education resource data, and divide the unlabeled science and education resource data into simple samples and difficult samples based on zero-sample prediction and self-checking of large models to form a few-sample training set; Manually label the few-sample training set; Select the corresponding large model instruction fine-tuning algorithm according to different application scenarios, train the model on the labeled few-sample training set, and obtain the trained model; Load the trained model for automatic relationship extraction and complete relationship prediction.

[0032] In the field of science and education, labeled data is often scarce and difficult to obtain. By utilizing the zero-sample prediction capability of the large model, the present invention can perform preliminary processing on unlabeled science and education resource data without relying on any labeled data, thus providing the possibility for subsequent model training.

[0033] Through the self-checking ability of the large model, the unlabeled data is divided into simple samples and difficult samples, and high-quality training samples are further screened to form a small sample training set. This solves the problem that traditional machine learning methods require a large amount of labeled data for effective training.

[0034] The present invention selects the most representative training samples from simple samples and difficult samples by using methods such as uncertainty sorting, thereby ensuring the quality of the training set, which helps to improve the accuracy of the model in the relationship prediction task.

[0035] According to different application scenarios, the corresponding large model instruction fine-tuning algorithm is selected to fine-tune the model. This personalized fine-tuning method can make the model better adapt to specific scientific and educational resource relationship prediction tasks and further improve the accuracy of the prediction.

[0036] By carefully selecting training samples and fine-tuning the algorithm with large model instructions, the model can achieve better prediction results in fewer training rounds, improving training efficiency.

[0037] Due to the careful selection of training samples and personalized selection of fine-tuning algorithms, the model can maintain stable prediction performance when facing different scientific and educational resource relationship prediction tasks, reducing prediction fluctuations caused by data changes or task differences.

[0038] The method provided by the present invention can efficiently extract the relationship between scientific and educational resources, and provide strong support for building a high-quality scientific and educational knowledge map. This helps to promote the level of knowledge management and application in the field of science and education, and promote the sharing and inheritance of knowledge.

[0039] In summary, the scientific and educational resource relationship prediction method based on large-model zero-sample prediction provided by the present invention has shown significant technical effects in solving the scarcity of labeled data, improving the accuracy of relationship prediction, enhancing the efficiency and stability of model training, and promoting the construction and application of scientific and educational knowledge graphs.

[0040] Embodiment 2, the present invention provides a method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction, which specifically includes: Knowledge graph construction system model in science and education: The small sample training framework based on large model zero-sample adaptation designed in this solution is mainly used in the knowledge graph construction system in science and education where labeled samples are scarce. With the continuous development of automatic knowledge graph construction technology, the knowledge graph construction system is mainly divided into four modules, namely knowledge acquisition, ontology modeling, knowledge extraction and knowledge storage. Figure 2 As shown. In the process of knowledge graph construction, a large amount of knowledge is first acquired from multi-source heterogeneous scientific and educational resources, which generally include structured, semi-structured and unstructured. Secondly, ontology modeling is carried out to design the conceptual layer of the acquired knowledge in order to standardize the knowledge representation. The knowledge extraction module can usually be divided into two subtasks: entity recognition and relationship extraction. The training scheme in this article mainly acts on this module, aiming to give full play to the small sample migration ability of the large model through reasonable sample selection. Knowledge storage is the final step of the system, which is used to manage and utilize the constructed knowledge graph. In this system, the open source graph management tool Neo4j is used as the storage database.

[0041] The small-sample training framework based on large-model zero-sample adaptation designed in this solution runs on the above-mentioned knowledge graph construction system in the field of science and education, and its main function depends on a large amount of unlabeled data in the field of science and education. The main functions are as follows: In the face of a large amount of unlabeled data in the field of science and education, the framework can adaptively select a small batch of samples that are most challenging for the model for manual annotation based on the zero-sample capability of the current large model, so as to maximize the training benefits within the limited labeled samples; in addition, in order to prevent the large model from overfitting on difficult samples, it is necessary to select some aligned samples that match the zero-sample capability of the large model for manual annotation at the same time, and together with the above-selected difficult samples, they constitute the training data for small-sample fine-tuning; secondly, the framework provides a variety of large-model instruction fine-tuning algorithms, including full-quantity fine-tuning, efficient fine-tuning (LoRA) and model quantization fine-tuning (QLoRA), which can be adjusted according to different application scenarios.

[0042] Operation process (operation process of knowledge graph construction system) First, the system will obtain a large amount of multi-source heterogeneous science and education data through educational resources such as the Internet, textbooks, and supplementary teaching materials, and convert non-editable resources into editable resources through OCR recognition and store them in the corpus. Secondly, the ontology design is carried out in a semi-automatic way based on the science and education data, which mainly includes three entity elements, namely teaching resources (such as tutorials, videos, test questions, etc.), algorithm resources (such as frameworks, algorithms, data sets, etc.), and computing power resources (such as GPUs, network equipment, etc.), including four relationship sets, namely teaching-algorithm set, teaching-computing power set, algorithm-computing power set, and full set. Then, it enters the knowledge extraction stage, which can be subdivided into entity extraction and relationship extraction according to the different types of knowledge extracted. Entity extraction is divided into two steps, including boundary identification of named entities and entity classification. Relationship extraction predicts the potential relationship between entities based on entity extraction. The few-shot training framework based on large model zero-shot adaptation proposed in this paper acts on the entity extraction and relationship extraction stages respectively to improve the accuracy and efficiency of knowledge extraction.

[0043] Taking relation extraction as an example, the training framework process is briefly described: based on a large amount of unlabeled corpus and extracted entities, the zero-sample capability of the large model is used to predict the relationship between entity pairs in the same sample, and then the correctness of the prediction is judged by the zero-sample self-checking capability of the large model, that is, the prediction result and the sample are reorganized into a conclusion, which is input into the large model to ask whether it is correct. If it is correct, it means that the large model is more certain about the prediction result of the sample, and the use of such samples for training may not bring much benefit; if it is incorrect, it means that the large model is more confused about the sample, which is called "difficult sample" in this paper. Training on difficult samples can enable the large model to obtain greater training benefits. Therefore, according to the results of the zero-sample self-check of the large model, the unlabeled samples can be divided into simple samples and difficult samples. In addition, this paper uses uncertainty to measure the reliability of the self-checking results of the large model. The smaller the uncertainty, the more certain the result. Therefore, this paper sorts the difficult samples and simple samples of the self-checking results from low to high according to the uncertainty, and takes the first K samples in the difficult samples as training samples. In order to prevent the large model from having serious overfitting during the training process, we select the first NK samples from the simple samples as regular samples to add to the training, so N training samples can be obtained after the above steps. Next, the N training samples are manually labeled, and the appropriate algorithm is selected from the three fine-tuning algorithms according to different application scenarios to fine-tune the large model. At this point, the training task of the large model on relation extraction has been completed. Finally, the trained large model can automatically perform the relation extraction task.

[0044] Specific process: 1. The few-sample training framework based on large model zero-sample adaptation mainly includes the following steps (taking relationship extraction as an example): High-quality sample selection: Based on the zero-sample prediction and self-checking capabilities of the large model, the framework divides unlabeled data into simple samples and difficult samples, and selects K difficult samples and NK simple samples through uncertainty to form the final few-sample training set.

[0045] Few-sample data labeling: After the above sample selection, the selected high-quality samples need to be manually labeled.

[0046] Large model few-sample fine-tuning: Select the corresponding large model instruction fine-tuning algorithm according to different application scenarios, including full fine-tuning, high-efficiency fine-tuning (LoRA) and model quantization fine-tuning (QLoRA) to train the model on the labeled few-sample training set.

[0047] Large model prediction: Load the trained model to perform automatic relationship extraction.

[0048] The high-quality sample selection shown in 1 mainly includes the following steps: Zero-shot prediction: existing unlabeled relation extraction datasets ,for Each sample in Use the large model to make zero-sample predictions, i.e. ,in Indicates that for The prediction prompts for the sample design are as follows: "Your task is to complete the relationship extraction based on the given sentence, predefined relationship set and entity pair. \nPredefined relationship set: 1. Teaching-algorithm 2. Teaching-computing power 3. Computing power-algorithm 4. Others \nSentence: {... ...} \nEntity pair: {entity 1, entity 2} \nPlease answer the relationship between {entity 1} and {entity 2} based on the above content."

[0049] Sample division based on self-checking: Then, for each sample, based on the zero-sample prediction results of the large model and relationship prediction value Design large model self-check tips , specifically "Your task is to judge whether the conclusion is correct based on the given conclusion. Conclusion: In {given sentence}, the relationship between {entity 1} and {entity 2} is {relationship prediction value}. Please judge whether the conclusion is correct based on the above content, and answer with 'yes' or 'no'", and perform a large model self-check, that is, , according to the results of the large model self-test Unlabeled datasets can be Divide into and Two sets, of which Indicates difficult samples, that is, the self-test results of the large model are inconsistent with the prediction results, and there is a contradiction in the sample. Therefore, training on this sample can obtain better training benefits. On the contrary, the large model The simple samples in the prediction and self-checking stages have consistent results, indicating that the large model is relatively certain about the result. This type of sample represents the capabilities of the large model itself to a certain extent, and the benefits of training this type of sample are relatively small.

[0050] Uncertainty sorting: In order to further select high-quality samples, this paper designs uncertainty to measure The difficulty level of the difficult samples in ,in express Then, the difficult samples are sorted according to the uncertainty of each self-test result, and the top samples are used as training samples to be labeled.

[0051] Construction of high-quality training set: So far, we have selected In addition, since difficult samples have an implicit distribution of difficult samples, in order to prevent the large model from having a serious overfitting problem on this distribution, which would cause the large model to lose its prediction ability for simple samples. To this end, this scheme will sort the simple samples from low to high by uncertainty and select the top Simple samples are added as regular samples for training. Finally, after the above steps, High-quality training samples to be labeled.

[0052] As shown in 1, the few-sample data labeling mainly includes the following steps: General large model type automatic labeling: In order to improve labeling efficiency, the training samples to be labeled will be given priority for automatic labeling through existing general large models, such as Tongyi Qianwen and Wenxin Yiyan. The specific prompt design is as follows: "Your task is to complete relationship extraction based on given sentences, predefined relationship sets and entity pairs.\nPredefined relationship sets: 1. Teaching-algorithm 2. Teaching-computing power 3. Computing power-algorithm 4. Other\nSentence: {... ...}\nEntity pair: {entity 1, entity 2}\nPlease answer the relationship between {entity 1} and {entity 2} based on the above content."

[0053] Manual correction: In order to improve the accuracy of annotation, manual correction of automatically annotated data is required.

[0054] Manual review: To further improve the reliability of the labeled data, the system will submit the manually corrected data to professionals for review. If the review fails, it means that the sample is ambiguous and step (2) needs to be repeated.

[0055] As shown in 1, fine-tuning a large model with a few samples mainly includes the following steps: Fine-tuning algorithm selection: Select the corresponding large model instruction fine-tuning algorithm according to different application scenarios, including full fine-tuning, efficient fine-tuning (LoRA) and model quantization fine-tuning (QLoRA) to train the model on a labeled small sample training set. Among them, full fine-tuning has high requirements for video memory, efficient fine-tuning freezes the parameters of the entire model and trains by adding additional trainable parameters, and model quantization has low requirements for the device, but it will cause a greater loss in the accuracy of the model.

[0056] Model fine-tuning training: After determining the fine-tuning method, the cross entropy of each category is calculated and summed as the final model loss, that is, .

[0057] The large model prediction shown in 1 mainly includes the following steps: Model loading: For models under full fine-tuning, the system only needs to load the fine-tuned large model. For models under efficient fine-tuning, the system needs to first load the parameters of the basic model, and then load the additional model weights added during the fine-tuning process. For model quantization fine-tuning, the system needs to first load the quantized basic model, and then load the additional trained model parameters.

[0058] Relation extraction prompt construction: When applying a large model to a relationship extraction task, it is necessary to design corresponding prompts to guide the large model to complete the relevant tasks. The specific prompt design is as follows: "Your task is to complete relationship extraction based on given sentences, predefined relationship sets, and entity pairs. \nPredefined relationship sets: 1. Teaching-algorithm 2. Teaching-computing power 3. Computing power-algorithm 4. Others \nSentence: {... ...} \nEntity pair: {entity 1, entity 2} \nPlease answer the relationship between {entity 1} and {entity 2} based on the above content."

[0059] Relationship prediction: Input the constructed prompts into the loaded model to complete the automatic extraction of relationships.

[0060] The present invention comprehensively utilizes the zero-sample prediction and self-checking capabilities of the large model to construct a high-yield training sample selection mechanism in a few-sample scenario, without relying on any labeled data, and successfully applies it to the construction of knowledge graphs in the field of science and education where labeled data is scarce, relying on the knowledge graph construction system. Compared with most of the current few-sample schemes based on random sampling, the scheme in this paper improves the fine-tuning effect of large-model instructions while taking into account the stability of few-sample fine-tuning, which is of great significance for constructing high-quality science and education knowledge graphs.

[0061] In yet another embodiment of the present invention, a system for predicting the relationship between scientific and educational resources based on large model zero-sample prediction is provided, which can be used to implement the above-mentioned method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction. Specifically, the system includes: The data acquisition module is used to obtain unlabeled science and education resource data. Based on the zero-sample prediction and self-checking of the large model, the unlabeled science and education resource data is divided into simple samples and difficult samples to form a few-sample training set. Data annotation module, used to manually annotate the few-sample training set; The model training module is used to select the corresponding large model instruction fine-tuning algorithm according to different application scenarios, train the model on the labeled few-sample training set, and obtain the trained model; The prediction output module is used to load the trained model for automatic relationship extraction and complete relationship prediction.

[0062] The division of modules in the embodiments of the present invention is schematic and is only a logical function division. There may be other division methods in actual implementation. In addition, each functional module in each embodiment of the present invention may be integrated into one processor, or may exist physically separately, or two or more modules may be integrated into one module. The above-mentioned integrated modules may be implemented in the form of hardware or in the form of software functional modules.

[0063] In another embodiment of the present invention, a computer device is provided, the computer device including a processor and a memory, the memory is used to store a computer program, the computer program includes program instructions, and the processor is used to execute the program instructions stored in the computer storage medium. The processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc., which are the computing core and control core of the terminal, which are suitable for implementing one or more instructions, and are specifically suitable for loading and executing one or more instructions in the computer storage medium to implement the corresponding method flow or corresponding function; the processor described in the embodiment of the present invention can be used for the operation of the scientific and educational resource relationship prediction method based on large model zero-sample prediction.

[0064] In another embodiment of the present invention, the present invention also provides a storage medium, specifically a computer-readable storage medium (Memory), which is a memory device in a computer device for storing programs and data. It is understandable that the computer-readable storage medium here can include both built-in storage media in a computer device and, of course, an extended storage medium supported by the computer device. The computer-readable storage medium provides a storage space, which stores the operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by a processor are also stored in the storage space, and these instructions can be one or more computer programs (including program codes). It should be noted that the computer-readable storage medium here can be a high-speed RAM memory or a non-volatile memory, such as at least one disk memory. The processor can load and execute one or more instructions stored in the computer-readable storage medium to implement the corresponding steps of the method for predicting the relationship between science and education resources based on large model zero-sample prediction in the above embodiment.

[0065] It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0066] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0067] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0068] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0069] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.

Claims

1. A method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction, characterized in that: include: Obtain unlabeled science and education resource data, and divide the unlabeled science and education resource data into simple samples and difficult samples based on zero-sample prediction and self-checking of large models to form a few-sample training set; Manually label the few-sample training set; Select the corresponding large model instruction fine-tuning algorithm according to different application scenarios, train the model on the labeled few-sample training set, and obtain the trained model; Load the trained model for automatic relationship extraction and complete relationship prediction.

2. The method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction according to claim 1, characterized in that: Obtain unlabeled science and education resource data, including: obtaining multi-source heterogeneous science and education data through educational resources, and converting non-editable resources into editable resources through OCR recognition and storing them in the corpus.

3. The method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction according to claim 1, characterized in that: Based on the large model, zero-shot prediction and self-checking divide the unlabeled science and education resource data into simple samples and difficult samples to form a few-shot training set, including: Zero-shot prediction: existing unlabeled relation extraction datasets ,for Each sample in Use the large model to make zero-sample predictions, i.e. ,in Indicates that for Prediction tips for sample designs; Sample division based on self-checking: Then, for each sample, based on the zero-sample prediction results of the large model and relationship prediction value Design large model self-check tips , and conduct a large model self-check, that is , according to the results of the large model self-test Unlabeled dataset Divide into and Two sets, of which represents a difficult sample, represents a simple sample; Uncertainty sorting: Uncertainty is used to measure The difficulty level of the difficult samples in ,in express The maximum probability distribution of the self-test result is then sorted according to the uncertainty of each self-test result, and the top samples are selected. samples as training samples to be labeled; Construction of high-quality training set: difficult samples, sort the simple samples from low to high by uncertainty, and select the first Simple samples are added to the training as regular samples. Finally, select High-quality training samples to be labeled.

4. The method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction according to claim 1, characterized in that: Manually label the few-sample training set, including: General large model type automatic labeling: For the training samples to be labeled, the existing general large model is used for automatic labeling. Manually correct the automatically labeled data; The manually corrected data will be manually reviewed. If the review fails, the data will be corrected again.

5. The method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction according to claim 1, characterized in that: Select the corresponding large model instruction fine-tuning algorithm according to different application scenarios, including: According to different application scenarios, select the corresponding large model instruction fine-tuning algorithm, including full fine-tuning, efficient fine-tuning LoRA and model quantization fine-tuning QLoRA to train the model on the labeled few-sample training set.

6. The method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction according to claim 5, characterized in that: Train the model on the labeled few-sample training set to obtain a trained model, including: After determining the fine-tuning method, the cross entropy of each category is calculated and summed as the final loss of the model, that is, , where K represents the number of training samples and M represents the sequence length of each training sample.

7. The method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction according to claim 1, characterized in that: Load the trained model for automatic relationship extraction and complete relationship prediction, including: Model loading: For models with full fine-tuning, load the fine-tuned large model; for models with efficient fine-tuning, first load the parameters of the basic model, and then load the additional model weights added during the fine-tuning process; for models with quantized fine-tuning, first load the quantized basic model, and then load the additional trained model parameters; Relation extraction prompt construction: When applying a large model to a relation extraction task, design prompts to guide the large model to complete related tasks; Relationship prediction: Input the constructed prompts into the loaded model to complete the automatic extraction of relationships.

8. A scientific and educational resource relationship prediction system based on large model zero-sample prediction, characterized in that: include: The data acquisition module is used to obtain unlabeled science and education resource data. Based on the zero-sample prediction and self-checking of the large model, the unlabeled science and education resource data is divided into simple samples and difficult samples to form a few-sample training set. Data annotation module, used to manually annotate the few-sample training set; The model training module is used to select the corresponding large model instruction fine-tuning algorithm according to different application scenarios, train the model on the labeled few-sample training set, and obtain the trained model; The prediction output module is used to load the trained model for automatic relationship extraction and complete relationship prediction.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for predicting the relationship between scientific and educational resources based on large model zero-sample prediction as described in any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for predicting the relationship between scientific and educational resources based on large-model zero-sample prediction as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Intelligent demand analysis and service combination method and device for science and technology service

    CN114328957A

  • Zero sample event relation extraction method for agrometeorological disasters

    CN118940751A

  • Zero-shot entity linking based on symbolic information

    US20230229859A1

  • Network model training method and apparatus, and computer-readable storage medium

    WO2023071743A1