Data knowledge extraction method, system and equipment based on large language model and storage medium

Through a large language model to understand the relationship between texts and the quadratic retrieval optimization algorithm, the problem of time-consuming and resource-consuming and low efficiency in processing massive text data is solved, and efficient and accurate knowledge extraction effect is achieved.

CN119646134AActive Publication Date: 2025-03-18SOUTH CHINA UNIV OF TECH

Patent Information

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

AI Technical Summary

Technical Problem

The prior art consumes time and resources when processing massive text data, and has low data processing efficiency in specific fields, difficult to achieve real-time, and insufficient accuracy, making it easy to cause errors and omissions.

Method used

Understand the relationship between texts through a large language model, use a secondary search optimization algorithm to remove high correlation features, and use the fine-tuning training large language model to integrate information, improving the efficiency and accuracy of knowledge extraction.

Benefits of technology

It significantly improves the efficiency and accuracy of knowledge extraction, and can deeply merge knowledge source information while maintaining semantic integrity, eliminate duplicate information and deal with ambiguity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119646134A_ABST
    Figure CN119646134A_ABST
Patent Text Reader

Abstract

The invention discloses a data knowledge extraction method, system and device based on a large language model, and a storage medium. The method comprises the following steps: preprocessing obtained original data; extracting features from the original data, selecting corresponding task features, and removing high-correlation features by calculating a correlation coefficient matrix between the features; selecting a large language model of the task, capturing general languages and knowledge, and performing fine tuning on the large language model on an annotation data set of a specific field or task; based on big language model reasoning and cue word engineering, knowledge source information is extracted by adopting a secondary block iteration mode, and information extracted from different data sources is integrated by utilizing context understanding ability of a big language model after fine tuning training; and defining an evaluation standard, analyzing an error case of the large language model, identifying an improvement direction, and adjusting model parameters and training data according to an evaluation result and error analysis. The method has the advantage of improving the efficiency and accuracy of the knowledge extraction method.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of data knowledge, and specifically relates to a data knowledge extraction method, system, device and storage medium based on a large language model. Background Art

[0002] With the rapid development of the Internet, a large amount of text data, such as user comments on social media, news reports, forum posts, and blog articles, continues to emerge. These data contain rich information and knowledge, and how to effectively extract valuable knowledge from them has become a key research direction. The extracted knowledge not only helps companies make accurate market decisions and product optimization, but also provides strong data support for academic research, thereby promoting the advancement of science and technology.

[0003] Currently, large language models have excellent text understanding and generation capabilities due to their large number of parameters, which makes it possible to use such models to extract key information. However, existing knowledge extraction technologies still face many challenges: on the one hand, processing massive amounts of text data requires a lot of time and computing resources; on the other hand, when processing data in specific fields, existing methods are inefficient and difficult to meet real-time requirements. In addition, due to the diversity and complexity of text data itself, existing technologies are still insufficient in terms of accuracy and are prone to errors and omissions. In particular, although large-scale language models have powerful understanding and generation capabilities, they may also generate inaccurate information, which requires manual verification to ensure the authenticity of the information.

[0004] Therefore, developing a large language model-based method that can improve the efficiency and accuracy of knowledge extraction is crucial to improving the current data analysis process. Summary of the invention

[0005] The main purpose of the present invention is to overcome the shortcomings and deficiencies of the prior art and to provide a data knowledge extraction method, system, device and storage medium based on a large language model. The present invention considers the relationship between texts through a large language model understanding model, and achieves complementary advantages between knowledge sources through a secondary retrieval optimization algorithm, thereby improving the efficiency and accuracy of the knowledge extraction method.

[0006] In order to achieve the above object, the present invention adopts the following technical solutions:

[0007] In a first aspect, the present invention provides a data knowledge extraction method based on a large language model, comprising the following steps:

[0008] Acquire raw data, and pre-process the acquired raw data;

[0009] Extract features from the preprocessed raw data, select the corresponding task features, and remove the features with high correlation by calculating the correlation coefficient matrix between the features;

[0010] Select a large language model for the task, capture general language and knowledge based on the large language model, and fine-tune the large language model on the labeled dataset of the corresponding task;

[0011] Based on large language model reasoning and prompt word engineering, a secondary block iteration method is used to extract knowledge source information, and the context understanding ability of the fine-tuned large language model is used to integrate information extracted from different data sources;

[0012] Define evaluation criteria, analyze error cases of large language models, identify improvement directions, and adjust large language model parameters and training data based on evaluation results and error analysis.

[0013] As a preferred technical solution, the obtained raw data is preprocessed as follows:

