Entity relationship extraction method and device based on transfer learning model, equipment and medium

By integrating machine learning and transfer learning models and combining grid search algorithms for parameter tuning, efficient and accurate realization of entity relationship extraction is achieved, and the problem of model fusion problems and low computational efficiency in the existing technology is solved.

CN119443105AInactive Publication Date: 2025-02-14BEIJING BIG DATA CENT
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510039582.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-10
Publication Date
2025-02-14
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Currently, it is impossible to effectively integrate machine learning and transfer learning models to realize entity relationship extraction based on transfer learning models. Moreover, the grid search algorithm is computationally expensive and time-consuming, making it difficult to find the global optimal solution.

Method used

By obtaining the original data for preprocessing and annotation, preset features are extracted, machine learning algorithms and transfer learning models are integrated, and parameters and transfer strategies are jointly tuned with grid search algorithms to find parameters with similarity satisfies the preset threshold. Combination to realize the migration of entity relationship groups.

Benefits of technology

The accuracy of entity recognition and relationship extraction tasks is improved, and the accuracy and efficiency of entity relationship extraction based on transfer learning model in the target field is effectively improved, and the problems of data sparseness and insufficient labeling data are solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119443105A_ABST
    Figure CN119443105A_ABST
Patent Text Reader

Abstract

The invention provides an entity relationship extraction method and device based on a transfer learning model, equipment and a medium, and belongs to the technical field of data processing. Original data are acquired, the original data are preprocessed and labeled, a training data set is generated, and then an entity relationship is constructed; utilizing a machine learning algorithm to construct an entity relationship processing task in the knowledge graph; constructing a transfer learning model, and carrying out transfer learning on knowledge in a source domain or a source task to a target domain or a target task based on the transfer learning model to initialize or assist training of a target domain model; a machine learning algorithm and a transfer learning model are fused, feature representation useful for a target domain can be extracted by utilizing rich annotation data and domain knowledge of a source domain, and the feature representation is applied to tasks of the target domain, so that useful features can be learned more quickly, and the efficiency of the target domain is improved. Therefore, the accuracy of tasks such as entity recognition and relation extraction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of data processing technology, and in particular to an entity relationship extraction method, device, equipment and medium based on a transfer learning model. Background Art

[0002] With the rapid development of information technology and the advent of the big data era, how to efficiently and accurately extract entity relationships from massive text information has become an important research direction in the field of natural language processing (NLP). Entity relationship extraction based on transfer learning models plays a key role in multiple application scenarios such as knowledge graph construction, intelligent question-answering systems, and information retrieval.

[0003] At present, machine learning algorithms have been widely used in entity relationship extraction tasks based on transfer learning models. Traditional machine learning methods extract features from training data sets and use these features to train classifiers or regression models to achieve automatic recognition of entity relationships.

[0004] Transfer learning is a technique that transfers knowledge learned in a source domain (or source task) to a target domain (or target task). In entity relationship extraction tasks based on transfer learning models, transfer learning can help solve problems such as scarce labeled data and large domain differences.

[0005] Currently, it is not possible to effectively integrate machine learning and transfer learning models to achieve entity relationship extraction based on transfer learning models. In addition, in the process of entity relationship extraction based on transfer learning models, although the grid search algorithm can be used to traverse data parameters to solve the fusion problem, the related grid search algorithm has a large amount of calculation, is time-consuming, and it is difficult to find the global optimal solution. For transfer learning, although the knowledge in the source domain or source task can be used to assist the learning of the target domain or target task, how to efficiently transfer knowledge and avoid negative transfer, that is, the source domain knowledge has a negative impact on the target domain learning, is a problem that needs to be solved at present. Summary of the invention

[0006] The present invention provides an entity relationship extraction method based on a transfer learning model. The method can extract feature representations that are useful to a target domain by utilizing rich annotated data and domain knowledge in a source domain, and apply them to tasks in the target domain. Useful features can be learned more quickly, thereby improving the accuracy of tasks such as entity recognition and relationship extraction.

[0007] Entity relationship extraction methods based on transfer learning models include: Obtain the original data, preprocess the original data, and annotate the entity relationships of the data to generate a labeled training data set. Extract preset features from the training data set as input to the machine learning algorithm to capture the entity relationships in the features. Use machine learning algorithms to construct entity relationship processing tasks in knowledge graphs; Build a transfer learning model to transfer knowledge from the source domain or source task to the target domain or target task based on the transfer learning model to initialize or assist the training of the target domain model; The machine learning algorithm is integrated with the transfer learning model, and the parameters of the machine learning algorithm and the migration strategy of the transfer learning model are jointly tuned using the grid search algorithm to find the parameter combination whose similarity meets the preset threshold, and determine the source domain and target domain of the knowledge graph, and then realize the migration of entity relationship groups through feature migration and machine learning algorithms.

[0008] It should be further explained that the methods for preprocessing the raw data include: Screen and filter data to remove invalid, duplicate or incomplete data; The data format is standardized, and missing value processing, duplicate value processing, and outlier detection and processing are performed.

