A method for learning address text information relevance based on data preprocessing

By performing masking preprocessing on the pre-training set and correcting and completing the address information, combined with the multi-head attention mechanism and sub-training set division, the problems of poor model generalization ability and imbalanced training data in the existing technology are solved, and the address information is improved. Accuracy of text information relevance judgment and model generalization ability.

CN114298228BActive Publication Date: 2024-10-15HANGZHOU DIANZI UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111650136.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-30
Publication Date
2024-10-15
Estimated Expiration
2041-12-30

AI Technical Summary

Technical Problem

Existing methods for determining the relevance of address text information lack pertinence, have poor model generalization capabilities, and are limited by general domain knowledge. Moreover, training data annotation is time-consuming and unbalanced, resulting in low accuracy.

Method used

By masking preprocessing on the pre-training set, the model's pertinence is enhanced; the ac automaton algorithm is used to correct and complete the address information; the training set is divided into sub-training sets, and the multi-head attention mechanism and cross-entropy loss are used for integrated training to improve Model generalization ability.

Benefits of technology

It improves the model's understanding and comparative correlation of address text, alleviates the problem of sample number imbalance, and enhances the model's generalization ability and the accuracy of address correlation tasks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114298228B_ABST
    Figure CN114298228B_ABST
Patent Text Reader

Abstract

The present invention discloses a training and learning method for address text information relevance. Aiming at the lack of pertinence of model pre-training knowledge, the non-standardization of address text itself and the imbalance of sample quantity in training set, the addresses in the pre-training set are firstly masked and pre-processed, and then the initialized model is pre-trained with the pre-processed pre-training set, and then the two addresses of the address relationship pair in the training set are corrected and supplemented, and the whole training set is divided into multiple sub-training sets by using a special training set division strategy, and then the pre-trained model is used to perform integrated training and prediction on each sub-training set, and finally the generalization ability of the integrated model is tested.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of deep learning technology, and in particular to an address text information correlation learning method based on data preprocessing. Background Art

[0002] With the rapid development of Internet and Internet of Things technologies, the address text information relevance task has a wide range of application scenarios in the real world, such as: geographic location services based on geographic information search, rapid search and positioning of emergency location information, alignment of different address location information systems, etc. The method for judging the relevance of address text information is currently mainly a supervised learning method, which can be divided into the following two types: one is to merge the address pairs to be judged through special separator characters and then input them into the model to directly obtain the classification result; the other is to input the two addresses in the address pair into the model separately, and obtain the result based on the cosine similarity of the output vector.

[0003] The shortcomings of existing methods are: first, most models are pre-trained based on general domain knowledge, resulting in the lack of specificity of the knowledge learned by the model in the field of address text; in addition, there are often missing elements or irregularities in the address text, which reduces the comprehensibility of the address text and the comparative correlation between address relationship pairs; in addition, the labeling of training data is not only very time-consuming and labor-intensive, but also the labeled training set may have different degrees of sample number imbalance. These imbalances will be propagated and amplified in the model to varying degrees with the differences in model fitting capabilities, resulting in a significant decrease in the generalization ability of the model, which is ultimately manifested in the large differences in the accuracy of completing the address text information relevance task or the overall accuracy is not high when targeting different data sets. Summary of the invention

[0004] In view of the shortcomings of the prior art, the present invention proposes an address text information correlation learning method based on data preprocessing. First, the addresses in the pre-training set are masked and pre-processed, and then the initialized model is pre-trained with the pre-processed pre-training set to enhance the pertinence of the knowledge learned by the model; then, the two addresses of the address relationship pair in the training set are corrected and supplemented, and the entire training set is divided into multiple sub-training sets using a specific training set division strategy, and then the pre-trained model is used to perform integrated training and prediction on each sub-training set, so as to solve the problems of the non-standardization of the address text itself and the imbalance of the number of training set samples, and finally the generalization ability of the integrated model is tested.

[0005] A method for learning address text information relevance based on data preprocessing, specifically comprising the following steps:

[0006] Step 1: Pre-training data masking

[0007] Collect multiple single addresses containing complete address information, and then randomly mask these single addresses to obtain a pre-training set.