[0014] Delete irrelevant information in the original data, fill in missing data, or delete records with a large number of missing values, correct spelling errors, inconsistent format data; design personalized prompt word templates, process data through a large language model, standardize date, time, and currency data in different formats into a unified format, unify text data into lowercase, remove special characters and punctuation, convert data into data types suitable for model processing, perform word segmentation and part-of-speech tagging on text data, and use word embedding technology to convert structured and unstructured text into word vector representations.

[0015] As a preferred technical solution, the features are extracted from the preprocessed raw data, the corresponding task features are selected, and the features with high correlation are removed by calculating the correlation coefficient matrix between the features, specifically:

[0016] Convert the text data in the original data into word frequency vectors, measure the importance of words, reduce the weight of common words, use the pre-trained word vector model to convert the text data into a high-dimensional vector, calculate the mean, standard deviation, maximum, and minimum values, and in time series data, aggregate features by time window, calculate the correlation coefficient between features and target variables, select features with high correlation, remove features with high correlation by calculating the correlation coefficient matrix between features, and project the data to a lower dimensional space through linear transformation, retain key information, and remove redundant features. The key information includes semantic information and word frequency information.

[0017] As a preferred technical solution, in the time series data, the features are aggregated by time window, and the correlation coefficient between the features and the target variable is calculated, specifically:

[0018] Arrange the time series data in chronological order and include feature data and target variables. Select the time window size to aggregate features, calculate the statistical features within each time window, and align the aggregated features with the target variable. Since the sequence data is not normally distributed, select the Spearman correlation coefficient as the sequence analysis model to calculate the correlation parameter between each aggregated feature and the target variable.

[0019] As a preferred technical solution, the fine-tuning of the large language model on the labeled data set of the corresponding task includes the following steps:

[0020] According to the needs of specific tasks, modify the structure of the large language model, adjust the output layer, and add auxiliary loss functions for specific tasks. Specifically:

[0021] First, supervised fine-tuning is performed on the large language model so that the large language model has preliminary data knowledge extraction capabilities; the supervised fine-tuning is performed by collecting a supervised dataset containing input prompts and required outputs to fine-tune the large language model;

[0022] Secondly, a reward model is trained. The reward model is a model obtained by removing the final embedding layer of the large language model after supervised fine-tuning training. The reward model takes prompts and replies as inputs and calculates a scalar reward value as output. The training of the reward model is achieved by fitting human tendencies for different replies. The tendency probability is calculated by the difference between the reward values ​​of two replies in each sample to fit human labels, thereby completing the training of the reward model. The loss function of the reward model aims to maximize the difference between the responses that users prefer and those that they don’t like.

[0023] Next, a strategy is generated to optimize the PPO model, and the reward model is used to guide the supervised fine-tuned SFT model to continue training. Specifically, first, the current strategy samples responses based on the input query; then, the reward model calculates rewards based on the quality of the responses and feeds them back to the current strategy for updating; when the SFT model continues to be trained, a penalty term is added to the loss function to ensure that the difference between the PPO model output and the SFT model output is as small as possible, and a general large language model is added to the training target to improve performance;

[0024] According to the preset fine-tuning strategy, choose to freeze some pre-trained model parameters, retain the large language model's learning on general language and knowledge, use the labeled dataset to fine-tune and train the large language model, and update the model parameters through the back-propagation algorithm.

[0025] As a preferred technical solution, the context understanding ability of the fine-tuned trained large language model is used to integrate the information extracted from different data sources, specifically:

[0026] Combine information from different data sources, divide the data source information into blocks, generate vectors based on the fine-tuned Chinese word embedding model, calculate the similarity between each block of information based on the prompt word and the large language model, and use the large language model itself to generate the corresponding input question to retrieve the data source with higher similarity. Use the large language model to re-retrieve different information sources with this input question, divide the information source content into blocks and perform word embedding again. The block size in the second retrieval is twice that of the first one. Consider the relationship between texts through context understanding of the data information with higher content relevance after retrieval, integrate the extracted entities and relationships into a knowledge graph, display the relationship and connection between entities, eliminate duplicate information, and process ambiguous information based on the content similarity of the retrieval results.

[0027] As a preferred technical solution, the error cases of the analysis model and identification of improvement directions are specifically as follows:

[0028] Use the validation set or test set to evaluate the trained model, calculate the performance of the large language model on various evaluation indicators, and use the large language model to perform self-error case analysis on samples that the large language model predicts incorrectly on the validation set or test set to identify patterns or characteristics that are prone to errors in the model. Check whether the model lacks key features and whether more feature engineering is needed. Check whether the dataset has category imbalance or data bias, use fusion retrieval enhancement technology or adjust category weights. According to the results of the error case analysis, adjust the training data, increase or decrease the number of samples in certain categories, retrain the model using the adjusted model parameters and training data, and evaluate the adjusted model again using the validation set or test set to check whether the model's performance on the evaluation indicators has improved.