[0009] It should be further explained that the method of labeling the entity relationship of the data includes: labeling the data with entity relationship based on the supervised learning task.

[0010] It should be further explained that the machine learning algorithm includes: a classification algorithm, a clustering algorithm and a sequence labeling algorithm.

[0011] It should be further explained that building a transfer learning model also includes: Define the unlabeled dataset S and training dataset T: Unlabeled dataset ; in, k is the number of elements in the set S; The training data set T is divided into two subsets:

[0012] Among them, c(x) is the true class label of instance x, Ta is the auxiliary training data set, and Tb is the target training data set; n and m are the sizes of the auxiliary training dataset and the target training dataset, respectively. The combined training dataset T={(xi,c(xi))} is defined as: ; The combined training data set T = Ta ∪ Tb; Given the target training data set Tb, auxiliary training data Ta and unlabeled test data set S, confirm that the target is to train the classifier; Using the TrAdaBoost algorithm, a weight is assigned to each sample in the training data set T; When a sample in the source domain is misclassified, increase the weight of the misclassified sample; When a sample in the auxiliary data set is misclassified, the weight of the sample in the classifier is reduced to train the classifier.

[0013] It is further necessary to explain that, in the method, the output of the machine learning algorithm and the transfer learning model are fused using the averaging method; Specifically include: Select multiple different machine learning algorithms and transfer learning models; Each selected machine learning algorithm and transfer learning model is trained independently using the training dataset; Predict the trained machine learning algorithm and transfer learning model based on the validation set or test set to obtain the output results of the machine learning algorithm and the output results of the transfer learning model respectively; Assign the same weight 1 / N to the machine learning algorithm and the transfer learning model, where N is the number of algorithm models; The average method is used to output the probability of regression or classification problems, and the arithmetic mean of the prediction results of all algorithm models is calculated as the final prediction; Final prediction , is the prediction result of model i, and the trained integrated model is obtained.

[0014] It should be further explained that the joint tuning methods include: Define the hyperparameter space for the trained ensemble model, determine the tuning hyperparameters, and define the value range for each hyperparameter; Build tuning models based on machine learning algorithms; Select one or more evaluation metrics to measure the performance of the tuned model; Use the grid search algorithm to traverse all combinations of hyperparameters, and combine it with cross-validation to divide the training data set into multiple subsets, each subset is used as a test set in turn, and the rest are used as training sets; For each set of hyperparameters, use the training set data to train the tuning model, and evaluate the performance of the tuning model on the validation set or the test set obtained through cross-validation. Record the evaluation results of each set of hyperparameter combinations, and find the hyperparameter combination that meets the preset conditions. Retrain the tuned model on the training set data using a hyperparameter combination that meets the preset conditions, and verify the performance of the tuned model on an independent test set; Perform iterative optimization, through multiple iterations of training and adjustment of the model structure, by exploring the relationship between similar scenes, find two sets of parameter combinations whose similarity meets the preset threshold, namely the relationship group, determine the source domain and the target domain, and use machine learning algorithms and feature migration to achieve relationship group migration.

[0015] The present application also provides an entity relationship extraction device based on a transfer learning model, the device comprising: The data processing module is used to obtain the original data, pre-process the original data, and annotate the entity relationships of the data to generate a labeled training data set, extract preset features from the training data set as the input of the machine learning algorithm, and capture the entity relationships in the features; The task building module is used to build entity relationship processing tasks in the knowledge graph using machine learning algorithms; The module training module is used to build a transfer learning model. Based on the transfer learning model, the knowledge in the source domain or source task is transferred to the target domain or target task to initialize or assist the training of the target domain model. The feature migration module is used to integrate the machine learning algorithm with the transfer learning model, and use the grid search algorithm to jointly tune the parameters of the machine learning algorithm and the migration strategy of the transfer learning model to find the parameter combination whose similarity meets the preset threshold, and determine the source domain and target domain of the knowledge graph, and then realize the migration of entity relationship groups through feature migration and machine learning algorithms.

[0016] According to another embodiment of the present application, an electronic device is provided, 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 entity relationship extraction method based on the transfer learning model when executing the program.

[0017] According to another embodiment of the present application, a storage medium is also provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the entity relationship extraction method based on the transfer learning model are implemented.

[0018] It can be seen from the above technical solutions that the present invention has the following advantages: The entity relationship extraction method based on the transfer learning model provided by the present invention obtains the original data, pre-processes the original data and annotates the entity relationship, generates a labeled training data set, extracts the preset features from the training data set as the input of the machine learning algorithm, and captures the entity relationship in the feature; uses the machine learning algorithm to construct the entity relationship processing task in the knowledge graph; constructs the transfer learning model, and transfers the knowledge in the source domain or source task to the target domain or target task based on the transfer learning model to initialize or assist the training of the target domain model; and then uses the knowledge in the source domain to improve the performance of the target domain task. The present application also uses the parameters or feature representation of the source domain model to initialize or assist the training of the target domain model, and finally uses the machine learning algorithm and the transfer learning model to fuse the entity relationship extraction based on the transfer learning model on the target domain data. The present method improves the accuracy of entity relationship extraction based on the transfer learning model, and can effectively improve the accuracy and efficiency of entity relationship extraction based on the transfer learning model in the target domain. Moreover, the present application adopts the model of the target domain to learn useful features faster, thereby improving the accuracy of tasks such as entity recognition and relationship extraction. Effectively solve the problems caused by data sparsity and insufficient labeled data in the construction of knowledge graphs. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0020] Figure 1 This is a flow chart of the entity relationship extraction method based on the transfer learning model; Figure 2 It is a flow chart of the data cleaning process; Figure 3 It is a flow chart of the model fusion and optimization method; Figure 4 It is a schematic diagram of an entity relationship extraction device based on a transfer learning model; Figure 5 Schematic diagram of an electronic device. DETAILED DESCRIPTION