[0008] The random masking preprocessing method is: first use a random algorithm to determine whether to mask the address. If masking is required, the random algorithm is used to determine whether to mask a random word or a special phrase representing the location information; then the random algorithm is used to determine the specific content to be masked, and finally the content selected to be masked is replaced with a special character [mask].

[0009] Step 2: Model pre-training

[0010] Model pre-training uses self-supervised learning to allow the model to learn the semantic relationship between words in a sentence in advance through large amounts of relevant knowledge training, so as to reduce the amount of data and learning time required to understand the relevant contextual relationship during specific task training. Model pre-training specifically includes the following steps:

[0011] s2.1. Randomly initialize the model. In the word embedding layer, based on the new pre-training set after random masking in step 1, obtain the pre-training sentence matrix vector of each address in the pre-training set.

[0012] s2.2. In the encoder module, the pre-trained sentence matrix vector obtained in s2.1 is subjected to multi-head attention operation and linear operation in turn, and then residual connection and normalization operations are performed respectively to output the pre-trained encoder feature information.

[0013] The attention operation can be used to obtain the degree of attention of a word vector to other word vectors in the sentence matrix vector. The multi-head attention mechanism is further adopted. After the input is dimensionally compressed, multiple different attention operations can be used to increase the generalization ability of the model. The multi-head attention operation is:

[0014] MultiHead=Concat(Head1,…,Head l )W O

[0015] Head i =Attention(HW i Q ,HwiK i K ,Hw i V )

[0016] Among them, MultiHead represents the output of multi-head attention operation; Head irepresents the output of the i-th attention operation; l represents the number of attention operations; Concat represents the stacking operation of the outputs of multiple attention operations; W O represents the learnable parameter matrix; H represents the pre-trained encoder feature information or pre-trained sentence matrix vector output by the previous encoder module; W i Q ,W i K ,W i V Represents the learnable parameter matrix of the i-th attention operation; where the attention operation Attention() is:

[0017]

[0018]

[0019] Among them, Q, K, and V represent three different inputs; d represents the number of input word vector feature representations; S represents the input matrix of the Softmax score operation; s m represents the mth word vector of the input matrix, and n represents the maximum text length.

[0020] The normalization operation integrates the input feature information using the expected μ and the standard deviation σ, which can alleviate the overfitting, gradient explosion and vanishing problems of the model:

[0021]

[0022]

[0023] Among them, LN represents the output after normalization operation; Z represents the input; z j represents the jth word vector of the input matrix; h represents the number of word vector feature representations of Z; G and B represent learnable parameter matrices.

[0024] Linear operations reorganize and extract feature information:

[0025] Linner=wX+b

[0026] Among them, Linner represents the output after linear operation; X represents the input; w and b represent the learnable parameter matrix.

[0027] s2.3, repeat multiple times to obtain the optimal pre-trained encoder feature information. Then, in the classification linear layer, based on the optimal pre-trained encoder feature information, obtain the conditional probability that each word in the vocabulary is the same as the masked content in the pre-training set; calculate the cross entropy loss based on the conditional probability, and continuously update the model to finally complete the pre-training of the model.

[0028] Step 3: Correct and complete training data

[0029] Collect address relationship pair data for address text information correlation tasks, and use the AC automaton algorithm to perform secondary matching on the two addresses of all address relationship pairs in these address relationship pair data. First, obtain the key information identifying the province, city, and district in the address, and then correct and complete the erroneous or incomplete address information. After the completion, there is only one option for the address information.

[0030] The specific steps of the ac automaton algorithm include: splitting each address in the data into independent words according to the collected address relationship, constructing a dictionary tree, and then starting from the root node (root) of the dictionary tree, deciding whether to insert a new node according to whether the word exists continuously; then using the depth-first algorithm to construct a fail pointer between nodes, the fail pointer is located at the node that needs to be turned to when the next character match fails, and the character pointed to by the fail pointer is the node where the matched string suffix and the longest identical character of the string prefix are located; then, according to the constructed dictionary tree, the matching address is continuously matched until all characters are matched or it stops at the root node and cannot continue to match.

[0031] Step 4: Sub-training set division