[0029] In a second aspect, the present invention provides a data knowledge extraction system based on a large language model, which is applied to the data knowledge extraction method based on a large language model, including a data acquisition module, a feature extraction module, a model fine-tuning module, an information integration module and a result evaluation module;

[0030] The data acquisition module is used to acquire original data and pre-process the acquired original data;

[0031] The feature extraction module is used to extract features from the preprocessed raw data, select corresponding task features, and remove features with high correlation by calculating the correlation coefficient matrix between the features;

[0032] The model fine-tuning module is used to select a large language model for a task, capture general language and knowledge based on the large language model, and fine-tune the large language model on a labeled dataset corresponding to the task;

[0033] The information integration module is used to extract knowledge source information through secondary block iteration based on large language model reasoning and prompt word engineering, and integrate information extracted from different data sources by using the context understanding ability of the fine-tuned large language model.

[0034] The result evaluation module is used to define evaluation criteria, analyze error cases of the large language model, identify improvement directions, and adjust large language model parameters and training data based on evaluation results and error analysis.

[0035] In a third aspect, the present invention provides an electronic device, the electronic device comprising:

[0036] at least one processor; and,

[0037] a memory communicatively connected to the at least one processor; wherein,

[0038] The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor to enable the at least one processor to perform the data knowledge extraction method based on the large language model.

[0039] In a fourth aspect, the present invention provides a computer-readable storage medium storing a program, which, when executed by a processor, implements the data knowledge extraction method based on a large language model.

[0040] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0041] The data knowledge extraction method of the present invention calculates the correlation coefficient matrix between features, removes features with high correlation, projects data to a lower dimensional space through linear transformation, retains main information, considers the relationship between texts through a large language model understanding model, and achieves complementary advantages between knowledge sources through a secondary retrieval optimization algorithm. It retains semantics through changes in block size while achieving deep merging of knowledge source information with the help of the powerful language understanding ability of the large model, integrates the extracted entities and relationships into a knowledge graph, displays the relationship and connection between entities, eliminates duplicate information, and processes ambiguous information, thereby improving the efficiency and accuracy of the knowledge extraction method. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0043] Figure 1 This is a flow chart of a data knowledge extraction method based on a large language model according to an embodiment of the present invention;

[0044] Figure 2 A flowchart of a reward model training method based on user backtest data according to an embodiment of the present invention;

[0045] Figure 3 A block diagram of a data knowledge extraction system based on a large language model according to an embodiment of the present invention;

[0046] Figure 4 4 is a structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0047] In order to enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present application.

[0048] Reference to "embodiments" in this application means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described in this application may be combined with other embodiments.

[0049] like Figure 1 As shown, this embodiment provides a data knowledge extraction method based on a large language model, comprising the following steps:

[0050] S1. Collect raw data from various sources and pre-process the collected raw data;

[0051] Furthermore, in step S1, the collected raw data is preprocessed, specifically:

[0052] Delete irrelevant information in the original data, fill in missing data, use the mean, median or interpolation method, or delete records with a large number of missing values, correct spelling errors, inconsistent format data; design personalized prompt word templates, and use large language models to process data to standardize data in different formats such as date, time, and currency into a unified format, unify text data into lowercase, remove special characters and punctuation, convert data into data types suitable for model processing, perform word segmentation and part-of-speech tagging on text data, and use word embedding technology to convert structured and unstructured text into word vector representations.

[0053] S2. Extract features from the preprocessed raw data, select the corresponding task features, and remove the features with high correlation by calculating the correlation coefficient matrix between the features.

[0054] Furthermore, step S2 is specifically as follows:

[0055] Convert text data into word frequency vectors, measure the importance of words, reduce the weight of common words, use pre-trained word vector models to convert text into high-dimensional vectors, calculate the mean, standard deviation, maximum, and minimum values, aggregate features by time window in time series data, calculate the correlation coefficient between features and target variables, select features with high correlation, remove features with high correlation by calculating the correlation coefficient matrix between features, project data into a lower-dimensional space through linear transformation, retain key information, and remove redundant features.

[0056] Furthermore, in time series data, features are aggregated by time windows, and the correlation coefficients between features and target variables are calculated. Specifically, the time series data is arranged in chronological order, including feature data and target variables, the time window size is selected to aggregate features, the statistical features within each time window are calculated, the aggregated features are aligned with the target variable, and the correlation parameters between each aggregated feature and the target variable are calculated.

[0057] S3. Select a large language model for the task, capture common language and knowledge based on the large language model, and fine-tune the large language model on the labeled dataset of the corresponding task.