[0021] The entity relationship extraction method based on the transfer learning model provided in this application can apply multi-source data to multi-relational knowledge graph reasoning technology, and use the knowledge of the source field to improve the performance of tasks in the target field.

[0022] Before extracting entity relationships based on the transfer learning model, this application first preprocesses data, extracts features, selects models, and tunes parameters to ensure that the source domain model can achieve a high accuracy rate. Then, the transfer learning model is constructed, and the TrAdaBoost algorithm is used to train a classifier with strong generalization ability, and the parameters or feature representations of the source domain model are used to initialize or assist the training of the target domain model. Finally, on the target domain data, the machine learning algorithm and the transfer learning model are fused to extract entity relationships based on the transfer learning model, thereby improving the accuracy of tasks such as entity recognition and relationship extraction.

[0023] The entity relationship extraction method based on transfer learning model involved in this application can be applied to the entity relationship extraction based on transfer learning model of academic paper data, the entity relationship extraction based on transfer learning model of technical report data, etc. It can also be applied to the entity relationship extraction based on transfer learning model of pipeline news report data, the entity relationship extraction based on transfer learning model of social media content data, etc. The entity relationship extraction based on transfer learning model of factory monitoring log data, the entity relationship extraction based on transfer learning model of equipment maintenance record data, the entity relationship extraction based on transfer learning model of production report data, the entity relationship extraction based on transfer learning model of operation manual data, etc.

[0024] Exemplarily, the present application can extract the relationship between equipment failure and cause, the association between production process and steps, the correspondence between operating specifications and safety risks, etc., to provide a decision-making basis for equipment maintenance, production optimization, safety management, etc.

[0025] The specific process of the entity relationship extraction method based on the transfer learning model will be described in detail below. For the purpose of illustration rather than limitation, specific details such as specific system structures and technologies are proposed to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application can also be implemented in other embodiments without these specific details.

[0026] The phrases such as "one embodiment" or "some embodiments" described in the present application mean that the specific features, structures or characteristics described in the embodiment are included in one or more embodiments of the present application. Therefore, the phrases such as "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments" etc. that appear in different places in the present application do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways.

[0027] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0028] See also Figure 1 FIG. 1 is a flowchart of an entity relationship extraction method based on a transfer learning model in a specific embodiment, and the method includes: S101: Obtain raw data, preprocess the raw data, and annotate the entity relationships of the data to generate a labeled training data set, extract preset features from the training data set as input to the machine learning algorithm, and capture the entity relationships in the features.

[0029] In some embodiments, when constructing or optimizing a knowledge graph, raw data is obtained and preprocessed to provide a data set for subsequent machine learning algorithms. Data preprocessing mainly includes steps such as data cleaning, data labeling, and feature extraction.

[0030] For the data cleaning of this embodiment, the data quality can be improved by removing duplicate, irrelevant or erroneous data, and processing missing values ​​and outliers.

[0031] like Figure 2 As shown below, taking the construction of knowledge graph as an example, the data cleaning process is explained, which specifically includes the following steps: S1011: Data preprocessing.

[0032] Before data cleaning, the data is preprocessed, including data collection, integration and archiving. Data from different sources are integrated into one data set.

[0033] S1012: Data screening and filtering.

[0034] Through screening and filtering, invalid, duplicate or incomplete data for building or optimizing the knowledge graph can be eliminated. For example, according to the needs of building a knowledge graph, data that meets the requirements of building a knowledge graph can be screened out, and data that does not meet the requirements of building a knowledge graph can be removed.

[0035] S1013: Standardize the data format.

[0036] In order to solve the problem of format inconsistency in constructing knowledge graph data, the data format is standardized.

[0037] S1014: Missing value processing.

[0038] This embodiment processes missing values ​​of knowledge graph data by filling, deleting or interpolating, so as to ensure the integrity and accuracy of the knowledge graph data.

[0039] S1015: Duplicate value processing.

[0040] This embodiment uses the unique identifier of the knowledge graph data or combines multiple fields to determine whether the knowledge graph data is repeated. For repeated knowledge graph data, one record is retained.

[0041] S1016: Outlier detection and processing.

[0042] Common methods of automatically identifying and processing these outliers through data cleaning technology include deleting outliers, correcting outliers, or treating them as missing values.