[0032] Based on the corrected and completed address text information relevance task training set in step 3, the labels of each address relationship pair in the training set are screened and a specific cross-grouping strategy is performed. Assume that the training set E consists of subsets e0, e1, and e2 with different labels. Extract the subset e0 of the low data volume category and combine the remaining subsets of other categories into E 12 Perform multiple cross-grouping to form multiple new subsets, and then re-add the low-data-volume subset e0 to obtain multiple sub-training sets O n :

[0033]

[0034] Where k represents the set E 12 The number of folds to be split; n represents the set E 12 The nth fold to be split; num k Represents the set E 12 The total amount of data; num k Indicates that each fold after splitting occupies the set E 12 The average of the total data volume, num k =num total / k.

[0035] By dividing the above training sets into sub-sets, the problem of sample quantity imbalance can be solved or alleviated while ensuring sufficient training data.

[0036] Step 5: Model ensemble training

[0037] Using the pre-trained model in step 2, the training sentence matrix vector of each training address relationship pair is obtained in the word embedding layer; and the optimal training encoder feature information is obtained by stacking multiple encoder modules; the parameters and scale of the classification linear layer of the model are reinitialized, and after the classification linear layer processes the optimal training encoder feature information, the correlation classification conditional probability of each training address relationship pair is obtained; based on the conditional probability, the cross entropy loss is obtained, so as to continuously update the model and complete the training of a single model.

[0038] Repeat the above process and retrain each sub-training set On using the pre-trained model to obtain models trained with different sub-training sets.

[0039] Step 6: Integrated model testing

[0040] After completing the training of the address text information relevance task, it is necessary to test the generalization ability of the trained model. First, load the address relationship pair test set in the address text information relevance task database, and use the model trained with different sub-training sets in step 5 to obtain the relationship classification probability of each address relationship pair in the test set; then, perform a weighted average of the relationship classification probabilities of the same test address relationship pair output by each model, and determine the relevance of each test address relationship pair by taking the classification label with the highest probability; finally, evaluate the test results using the predefined indicator function F1 value. The larger the F1 value, the stronger the generalization ability of the model on the test set, so as to determine whether the model needs to be re-pretrained or continue training:

[0041]

[0042]

[0043]

[0044] Among them, P represents precision, R represents recall, and r i represents the number of correctly classified test address pairs of the i-th category, t i represents the number of test address relationship pairs classified as the i-th category, a i Represents the number of test address relationship pairs that are correctly labeled as the i-th category.

[0045] The present invention has the following beneficial effects:

[0046] 1. Use a single piece of address information to pre-train the model, so that the model can learn the semantic relationship in the address information in advance through a large amount of address information data, reducing the amount of data and learning time to understand the relevant contextual relationship in the specific address pair correlation analysis task.

[0047] 2. Use the AC automaton algorithm to correct and complete incorrect or incomplete address information, so as to solve the problem of non-standard address text itself, increase the comprehensibility of address text in the data set and the comparative correlation between address relationship pairs.

[0048] 3. By dividing the training set into sub-sets, the large number of category data are uniformly cross-grouped, and then a small number of category data are added to form a new sub-training set for model training. This can solve or alleviate the problem of sample quantity imbalance while ensuring sufficient training data, and further improve the generalization ability of the model. BRIEF DESCRIPTION OF THE DRAWINGS

[0049] Figure 1 A flow chart of the analysis method for address text information relevance;

[0050] Figure 2 Schematic diagram of the model structure used in the embodiment;

[0051] Figure 3 This is a tree structure diagram of the ac automaton established in the embodiment. DETAILED DESCRIPTION

[0052] The present invention will be further explained below with reference to the accompanying drawings;

[0053] like Figure 1 As shown, a method for learning the relevance of address text information based on data preprocessing specifically includes the following steps:

[0054] Step 1: Pre-training data masking

[0055] All single addresses containing complete address location information in the national statistical division code and urban-rural division database are collected, and the address of "Xiasha Street, Qiantang District, Hangzhou City, Zhejiang Province" is randomly masked.

[0056] If random words are used to mask the address, the original address will mask any position and non-continuous words with a high probability, and the masked address information will be: "Xiasha Road, Qiantang District, Zhejiang Province, Zhejiang Province, Zhejiang Province". If special phrases representing location information are used to mask the address, the masked words will represent key elements of the address, such as randomly selected from provinces, cities, districts, etc., and the masked address information will be: "Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, and Zhejiang Province, and the masked words will be randomly selected from provinces, cities, and districts. The address information after masking is: "Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, Zhejiang Province, and Zhejiang Province".