[0058] Step S3 is specifically as follows:

[0059] S31. According to the requirements of specific tasks, modify the structure of the large language model, adjust the output layer, and add an auxiliary loss function for the specific task, which specifically includes the following steps:

[0060] The first step is supervised fine-tuning. In order for the language model to have preliminary data knowledge extraction capabilities, it is usually necessary to collect a supervised dataset containing input prompts (instructions) and required outputs to fine-tune the language model. These prompts and outputs can be written by manual annotators for certain specific data knowledge extraction tasks while ensuring task diversity. Here we use historical labeled data. Supervised fine-tuning can utilize the parameters and structure of the pre-trained model to avoid training the model from scratch, thereby accelerating the model training process and improving the model's performance on the target task. Generally speaking, only a portion of the layers of the pre-trained model will be fine-tuned. During the fine-tuning process, the model is optimized through the back-propagation algorithm to make the model perform better on the task.

[0061] The second step is to train a reward model. This stage aims to obtain a reward model that fits human preference data knowledge extraction. The structure of the reward model is a model with the last embedding layer of the model after supervised fine-tuning training removed. The reward model takes prompts and replies as input and calculates a scalar reward value as output. The training process of the reward model is achieved by fitting human tendencies for different replies. Specifically, first, based on the model fine-tuned on human writing data, K different replies (4≤K≤9) are sampled for the same prompt. Then, the replies are combined in pairs to form a reward model training sample, and humans give tendency labels, that is, each prompt is displayed in total results, and the user then selects the better output. This training method of batching prompts is less prone to overfitting than the traditional method of batching samples, because in this method, each prompt is input into the model only once. Finally, the reward model calculates the propensity probability to fit the human label by the difference in the reward values ​​of the two responses in each sample, thereby completing the training of the reward model. The loss function of the reward model is expressed as shown in the following formula. The goal of this loss function is to maximize the difference between the responses that the user prefers and the responses that he does not like.

[0062]

[0063] where r θ (x,y w ) is the reward value of prompt x and response y under the reward model with parameter θ, y w is the response that the labeler prefers, y l is the response that the labeler dislikes more. D is the entire training dataset.

[0064] The third step is to generate policy optimization PPO. It guides the continued training of the SFT model through the reward model obtained in the second step. Given the learned data knowledge extraction reward model, the parameters of the pre-trained model will be regarded as a strategy and trained under the framework of reinforcement learning. First, the current strategy samples replies based on the input query. Then, the reward model calculates the reward based on the quality of the reply and feeds it back to the current strategy for updating. In this step, the training goal aims to solve the following two problems. The first problem is that as the model is updated, the data generated by the reinforcement learning model and the data of the training reward model will be more different. Add a KL penalty term to the loss function To ensure that the difference between the PPO model output and the SFT output is not too large. The second problem is that if only the PPO model is used for training, the performance of the model on general NLP tasks will be greatly reduced. You can add a general language model target to the training target. To solve this problem, in summary, the following objective function is maximized in PPO training.

[0065]

[0066] in, is the learned RL policy, π SFT is the SFT model, D pretain is the pre-training distribution, β is the KL penalty coefficient, and γ controls the KL penalty and pre-training gradient.

[0067] Furthermore, after the two fine-tuning steps of knowledge error correction and variance elimination, the data knowledge extraction model has basically met the human requirements for the model and can output real information and rich opinions. However, the original intention of the data knowledge extraction model is to solve human problems in the vertical field of data knowledge extraction. Users prefer to solve their problems in as few dialogue rounds as possible. Too many dialogue rounds are obviously the result that users do not want to see. Therefore, in the vertical field of data knowledge extraction, this phenomenon is one of the core problems that need to be solved. However, the frequency of this low dialogue efficiency problem is relatively low, and it is difficult to make a qualitative judgment on it. Therefore, if the current reinforcement learning method based on human feedback is used for targeted fine-tuning, the cost of manual labeling is very huge, and it is difficult to form a good evaluation rule for human labelers to refer to.

[0068] Therefore, we make corresponding modifications to the traditional reward model training stage and propose a reward model training method based on user backtesting data. By setting up a satisfaction survey after users use the model, we aim to use user evaluation data to conduct reinforcement learning based on human feedback, and to optimize the conversation efficiency of large models in vertical fields. In addition, this method can continuously optimize and improve the model according to other needs of the later model to meet different requirements. Figure 2 As shown, after the user and the vertical field large model have completed the interaction, artificially designed evaluation questions are used to evaluate certain capabilities of the model. Two evaluation questions are proposed in this patent: 1. Please rate the accuracy of the model's answers to questions during this use; 2. Please rate the number of dialogue rounds the model spent on solving problems during this use. These two questions describe the dialogue efficiency of the model from two perspectives. After the interaction data and evaluation data generated by the user reach a certain scale, the data set is extracted, and the general large language model is used to merge the questions in the data set. Questions with different language descriptions but the same core questions are identified, and the questions and the answers of the vertical field large model are merged to obtain a human feedback data set containing two evaluation indicators. Obviously, it is difficult to train two evaluation indicators at the same time, so this study proposes a method of dynamically weighted aggregation of the two evaluation indicators to form a human feedback data set that sorts answers according to scores.