[0043] This embodiment also performs data annotation on the knowledge graph data. Considering that for supervised learning tasks, entity relationships need to be annotated, a labeled training data set can be generated.

[0044] This embodiment annotates the intrinsic connections between different entity relationships when annotating the entity relationships for constructing the knowledge graph data.

[0045] For example, when analyzing the relationship between equipment failure and cause, the entity is the equipment, and the process corresponds to the relationship between the equipment. For the association between production process and steps, the equipment is also the entity, and the production process and steps correspond to the relationship between the equipment. Entities can also be various urban components, people and events in the city, and the relationship between them reflects the complexity and diversity of urban operations. For example, the relationship between people and urban components, the entity is the resident group and public facilities, and the relationship is the use of a certain public facility.

[0046] For example, the elderly use the fitness facilities in the community. For example, the relationship between events, the entities are festivals, sports events, etc., and the relationship is that they occur at a certain time point or time period. For example, the National Day celebration is held on October 1 every year.

[0047] This embodiment generates a labeled training data set by rule-based labeling + manual labeling. Based on rule-based labeling, by setting filtering conditions and rules, the knowledge graph data can be automatically labeled. When processing the knowledge graph data, SQL statements can also be written to label according to certain features or naming rules. Of course, manual labeling can also be used, which is to use manual data to perform detailed standards to ensure the accuracy of data labeling.

[0048] In some specific embodiments, the purpose of annotating labeled training data sets is to quickly build associations between entities, which is an important part of machine learning and provides sufficient information for machine learning models so that they can learn and identify patterns and features in the data. By annotating labels, training data sets can guide the model to perform correct classification or prediction, thereby improving the accuracy and performance of the model.

[0049] This embodiment also involves feature extraction, which currently involves extracting meaningful features from the cleaned knowledge graph data as input to the machine learning algorithm.

[0050] This embodiment is about features that have a high correlation with the target variable, such as meaningful features in the elderly group, such as age, date of birth, gender, travel habits and other features.

[0051] S102: Use machine learning algorithms to construct entity relationship processing tasks in knowledge graphs.

[0052] In some embodiments, the labeled training data set generated in step S101 is used to convert the text data for constructing the knowledge graph into processable feature vectors, with the purpose of extracting features that can characterize entities and relationships.

[0053] The entity relationship processing tasks of this embodiment include, but are not limited to, relationship extraction, entity recognition, relationship classification, event extraction, and attribute extraction.

[0054] This embodiment selects a suitable machine learning algorithm for model training. The machine learning algorithms that can be used include support vector machine (SVM), logistic regression, random forest, and deep learning algorithms. The machine learning algorithm can learn the patterns and rules between entities and relationships in the knowledge graph through the training data set.

[0055] This embodiment uses a training data set and a selected machine learning algorithm to perform model training. During the training process, the algorithm learns how to identify entities and their relationships from the input feature vectors.

[0056] It can be seen that this embodiment can automatically identify and extract entity relationships from text through machine learning algorithms, thereby improving processing efficiency and accuracy.

[0057] S103: Construct a transfer learning model, and transfer the knowledge in the source domain or source task to the target domain or target task based on the transfer learning model to initialize or assist the training of the target domain model.

[0058] In this embodiment, the selection of the source domain and the target domain is to determine the starting point and the end point of the knowledge migration. That is, the source domain is the starting point of the knowledge migration, and the target domain is the end point of the knowledge migration.

[0059] In the entity relationship extraction task based on the transfer learning model, the source domain is a well-constructed knowledge graph or dataset containing entity relationship knowledge, while the target domain is a new text or dataset from which entity relationships are to be extracted.

[0060] According to the characteristics of the source domain and the target domain, select an appropriate transfer learning model. Common transfer learning models include feature-based methods, instance-based methods, and model-based methods.

[0061] This embodiment uses a transfer learning model to transfer knowledge from the source domain to the target domain. The parameters of the source domain model are fine-tuned to adapt it to the data distribution and characteristics of the target domain. The transfer learning model is integrated with the machine learning model in the target domain to fully utilize the advantages of both.

[0062] Through transfer learning, this embodiment can use the knowledge in the existing knowledge graph or data set to assist the entity relationship extraction task based on the transfer learning model in the new text or data set, thereby improving the accuracy and efficiency of the extraction. Transfer learning helps solve the problem of data scarcity or difficulty in labeling in the target domain and reduces the reliance on large-scale labeled data.

[0063] S104: Integrate the machine learning algorithm with the transfer learning model, and use the grid search algorithm to jointly tune the parameters of the machine learning algorithm and the migration strategy of the transfer learning model to find a parameter combination whose similarity meets the preset threshold, and determine the source domain and target domain of the knowledge graph, and then realize the migration of entity relationship groups through feature migration and machine learning algorithms.

[0064] In this embodiment, the parameters of the machine learning algorithm and the migration strategy of the transfer learning model are jointly tuned using optimization methods such as a grid search algorithm. A parameter space can be defined, and the optimal parameter combination can be found through exhaustive or heuristic search.