[0057] Step 2: Calculate the predicted probability of the masked word

[0058] Step 2: Model pre-training

[0059] Model pre-training uses self-supervised learning to allow the model to learn the semantic relationship between words in a sentence in advance through large amounts of relevant knowledge training, so as to reduce the amount of data and learning time required to understand the relevant contextual relationship during specific task training. Model pre-training specifically includes the following steps:

[0060] s2.1、For Figure 2 The model shown is randomly initialized. In the word embedding layer, based on the new pre-training set after random masking in step 1, the pre-training sentence matrix vector of each address in the pre-training set is obtained;

[0061] s2.2. In the encoder module, the pre-trained sentence matrix vector obtained in s2.1 is subjected to multi-head attention operation and linear operation in turn, and then residual connection and normalization operations are performed respectively to output the pre-trained encoder feature information.

[0062] The attention operation can be used to obtain the degree of attention of a word vector to other word vectors in the sentence matrix vector. The multi-head attention mechanism is further adopted. After the input is dimensionally compressed, multiple different attention operations can be used to increase the generalization ability of the model. The multi-head attention operation is:

[0063] MultiHead=Concat(Head1,…,Head l )W O

[0064] Head i =Attention(HW i Q ,HW i K ,HW i V )

[0065] Among them, MultiHead represents the output of multi-head attention operation; Head i represents the output of the i-th attention operation; l represents the number of attention operations; Concat represents the stacking operation of the outputs of multiple attention operations; W O represents the learnable parameter matrix; H represents the pre-trained encoder feature information or pre-trained sentence matrix vector output by the previous encoder module; W i Q ,W i K ,W i VRepresents the learnable parameter matrix of the i-th attention operation; where the attention operation Attention() is:

[0066]

[0067]

[0068] Among them, Q, K, and V represent three different inputs; d represents the number of input word vector feature representations; S represents the input matrix of the Softmax score operation; s m represents the mth word vector of the input matrix, and n represents the maximum text length.

[0069] The normalization operation integrates the input feature information using the expected μ and the standard deviation σ, which can alleviate the overfitting, gradient explosion and vanishing problems of the model:

[0070]

[0071]

[0072] Among them, LN represents the output after normalization operation; Z represents the input; z j represents the jth word vector of the input matrix; h represents the number of word vector feature representations of Z; G and B represent learnable parameter matrices.

[0073] Linear operations reorganize and extract feature information:

[0074] Linner=wX+b

[0075] Among them, Linner represents the output after linear operation; X represents the input; w and b represent the learnable parameter matrix.

[0076] s2.3, repeat multiple times to obtain the optimal pre-trained encoder feature information. Then, in the classification linear layer, based on the optimal pre-trained encoder feature information, obtain the conditional probability that each word in the vocabulary is the same as the masked content in the pre-training set; calculate the cross entropy loss based on the conditional probability, and continuously update the model to finally complete the pre-training of the model.

[0077] Step 3: Correct and complete training data

[0078] After loading the address relationship pair training set in the address text information correlation task database, the AC automaton algorithm is used to perform secondary matching on the two addresses of all address relationship pairs in these address relationship pair data. First, the key information identifying the province, city, and district in the address is obtained, and then the erroneous or incomplete address information is corrected and supplemented. There is only one option for the completed address information.

[0079] like Figure 3 As shown in the figure, "Zhejiang", "Jiangsu" and "Jiangxi" are divided into individual characters, and a node tree connected by solid lines is formed starting from the root. The gray-filled nodes in the figure are the end nodes. For the phrase that has been matched, when the algorithm fails to match at a certain node, it jumps to a certain node through the fail pointer, which is represented by the dotted line. When the next character of "Zhejiang" is not "Hangzhou", the algorithm will jump to the "Jiangsu" character in "Jiangsu" because "Jiangsu" is the longest identical item of the suffix of "Zhejiang" and the prefix of "Jiangsu". In addition, if the item to be matched is "No. xx, Wenyi Road, Xiasha Street, Qiantang District, Zhejiang", the AC automatic machine will first match the key information "Zhejiang" and "Qiantang District" that may be the address, and then search all possible addresses in the database and output "Qiantang District, Hangzhou City, Zhejiang Province". If there is only one possible address, the complete address will be used to replace the original incomplete address. If there are multiple possible addresses, such as "Gulou District", multiple results such as "Gulou District, Nanjing City, Jiangsu Province", "Gulou District, Xuzhou City, Jiangsu Province", and "Gulou District, Kaifeng City, Henan Province" may be output. In this case, the original incomplete address will not be replaced.