[0069] Taking the two evaluation questions mentioned in this embodiment as an example, the comprehensive evaluation score of a certain answer is defined as follows:

[0070] Score[X]=α1β1Score1[X]+α2β2Score2[X]

[0071] Among them, α1 and α2 represent the initial weights of the two ratings, reflecting the researcher's measure of the importance of the two evaluations. If the importance is the same, both are 0.5. β1 and β2 represent the dynamic weights of the two ratings. The dynamic weights reflect the relative saturation between different ratings. For example, when the average satisfaction of rating 1 is very high and the average satisfaction of rating 2 is low, the weight of β1 should be much lower than β2, so that the model can focus more on learning and improving the dissatisfaction caused by rating 2. Therefore, the dynamic weight is defined as follows:

[0072] β1=S2 / (S1+S2)

[0073] β2=S1 / (S1+S2)

[0074] Where S1 represents the average score of all answers to the question on score 1. After obtaining the comprehensive score of each answer, all answers to each question can be sorted to obtain a standard human feedback data set for training the reward model. The reward model is a model with the last embedding layer in the network structure of a large model in a vertical field removed. The input is questions and answers, and the output is a scalar reward value. During training, the answer corresponding to each question is taken as a batch. This method of dividing batches by questions is less prone to overfitting than the traditional method of randomly dividing batches, because each question data is input into the model only once. The loss of model learning is as follows

[0075]

[0076] The goal of this loss function is to maximize the difference between the answers that the annotator likes and the answers that he doesn’t like. θ (x,y w ) represents question x and answer y w The reward value under the reward model with parameter θ. w is the higher-scoring answer, r θ It is the answer with a lower score. After the reward model is trained, the question and answer data can be used to fine-tune the model through reinforcement learning to improve the conversation efficiency of large models in vertical fields. It is worth mentioning that the data used for reinforcement learning fine-tuning can be collected from the process of users using the product, so that training can be achieved while using it, and the performance of the model can be gradually improved.

[0077] S32. According to the preset fine-tuning strategy, select to freeze some pre-trained model parameters, retain the learning of the large language model on general language and knowledge, use the labeled data set to fine-tune and train the large language model, and update the model parameters through the back-propagation algorithm.

[0078] S4. Based on large language model reasoning and prompt word engineering, a secondary block iteration method is used to extract knowledge source information, and the context understanding ability of the fine-tuned large language model is used to integrate the information extracted from different data sources.

[0079] Furthermore, the contextual understanding ability of the model is used to integrate the information extracted from different data sources. Specifically, the information from different data sources is combined and divided into blocks. After generating vectors based on the fine-tuned Chinese word embedding model, the similarity between each block of information is calculated based on the prompt word and the large language model. The large language model itself generates a corresponding input question for retrieving data sources with high comprehensive similarity, and the input question is used to re-search different information sources through the large language model. The information source content is again divided into blocks and word embedding is performed. The block size in the second retrieval is twice that of the first time. The data information with high content relevance after retrieval is considered through contextual understanding. The relationship between texts is considered, and the extracted entities and relationships are integrated into a knowledge graph to display the relationship and connection between entities, eliminate duplicate information, and process ambiguous information based on the content similarity after the retrieval results.

[0080] S5. Define evaluation criteria, analyze error cases of large language models, identify improvement directions, and adjust model parameters and training data based on evaluation results and error analysis.

[0081] Furthermore, step S5 is specifically as follows:

[0082] Use the validation set or test set to evaluate the trained model, calculate the model's performance on various evaluation indicators, perform error case analysis on samples that the model predicts incorrectly on the validation set or test set, identify patterns or characteristics that are prone to errors in the model, check whether the model lacks key features and whether more feature engineering is needed, check whether the dataset has category imbalance or data bias, use data augmentation techniques or adjust category weights, adjust the training data based on the results of the error case analysis, increase or decrease the number of samples in certain categories, retrain the model using the adjusted model parameters and training data, evaluate the adjusted model again using the validation set or test set, and check whether the model's performance on the evaluation indicators has improved.

