Text attachment enhanced database record outlier calculation method
By generating summary text and calculating the similarity of database records, it solves the problem of low efficiency of manual classification in database management, realizes automatic identification of outliers, and improves the accuracy and efficiency of data management.
Patent Information
- Application Number
- CN202411004738.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-25
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2044-07-25
AI Technical Summary
The existing technology has low efficiency of manual classification and grouping in database management, which may lead to insufficient accuracy of data management and difficulty in effectively identifying outliers in database records.
By obtaining multi-dimensional text data from the database, we generate summary text, use word frequency and inverse document frequency to extract feature vectors, calculate text similarity and field similarity, determine whether the record is an outlier based on the similarity score, and use grid search to optimize the super parameters to improve judgment accuracy.
It realizes automatic calculation of similarities between database records, improves the accuracy and efficiency of data management, automatically identifies outliers, and reduces manual intervention.
Smart Images

Figure CN118780265A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of data management, and in particular to a method for calculating outlier points in a database record enhanced by a text attachment. Background Art
[0002] With the continuous growth of data and the popularization of the Internet, databases have become an indispensable part of modern information technology. Databases are used to store data in applications. They can provide fast and reliable storage and retrieval of data, providing necessary key data support for various applications. In a database, data is stored in the form of records. Database records are multidimensional data with multiple data types (text, numbers, dates). Each record consists of a series of fields that represent the various attributes of the record.
[0003] When managing a database, it is usually necessary to manually classify, group, and split the data to achieve classified management of the data in the database. Manual data management not only consumes a lot of manpower and has low management efficiency, but may also lead to human negligence, resulting in the accuracy of data management needs to be improved. Summary of the invention
[0004] The invention provides a text attachment enhanced database record outlier calculation method to solve the problem raised in the background technology.
[0005] A method for calculating outliers in database records enhanced by text attachments, comprising:
[0006] S1: obtaining multiple groups of multidimensional text data from a database based on database records, and generating summary text corresponding to each group of multidimensional text data based on a summary model;
[0007] S2: Based on word frequency and inverse document frequency, feature extraction is performed on the summary text to obtain a summary feature vector, and the text similarity between two summary texts is calculated based on the summary feature vector;
[0008] S3: Obtain the field similarity between every two database records, and calculate the similarity between two database records based on text similarity and field similarity;
[0009] S4: Based on the similarity between the database records in pairs, obtain the average similarity score between the current database record and all other database records, and determine whether the current database record is an outlier based on the average similarity score.
[0010] Preferably, in S1, multiple groups of multidimensional text data are obtained from a database based on database records, and summary text corresponding to each group of multidimensional text data is generated based on a summary model, including:
[0011] Based on the database records, the multi-dimensional text data of each database record is retrieved and found;
[0012] The BigBird model is trained using the preset Chinese long text summary dataset to obtain a summary model;
[0013] The multidimensional text data is segmented based on the word segmenter to obtain a word segmentation output result, and the word segmentation output result is input into the summary model to generate a summary, so as to obtain a summary text corresponding to each group of multidimensional text data.
[0014] Preferably, in S2, feature extraction is performed on the summary text based on word frequency and inverse document frequency to obtain a summary feature vector, including:
[0015] Calculate the word frequency of the current word segment in the summary text based on the following formula;
[0016]
[0017] Among them, TF(t,d) represents the word frequency of the current segmentation, t represents the current segmentation, n represents all the segmentations in the summary text, d represents the summary text, and f i,d It represents the logarithmic frequency of the i-th word in the summary text d, specifically expressed as f i,d =1+log(m i,d ), m represents the number of times the i-th word appears in the summary text d;
[0018] Calculate the inverse document frequency of the current word segment t based on the following formula;
[0019]
[0020] Among them, IDF(t) represents the inverse document frequency of the current word segmentation t, D is the number of summary texts, and Df t is the number of summary texts in which the current word t appears;
[0021] The feature value of the current word segmentation is calculated based on the following formula;
[0022] TFIDF(t,d)=TF(t,d)*IDF(t)
[0023] Among them, TFIDF(t,d) represents the feature value of the current word segmentation;
[0024] The summary feature vector of the summary text is calculated based on the following formula;
[0025] V d =[TFIDF(t0,d),TFIDF(t1,d)…,TFIDF(t n ,d)]
[0026] Among them, V d The summary feature vector representing the summary text, TFIDF(t n ,d) represents the feature value of the nth word.
[0027] Preferably, in S2, calculating the text similarity between two summary texts based on the summary feature vector includes:
[0028] Based on the summary feature vector, the similarity between two summary texts is calculated according to the following formula;
[0029]
[0030] in, represents the similarity between the jth summary text and the ωth summary text, represents the summary feature vector of the jth summary text, represents the summary feature vector of the ω-th summary text, express and The cosine similarity of .
[0031] Preferably, in S3, obtaining the field similarity between every two database records includes:
[0032] For text type fields between two database records, the cosine similarity is used to calculate the similarity S of the same field in the two database records. t ;
[0033] For numeric fields and date fields between two databases, the numeric difference and date difference are calculated as the similarity S of the same field in the records of the two databases. d ;
[0034] Based on S t and S d , and calculate the field similarity between the two database records according to the following formula;
[0035]
[0036] Among them, S meta represents the field similarity between two database records, s represents the number of fields in any one of the two database records, and p a It represents the weight of the similarity of the ath field. It is a hyperparameter ranging from 0 to 1. The initial value can be given based on experience. a Indicates the similarity of the same field in two database records of the a-th field. If it is a text type field, then according to S t Calculation: If it is a numeric field or a date field, then according to Sd calculate.
[0037] Preferably, in S3, the similarity between two database records is calculated based on text similarity and field similarity, including:
[0038] Based on the field similarity between two database records, the similarity between two database records is calculated according to the following formula;
[0039]
[0040] in, Indicates the similarity between the records in database b and database c. Indicates the similarity between the summary text corresponding to the record in database b and the summary text corresponding to the record in database c, It represents the field similarity between the records in database b and database c. k and l are hyperparameters ranging from 0 to 1 and are initially set based on experience.
[0041] Preferably, in S4, based on the similarity between two database records, obtaining the average similarity score between the current database record and all other database records includes:
[0042]
[0043] in, represents the average similarity score between the current database record and all other database records, q represents the number of database records, Indicates the similarity between the current database record and the hth database record.
[0044] Preferably, in S4, determining whether the current database record is an outlier based on the average similarity score includes:
[0045] Determine an initial threshold e, and judge whether the average similarity score is greater than the initial threshold e,
[0046] If so, determine that the current database record is an outlier;
[0047] Otherwise, it is determined that the current database record is not an outlier.
[0048] Preferably, it also includes: based on grid search, weights p1 to p a , k and l hyper parameters and the initial threshold e are searched and optimized to obtain the best parameters, and the latest outlier point judgment of the current database record is obtained based on the best parameters;
[0049] Based on the initialization hyperparameter and the historical optimal hyperparameter as the target point of the grid search, the grid is clustered using the target point to obtain the cluster corresponding to the target point;
[0050] Based on the target point and its corresponding cluster, determine the search step and search direction of the grid search;
[0051] According to the search step and search direction, the weights p1 to p2 of the field similarity are initialized with the hyperparameters as the starting point. a , k and l hyperparameters and initial threshold e are locally iterated and calculated to obtain weights p1~p a , the local optimal values of the k and l hyperparameters and the initial threshold e, as well as the first outlier labeling results;
[0052] Compare the first outlier annotation result with the manual annotation result to obtain the accuracy, recall rate and F1 score under each local optimal value;
[0053] According to the search step and search direction, the weights p1 to p2 of the field similarity are initialized with the hyperparameters as the starting point. a , k and l hyper parameters and initial threshold e are iterated as a whole to obtain weights p1~p a , the overall initial values of the k and l hyperparameters and the initial threshold e, as well as the second outlier labeling results;
[0054] Compare the second outlier annotation result with the manual annotation result to obtain the accuracy, recall rate and F1 score under the overall initial value;
[0055] Compare the accuracy, recall, and F1 score at each local optimal value with the accuracy, recall, and F1 score at the overall initial value to obtain the difference in results;
[0056] Based on the result differences and the local optimal values, the overall initial value is adjusted to obtain the overall optimal value;
[0057] The optimal value is used as the optimal parameter to obtain the latest outlier judgment for the current database record.
[0058] Preferably, adjusting the overall initial value based on the result difference and the local optimal value to obtain the overall optimal value includes:
[0059] Determine whether the result difference is within a preset difference range;
[0060] If so, do not adjust the overall initial value;
[0061] Otherwise, based on the local optimal value, determine the latest search step and the latest search direction, and iteratively calculate the overall initial value according to the latest search step and the latest search direction until the result difference is within the preset difference range to obtain the overall optimal value.
[0062] Compared with the prior art, the present invention has achieved the following beneficial effects:
[0063] The method obtains multiple groups of multidimensional text data from a database based on database records, generates summary texts corresponding to each group of multidimensional text data based on a summary model, extracts features of the summary texts based on word frequency and inverse document frequency to obtain summary feature vectors, calculates text similarity between two summary texts based on the summary feature vectors, obtains field similarity between every two database records, obtains similarity between two database records based on text similarity and field similarity, obtains average similarity scores between current database records and all other database records based on similarity between two database records, and determines whether the current database record is an outlier based on the average similarity score, thereby automatically calculating the similarity between different records and automatically calculating outliers, providing a basis for automatically classifying data in a database, ensuring data management accuracy, and improving data management efficiency.
[0064] Other features and advantages of the present invention will be described in the following description, and partly become apparent from the description, or understood by practicing the present invention. The purpose and other advantages of the present invention can be realized and obtained by the structures specifically pointed out in this application document.
[0065] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0066] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings:
[0067] Figure 1 A flowchart of a method for calculating outlier points in a database record enhanced by a text attachment in an embodiment of the present invention;
[0068] Figure 2 The flowchart of generating summary text in an embodiment of the present invention. DETAILED DESCRIPTION
[0069] The preferred embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.
[0070] Embodiment 1:
[0071] The embodiment of the present invention provides a method for calculating outliers in a database record enhanced by a text attachment, such as Figure 1 As shown, including:
[0072] S1: obtaining multiple groups of multidimensional text data from a database based on database records, and generating summary text corresponding to each group of multidimensional text data based on a summary model;
[0073] S2: Based on word frequency and inverse document frequency, feature extraction is performed on the summary text to obtain a summary feature vector, and the text similarity between two summary texts is calculated based on the summary feature vector;
[0074] S3: Obtain the field similarity between every two database records, and calculate the similarity between two database records based on text similarity and field similarity;
[0075] S4: Based on the similarity between the database records in pairs, obtain the average similarity score between the current database record and all other database records, and determine whether the current database record is an outlier based on the average similarity score.
[0076] In this embodiment, one database record corresponds to a set of multi-dimensional text data.
[0077] In this embodiment, the summary model is used to process long text to generate text summaries. In actual use, it is used to generate text summaries at the first time when the text data is uploaded, and the text length is reduced by generating summaries, thereby reducing the complexity of subsequent calculations and improving the overall process performance.
[0078] The beneficial effects of the above design scheme are: by obtaining multiple groups of multidimensional text data from the database based on database records, and generating summary texts corresponding to each group of multidimensional text data based on the summary model, feature extraction is performed on the summary text based on word frequency and inverse document frequency to obtain a summary feature vector, and the text similarity between two summary texts is calculated based on the summary feature vector, the field similarity between every two database records is obtained, the similarity between two database records is calculated based on text similarity and field similarity, based on the similarity between two database records, the average similarity score between the current database record and all other database records is obtained, and whether the current database record is an outlier is determined based on the average similarity score, so as to realize automatic calculation of the similarity between different records and automatic calculation of outliers, provide a basis for automatic data classification in the database, ensure data management accuracy, and improve data management efficiency.
[0079] Embodiment 2:
[0080] Based on Example 1, the present invention provides a method for calculating outliers in a database record enhanced by a text attachment, such as Figure 2 As shown, in S1, multiple groups of multidimensional text data are obtained from the database based on the database records, and summary text corresponding to each group of multidimensional text data is generated based on the summary model, including:
[0081] Based on the database records, the multi-dimensional text data of each database record is retrieved and found;
[0082] The BigBird model is trained using the preset Chinese long text summary dataset to obtain a summary model;
[0083] The multidimensional text data is segmented based on the word segmenter to obtain a word segmentation output result, and the word segmentation output result is input into the summary model to generate a summary, so as to obtain a summary text corresponding to each group of multidimensional text data.
[0084] The beneficial effects of the above design scheme are: by searching and finding the multidimensional text data of each database record based on the database record;
[0085] The BigBird model is trained using a preset Chinese long text summary dataset to obtain a summary model. The multidimensional text data is segmented based on a word segmenter to obtain a word segmentation output result. The word segmentation output result is input into the summary model for summary generation to obtain a summary text corresponding to each group of multidimensional text data, thereby realizing the extraction of key information from the multidimensional text data and providing a concise data basis for subsequent similarity calculations.
[0086] Embodiment 3:
[0087] Based on Example 1, the embodiment of the present invention provides a method for calculating outliers in a database record enhanced by a text attachment, characterized in that in S2, feature extraction is performed on the summary text based on word frequency and inverse document frequency to obtain a summary feature vector, including:
[0088] Calculate the word frequency of the current word segment in the summary text based on the following formula;
[0089]
[0090] Among them, TF(t,d) represents the word frequency of the current segmentation, t represents the current segmentation, n represents all the segmentations in the summary text, d represents the summary text, and f i,d It represents the logarithmic frequency of the i-th word in the summary text d, specifically expressed as f i,d =1+log(m i,d ), m represents the number of times the i-th word appears in the summary text d;
[0091] Calculate the inverse document frequency of the current word segment t based on the following formula;
[0092]
[0093] Among them, IDF(t) represents the inverse document frequency of the current word segmentation t, D is the number of summary texts, and Df t is the number of summary texts in which the current word t appears;
[0094] The feature value of the current word segmentation is calculated based on the following formula;
[0095] TFIDF(t,d)=TF(t,d)*IDF(t)
[0096] Among them, TFIDF(t,d) represents the feature value of the current word segmentation;
[0097] The summary feature vector of the summary text is calculated based on the following formula;
[0098] V d =[TFIDF(t0,d),TFIDF(t1,d)…,TFIDF(t n ,d)]
[0099] Among them, V d The summary feature vector representing the summary text, TFIDF(t n ,d) represents the feature value of the nth word.
[0100] The beneficial effects of the above design scheme are: by calculating the word frequency of the segmented words, the occurrence of the segmented words in the corresponding summary text is determined, and by calculating the inverse document frequency of the segmented words, the occurrence of the segmented words in the entire summary text is determined, and finally the summary feature vector of the summary text is obtained, thereby ensuring the accuracy of the obtained summary feature vector.
[0101] Embodiment 4:
[0102] Based on Example 3, the embodiment of the present invention provides a method for calculating outliers in a database record enhanced by a text attachment. In S2, the text similarity between two summary texts is calculated based on the summary feature vector, including:
[0103] Based on the summary feature vector, the similarity between two summary texts is calculated according to the following formula;
[0104]
[0105] in, represents the similarity between the jth summary text and the ωth summary text, represents the summary feature vector of the jth summary text, represents the summary feature vector of the ω-th summary text, express and The cosine similarity of .
[0106] The beneficial effect of the above design is that by using the cosine similarity as the text similarity between two summary texts, the accuracy of the obtained text similarity is guaranteed.
[0107] Embodiment 5:
[0108] Based on Example 1, the embodiment of the present invention provides a method for calculating outliers in a database record enhanced by a text attachment. In S3, obtaining the field similarity between every two database records includes:
[0109] For text type fields between two database records, the cosine similarity is used to calculate the similarity S of the same field in the two database records. t ;
[0110] For numeric fields and date fields between two databases, the numeric difference and date difference are calculated as the similarity S of the same field in the records of the two databases. d ;
[0111] Based on S t and S d , and calculate the field similarity between the two database records according to the following formula;
[0112]
[0113] Among them, S meta represents the field similarity between two database records, s represents the number of fields in any one of the two database records, and p a It represents the weight of the similarity of the ath field. It is a hyperparameter ranging from 0 to 1. The initial value can be given based on experience. a Indicates the similarity of the same field in two database records of the a-th field. If it is a text type field, then according to S t Calculation: If it is a numeric field or a date field, then according to S d calculate.
[0114] The beneficial effect of the above design is: obtaining the field similarity between every two database records, providing a basis for calculating the similarity between two database records.
[0115] Embodiment 6:
[0116] Based on Example 1, the embodiment of the present invention provides a method for calculating outliers in a database record enhanced by a text attachment. In S3, the similarity between two database records is calculated based on text similarity and field similarity, including:
[0117] Based on the field similarity between two database records, the similarity between two database records is calculated according to the following formula;
[0118]
[0119] in, Indicates the similarity between the records in database b and database c. Indicates the similarity between the summary text corresponding to the record in database b and the summary text corresponding to the record in database c, It represents the field similarity between the records in database b and database c. k and l are hyperparameters ranging from 0 to 1 and are initially set based on experience.
[0120] The beneficial aspect of the above design is that the similarity between two database records is calculated based on text similarity and field similarity, which provides a basis for calculating the average similarity score between the current database record and all other database records.
[0121] Embodiment 7:
[0122] Based on Example 1, the embodiment of the present invention provides a method for calculating outliers in a database record enhanced by a text attachment. In S4, based on the similarity between two database records, an average similarity score between the current database record and all other database records is obtained, including:
[0123]
[0124] in, represents the average similarity score between the current database record and all other database records, q represents the number of database records, Indicates the similarity between the current database record and the hth database record.
[0125] The beneficial effect of the above design is: based on the similarity between two database records, the average similarity score between the current database record and all other database records is obtained, which provides a basis for determining whether the current database record is an outlier.
[0126] Embodiment 8:
[0127] Based on Example 7, the embodiment of the present invention provides a method for calculating outliers in a database record enhanced by a text attachment. In S4, determining whether the current database record is an outlier based on the average similarity score includes:
[0128] Determine an initial threshold e, and judge whether the average similarity score is greater than the initial threshold e,
[0129] If so, determine that the current database record is an outlier;
[0130] Otherwise, it is determined that the current database record is not an outlier.
[0131] The beneficial effects of the above design scheme are: determining whether the current database record is an outlier based on the average similarity score, automatically calculating the similarity between different records, automatically calculating the outliers, providing a basis for automatically classifying data in the database, ensuring data management accuracy, and improving data management efficiency.
[0132] Embodiment 9:
[0133] Based on Example 1, the embodiment of the present invention provides a method for calculating outliers in a database record enhanced by a text attachment, further comprising: performing a grid search on the weights p1 to p2 of the field similarity. a , k and l hyper parameters and the initial threshold e are searched and optimized to obtain the best parameters, and the latest outlier point judgment of the current database record is obtained based on the best parameters;
[0134] Based on the initialization hyperparameter and the historical optimal hyperparameter as the target point of the grid search, the grid is clustered using the target point to obtain the cluster corresponding to the target point;
[0135] Based on the target point and its corresponding cluster, determine the search step and search direction of the grid search;
[0136] According to the search step and search direction, the weights p1 to p2 of the field similarity are initialized with the hyperparameters as the starting point. a , k and l hyperparameters and initial threshold e are locally iterated and calculated to obtain weights p1~p a , the local optimal values of the k and l hyperparameters and the initial threshold e, as well as the first outlier labeling results;
[0137] Compare the first outlier annotation result with the manual annotation result to obtain the accuracy, recall rate and F1 score under each local optimal value;
[0138] According to the search step and search direction, the weights p1 to p2 of the field similarity are initialized with the hyperparameters as the starting point. a, k and l hyper parameters and initial threshold e are iterated as a whole to obtain weights p1~p a , the overall initial values of the k and l hyperparameters and the initial threshold e, as well as the second outlier labeling results;
[0139] Compare the second outlier annotation result with the manual annotation result to obtain the accuracy, recall rate and F1 score under the overall initial value;
[0140] Compare the accuracy, recall, and F1 score at each local optimal value with the accuracy, recall, and F1 score at the overall initial value to obtain the difference in results;
[0141] Based on the result differences and the local optimal values, the overall initial value is adjusted to obtain the overall optimal value;
[0142] The optimal value is used as the optimal parameter to obtain the latest outlier judgment for the current database record.
[0143] The beneficial effects of the above design scheme are: by determining the search step and search direction of the grid search based on the target point and its corresponding cluster, the grid search efficiency is improved, and the accuracy, recall rate and F1 score under each local optimal value are compared with the accuracy, recall rate and F1 score under the overall initial value to obtain the result difference; based on the result difference and the local optimal value, the overall initial value is adjusted to obtain the overall optimal value; the optimal value is used as the best parameter to obtain the latest outlier point judgment of the current database record, and the accuracy of the outlier point is guaranteed, which provides a basis for automatically classifying data in the database, ensures the accuracy of data management, and improves the efficiency of data management.
[0144] Embodiment 10:
[0145] Based on Example 9, an embodiment of the present invention provides a method for calculating outliers in a database record enhanced by a text attachment, wherein the overall initial value is adjusted based on the result difference and the local optimal value to obtain the overall optimal value, including:
[0146] Determine whether the result difference is within a preset difference range;
[0147] If so, do not adjust the overall initial value;
[0148] Otherwise, based on the local optimal value, determine the latest search step and the latest search direction, and iteratively calculate the overall initial value according to the latest search step and the latest search direction until the result difference is within the preset difference range to obtain the overall optimal value.
[0149] The beneficial effect of the above design scheme is: based on the result difference and the local optimal value, the overall initial value is adjusted to obtain the overall optimal value, which provides a basis for determining the final outlier point and ensures the accuracy of the obtained outlier point.
[0150] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention belong to the scope of this application document and its equivalent technology, the present invention is also intended to include these changes and variations.
Claims
1. A method for calculating outliers in database records enhanced by text attachments, characterized in that: include: S1: obtaining multiple groups of multidimensional text data from a database based on database records, and generating summary text corresponding to each group of multidimensional text data based on a summary model; S2: Based on word frequency and inverse document frequency, feature extraction is performed on the summary text to obtain a summary feature vector, and the text similarity between two summary texts is calculated based on the summary feature vector; S3: Obtain the field similarity between every two database records, and calculate the similarity between two database records based on text similarity and field similarity; S4: Based on the similarity between the database records in pairs, obtain the average similarity score between the current database record and all other database records, and determine whether the current database record is an outlier based on the average similarity score.
2. The method for calculating outliers in a database record enhanced by a text attachment according to claim 1, characterized in that: In S1, multiple groups of multidimensional text data are obtained from a database based on database records, and summary text corresponding to each group of multidimensional text data is generated based on a summary model, including: Based on the database records, the multi-dimensional text data of each database record is retrieved and found; The BigBird model is trained using the preset Chinese long text summary dataset to obtain a summary model; The multidimensional text data is segmented based on the word segmenter to obtain a word segmentation output result, and the word segmentation output result is input into the summary model to generate a summary, so as to obtain a summary text corresponding to each group of multidimensional text data.
3. The method for calculating outliers in a database record enhanced by a text attachment according to claim 1, characterized in that: In S2, feature extraction is performed on the summary text based on word frequency and inverse document frequency to obtain a summary feature vector, including: Calculate the word frequency of the current word segment in the summary text based on the following formula; Among them, TF(t,d) represents the word frequency of the current segmentation, t represents the current segmentation, n represents all the segmentations in the summary text, d represents the summary text, and f i,d It represents the logarithmic frequency of the i-th word in the summary text d, specifically expressed as f i,d =1+log(m i,d ), m represents the number of times the i-th word appears in the summary text d; Calculate the inverse document frequency of the current word segment t based on the following formula; Among them, IDF(t) represents the inverse document frequency of the current word segmentation t, D is the number of summary texts, and Df t is the number of summary texts in which the current word t appears; The feature value of the current word segmentation is calculated based on the following formula; TFIDF(t,d)=TF(t,d)*IDF(t) Among them, TFIDF(t,d) represents the feature value of the current word segmentation; The summary feature vector of the summary text is calculated based on the following formula; V d =[TFIDF(t0,d),TFIDF(t1,d)…,TFIDF(t n ,d)] Among them, V d The summary feature vector representing the summary text, TFIDF(t n ,d) represents the feature value of the nth word.
4. The method for calculating outliers in a database record enhanced by text attachment according to claim 3, characterized in that: In S2, the text similarity between two summary texts is calculated based on the summary feature vector, including: Based on the summary feature vector, the similarity between two summary texts is calculated according to the following formula; in, represents the similarity between the jth summary text and the ωth summary text, represents the summary feature vector of the jth summary text, represents the summary feature vector of the ω-th summary text, express and The cosine similarity of .
5. The method for calculating outlier points in a database record enhanced by text attachment according to claim 1, characterized in that: In S3, the field similarity between every two database records is obtained, including: For text type fields between two database records, the cosine similarity is used to calculate the similarity S of the same field in the two database records. t ; For numeric fields and date fields between two databases, the numeric difference and date difference are calculated as the similarity S of the same field in the records of the two databases. d ; Based on S t and S d , and calculate the field similarity between the two database records according to the following formula; Among them, S meta represents the field similarity between two database records, s represents the number of fields in any one of the two database records, and p a It represents the weight of the similarity of the ath field. It is a hyperparameter ranging from 0 to 1. The initial value can be given based on experience. a Indicates the similarity of the same field in two database records of the a-th field. If it is a text type field, then according to S t Calculation: If it is a numeric field or a date field, then according to S d calculate.
6. The method for calculating outliers in a database record enhanced by text attachment according to claim 1, characterized in that: In S3, the similarity between two database records is calculated based on text similarity and field similarity, including: Based on the field similarity between two database records, the similarity between two database records is calculated according to the following formula; in, Indicates the similarity between the records in database b and database c. Indicates the similarity between the summary text corresponding to the record in database b and the summary text corresponding to the record in database c, It represents the field similarity between the records in database b and database c. k and l are hyperparameters ranging from 0 to 1 and are initially set based on experience.
7. The method for calculating outliers in a database record enhanced by a text attachment according to claim 1, characterized in that: In S4, based on the similarity between two database records, the average similarity score between the current database record and all other database records is obtained, including: in, represents the average similarity score between the current database record and all other database records, q represents the number of database records, Indicates the similarity between the current database record and the hth database record.
8. The method for calculating outliers in a database record enhanced by text attachments according to claim 7, characterized in that: In S4, determining whether the current database record is an outlier based on the average similarity score includes: Determine an initial threshold e, and judge whether the average similarity score is greater than the initial threshold e, If so, determine that the current database record is an outlier; Otherwise, it is determined that the current database record is not an outlier.
9. The method for calculating outliers in a database record enhanced by text attachment according to claim 1, characterized in that: Also includes: Based on grid search, the weights p1 to p of field similarity are a , k and l hyper parameters and the initial threshold e are searched and optimized to obtain the best parameters, and the latest outlier point judgment of the current database record is obtained based on the best parameters; Based on the initialization hyperparameter and the historical optimal hyperparameter as the target point of the grid search, the grid is clustered using the target point to obtain the cluster corresponding to the target point; Based on the target point and its corresponding cluster, determine the search step and search direction of the grid search; According to the search step and search direction, the weights p1 to p2 of the field similarity are initialized with the hyperparameters as the starting point. a , k and l hyperparameters and initial threshold e are locally iterated and calculated to obtain weights p1~p a , the local optimal values of the k and l hyperparameters and the initial threshold e, as well as the first outlier labeling results; Compare the first outlier annotation result with the manual annotation result to obtain the accuracy, recall rate and F1 score under each local optimal value; According to the search step and search direction, the weights p1 to p2 of the field similarity are initialized with the hyperparameters as the starting point. a , k and l hyper parameters and initial threshold e are iterated as a whole to obtain weights p1~p a , the overall initial values of the k and l hyperparameters and the initial threshold e, as well as the second outlier labeling results; Compare the second outlier annotation result with the manual annotation result to obtain the accuracy, recall rate and F1 score under the overall initial value; Compare the accuracy, recall, and F1 score at each local optimal value with the accuracy, recall, and F1 score at the overall initial value to obtain the difference in results; Based on the result differences and the local optimal values, the overall initial value is adjusted to obtain the overall optimal value; The optimal value is used as the optimal parameter to obtain the latest outlier judgment for the current database record.
10. The method for calculating outliers in a database record enhanced by text attachment according to claim 9, characterized in that: The adjusting of the overall initial value based on the result difference and the local optimal value to obtain the overall optimal value includes: Determine whether the result difference is within a preset difference range; If so, do not adjust the overall initial value; Otherwise, based on the local optimal value, determine the latest search step and the latest search direction, and iteratively calculate the overall initial value according to the latest search step and the latest search direction until the result difference is within the preset difference range to obtain the overall optimal value.
Citation Information
Patent Citations
Homonymous author disambiguation method based on network representation and semantic representation
CN111191466A
Long text automatic classification recommendation method and device
CN114911928A
Complex equipment parameter anomaly detection method based on improved density peak clustering
CN115964662A
Multi-topic text abstract automatic generation method and system
CN116756303A
Domain keyword extraction method based on weighted TextRank and K-means
CN117057346A
Cited By
Document retrieval method based on multi-field information and outlier detection
CN120994760A