[0080] Step 4: Sub-training set division

[0081] Based on the address text information relevance task training set E that has been corrected and completed in step 3, the labels of each address relationship pair in the training set are screened and divided into subsets e0, e1, and e2 according to the labels. e0 is a subset with low data volume, so e0 is extracted, and the set E composed of the remaining subsets e1 and e2 is 12 Perform multiple cross-grouping to form multiple new subsets, and then re-add the low-data-volume subset e0 to obtain multiple sub-training sets O n :

[0082]

[0083] Where k represents the set E 12 The number of folds to be split; n represents the set E 12 The nth fold to be split; num k Represents the set E 12 The total amount of data; num k Indicates that each fold after splitting occupies the set E 12 The average of the total data volume, num k =num total / k.

[0084] By dividing the above training sets into sub-sets, the problem of sample quantity imbalance can be solved or alleviated while ensuring sufficient training data.

[0085] Step 5: Model ensemble training

[0086] Using the pre-trained model in step 2, the training sentence matrix vector of each training address relationship pair is obtained in the word embedding layer; and the optimal training encoder feature information is obtained by stacking multiple encoder modules; the parameters and scale of the classification linear layer of the model are reinitialized, and after the classification linear layer processes the optimal training encoder feature information, the correlation classification conditional probability of each training address relationship pair is obtained; based on the conditional probability, the cross entropy loss is obtained, so as to continuously update the model and complete the training of a single model.

[0087] Repeat the above process for each sub-training set O n All of them are retrained using the pre-trained model to obtain models trained with different sub-training sets.

[0088] Step 6: Integrated model testing

[0089] After completing the training of the address text information relevance task, it is necessary to test the generalization ability of the trained model. First, load the address relationship pair test set in the address text information relevance task database, and use the model trained with different sub-training sets in step 5 to obtain the relationship classification probability of each address relationship pair in the test set; then, perform a weighted average of the relationship classification probabilities of the same test address relationship pair output by each model, and determine the relevance of each test address relationship pair by taking the classification label with the highest probability; finally, evaluate the test results using the predefined indicator function F1 value. The larger the F1 value, the stronger the generalization ability of the model on the test set, so as to determine whether the model needs to be re-pretrained or continue training:

[0090]

[0091]

[0092]

[0093] Among them, P represents precision, R represents recall, and r i represents the number of correctly classified test address pairs of the i-th category, t i represents the number of test address relationship pairs classified as the i-th category, a i Represents the number of test address relationship pairs that are correctly labeled as the i-th category.

Claims

1. A method for learning address text information relevance based on data preprocessing, characterized in that: The method specifically comprises the following steps: Step 1: Pre-training data processing Collect multiple single addresses containing complete address information, and then use a random algorithm to determine whether to mask the address. If masking is required, the random algorithm is used to determine whether to mask a random word or a special phrase representing the location information. The random algorithm is then used to determine the specific content to be masked, and finally the content to be selected for masking is replaced with a special character mask. After completing the random masking process of a single address, a pre-training set is obtained. Step 2: Model pre-training s2.

1. Randomly initialize the model, input the pre-training set obtained in step 1 into the word embedding layer of the model, and obtain the pre-training sentence matrix vector of each address in the pre-training set; s2.2, in the encoder module, perform multi-head attention operation, normalization operation and linear operation on the pre-trained sentence matrix vector obtained in s2.1 in sequence, and output the pre-trained encoder feature information; repeat multiple times to obtain the optimal pre-trained encoder feature information; s2.