[0083] The data knowledge extraction method of the present invention selects low-redundancy feature sets by constructing a correlation coefficient matrix between features; then uses linear transformation technology to map data to a low-dimensional space to retain key information; uses a large language model to parse the correlation between texts; implements a secondary retrieval optimization algorithm to integrate the advantages of different knowledge sources; and dynamically adjusts the block size to maintain semantic integrity while leveraging the powerful understanding ability of the large language model for deep information integration. Finally, the extracted entities and their relationships are constructed into a knowledge graph to show the connections between entities, while eliminating duplication and resolving fuzzy information, significantly improving the efficiency and accuracy of the knowledge extraction process.

[0084] It should be noted that, for the sake of convenience, the aforementioned method embodiments are all expressed as a series of action combinations, but those skilled in the art should know that the present invention is not limited to the described order of actions, because according to the present invention, certain steps can be performed in other orders or simultaneously.

[0085] Based on the same idea as the data knowledge extraction method based on a large language model in the above-mentioned embodiment, the present invention also provides a data knowledge extraction system based on a large language model, which can be used to execute the above-mentioned data knowledge extraction method based on a large language model. For ease of explanation, the structural diagram of the embodiment of the data knowledge extraction system based on a large language model only shows the parts related to the embodiment of the present invention. Those skilled in the art can understand that the illustrated structure does not constitute a limitation on the device, and may include more or fewer components than shown in the diagram, or combine certain components, or arrange the components differently.

[0086] See also Figure 3 In another embodiment of the present application, a data knowledge extraction system 100 based on a large language model is provided, the system comprising a data acquisition module 101, a feature extraction module 102, a model fine-tuning module 103, an information integration module 104 and a result evaluation module 105;

[0087] The data acquisition module 101 is used to acquire original data and pre-process the acquired original data;

[0088] The feature extraction module 102 is used to extract features from the preprocessed raw data, select corresponding task features, and remove features with high correlation by calculating the correlation coefficient matrix between the features;

[0089] The model fine-tuning module 103 is used to select a large language model for a task, capture general language and knowledge based on the large language model, and fine-tune the large language model on a labeled dataset corresponding to the task;

[0090] The information integration module 104 is used to extract knowledge source information in a secondary block iterative manner based on large language model reasoning and prompt word engineering, and integrate information extracted from different data sources by using the context understanding ability of the fine-tuned large language model;

[0091] The result evaluation module 105 is used to define evaluation criteria, analyze error cases of the large language model, identify improvement directions, and adjust large language model parameters and training data based on evaluation results and error analysis.

[0092] It should be noted that the data knowledge extraction system based on a large language model of the present invention corresponds one-to-one to the data knowledge extraction method based on a large language model of the present invention. The technical features and beneficial effects described in the above-mentioned embodiment of the data knowledge extraction method based on a large language model are applicable to the embodiment of the data knowledge extraction based on a large language model. For specific contents, please refer to the description in the embodiment of the method of the present invention, which will not be repeated here. This is hereby declared.

[0093] In addition, in the implementation of the data knowledge extraction system based on the large language model in the above-mentioned embodiment, the logical division of each program module is only an example. In actual applications, the above-mentioned functions can be assigned to different program modules as needed, for example, for the configuration requirements of the corresponding hardware or the convenience of software implementation. That is, the internal structure of the data knowledge extraction system based on the large language model is divided into different program modules to complete all or part of the functions described above.

[0094] See also Figure 4 In one embodiment, an electronic device for implementing a data knowledge extraction method based on a large language model is provided. The electronic device 200 may include a first processor 201, a first memory 202 and a bus, and may also include a computer program stored in the first memory 202 and executable on the first processor 201, such as a data knowledge extraction program 203 based on a large language model.

[0095] Among them, the first memory 202 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, mobile hard disk, multimedia card, card-type memory (for example: SD or DX memory, etc.), magnetic memory, disk, optical disk, etc. In some embodiments, the first memory 202 can be an internal storage unit of the electronic device 200, such as a mobile hard disk of the electronic device 200. In other embodiments, the first memory 202 can also be an external storage device of the electronic device 200, such as a plug-in mobile hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the electronic device 200. Further, the first memory 202 can also include both an internal storage unit of the electronic device 200 and an external storage device. The first memory 202 can not only be used to store application software and various types of data installed in the electronic device 200, such as the code of the data knowledge extraction program 203 based on the large language model, but also can be used to temporarily store data that has been output or is to be output.

[0096] In some embodiments, the first processor 201 may be composed of an integrated circuit, for example, a single packaged integrated circuit, or a plurality of packaged integrated circuits with the same or different functions, including one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and combinations of various control chips, etc. The first processor 201 is the control core (Control Unit) of the electronic device, and uses various interfaces and lines to connect various components of the entire electronic device, and executes various functions and processes data of the electronic device 200 by running or executing programs or modules stored in the first memory 202, and calling data stored in the first memory 202.