[0065] The source domain and target domain of this embodiment can be determined according to the task requirements and data characteristics to clarify the source domain and target domain of the knowledge graph. After finding the optimal parameter combination, feature migration is performed. The feature representation in the source domain is migrated to the target domain to assist the entity relationship extraction task based on the transfer learning model in the target domain. The migration of entity relationship groups is achieved using the tuned machine learning algorithm and transfer learning model.

[0066] This embodiment can also perform entity relationship extraction based on the transfer learning model on new text or data sets in the target domain, and fuse the extraction results with the knowledge graph in the source domain.

[0067] It can be seen that in the entity relationship extraction method based on the transfer learning model of this embodiment, the knowledge in the source domain or source task is transferred to the target domain or target task based on the transfer learning model to initialize or assist the training of the target domain model; by jointly tuning the parameters and migration strategy of the machine learning algorithm and the transfer learning model, the optimal model configuration can be matched to improve the accuracy and efficiency of the entity relationship extraction based on the transfer learning model. Moreover, the combination of feature migration and machine learning algorithm realizes the migration of entity relationship groups, thereby constructing a knowledge graph.

[0068] In an embodiment of the present invention, based on step S102, a possible embodiment is given below to illustrate its specific implementation scheme in a non-limiting manner.

[0069] In this embodiment, after the data preprocessing is completed, the traditional machine learning algorithm is used to construct the knowledge graph to perform tasks such as entity relationship extraction based on the transfer learning model. Algorithms such as classification, clustering, and sequence standards can be used.

[0070] Among them, the classification algorithm can use naive Bayes, decision tree, support vector machine, etc. to classify entity relationships.

[0071] The clustering algorithm of this embodiment may adopt K-means, hierarchical clustering, etc., to discover potential entity relationship patterns.

[0072] The sequence labeling algorithm of this embodiment can adopt a hidden Markov model, a conditional random field, etc., and is suitable for processing sequence data, such as entities and relations in text.

[0073] Entities can be various urban components, people and events in the city, and the relationships between them reflect the complexity and diversity of urban operations. After extracting relevant features, the naive Bayes classifier is used to realize the classification of entity relationships.

[0074] The specific method of classification is: training the model and calculating the prior probability. For each category, calculate the probability of its appearance in the training set, that is, the prior probability.

[0075] This embodiment can also calculate conditional probabilities. Specifically, for each feature and each category, the conditional probability of the feature under a given category is calculated. Since the features are assumed to be independent of each other, the probability that an instance belongs to a certain category is the product of the conditional probabilities of each feature.

[0076] In this embodiment, Bayes' theorem is applied: for a new instance, the posterior probability of it belonging to each category is calculated. Then the posterior probabilities are compared, and the category with the highest posterior probability is selected as the predicted category. Finally, the trained model is used to classify the data.

[0077] In some specific embodiments, in combination with the method of constructing a knowledge graph with city-level multi-source data, the number of clusters K can be selected, that is, the number of clusters to be divided into can be determined. Then K points are randomly selected as initial cluster centers, which can be points in the data set or randomly generated points. The distance between each data point and each cluster center is calculated, and the data point is assigned to the nearest cluster center according to the calculated distance.

[0078] This embodiment can also recalculate the cluster center of each cluster, and obtain a new cluster center by taking the average value of all data points in the cluster. The above two steps are continuously iterated and optimized until the cluster center no longer changes significantly or a predetermined number of iterations is reached. At this point, the algorithm finds the most stable group division.

[0079] Finally, the clustering effect is evaluated to determine the optimal K value, and the clustering results are visualized through a scatter plot. Different clusters are represented by different colors to intuitively display the clustering results.

[0080] Through clustering results, we can discover potential structures and patterns in the data. For example, in city-level multi-source data, we may discover the functional similarities of certain areas or the distribution patterns of population density.

[0081] As for the method of constructing knowledge graphs with city-level multi-source data, the conditional random field (CRF) model can be used to achieve sequence labeling.

[0082] It should be noted that the design of feature functions can describe the relationship between the observation sequence (such as an entity) and the label sequence (such as a feature label). Then the CRF model and weight initialization are performed. In CRF, each feature function has an associated weight, which is learned during the model training process.

[0083] The CRF of this embodiment uses these feature functions and weights to build a probability model, which gives the probability of each label sequence (feature label) given the observed data (entity).

[0084] The training CRF model of this embodiment involves maximizing the log-likelihood of the conditional probability, using an iterative algorithm such as gradient descent. During the training process, the weights of the feature function are adjusted by maximizing the conditional probability of the label sequence under the condition of the observation sequence. Finally, given the observation sequence (entity), the Viterbi algorithm is used to find the most likely label sequence (feature label). The trained CRF model is applied to the new data sequence for annotation to discover potential entity relationship patterns.

[0085] Furthermore, as a step in the above embodiment, a transfer learning model is constructed, and the knowledge in the source domain or source task is transferred to the target domain or target task based on the transfer learning model to initialize or assist the training of the target domain model to refine and expand the specific implementation method.

