Address generation method and device for address detection, equipment and storage medium
By performing word segmentation and vectorization processing on address samples, combining the generation of adversarial models and noise vectors, the problem of insufficient number and diversity of target false addresses in training of false address detection models is solved, and high-quality training data is achieved efficiently.
Patent Information
- Application Number
- CN202310696533.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-06-12
- Publication Date
- 2024-12-13
AI Technical Summary
In the prior art, the number of target false addresses generated during training of false address detection models is small and has poor diversity, which cannot meet the training needs.
By segmenting the address samples, the address vector is constructed, and the pre-trained generative adversarial model and noise vector superimposed processing is used to generate high-quality and diverse target addresses.
It has achieved efficient generation of a large number of target false addresses with strong diversity, improving the quality and efficiency of the training data of the false address detection model.
Smart Images

Figure CN119128025A_ABST
Abstract
Description
Technical Field
[0001] Embodiments of the present invention relate to the field of computer technology, and in particular to an address generation method, device, equipment and storage medium for address detection. Background Art
[0002] The false address detection task is an indispensable technical support for map services. Training a false address detection model requires a large amount of annotated address data, which can include real address data and false address data. However, the proportion of false address data in the annotated address data is extremely low, which seriously affects the training of the false address detection model. Therefore, data enhancement of false addresses to generate a large number of false addresses is of great significance to improve the false address detection effect.
[0003] In the prior art, methods such as synonym replacement, random insertion, random deletion, random exchange, and back translation are usually used to process false address samples to obtain target false addresses.
[0004] In the process of implementing the present invention, the inventors found that there are at least the following technical problems in the prior art:
[0005] The number of generated target fake addresses is small and the diversity is poor. Summary of the invention
[0006] The present invention provides an address generation method, device, equipment and storage medium for address detection, so as to realize high-efficiency generation of a large number of target addresses with strong diversity for address detection.
[0007] In a first aspect, an embodiment of the present invention provides an address generation method for address detection, comprising:
[0008] Segmenting the address sample for address detection to obtain the address word corresponding to the address sample for address detection;
[0009] Determining, according to the address words corresponding to the address samples used for address detection, the address vectors corresponding to the address samples used for address detection;
[0010] The address vector and the noise vector set are input into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, wherein each noise vector has the same dimension as the address vector.
[0011] In a second aspect, an embodiment of the present invention further provides an address generation device for address detection, comprising:
[0012] A word segmentation module, used for performing word segmentation on the address sample used for address detection to obtain the address word corresponding to the address sample used for address detection;
[0013] A determination module, configured to determine an address vector corresponding to the address sample used for address detection according to the address word corresponding to the address sample used for address detection;
[0014] An execution module is used to input the address vector and the noise vector set into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, wherein each noise vector has the same dimension as the address vector.
[0015] In a third aspect, an embodiment of the present invention further provides a computer device, including:
[0016] One or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the address generation method for address detection as described in any one of the first aspects.
[0017] In a fourth aspect, an embodiment of the present invention further provides a storage medium comprising computer executable instructions, wherein the computer executable instructions, when executed by a computer processor, are used to execute the address generation method for address detection as described in any one of the first aspects.
[0018] The embodiments of the above invention have the following advantages or beneficial effects:
[0019] An embodiment of the present invention provides an address generation method for address detection, including: performing word segmentation on an address sample for address detection to obtain address words corresponding to the address sample for address detection; determining an address vector corresponding to the address sample for address detection according to the address words corresponding to the address sample for address detection; inputting the address vector and a noise vector set into a pre-trained generative adversarial model so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, wherein the dimension of each noise vector is consistent with that of the address vector. The above technical scheme, firstly, can segment the address samples used for address detection according to the address structure and address hierarchical relationship of the address samples used for address detection, and obtain the address words corresponding to the address samples used for address detection, thereby improving the segmentation efficiency of the address samples used for address detection, and realizing fast and effective segmentation of the address samples used for address detection. Secondly, the address vector retaining the address structure and address hierarchical relationship of the address samples used for address detection can be determined according to the address words corresponding to the address samples used for address detection. The address vector can be used to generate more target addresses with the same address structure and the same address hierarchical relationship as the address vector. The trained generative adversarial model can generate high-quality target addresses, and the noise vector set can improve the diversity of the generated target addresses. Therefore, after the address vector and the noise vector set corresponding to the address samples used for address detection are input into the trained generative adversarial model, the generation module contained in the trained generative adversarial model can generate target addresses according to the address vector and each noise vector in the noise vector set corresponding to the address samples used for address detection, thereby realizing efficient generation of a large number of high-quality and highly diverse target addresses. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] Figure 1 A flowchart of an address generation method for address detection provided by an embodiment of the present invention;
[0021] Figure 2 A flowchart of another address generation method for address detection provided by an embodiment of the present invention;
[0022] Figure 3 A schematic diagram of an address tree in another address generation method for address detection provided by an embodiment of the present invention;
[0023] Figure 4 A schematic diagram of a noise-assisted strategy in another address generation method for address detection provided by an embodiment of the present invention;
[0024] Figure 5 A schematic diagram of a generation module included in a generation adversarial model in another address generation method for address detection provided by an embodiment of the present invention;
[0025] Figure 6 A schematic diagram of generating an adversarial model in another address generation method for address detection provided by an embodiment of the present invention;
[0026] Figure 7 A flowchart of another address generation method for address detection provided by an embodiment of the present invention;
[0027] Figure 8 A schematic diagram of the structure of an address generation device for address detection provided by an embodiment of the present invention;
[0028] Fig. 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0029] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.
[0030] It should be mentioned before discussing exemplary embodiments in more detail that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow charts describe various operations (or steps) as sequential processes, many operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of various operations can be rearranged. The process can be terminated when its operation is completed, but can also have additional steps not included in the accompanying drawings. The process can correspond to methods, functions, procedures, subroutines, subprograms, etc. In addition, the embodiments in the present invention and the features in the embodiments can be combined with each other without conflict.
[0031] In order to train the false address detection model, a large number of false addresses need to be generated. In the prior art, any address word in the false address sample can be replaced based on the synonym replacement method to obtain the target false address, any address word can be inserted into the false address sample based on the random insertion method to obtain the target false address, any address word in the false address sample can be deleted based on the random deletion method to obtain the target false address, any two address words in the false address sample can be exchanged based on the random exchange method to obtain the target false address, and the false address sample can be translated into other languages through the language translation function based on the back translation method, and then translated from other languages back to the original language to obtain the target false address.
[0032] On the one hand, the address words contained in the false address sample can be provinces, cities, districts, counties, road names or points of interest that represent the address level, for example: Chongqing City / Zhong County / Xinli Town / Wenbi Village / Residential Point. Based on the synonym replacement method, any address word "Chongqing City" in the false address sample is replaced with "Shanghai City" to obtain the target false address "Shanghai City / Zhong County / Xinli Town / Wenbi Village / Residential Point". This method fails to take into account the relationship between the replaced address words and the remaining address words, resulting in poor quality of the target false address, which is easily recognized as a false address by the false address detection model. On the other hand, based on the random insertion method, random deletion method, and random exchange method, the false address samples are randomly inserted, deleted, and exchanged to obtain the target false address. This method will destroy the address structure and generate low-quality target false addresses. On the other hand, based on the back translation method, the false address samples are translated multiple times to obtain the target false address. The province, city, district, county, and road names in the false address samples usually have unique translations in all languages. After translating the false address samples multiple times based on the back translation method, the target false addresses obtained are not much different from the false address samples, and the diversity of the target false addresses is poor. Moreover, the existing technology can only generate one target false address by performing one or more operations on each false address sample, and the generation efficiency of the target false address is low. The training of the false address detection model requires a large number of false addresses, and the target false addresses generated by the existing technology cannot meet the training requirements of the false address detection model.
[0033] Therefore, the present application proposes an address generation method for address detection, so as to efficiently generate a large number of highly diverse false addresses for false address detection.
[0034] The address generation method for address detection proposed in the present application will be described in detail below with reference to diagrams and embodiments.
[0035] Figure 1 The present invention provides a flowchart of an address generation method for address detection. The present invention can be applied to the situation where a large number of highly diverse false addresses for address detection need to be generated efficiently. The method can be executed by an address generation device for address detection, which can be implemented by software and / or hardware. Figure 1 The method specifically comprises the following steps:
[0036] Step 110: Segment the address sample for address detection to obtain address words corresponding to the address sample for address detection.
[0037] The address sample used for address detection can be understood as an address text that is identified as a real address but is actually a false address. For example, in a logistics system, if an address text that is determined to be a real address based on a false address detection model is found to be a false address during the actual delivery process, the address text can be determined to be an address sample used for address detection. The address sample used for address detection is an address text with an address structure composed of multiple address words with an address hierarchical relationship.
[0038] Specifically, first, the address structure corresponding to the address sample used for address detection can be determined. For example, when the address sample used for address detection is "Chongqing City / Zhong County / Xinli Town / Wenbi Village / Residential Area", the address structure can be determined to be "City-County-Town-Village-Point of Interest". Secondly, based on the address hierarchy relationship and address structure, an address tree corresponding to the address sample used for address detection can be constructed, and the address tree contains the address hierarchy relationship and address structure of the address sample used for address detection. Furthermore, according to the address tree corresponding to the address sample used for address detection, the address sample used for address detection can be segmented, and the nodes in the address tree can be divided into address words to obtain the address words corresponding to the address sample used for address detection.
[0039] In an embodiment of the present invention, the address samples used for address detection are segmented according to their address structures and address hierarchical relationships to obtain address words corresponding to the address samples used for address detection, thereby achieving fast and effective segmentation of the address samples used for address detection.
[0040] Step 120: Determine the address vector corresponding to the address sample used for address detection according to the address word corresponding to the address sample used for address detection.
[0041] The pre-trained language embedding (Bidirectional Encoder Representation from Transformers, BERT) model can be understood as a pre-trained BERT model, which can be used to construct an address vector corresponding to an address sample for address detection according to an address word corresponding to the address sample for address detection.
[0042] The address vector may be an embedded vector recognizable by a computer, and the embedded vector is vector format data corresponding to the image data or text data.
[0043] Specifically, the pre-trained BERT model has learned non-semantic information such as address structure and address hierarchical relationship. Therefore, the address words corresponding to the address samples used for address detection can be input into the pre-trained BERT model as input data. The pre-trained BERT model can vectorize the address words corresponding to the address samples used for address detection to obtain the address word vectors corresponding to the address samples used for address detection, and then combine the address word vectors corresponding to the address samples used for address detection with the learned address structure and address hierarchical relationship to obtain the address vectors corresponding to the address samples used for address detection.
[0044] Since the pre-trained BERT model has learned the address structure and address hierarchical relationship, the address vector corresponding to the address sample used for address detection determined based on the pre-trained BERT model retains the address structure and address hierarchical relationship of the address sample used for address detection.
[0045] In an embodiment of the present invention, the address vector determined by the pre-trained BERT model that has learned the address structure and address hierarchical relationship retains the address structure and address hierarchical relationship of the address sample used for address detection, and the address vector can be used to generate more target addresses, providing a timely data basis for generating target addresses.
[0046] Step 130: Input the address vector and the noise vector set into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set to obtain a target address.
[0047] The generative adversarial model may include a generation module and a discrimination module. The generation module may generate a variety of intermediate addresses based on the address vector corresponding to the address sample used for address detection, and send the intermediate addresses to the discrimination module, hoping that the discrimination module is as indistinguishable as possible from the existing addresses used for address detection and the generated intermediate addresses. Of course, in order to increase the diversity of the generated target addresses, the input of the generation module may also include a noise vector set, and the generation module may generate intermediate addresses based on the address vector and any noise vector in the noise vector set. The discrimination module also needs to distinguish the existing addresses used for address detection and the generated intermediate addresses as much as possible. The generation module and the discrimination module are jointly optimized through continuous iterative adversarial training, and the quality of the target addresses generated by the generation module is getting higher and higher. Finally, a generation module with good generation effect can be obtained, and the generative adversarial model including the generation module and the discrimination module can be used to generate target addresses.
[0048] Specifically, the dimensions of each noise vector in the noise vector set are consistent with the address vector, and of course, the scale is also consistent. The address vector and the noise vector set are input into the pre-trained generative adversarial model as input information. The generation module included in the generative adversarial model can firstly superimpose the address vector and each noise vector in the noise vector set respectively, and then encode the superposition result to obtain the encoding information, and can also decode the encoding information to obtain the target address vector, and then determine the target address according to the target address vector.
[0049] In an embodiment of the present invention, a trained generative adversarial model can be used to generate high-quality target addresses. After the address vector and the noise vector set corresponding to the address sample used for address detection are input into the trained generative adversarial model, the generation module contained in the trained generative adversarial model generates the target address according to the address vector corresponding to the address sample used for address detection and each noise vector in the noise vector set, thereby achieving efficient generation of a large number of target addresses with high diversity.
[0050] The address generation method for address detection provided in an embodiment of the present invention includes: performing word segmentation on an address sample for address detection to obtain address words corresponding to the address sample for address detection; determining an address vector corresponding to the address sample for address detection according to the address words corresponding to the address sample for address detection; inputting the address vector and a noise vector set into a pre-trained generative adversarial model so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, wherein each noise vector has the same dimension as the address vector. The above technical scheme, firstly, can segment the address samples used for address detection according to the address structure and address hierarchical relationship of the address samples used for address detection, and obtain the address words corresponding to the address samples used for address detection, thereby improving the segmentation efficiency of the address samples used for address detection, and realizing fast and effective segmentation of the address samples used for address detection. Secondly, the address vector retaining the address structure and address hierarchical relationship of the address samples used for address detection can be determined according to the address words corresponding to the address samples used for address detection. The address vector can be used to generate more target addresses with the same address structure and the same address hierarchical relationship as the address vector. The trained generative adversarial model can generate high-quality target addresses, and the noise vector set can improve the diversity of the generated target addresses. Therefore, after the address vector and the noise vector set corresponding to the address samples used for address detection are input into the trained generative adversarial model, the generation module contained in the trained generative adversarial model can generate target addresses according to the address vector and each noise vector in the noise vector set corresponding to the address samples used for address detection, thereby realizing efficient generation of a large number of high-quality and highly diverse target addresses.
[0051] Figure 2 A flowchart of another address generation method for address detection provided by an embodiment of the present invention, which is applicable to situations where a large number of highly diverse false addresses for address detection need to be generated efficiently. Based on the above embodiment, before the address words corresponding to the address samples for address detection are input into the pre-trained language and embedded into the BERT model, the embodiment of the present invention adds "unsupervised pre-training of the BERT model based on the mask prediction task and the next sentence prediction task, so that the BERT model learns the address hierarchy relationship based on the mask prediction task and the next sentence preset task; the BERT model that has learned the address hierarchy relationship is determined as the pre-trained BERT model." Before the address vector and the noise vector set are input into the pre-trained generative adversarial model, the following is added: "adjusting each initial noise vector in the initial noise vector set to obtain the noise vector corresponding to each initial noise vector with the same dimension as the address vector; constructing the noise vector set based on the noise vector." Before the address vector and the noise vector set are input into the pre-trained generative adversarial model, a training process of the generative adversarial model is added, wherein the explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. See. Figure 2 , the address generation method for address detection provided by the embodiment of the present invention includes:
[0052] Step 210: Segment the address sample for address detection to obtain address words corresponding to the address sample for address detection.
[0053] In one implementation, step 210 may specifically include:
[0054] The address sample used for address detection is segmented according to the address structure and the address hierarchy relationship to obtain the address words corresponding to the address sample used for address detection.
[0055] The address used for address detection may be understood as a false address, and the target address may be understood as a target false address.
[0056] Specifically, in order to improve the diversity of target false addresses, multiple false address samples can be obtained from the logistics system. Multiple false address samples are segmented. First, the address structure corresponding to each false address sample can be determined. For example, when the false address sample is "Hunan Province / Changsha City / Li County / Zhongxing Town / Yangjia Village / Resident Activity Center", the address structure can be determined to be "Province-City-County-Town-Village-Point of Interest". Secondly, based on the address hierarchy and address structure, the address tree corresponding to each false address sample can be constructed. Figure 3 A schematic diagram of an address tree in another address generation method for address detection provided by an embodiment of the present invention, such as Figure 3As shown, the address tree corresponding to the false address sample contains the address hierarchy and address structure of the false address sample. Furthermore, according to the address tree corresponding to the false address sample, the false address sample can be segmented, and each node in the address tree can be divided into address words to obtain the false address words corresponding to the false address sample. For example, when the false address sample is "Chongqing City / Zhong County / Xinli Town / Wenbi Village / Residential Point", the false address words can be determined as: w1: Chongqing City, w2: Zhong County, w3: Shuanggui Town, w4: Wenbi Village, w5: Residential Point.
[0057] In the embodiment of the present invention, the false address samples are segmented according to their address structures and address hierarchical relationships to obtain false address words corresponding to each false address sample, thereby achieving fast and effective segmentation of the false address samples.
[0058] Step 220, perform unsupervised pre-training on the BERT model based on the mask prediction task and the next sentence prediction task, so that the BERT model learns the address hierarchy relationship based on the mask prediction task and the next sentence preset task; and determine the BERT model that has learned the address hierarchy relationship as the pre-trained BERT model.
[0059] In one implementation, step 220 may specifically include:
[0060] Obtain a first historical address and a masked address corresponding to the first historical address, and use the first historical address and the masked address corresponding to the first historical address as a first intermediate training data set to perform unsupervised pre-training on the BERT model, so that the BERT model learns the subordinate hierarchical relationship of the addresses; obtain a second historical address and an adjacent historical address corresponding to the second historical address, and use the second historical address and the adjacent historical address corresponding to the second historical address as a second intermediate training data set to perform unsupervised pre-training on the BERT model, so that the BERT model learns the same-level hierarchical relationship of the addresses; wherein, the second historical address corresponds to a first address level, the adjacent historical address corresponding to the second historical address corresponds to a second address level, the total number of address levels of the first address level and the second address level is consistent, and the first N address levels are consistent, and N is a positive integer less than the total number of address levels; the BERT model that has learned the address hierarchical relationship is determined as the pre-trained BERT model.
[0061] When determining the false address vector corresponding to the false address sample, it is necessary to consider the non-semantic information such as the address structure and address hierarchical relationship of the false address sample. Therefore, the false address vector corresponding to the false address sample can be determined based on the pre-trained BERT model that has learned the address structure and address hierarchical relationship.
[0062] Of course, before determining the false address vector corresponding to the false address sample, the BERT model needs to be pre-trained to determine the pre-trained BERT model.
[0063] like Figure 3 As shown in the figure, in the address text, there are some hierarchical relationships similar to tree structures. In order to retain this hierarchical relationship in the address vector, it is necessary to consider the subordinate aspects and the same-level aspects in the process of determining the address vector based on the address text. In terms of subordinate aspects, since District 1 belongs to City 1 but not City 2, it is hoped that the address vector of "X Province / City 1 / District 1" is closer to the address vector of "X Province / City 1" and away from the address vector of "X Province / City 2"; in terms of the same level, since District 1 and District 2 belong to City 1, while District 1 and District 4 belong to different cities, it is hoped that the address vector of "X Province / City 1 / District 1" is closer to the address vector of "X Province / City 1 / District 2" and away from the address vector of "X Province / City 2 / District 4". Therefore, the BERT model can be unsupervised pre-trained based on the mask prediction task and the next sentence prediction task.
[0064] Specifically, first, construct the data required for BERT model pre-training. Figure 3 In the address tree shown, triggered by the root node, a path from the root node to the leaf node is randomly selected as an address text. Data for BERT model pre-training is constructed based on two randomly collected address texts. For example, based on the address texts "x Province City 1 District 1..." and "x Province City 2 District 4...", data for BERT model pre-training "x Province City 1 District 1..." can be constructed. <sep>City 1, District 1, Province X...". The masked prediction task can capture the hierarchical relationship of subordinate aspects in the address text, making the address vector of District 1 contain the information of City 1. In this embodiment, the random mask word strategy of the original BERT model can be improved to mask the names of provinces, cities, and districts. Determine the first historical address required for unsupervised pre-training of the BERT model based on the masked prediction task and the masked address corresponding to the first historical address. For example, it can be determined that the masked addresses corresponding to "City 1, District 1, Province X..." and "City 2, District 4, Province X..." are "Province X [mask] District 1... <sep>[mask] City 2 District 4…”. Of course, if the address vector of District 1 can infer the masked city name, it can be determined that the address vector of District 1 contains the information of City 1; if the address vector of City 2 can infer the masked province name, it can be determined that the address vector of City 2 contains the information of Province x. In order to capture the hierarchical relationship of the same level in the address text and make the address vector of District 1 close to the address vector of District 2, in this embodiment, the original BERT model can be improved to determine whether the second sentence is the next sentence of the first sentence, and whether the two addresses are close. Determine the unsupervised pre-training of the BERT model based on the next sentence prediction task The required second historical address and the adjacent historical address corresponding to the second historical address, the second historical address corresponds to the first address level, the adjacent historical address corresponding to the second historical address corresponds to the second address level, the total number of address levels of the first address level and the second address level are consistent, and the first N address levels are consistent, and N is a positive integer less than the total number of address levels. For example, it can be determined that District 1 and District 2 in "x Province City 1 District 1..." and "x Province City 1 District 2..." belong to the same city, therefore, "x Province City 1 District 1..." and "x Province City 1 District 2..." are close to each other at the district level, and it can be determined that "x Province City 1 District 1..." is the adjacent address of "x Province City 1 District 2...".
[0065] It should be noted that when the BERT model is unsupervisedly pre-trained based on the mask prediction task and the next sentence prediction task, the training order is not specifically limited and can be determined according to actual needs.
[0066] On the one hand, the first historical address and the masked address corresponding to the first historical address can be obtained, and the first historical address and the masked address corresponding to the first historical address can be used as the first intermediate training data set to perform unsupervised pre-training on the BERT model, so as to implement the training of the BERT model based on the mask prediction task, so that the BERT model learns the subordinate hierarchical relationship of the address, and obtains the intermediate BERT model; the second historical address and the adjacent historical address corresponding to the second historical address are obtained, and the second historical address and the adjacent historical address corresponding to the second historical address are used as the second intermediate training data set to perform unsupervised pre-training on the intermediate BERT model, so as to implement the training of the intermediate BERT model based on the next sentence prediction task, so that the intermediate BERT model learns the same-level hierarchical relationship of the address, and obtains the pre-trained BERT model.
[0067] On the other hand, the second historical address and the adjacent historical address corresponding to the second historical address can be obtained, and the second historical address and the adjacent historical address corresponding to the second historical address can be used as the second intermediate training data set to perform unsupervised pre-training on the BERT model, so as to implement the training of the BERT model based on the next sentence prediction task, so that the BERT model learns the same-level hierarchical relationship of the addresses, and obtains the intermediate BERT model; the first historical address and the masked address corresponding to the first historical address are obtained, and the first historical address and the masked address corresponding to the first historical address are used as the first intermediate training data set to perform unsupervised pre-training on the intermediate BERT model, so as to implement the training of the intermediate BERT model based on the mask prediction task, so that the intermediate BERT model learns the subordinate hierarchical relationship of the addresses, and obtains the pre-trained BERT model.
[0068] In an embodiment of the present invention, the pre-trained BERT model obtained by unsupervised pre-training of the BERT model through mask prediction tasks and next sentence prediction tasks can learn the address structure and address hierarchical relationship of the address text. The pre-trained BERT model that has learned the address structure and address hierarchical relationship can vectorize the address text and determine the address vector corresponding to the address text.
[0069] Step 230: input the address words corresponding to the address samples for address detection into a pre-trained language embedding BERT model, so that the pre-trained BERT model vectorizes the address words corresponding to the address samples for address detection to obtain address vectors corresponding to the address samples for address detection.
[0070] Specifically, the false address words corresponding to multiple false address samples are input into the pre-trained BERT model. The pre-trained BERT model can firstly vectorize each false address word to obtain an address word vector corresponding to each false address word, and then combine each address word vector based on the learned address structure and address hierarchy relationship to obtain a false address vector, which retains the address structure and address hierarchy relationship of the false address sample.
[0071] For example, when the false address sample is "Chongqing City / Zhong County / Xinli Town / Wenbi Village / Residential Point", the false address words are: w1: Chongqing City, w2: Zhong County, w3: Shuanggui Town, w4: Wenbi Village, w5: Residential Point. The pre-trained BERT model vectorizes the false address words and obtains the address word vectors corresponding to the false address words: e 重庆市 、e 忠县 、e 双桂镇 、e 文笔村 、e 居民点 , where e 重庆市 represents the address vector corresponding to the address word "Chongqing City", e 忠县 represents the address vector corresponding to the address word "Zhongxian", e 双桂镇 represents the address vector corresponding to the address word "Shuanggui Town", e 文笔村 represents the address vector corresponding to the address word "Wenbi Village", e 居民点 The pre-trained BERT model combines the address word vectors based on the learned address structure and address hierarchy to obtain the false address vector E corresponding to the false address sample "Chongqing City / Zhong County / Xinli Town / Wenbi Village / Residential Point" = (e 重庆市 , e 忠县 , e 双桂镇 , e 文笔村 , e 居民点 ).
[0072] It should be noted that the pre-trained BERT model can continuously optimize the model in the process of determining the false address vectors corresponding to the false address samples. As the number of times the pre-trained BERT model is used increases, the efficiency and quality of determining the false address vectors corresponding to the false address samples will gradually improve.
[0073] In an embodiment of the present invention, after the pre-trained BERT model vectorizes each false address word, it combines the address word vectors based on the learned address structure and address hierarchy relationship to obtain a false address vector. The false address vector retains the address structure and address hierarchy relationship of the false address sample, and can be used to generate more target false addresses, providing a timely data basis for generating target false addresses.
[0074] Step 240: Adjust each initial noise vector in the initial noise vector set to obtain the noise vector corresponding to each initial noise vector and having the same dimension as the address vector; and construct the noise vector set according to the noise vector.
[0075] Specifically, the dimension and scale of the randomly generated noise vector are uncertain. Therefore, first, n initial noise vectors z1, z2, z3, ..., zn can be randomly generated, and then each initial noise vector can be adjusted based on the adjustable parameter matrix. Specifically, each initial noise vector can be adjusted by formula 1 to obtain a noise vector Z1, Z2, Z3, ..., Zn that is consistent with the dimension and scale of the false address vector. The low-dimensional initial noise vector is multiplied by the adjustable parameter matrix to become a high-dimensional noise vector, and the dimension and scale of the noise vector are consistent with the false address vector. Furthermore, a noise vector set can be constructed based on the noise vector.
[0076] Zi=zi·WFormula 1
[0077] Where Zi represents the noise vector, zi represents the initial noise vector, and W represents the adjustable parameter matrix. The dimension dim(Zi) of Zi is consistent with the dimension dim(E) of E, and the scale s(Zi) of Zi is consistent with the scale s(E) of E.
[0078] In an embodiment of the present invention, by adjusting the dimension and scale of the randomly generated initial noise vector through an adjustable parameter matrix, a noise vector consistent with the dimension and scale of the false address vector can be obtained. The noise vector can be used in combination with the false address vector to generate diversified target false addresses and improve the diversity of the target false addresses.
[0079] Step 250: Input the address vector and the noise vector set into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address.
[0080] The dimension and scale of each noise vector are consistent with those of the address vector.
[0081] In one implementation, step 250 may specifically include:
[0082] The address vector and the noise vector set are input into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain an initial address vector, and then encodes and decodes the initial address vector to obtain a target address vector, and determines the target address according to the target address vector.
[0083] Normally, after a false address vector is input into the generative adversarial model, the generative module of the generative adversarial model can only generate one target false address. However, the training of the false address detection model requires a large number of false addresses. Therefore, it is necessary to introduce a noise vector auxiliary strategy to transform a false address vector into multiple target address vectors through the noise vector, thereby improving the diversity of the target address vector.
[0084] Figure 4 A schematic diagram of a noise auxiliary strategy in another address generation method for address detection provided by an embodiment of the present invention, such as Figure 4 As shown, each false address vector is bitwise added to each noise vector in the noise vector set to obtain n initial false address vectors corresponding to each false address vector. For example, based on Formula 2, the false address vector E is bitwise added to each noise vector Z1, Z2, Z3...Zn in the noise vector set (Z1, Z2, Z3,..., Zn) to obtain n initial false address vectors E1, E2, E3...En corresponding to each false address vector.
[0085]
[0086] Among them, Ei represents the initial false address vector, E represents the false address vector, and Zi represents the noise vector.
[0087] Specifically, the false address vector and the noise vector set are input into the generative adversarial model. The generative adversarial model can perform superposition processing on the false address vector and each noise vector in the noise vector set based on Formula 2. Specifically, bitwise addition can be performed to obtain multiple initial false address vectors corresponding to the false address vector.
[0088] The generative adversarial module may include a generation module. In order to ensure that the target fake address generated by the generation module retains the unique sequence structure of the address text, the generation module may be a Transformer-based generation module. Figure 5 A schematic diagram of a generation module included in a generation adversarial model in another address generation method for address detection provided by an embodiment of the present invention, such as Figure 5 As shown, the Transformer-based generation module includes six encoding layers (Encoder) and six decoding layers (Decoder), the encoding layer is used to compress and represent the data, and the encoding layer is used to generate and expand the data. In practical applications, the generation module can also be other modules with sequence structures, such as a generation module based on seq2seq.
[0089] The generation module can encode the initial false address vector in sequence based on the six coding layers to obtain the coding information corresponding to the initial false address vector, and then pass the coding information corresponding to the initial false address vector to each decoding layer. The first decoding layer can decode the coding information to obtain the first decoding information, and the other decoding layers can determine the decoding information based on the coding information and the last decoding information obtained by decoding the coding information of the previous decoding layer. Then, the last decoding layer determines the target false address vector corresponding to the initial false address vector based on the coding information and the last decoding information obtained by decoding the coding information of the previous decoding layer. Finally, the target false address vector can be normalized to obtain the target false address.
[0090] like Figure 5 As shown, the initial false address vector is (e 重庆市 , e 忠县 , e 双桂镇 , e 文笔村 , e 居民点 ), the initial false address vector is encoded and decoded, and the target false address vector can be obtained as (e 重庆市 , e 忠县 , e 拔山镇 , e 文笔村 , e 居民点 ), and then we can determine that the target fake address is "Chongqing City / Zhong County / Bashan Town / Wenbi Village / Residential Area".
[0091] In an embodiment of the present invention, after the false address vector and the noise vector set corresponding to the false address sample are input into the trained generative adversarial model, the generation module contained in the trained generative adversarial model generates the target false address according to the false address vector and each noise vector in the noise vector set corresponding to the false address sample, thereby achieving efficient generation of a large number of target false addresses with high diversity.
[0092] Figure 6 A schematic diagram of generating an adversarial model in another address generation method for address detection provided by an embodiment of the present invention, such as Figure 6 As shown, the generative adversarial module includes a generation module and a discrimination module.
[0093] The input of the discrimination module includes the acquired false address samples and the target false address generated by the generation module according to the false address sample vector and the noise vector. The discrimination module needs to distinguish the acquired false address samples and the generated target false address as correctly as possible, and feed back the discrimination results to the generation module. The input of the generation module includes the false address samples, the noise vector and the discrimination results. The target false address is generated according to the false address samples and the noise vector, and the target false address is sent to the discrimination module, hoping that the discrimination module will mistakenly discriminate the generated target false address as the acquired false address sample. The generation module can adjust itself according to the discrimination results, optimize the generation process, and improve the quality of the generated target false address.
[0094] Optionally, the training process of the generative adversarial model includes: inputting the acquired historical address for address detection and the noise vector set into the generative adversarial model, so that the generation module in the generative adversarial model determines the generated historical address for address detection corresponding to the acquired historical address for address detection; based on the acquired historical address for address detection and the real source of the acquired historical address for address detection, the generated historical address for address detection and the false source of the generated historical address for address detection, the discriminant module in the generative adversarial model is trained to obtain a first intermediate generative adversarial model; fixing the parameter information of the discriminant module in the first intermediate generative adversarial model; based on the generated historical address for address detection and the real source, the generation module in the first intermediate generative adversarial model is trained to obtain a second intermediate generative adversarial model; determining whether the training end condition is met, if the training end condition is not met, returning to execute the input of the acquired historical address for address detection into the generative adversarial model, so that the generation module in the generative adversarial model determines the generated historical address for address detection corresponding to the acquired historical address for address detection; otherwise, determining that the second intermediate generative adversarial model is a trained generative adversarial model.
[0095] Specifically, the acquired false historical address is input into the generation module, and the generation module determines the generated false historical address corresponding to the false historical address. At this time, the generation module has not been trained, and the quality of the generated false historical address is poor. The parameters of the generation module are fixed unchanged, and the discrimination module is trained. Specifically, the acquired false historical address and the real source of the acquired false historical address, the generated false historical address and the false source of the generated false historical address are used as the first training data set to train the model of the discrimination module. The loss function is the accuracy of the source. According to the loss function, the parameters of the discrimination module are updated. After the training of the discrimination module is completed, the generation module needs to be trained to improve the fraud ability of the generation module. At this time, the generation module can be connected in series with the previously trained discrimination module, and the parameters of the discrimination module are fixed to train the generation module. Based on the generated false historical address and the real source, the generation module is trained. The loss function is the output of the discrimination module. According to the loss function, the parameters of the generation module are updated. After the training of the generation module is completed, the parameters of the generation module are fixed again and the discrimination module is continued to be trained. The above process is repeated until the model training times meet the training end conditions. At this time, the generation module can generate a target false address that is closer to the obtained false historical address, and the discrimination module also has a better ability to identify the source.
[0096] The training end condition can be determined according to the quality requirements of the target false address, and is not specifically limited here.
[0097] In the embodiment of the present invention, the generation module and the discrimination module compete with each other during the training process to achieve a joint optimization effect.
[0098] The address generation method for address detection provided by an embodiment of the present invention includes: performing word segmentation on an address sample for address detection to obtain address words corresponding to the address sample for address detection; performing unsupervised pre-training on a BERT model based on a mask prediction task and a next sentence prediction task, so that the BERT model learns the address hierarchy relationship based on the mask prediction task and the next sentence preset task; determining the BERT model that has learned the address hierarchy relationship as the pre-trained BERT model; inputting the address words corresponding to the address sample for address detection into a pre-trained language embedding BERT model, so that the pre-trained BERT model performs vectorization processing on the address words corresponding to the address sample for address detection to obtain an address vector corresponding to the address sample for address detection; adjusting each initial noise vector in an initial noise vector set to obtain the noise vector corresponding to each initial noise vector having the same dimension as the address vector; constructing the noise vector set according to the noise vector; inputting the address vector and the noise vector set into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address. The above technical solution, when the address used for address detection is a false address and the target address is a target false address, segment the false address samples according to their address structure and address hierarchical relationship, and obtain the false address words corresponding to each false address sample, thereby improving the segmentation efficiency of the false address samples and achieving fast and effective segmentation of the false address samples. The pre-trained BERT model obtained by unsupervised pre-training of the BERT model through the mask prediction task and the next sentence prediction task can learn the address structure and address hierarchical relationship of the address text. The pre-trained BERT model that has learned the address structure and address hierarchical relationship can determine the address corresponding to the false address word. Word vectors, and each address word vector can also be combined to obtain a false address vector that retains the address structure and address hierarchy relationship of the false address sample. The trained generative adversarial model can be used to generate high-quality target false addresses, and the noise vector set can improve the diversity of the generated target false addresses. Therefore, after the false address vectors and noise vector set corresponding to the false address samples are input into the trained generative adversarial model, the generation module contained in the trained generative adversarial model can generate target false addresses according to the false address vectors corresponding to the false address samples and each noise vector in the noise vector set, thereby achieving efficient generation of a large number of high-quality and diverse target false addresses.
[0099] In addition, by continuously iterating adversarial training on the generation module and the discrimination module contained in the generative adversarial model, joint optimization can be achieved, and the quality of the target false addresses generated by the generation module becomes higher and higher.
[0100] Figure 7 The flowchart of another address generation method for address detection provided by the embodiment of the present invention exemplifies one of the implementation methods. Figure 7 As shown, including:
[0101] Step 710: Segment the false address samples to obtain false address words corresponding to the false address samples.
[0102] Step 720: Input the false address words into a pre-trained BERT model that has been trained for the mask prediction task and the next sentence prediction task and has learned the address hierarchy relationship, so that the pre-trained BERT model vectorizes each false address word corresponding to the false address sample to obtain an address word vector corresponding to each false address word, and combines each address word vector based on the learned address hierarchy relationship to obtain a false address vector corresponding to the false address sample.
[0103] Step 730: input the false address vector and the noise vector set into the generative adversarial model, so that the generation module contained in the generative adversarial model performs superposition processing on the false address vector and each noise vector in the noise vector set respectively to obtain an initial false address vector, and then encodes and decodes the initial false address vector to obtain a target false address vector, and determines the target false address according to the target false address vector.
[0104] The implementation of the address generation method for address detection provided by the embodiment of the present invention has the corresponding beneficial effects of executing any of the aforementioned address generation methods for address detection.
[0105] Figure 8 A schematic diagram of the structure of an address generation device for address detection provided in an embodiment of the present invention. The device and the address generation method for address detection in the above embodiments belong to the same inventive concept, and the details not described in detail in the embodiment of the address generation device for address detection can refer to the embodiment of the address generation method for address detection.
[0106] The specific structure of the address generation device for address detection is as follows: Figure 8 As shown, including:
[0107] A word segmentation module 810, configured to segment address samples used for address detection to obtain address words corresponding to the address samples used for address detection;
[0108] A determination module 820, configured to determine an address vector corresponding to the address sample used for address detection according to the address word corresponding to the address sample used for address detection;
[0109] The execution module 830 is used to input the address vector and the noise vector set into a pre-trained generative adversarial model so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, wherein each noise vector has the same dimension as the address vector.
[0110] Based on the above embodiment, the word segmentation module 810 is specifically used for:
[0111] The address sample used for address detection is segmented according to the address structure and the address hierarchy relationship to obtain the address words corresponding to the address sample used for address detection.
[0112] Based on the above embodiment, the determination module 820 is specifically used for:
[0113] The address words corresponding to the address samples used for address detection are input into a pre-trained language embedding BERT model, so that the pre-trained BERT model vectorizes the address words corresponding to the address samples used for address detection to obtain address vectors corresponding to the address samples used for address detection.
[0114] Based on the above embodiment, the device further includes:
[0115] The first training module is used to perform unsupervised pre-training on the BERT model based on the mask prediction task and the next sentence prediction task, so that the BERT model learns the address hierarchy relationship based on the mask prediction task and the next sentence preset task; and the BERT model that has learned the address hierarchy relationship is determined as the pre-trained BERT model.
[0116] In one implementation, the first training module is specifically used to:
[0117] Obtain a first historical address and a masked address corresponding to the first historical address, and use the first historical address and the masked address corresponding to the first historical address as a first intermediate training data set to perform unsupervised pre-training on the BERT model, so that the BERT model learns the subordinate hierarchical relationship of the addresses; obtain a second historical address and an adjacent historical address corresponding to the second historical address, and use the second historical address and the adjacent historical address corresponding to the second historical address as a second intermediate training data set to perform unsupervised pre-training on the BERT model, so that the BERT model learns the same-level hierarchical relationship of the addresses; wherein, the second historical address corresponds to a first address level, the adjacent historical address corresponding to the second historical address corresponds to a second address level, the total number of address levels of the first address level and the second address level is consistent, and the first N address levels are consistent, and N is a positive integer less than the total number of address levels; the BERT model that has learned the address hierarchical relationship is determined as the pre-trained BERT model.
[0118] Based on the above embodiment, the device further includes:
[0119] A construction module is used to adjust each initial noise vector in the initial noise vector set to obtain the noise vector corresponding to each initial noise vector and having the same dimension as the address vector; and construct the noise vector set according to the noise vector.
[0120] Based on the above embodiment, the execution module 830 is specifically used for:
[0121] The address vector and the noise vector set are input into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain an initial address vector, and then encodes and decodes the initial address vector to obtain a target address vector, and determines the target address according to the target address vector.
[0122] On the basis of the above embodiment, the generative adversarial model includes a generation module and a discrimination module. Accordingly, the device also includes:
[0123] The second training module is used to input the acquired historical address for address detection and the noise vector set into the generative adversarial model, so that the generation module in the generative adversarial model determines the generated historical address for address detection corresponding to the acquired historical address for address detection; based on the acquired historical address for address detection and the real source of the acquired historical address for address detection, the generated historical address for address detection and the false source of the generated historical address for address detection, the discriminant module in the generative adversarial model is trained to obtain a first intermediate generative adversarial model; the parameter information of the discriminant module in the first intermediate generative adversarial model is fixed; based on the generated historical address for address detection and the real source, the generation module in the first intermediate generative adversarial model is trained to obtain a second intermediate generative adversarial model; determine whether the training end condition is met, if the training end condition is not met, return to execute the input of the acquired historical address for address detection into the generative adversarial model, so that the generation module in the generative adversarial model determines the generated historical address for address detection corresponding to the acquired historical address for address detection; otherwise, determine that the second intermediate generative adversarial model is a trained generative adversarial model.
[0124] The address generation device for address detection provided in the embodiment of the present invention can execute the address generation method for address detection provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the address generation method for address detection.
[0125] It is worth noting that in the above-mentioned embodiment of the address generation device for address detection, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0126] Fig. 9 A schematic diagram of the structure of a computer device provided in an embodiment of the present invention. Fig. 9 A block diagram of an exemplary computer device 9 suitable for use in implementing embodiments of the present invention is shown. Fig. 9 The computer device 9 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0127] like Fig. 9 As shown, the computer device 9 is in the form of a general-purpose computing electronic device. The components of the computer device 9 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 connecting different system components (including the system memory 28 and the processing unit 16).
[0128] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.
[0129] The computer device 9 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 9, including volatile and non-volatile media, removable and non-removable media.
[0130] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 9 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Fig. 9 not shown, usually called a "hard drive"). Although Fig. 9 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The system memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.
[0131] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in system memory 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. Program modules 42 generally perform the functions and / or methods of the embodiments described herein.
[0132] The computer device 9 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), one or more devices that enable a user to interact with the computer device 9, and / or any device that enables the computer device 9 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. Furthermore, the computer device 9 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through a network adapter 20. Fig. 9 As shown, the network adapter 20 communicates with other modules of the computer device 9 via the bus 18. It should be understood that although Fig. 9 Not shown, other hardware and / or software modules may be used in conjunction with computer device 9, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0133] The processing unit 16 executes various functional applications and page displays by running the program stored in the system memory 28, for example, implementing the address generation method for address detection provided in the embodiment of the present invention, the method comprising:
[0134] Segmenting the address sample for address detection to obtain the address word corresponding to the address sample for address detection;
[0135] Determining, according to the address words corresponding to the address samples used for address detection, the address vectors corresponding to the address samples used for address detection;
[0136] The address vector and the noise vector set are input into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, wherein each noise vector has the same dimension as the address vector.
[0137] Of course, those skilled in the art can understand that the processor can also implement the technical solution of the address generation method for address detection provided by any embodiment of the present invention.
[0138] An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the program is executed by a processor, an address generation method for address detection provided by an embodiment of the present invention is implemented, for example, the method comprising:
[0139] Segmenting the address sample for address detection to obtain the address word corresponding to the address sample for address detection;
[0140] Determining, according to the address words corresponding to the address samples used for address detection, the address vectors corresponding to the address samples used for address detection;
[0141] The address vector and the noise vector set are input into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, wherein each noise vector has the same dimension as the address vector.
[0142] The computer storage medium of the embodiment of the present invention can adopt any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium can be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: an electrical connection with one or more wires, a portable computer 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. In this document, a computer-readable storage medium can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.
[0143] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0144] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0145] Computer program code for performing the operations of the present invention may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0146] It should be understood by those skilled in the art that the modules or steps of the present invention described above can be implemented by a general-purpose computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, optionally, they can be implemented by a program code executable by a computer device, so that they can be stored in a storage device and executed by the computing device, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
[0147] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.< / sep> < / sep>
Claims
1. An address generation method for address detection, It is characterized in that include: Segmenting the address sample for address detection to obtain the address word corresponding to the address sample for address detection; Determining, according to the address words corresponding to the address samples used for address detection, the address vectors corresponding to the address samples used for address detection; The address vector and the noise vector set are input into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, wherein each noise vector has the same dimension as the address vector.
2. The address generation method for address detection according to claim 1, It is characterized in that Segmenting the address sample for address detection to obtain the address word corresponding to the address sample for address detection includes: The address sample used for address detection is segmented according to the address structure and the address hierarchy relationship to obtain the address words corresponding to the address sample used for address detection.
3. The address generation method for address detection according to claim 1, It is characterized in that Determining, according to the address words corresponding to the address samples used for address detection, the address vectors corresponding to the address samples used for address detection, comprises: The address words corresponding to the address samples used for address detection are input into a pre-trained language embedding BERT model, so that the pre-trained BERT model vectorizes the address words corresponding to the address samples used for address detection to obtain address vectors corresponding to the address samples used for address detection.
4. The address generation method for address detection according to claim 3, It is characterized in that Before the address words corresponding to the address samples for address detection are input into the pre-trained language embedding BERT model, the method further includes: Performing unsupervised pre-training on the BERT model based on the mask prediction task and the next sentence prediction task, so that the BERT model learns the address hierarchical relationship based on the mask prediction task and the next sentence preset task; The BERT model that has learned the address hierarchical relationship is determined as the pre-trained BERT model.
5. The address generation method for address detection according to claim 4, It is characterized in that The BERT model is unsupervisedly pre-trained based on the mask prediction task and the next sentence prediction task, so that the BERT model learns the address hierarchical relationship based on the mask prediction task and the next sentence preset task, including: Obtaining a first historical address and a masked address corresponding to the first historical address, and using the first historical address and the masked address corresponding to the first historical address as a first intermediate training data set to perform unsupervised pre-training on the BERT model, so that the BERT model learns the subordinate hierarchical relationship of the addresses; Obtain a second historical address and an adjacent historical address corresponding to the second historical address, and use the second historical address and the adjacent historical address corresponding to the second historical address as a second intermediate training data set to perform unsupervised pre-training on the BERT model, so that the BERT model learns the same-level hierarchical relationship of the addresses; wherein the second historical address corresponds to a first address level, the adjacent historical address corresponding to the second historical address corresponds to a second address level, the total number of address levels of the first address level and the second address level is consistent, and the first N address levels are consistent, and N is a positive integer less than the total number of address levels.
6. The address generation method for address detection according to claim 1, It is characterized in that Before inputting the address vector and the noise vector set into the pre-trained generative adversarial model, the method further includes: Adjusting each initial noise vector in the initial noise vector set to obtain the noise vector corresponding to each initial noise vector and having the same dimension as the address vector; The noise vector set is constructed according to the noise vector.
7. The address generation method for address detection according to claim 6, It is characterized in that Inputting the address vector and the noise vector set into a pre-trained generative adversarial model so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, including: The address vector and the noise vector set are input into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain an initial address vector, and then encodes and decodes the initial address vector to obtain a target address vector, and determines the target address according to the target address vector.
8. The address generation method for address detection according to claim 1, It is characterized in that The generative adversarial model includes a generation module and a discrimination module. Accordingly, before the address vector and the noise vector set are input into the pre-trained generative adversarial model, the method further includes: Inputting the acquired historical address for address detection and the noise vector set into the generative adversarial model, so that the generation module in the generative adversarial model determines the generated historical address for address detection corresponding to the acquired historical address for address detection; Based on the acquired historical addresses for address detection and the real sources of the acquired historical addresses for address detection, the generated historical addresses for address detection and the false sources of the generated historical addresses for address detection, the discriminant module in the generative adversarial model is trained to obtain a first intermediate generative adversarial model; Fixing parameter information of the discriminant module in the first intermediate generative adversarial model; Based on the generated historical addresses for address detection and the real sources, model training is performed on the generation module in the first intermediate generative adversarial model to obtain a second intermediate generative adversarial model; Determine whether the training end condition is met. If the training end condition is not met, return to execute and input the acquired historical address for address detection into the generative adversarial model, so that the generation module in the generative adversarial model determines the generated historical address for address detection corresponding to the acquired historical address for address detection; otherwise, determine that the second intermediate generative adversarial model is a trained generative adversarial model.
9. An address generation device for address detection, It is characterized in that include: A word segmentation module, used for performing word segmentation on the address sample used for address detection to obtain the address word corresponding to the address sample used for address detection; A determination module, configured to determine an address vector corresponding to the address sample used for address detection according to the address word corresponding to the address sample used for address detection; An execution module is used to input the address vector and the noise vector set into a pre-trained generative adversarial model, so that the generative adversarial model performs superposition processing on the address vector and each noise vector in the noise vector set respectively to obtain a target address, wherein each noise vector has the same dimension as the address vector.
10. A computer device, It is characterized in that include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the address generation method for address detection as described in any one of claims 1 to 8.
11. A storage medium containing computer executable instructions, It is characterized in that When the computer executable instructions are executed by a computer processor, they are used to perform the address generation method for address detection according to any one of claims 1 to 8.
Citation Information
Patent Citations
False address identification method, device and apparatus
CN110197284A
IPv6 target generation method and device based on language modeling in vector space
CN112651227A
Address standardization method and device
CN113468881A
Adversarial sample generation method and system, computer equipment and storage medium
CN113780123A
Adversarial sample generation method, target recognition model training method and related device
CN114386476A