[0097] Figure 4 Only an electronic device with components is shown, and those skilled in the art will understand that Figure 4 The structure shown does not constitute a limitation on the electronic device 200 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.

[0098] The data knowledge extraction program 203 based on the large language model stored in the first memory 202 in the electronic device 200 is a combination of multiple instructions. When running in the first processor 201, it can achieve:

[0099] Acquire raw data, and pre-process the acquired raw data;

[0100] Extract features from the preprocessed raw data, select the corresponding task features, and remove the features with high correlation by calculating the correlation coefficient matrix between the features;

[0101] Select a large language model for the task, capture general language and knowledge based on the large language model, and fine-tune the large language model on the labeled dataset of the corresponding task;

[0102] Based on large language model reasoning and prompt word engineering, a secondary block iteration method is used to extract knowledge source information, and the context understanding ability of the fine-tuned large language model is used to integrate information extracted from different data sources;

[0103] Define evaluation criteria, analyze error cases of large language models, identify improvement directions, and adjust large language model parameters and training data based on evaluation results and error analysis.

[0104] Furthermore, if the module / unit integrated in the electronic device 200 is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a non-volatile computer-readable storage medium. The computer-readable medium may include: any entity or device capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, and a read-only memory (ROM).

[0105] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0106] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0107] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.

Claims

1. A data knowledge extraction method based on a large language model, characterized in that: The steps include: Acquire raw data, and pre-process the acquired raw data; Extract features from the preprocessed raw data, select the corresponding task features, and remove the features with high correlation by calculating the correlation coefficient matrix between the features; Select a large language model for the task, capture general language and knowledge based on the large language model, and fine-tune the large language model on the labeled dataset of the corresponding task; Based on large language model reasoning and prompt word engineering, a secondary block iteration method is used to extract knowledge source information, and the context understanding ability of the fine-tuned large language model is used to integrate information extracted from different data sources; Define evaluation criteria, analyze error cases of large language models, identify improvement directions, and adjust large language model parameters and training data based on evaluation results and error analysis.

2. The data knowledge extraction method based on a large language model according to claim 1 is characterized in that: The preprocessing of the acquired raw data is specifically as follows: Delete irrelevant information in the original data, fill in missing data, or delete records with a large number of missing values, and correct spelling errors, format errors, and inconsistent data; Design personalized prompt word templates, process data through a large language model to standardize data in different formats such as date, time, and currency into a unified format, unify text data into lowercase, remove special characters and punctuation, convert data into data types suitable for model processing, perform word segmentation and part-of-speech tagging on text data, and use word embedding technology to convert structured and unstructured text into word vector representations.

3. The data knowledge extraction method based on a large language model according to claim 1 is characterized in that: The method extracts features from the preprocessed raw data, selects corresponding task features, and removes features with high correlation by calculating the correlation coefficient matrix between the features. Specifically, the following steps are performed: Convert the text data in the original data into word frequency vectors, measure the importance of words, reduce the weight of common words, use the pre-trained word vector model to convert the text data into a high-dimensional vector, calculate the mean, standard deviation, maximum, and minimum values, and in time series data, aggregate features by time window, calculate the correlation coefficient between features and target variables, select features with high correlation, remove features with high correlation by calculating the correlation coefficient matrix between features, and project the data to a lower dimensional space through linear transformation, retain key information, and remove redundant features. The key information includes semantic information and word frequency information.

4. The data knowledge extraction method based on a large language model according to claim 3 is characterized in that: In the time series data, features are aggregated by time window, and the correlation coefficient between the features and the target variable is calculated, specifically: Arrange the time series data in chronological order and include feature data and target variables. Select the time window size to aggregate features, calculate the statistical features within each time window, and align the aggregated features with the target variable. Since the sequence data is not normally distributed, select the Spearman correlation coefficient as the sequence analysis model to calculate the correlation parameter between each aggregated feature and the target variable.