[0086] Specifically, for the construction of transfer learning models, transfer learning can transfer knowledge learned from one field or task to another field or task, thereby improving the performance of the target task. The core of the transfer learning model is to use the parameters or feature representations of the source domain model to initialize or assist the training of the target domain model.

[0087] In some specific embodiments, a transfer learning model is constructed, and an unlabeled data set S and a training data set T are defined: Unlabeled dataset ; in, k is the number of elements in the set S; The training data set T is divided into two subsets:

[0088] Where c(x) is the true class label of instance x, Ta is the auxiliary training dataset, and Tb is the target training dataset. n and m are the sizes of the auxiliary training dataset and the target training dataset, respectively. The combined training dataset T={(xi,c(xi))} can be defined as: .

[0089] The combined training data set is T = Ta ∪ Tb. Given a small target training data set Tb, a large amount of auxiliary training data Ta and some unlabeled test data sets S, then confirm that the goal is to train a classifier to minimize the classification error on S.

[0090] This embodiment uses the TrAdaBoost algorithm to assign a weight to each sample in the training data T. When a sample in the source domain is misclassified, the weight of the sample is increased, so that the proportion of the sample in the next training is greater. If a sample in the auxiliary data set is misclassified, the sample is very different from the target data, and the weight of the data in the sample can be reduced, thereby reducing the proportion of the sample in the classifier.

[0091] In this way, in each round of iteration, if an auxiliary training data is misclassified, the data may be inconsistent with the source training data, and the weight of the data can be reduced.

[0092] Specifically, multiply the data by β丨ht(xi)-c(xi)丨, where ht is the classifier, c is the error, and the value of β is between 0 and 1.

[0093] Therefore, in the next iteration, the misclassified samples will have less impact on the classification model than in the previous round. After several times, those data in the auxiliary data that conform to the source data will have higher weights, while the weights of those that do not conform to the source data will decrease.

[0094] This embodiment also involves a method in which the auxiliary data is completely ignored, and the training data is the source data Tb. When calculating the error rate, if the calculated error rate is greater than 0.5, it needs to be reset to 0.5, and a suitable classifier is trained to classify and label the data in the unlabeled dataset S, and the classification error on S is minimized as much as possible.

[0095] It can be seen that this embodiment improves the effect of constructing the knowledge graph in the target domain by introducing transfer learning and utilizing the rich knowledge in the source domain.

[0096] Based on the above embodiments, in order to further improve the reliability of the entity relationship extraction method based on the transfer learning model provided in the above embodiments, the specific implementation manner of step S104 is further described. In step S104, model fusion and optimization can be performed to fuse and optimize traditional machine learning algorithms and transfer learning models.

[0097] The model fusion in this embodiment can adopt the averaging method to integrate the outputs of multiple traditional machine learning algorithms and transfer learning models to improve the stability of prediction. The specific method is as Figure 3 shown, and it includes the following steps: S1041: Select multiple different machine learning algorithms and transfer learning models. The machine learning algorithms and transfer learning models can be of the same type or different types to ensure diversity.

[0098] S1042: Independently train each selected model using the training dataset. Ensure that each model has been adjusted to its best performance.

[0099] The models mentioned here include machine learning algorithms and transfer learning models. Hereinafter, the description of machine learning algorithms and transfer learning models will be summarized by models.

[0100] S1043: Use the trained models to predict the validation set or test set to obtain the output results of each model.

[0101] S1044: Assign the same weight 1 / N to each model, where N is the number of models.

[0102] S1045: Using the simple averaging method, for the probability output of regression problems or classification problems, directly calculate the arithmetic mean of all model prediction results as the final prediction.

[0103] For example, the final prediction , is the prediction result of model i, and the trained integrated model is obtained.

[0104] This embodiment also involves parameter optimization, and a grid search algorithm can be used to tune the model parameters to find the optimal parameter combination. Specifically, the following steps are included: Define the hyperparameter space for the trained ensemble model, determine which hyperparameters need to be tuned, and define a possible range of values ​​for each hyperparameter. Build a model based on the selected machine learning algorithm. This model will be adjusted according to different settings of the hyperparameters. Select one or more evaluation indicators to measure the performance of the model. Common evaluation indicators include accuracy, F1 score, mean square error, etc. Use the grid search algorithm to traverse all combinations of hyperparameters. Grid search generates all possible hyperparameter combinations through Cartesian product and trains the model for each set of parameters. In order to evaluate the performance of each set of hyperparameters, cross-validation (CV) is usually combined to reduce the risk of overfitting and improve the stability of model evaluation. Cross-validation means dividing the dataset into several subsets, each of which is used as a test set in turn, while the rest are used as training sets. For each set of hyperparameters, train the model using the training set data, and evaluate the performance of the model on the validation set or the test set obtained by cross-validation. Record the evaluation results of each set of hyperparameter combinations and compare them to find the best performing hyperparameter combination. Retrain the model on the entire training set using the best parameter combination, and verify the performance of the model on an independent test set to ensure the generalization ability of the model. In order to improve the performance of the model, this embodiment also iteratively optimizes the above steps by training and adjusting the model structure multiple times. Through model fusion and optimization, the effect of knowledge graph construction can be further improved. And on the target domain data, the machine learning algorithm and the transfer learning model are fused to perform entity relationship extraction based on the transfer learning model. Compared with traditional machine learning methods, this method has a higher accuracy rate and can effectively improve the accuracy and efficiency of entity relationship extraction based on the transfer learning model in the target domain.