3. In the classification linear layer, according to the optimal pre-trained encoder feature information, obtain the conditional probability that each word in the vocabulary is the same as the masked content in the pre-training set; calculate the cross entropy loss based on the conditional probability, and continuously update the model to finally complete the pre-training of the model; Step 3: Training data preprocessing Collect address relationship pair data for address text information correlation tasks, and use the ac automaton algorithm to perform secondary matching on the two addresses of all address relationship pairs in these address relationship pair data. First, obtain the key information identifying the province, city, and district in the address, and then correct and complete the wrong or incomplete address information to obtain the preprocessed training set. The specific steps of the ac automaton algorithm are: s3.

1. Split each address in the data into independent words according to the collected address relationship, and then construct a dictionary tree. Starting from the root node, decide whether to insert a new node according to whether the words on the dictionary tree exist continuously; s3.

2. Use the depth-first algorithm to construct fail pointers between nodes, where the characters pointed to by the fail pointers are the matched string suffix and the node where the longest identical character of the string prefix is ​​located; s3.3, then continue to match the address to be matched according to the constructed dictionary tree until all characters are matched or it stops at the root node and cannot continue to match; Step 4: Divide the sub-training set The labels of each address relationship pair in the training set corrected and completed in step 3 are screened. The preprocessed training set E is divided into subsets e0, e1, and e2 according to the labels. The subset e0 with low data volume is extracted, and then the set E consisting of the remaining subsets e1 and e2 is 12 Perform multi-fold cross-grouping to form multiple new subsets, and then add the extracted low-data-volume subset e0 back into the new subsets obtained after multi-fold cross-grouping to obtain multiple sub-training sets O n : Where k represents the set E 12 The number of folds to be split; n represents the set E 12 The nth fold to be split; num total Represents the set E 12 The total amount of data; num k Indicates that each fold after splitting occupies the set E 12 The average of the total data volume, num k =num total / k; Step 5: Model ensemble training Each sub-training set obtained in step 4 is input into the model preprocessed in step 2, and the parameters and scale of the classification linear layer are optimized based on the cross entropy loss to obtain the model trained with different sub-training sets; the address relationship pairs that need to be analyzed for correlation tasks are input into the model trained with different sub-training sets to obtain the relationship classification probability of the address relationship pairs.

2. The method for learning address text information relevance based on data preprocessing as claimed in claim 1, characterized in that: The multi-head attention operation is: MultiHead=Concat(Head1,…,Head l )W O Head i =Attention(HW i Q ,HW i K ,HW i V ) Among them, MultiHead represents the output of multi-head attention operation; Head i represents the output of the i-th attention operation; l represents the number of attention operations; Concat represents the stacking operation of the outputs of multiple attention operations; W O represents the learnable parameter matrix; H represents the pre-trained encoder feature information or pre-trained sentence matrix vector output by the previous encoder module; W i Q ,W i K ,W i V represents the learnable parameter matrix of the i-th attention operation; where the attention operation Attention() is: Among them, Q, K, and V represent three different inputs; d represents the number of input word vector feature representations; S represents the input matrix of the Softmax score operation; s m represents the mth word vector of the input matrix, and n represents the maximum text length; The normalization operation integrates the input feature information using the expected μ and the standard deviation σ: Where LN represents the output after normalization operation; Z represents the input matrix of normalization operation; z j represents the jth word vector of the input matrix; h represents the number of word vector feature representations of the input matrix; G and B represent learnable parameter matrices; The linear operation reorganizes and extracts the feature information: Linner=wX+b Among them, Linner represents the output after linear operation; X represents the input matrix of linear operation; w and b represent the learnable parameter matrix.

3. The method for learning address text information relevance based on data preprocessing as claimed in claim 1, characterized in that: Evaluate the generalization ability of the models trained with different sub-training sets in step 5, and retrain the models with low generalization ability.

4. The method for learning address text information relevance based on data preprocessing as claimed in claim 3, characterized in that: The evaluation method is: the F1 value of the indicator function is used for evaluation. The larger the F1 value, the stronger the generalization ability of the model. Among them, P represents precision, R represents recall, and r i represents the number of correctly classified address relationship pairs of type i, t i represents the number of address relationship pairs classified as the i-th category, a i Represents the number of address relationship pairs that are correctly labeled as the i-th type.