5. The data knowledge extraction method based on a large language model according to claim 1 is characterized in that: The step of fine-tuning the large language model on the labeled dataset of the corresponding task includes the following steps: According to the needs of specific tasks, modify the structure of the large language model, adjust the output layer, and add auxiliary loss functions for specific tasks. Specifically: First, supervised fine-tuning is performed on the large language model so that the large language model has preliminary data knowledge extraction capabilities; the supervised fine-tuning is performed by collecting a supervised dataset containing input prompts and required outputs to fine-tune the large language model; Secondly, a reward model is trained. The reward model is a model obtained by removing the final embedding layer of the large language model after supervised fine-tuning training. The reward model takes prompts and replies as inputs and calculates a scalar reward value as output. The training of the reward model is achieved by fitting human tendencies for different replies. The tendency probability is calculated by the difference between the reward values ​​of two replies in each sample to fit human labels, thereby completing the training of the reward model. The loss function of the reward model aims to maximize the difference between the responses that users prefer and those that they don’t like. Next, a strategy optimization PPO model is generated, and the reward model is used to guide the supervised fine-tuned SFT model to continue training. Specifically, first, the current strategy samples responses based on the input query; Then, the reward model calculates the reward based on the quality of the reply and feeds it back to the current strategy for updating; when the SFT model continues to be trained, a penalty term is added to the loss function to ensure that the difference between the PPO model output and the SFT model output is as small as possible, and a general large language model is added to the training target to improve performance; According to the preset fine-tuning strategy, choose to freeze some pre-trained model parameters, retain the large language model's learning on general language and knowledge, use the labeled dataset to fine-tune and train the large language model, and update the model parameters through the back-propagation algorithm.

6. The data knowledge extraction method based on a large language model according to claim 1 is characterized in that: The context understanding capability of the fine-tuned large language model is used to integrate information extracted from different data sources, specifically: Combine information from different data sources, divide the data source information into blocks, generate vectors based on the fine-tuned Chinese word embedding model, calculate the similarity between each block of information based on the prompt word and the large language model, and use the large language model itself to generate the corresponding input question to retrieve the data source with higher similarity. Use the large language model to re-retrieve different information sources with this input question, divide the information source content into blocks and perform word embedding again. The block size in the second retrieval is twice that of the first one. Consider the relationship between texts through context understanding of the data information with higher content relevance after retrieval, integrate the extracted entities and relationships into a knowledge graph, display the relationship and connection between entities, eliminate duplicate information, and process ambiguous information based on the content similarity of the retrieval results.

7. The data knowledge extraction method based on a large language model according to claim 1 is characterized in that: The error cases of the analysis model are used to identify improvement directions, specifically: Use the validation set or test set to evaluate the trained model, calculate the performance of the large language model on various evaluation indicators, and use the large language model to perform self-error case analysis on samples that the large language model predicts incorrectly on the validation set or test set to identify patterns or characteristics that are prone to errors in the model. Check whether the model lacks key features and whether more feature engineering is needed. Check whether the dataset has category imbalance or data bias, use fusion retrieval enhancement technology or adjust category weights. According to the results of the error case analysis, adjust the training data, increase or decrease the number of samples in certain categories, retrain the model using the adjusted model parameters and training data, and evaluate the adjusted model again using the validation set or test set to check whether the model's performance on the evaluation indicators has improved.

8. A data knowledge extraction system based on a large language model, characterized in that: The data knowledge extraction method based on a large language model applied to any one of claims 1 to 7 comprises a data acquisition module, a feature extraction module, a model fine-tuning module, an information integration module and a result evaluation module; The data acquisition module is used to acquire original data and pre-process the acquired original data; The feature extraction module is used to extract features from the preprocessed raw data, select corresponding task features, and remove features with high correlation by calculating the correlation coefficient matrix between the features; The model fine-tuning module is used to select a large language model for a task, capture general language and knowledge based on the large language model, and fine-tune the large language model on a labeled dataset corresponding to the task; The information integration module is used to extract knowledge source information through secondary block iteration based on large language model reasoning and prompt word engineering, and integrate information extracted from different data sources by using the context understanding ability of the fine-tuned large language model. The result evaluation module is used to define evaluation criteria, analyze error cases of the large language model, identify improvement directions, and adjust large language model parameters and training data based on evaluation results and error analysis.

9. An electronic device, characterized in that: The electronic device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores computer program instructions that can be executed by the at least one processor, and the computer program instructions are executed by the at least one processor so that the at least one processor can execute the data knowledge extraction method based on a large language model as described in any one of claims 1-7.

10. A computer-readable storage medium storing a program, characterized in that: When the program is executed by a processor, the data knowledge extraction method based on a large language model described in any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Model optimization training system and method and related device

    CN116561542A

  • Method and device for training generative large language model based on knowledge base feedback

    CN117009490A

  • Multi-modal large model implementation method and system for organizational knowledge management

    CN117709356A

  • Intelligent legal question and answer method based on retrieval enhanced language model

    CN118277538A

  • Intelligent intrusion detection method and system based on interpretable intrusion detection network

    CN118337427A

Cited By

  • Intelligent construction special scheme paragraph intelligent compilation method based on information network

    CN120336334A

  • Text data automatic extraction method and equipment based on large language model

    CN120911446A