[0105] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0106] The following is an embodiment of an entity relationship extraction device based on a transfer learning model provided in an embodiment of the present disclosure. The device and the entity relationship extraction method based on a transfer learning model in the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the entity relationship extraction device based on a transfer learning model, please refer to the embodiment of the entity relationship extraction method based on a transfer learning model.

[0107] like Figure 4 As shown, the device comprises: The data processing module is used to obtain raw data, preprocess the raw data, and annotate the entity relationships of the data to generate a labeled training data set, extract preset features from the training data set as input to the machine learning algorithm, and capture the entity relationships in the features.

[0108] The task building module is used to build entity relationship processing tasks in the knowledge graph using machine learning algorithms.

[0109] The module training module is used to build a transfer learning model. Based on the transfer learning model, the knowledge in the source domain or source task is transferred to the target domain or target task to initialize or assist the training of the target domain model.

[0110] The feature migration module is used to integrate the machine learning algorithm with the transfer learning model, and use the grid search algorithm to jointly tune the parameters of the machine learning algorithm and the migration strategy of the transfer learning model to find the parameter combination whose similarity meets the preset threshold, and determine the source domain and target domain of the knowledge graph, and then realize the migration of entity relationship groups through feature migration and machine learning algorithms.

[0111] The entity relationship extraction device based on the transfer learning model involved in this embodiment uses the knowledge of the source domain to improve the performance of the target domain task. On the source domain data, a supervised learning method can be used to train a high-performance entity relationship extraction model based on the transfer learning model.

[0112] The extraction process of this embodiment includes steps such as data preprocessing, feature extraction, model selection and parameter tuning to ensure that the source domain model can achieve a high accuracy rate, and then construct a transfer learning model, use the TrAdaBoost algorithm to train a classifier with strong generalization ability, use the parameters or feature representation of the source domain model to initialize or assist the training of the target domain model, and finally use the machine learning algorithm and the transfer learning model fusion to extract entity relationships based on the transfer learning model on the target domain data. Compared with traditional machine learning methods, this method has a higher accuracy rate and can effectively improve the accuracy and efficiency of entity relationship extraction based on the transfer learning model in the target domain.

[0113] like Figure 5As shown, the present application also provides an electronic device, including a display module 103, a memory 102, a processor 101, and a computer program stored in the memory and executable on the processor 101, wherein the processor 101 implements the steps of an entity relationship extraction method based on a transfer learning model when executing the program.

[0114] In embodiments of the present invention, electronic devices include, but are not limited to, laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic devices may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the embodiments of the present application described and / or required herein.

[0115] In the embodiment of the present application, the processor 101 can be implemented by using at least one of an application-specific integrated circuit (ASIC), a programmable logic device (PLD), a field programmable gate array (FPGA), a processor, a controller, a microcontroller, a microprocessor, and an electronic unit designed to perform the functions described herein. In some cases, such an implementation can be implemented in a controller. For software implementation, implementations such as processes or functions can be implemented with separate software modules that allow execution of at least one function or operation. The software code can be implemented by a software application (or program) written in any appropriate programming language, and the software code can be stored in a memory and executed by a controller.

[0116] The display module 103 is used to display information input by the user or information provided to the user. The display module 103 may include a display panel, which may be configured in the form of a liquid crystal display (LCD), an organic light-emitting diode (OLED), etc.

[0117] The memory 102 may be used to store software programs and various data. The memory 102 may include a high-speed random access memory and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.

[0118] The present application also provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the entity relationship extraction method based on the transfer learning model are implemented.

[0119] The storage medium can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can be, for example, but not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above.

[0120] The above description of the disclosed embodiments enables one skilled in the art to implement or use the present invention. Various modifications to these embodiments will be apparent to one skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. The entity relationship extraction method based on the transfer learning model is characterized by: Methods include: Obtain the original data, preprocess the original data, and annotate the entity relationships of the data to generate a labeled training data set. Extract preset features from the training data set as input to the machine learning algorithm to capture the entity relationships in the features. Use machine learning algorithms to construct entity relationship processing tasks in knowledge graphs; Build a transfer learning model to transfer knowledge from the source domain or source task to the target domain or target task based on the transfer learning model to initialize or assist the training of the target domain model; The machine learning algorithm is integrated with the transfer learning model, and the parameters of the machine learning algorithm and the migration strategy of the transfer learning model are jointly tuned using the grid search algorithm to find the parameter combination whose similarity meets the preset threshold, and determine the source domain and target domain of the knowledge graph, and then realize the migration of entity relationship groups through feature migration and machine learning algorithms.

2. The entity relationship extraction method based on the transfer learning model according to claim 1 is characterized in that: The methods for preprocessing raw data include: Screen and filter data to remove invalid, duplicate or incomplete data; The data format is standardized, and missing value processing, duplicate value processing, and outlier detection and processing are performed.

3. The entity relationship extraction method based on the transfer learning model according to claim 1 is characterized in that: Methods for labeling entity relationships of data include: labeling data with entity relationships based on supervised learning tasks.

4. The entity relationship extraction method based on the transfer learning model according to claim 1 is characterized in that: The machine learning algorithms include: classification algorithms, clustering algorithms and sequence labeling algorithms.

5. The entity relationship extraction method based on the transfer learning model according to claim 1 is characterized in that: Building a transfer learning model also includes: Define the unlabeled dataset S and training dataset T: Unlabeled dataset ; in, k is the number of elements in the set S; The training data set T is divided into two subsets: Among them, c(x) is the true class label of instance x, Ta is the auxiliary training data set, and Tb is the target training data set; n and m are the sizes of the auxiliary training dataset and the target training dataset, respectively. The combined training dataset T={(xi,c(xi))} is defined as: ; The combined training data set T = Ta ∪ Tb; Given the target training data set Tb, auxiliary training data Ta and unlabeled test data set S, confirm that the target is to train the classifier; Using the TrAdaBoost algorithm, a weight is assigned to each sample in the training data set T.

6. The entity relationship extraction method based on the transfer learning model according to claim 1 is characterized in that: In the method, the output of the machine learning algorithm and the transfer learning model are fused using the averaging method; Specifically include: Select multiple different machine learning algorithms and transfer learning models; Each selected machine learning algorithm and transfer learning model is trained independently using the training dataset; Predict the trained machine learning algorithm and transfer learning model based on the validation set or test set to obtain the output results of the machine learning algorithm and the output results of the transfer learning model respectively; Assign the same weight 1 / N to the machine learning algorithm and the transfer learning model, where N is the number of algorithm models; The average method is used to output the probability of regression or classification problems, and the arithmetic mean of the prediction results of all algorithm models is calculated as the final prediction; Final prediction , is the prediction result of model i, and the trained integrated model is obtained.

7. The entity relationship extraction method based on the transfer learning model according to claim 6 is characterized in that: Joint tuning methods include: Define the hyperparameter space for the trained ensemble model, determine the tuning hyperparameters, and define the value range for each hyperparameter; Build tuning models based on machine learning algorithms; Select one or more evaluation metrics to measure the performance of the tuned model; Use the grid search algorithm to traverse all combinations of hyperparameters, and combine it with cross-validation to divide the training data set into multiple subsets, each subset is used as a test set in turn, and the rest are used as training sets; For each set of hyperparameters, use the training set data to train the tuning model, and evaluate the performance of the tuning model on the validation set or the test set obtained through cross-validation. Record the evaluation results of each set of hyperparameter combinations, and find the hyperparameter combination that meets the preset conditions. Retrain the tuned model on the training set data using a hyperparameter combination that meets the preset conditions, and verify the performance of the tuned model on an independent test set; Perform iterative optimization, through multiple iterations of training and adjustment of the model structure, by exploring the relationship between similar scenes, find two sets of parameter combinations whose similarity meets the preset threshold, namely the relationship group, determine the source domain and the target domain, and use machine learning algorithms and feature migration to achieve relationship group migration.

8. An entity relationship extraction device based on a transfer learning model, characterized in that: The device is used to implement the entity relationship extraction method based on the transfer learning model as described in any one of claims 1 to 7; The device includes: The data processing module is used to obtain the original data, pre-process the original data, and annotate the entity relationships of the data to generate a labeled training data set, extract preset features from the training data set as the input of the machine learning algorithm, and capture the entity relationships in the features; The task building module is used to build entity relationship processing tasks in the knowledge graph using machine learning algorithms; The module training module is used to build a transfer learning model. Based on the transfer learning model, the knowledge in the source domain or source task is transferred to the target domain or target task to initialize or assist the training of the target domain model. The feature migration module is used to integrate the machine learning algorithm with the transfer learning model, and use the grid search algorithm to jointly tune the parameters of the machine learning algorithm and the migration strategy of the transfer learning model to find the parameter combination whose similarity meets the preset threshold, and determine the source domain and target domain of the knowledge graph, and then realize the migration of entity relationship groups through feature migration and machine learning algorithms.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein: When the processor executes the program, the steps of the entity relationship extraction method based on the transfer learning model as described in any one of claims 1 to 7 are implemented.

10. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the entity relationship extraction method based on the transfer learning model as described in any one of claims 1 to 7 are implemented.

Citation Information

Cited By

  • Cross-platform user behavior analysis method and system based on transfer learning

    CN120811792A

  • A Cross-Platform User Behavior Analysis Method and System Based on Transfer Learning

    CN120811792B

  • Earthquake oscillation spectrum acceleration prediction method, migration learning method, equipment and medium

    CN120951824A

  • Ground motion spectrum acceleration prediction method, transfer learning method, device and medium

    CN120951824B