An address identification method, system and device
Patent Information
- Application Number
- CN202310290690.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2026-10-23
- Estimated Expiration
- 2043-03-21
AI Technical Summary
该方案依赖于海量地址库的维护,对于地址库中不包含的地址则无法进行识别
[0009]本申请的有益效果是:区别于现有技术的情况,本申请通过将地址描述文本输入至训练后得到的识别模型中,以准确获得地址描述文本中的所有识别地址及识别地址对应的地址类别。其中,在将地址描述文本输入识别模型之前,利用初始训练文本及其对应的初始标签生成参考训练文本,从而利用初始训练文本和参考训练文本对识别模型进行训练,以基于少量的初始训练文本资源训练得到准确率较高的识别模型,极大提高了识别模型训练的效率。
Smart Images

Figure CN116484849B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of address recognition technology, and in particular to an address recognition method, system and apparatus. Background Technology
[0002] Address recognition technology is a commonly used natural language processing technique. Its essence is to perform joint parsing on unstructured text containing address information in order to identify addresses at various levels in the text.
[0003] Traditional address recognition technology relies on word segmentation, which breaks down text into corresponding words and then matches them with addresses from a database. This approach depends on maintaining a massive address database, and cannot recognize addresses not included in the database. Furthermore, the effectiveness of address recognition varies depending on the user's expression habits.
[0004] Subsequently, with the development of deep learning, neural networks were introduced into address recognition technology. However, this approach requires massive amounts of address training data to train the neural network, which is costly. Summary of the Invention
[0005] The main technical problem addressed by this application is to provide an address recognition method, system, and apparatus that can improve the efficiency of address recognition.
[0006] To address the aforementioned technical problems, this application adopts the following technical solution: obtaining address description text; wherein the address corresponding to the address description text belongs to a first geographical area; inputting the address description text into a recognition model to obtain all recognized addresses in the address description text and the address categories corresponding to the recognized addresses; wherein the recognition model is trained based on an initial training text and its corresponding reference training text, the reference training text is obtained based on the initial training text and the initial labels corresponding to the initial training text, and the address categories are related to the range included by the recognized addresses.
[0007] To address the aforementioned technical problems, another technical solution adopted in this application is: providing an address recognition system, comprising: an acquisition module for acquiring address description text; wherein the address corresponding to the address description text belongs to a first geographical region; and a recognition module for inputting the address description text into a recognition model to obtain all recognized addresses in the address description text and the address categories corresponding to the recognized addresses; wherein the recognition model is trained based on an initial training text and its corresponding reference training text, the reference training text is obtained based on the initial training text and the initial label corresponding to the initial training text, and the address categories are related to the range included by the recognized addresses.
[0008] To solve the above-mentioned technical problems, another technical solution adopted in this application is: to provide an address identification device, including a memory and a processor coupled to each other, wherein the processor stores program instructions, and the processor is used to execute the program instructions to implement the method mentioned in the above technical solution.
[0009] The beneficial effects of this application are as follows: Unlike existing technologies, this application accurately obtains all identified addresses and their corresponding address categories by inputting address description text into the trained recognition model. Specifically, before inputting the address description text into the recognition model, reference training text is generated using the initial training text and its corresponding initial labels. The recognition model is then trained using both the initial and reference training texts, resulting in a highly accurate recognition model trained with only a small amount of initial training text resources, thus significantly improving the efficiency of recognition model training. Attached Figure Description
[0010] To more clearly illustrate the technical solutions in the embodiments of this application, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein:
[0011] Figure 1 This is a flowchart illustrating one implementation method of the address identification method of this application;
[0012] Figure 2 This is a schematic diagram of the structure of one embodiment of the identification model of this application;
[0013] Figure 3 This is a flowchart of an embodiment following step S102;
[0014] Figure 4 This is a flowchart illustrating one implementation method of the training method for the recognition model of this application;
[0015] Figure 5 This is a flowchart illustrating step S302 corresponding to one implementation method;
[0016] Figure 6 This is a flowchart illustrating step S303 corresponding to one implementation method;
[0017] Figure 7 This is a schematic diagram of one embodiment of the address identification system of this application;
[0018] Figure 8 This is a schematic diagram of one embodiment of the address identification device of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0020] Please see Figure 1 , Figure 1 This is a flowchart illustrating one embodiment of the address identification method of this application, which includes:
[0021] S101: Obtain the address description text. The address corresponding to the address description text belongs to the first geographical region.
[0022] In one embodiment, step S101 includes: obtaining address description text for which address identification is required, wherein the address in the address description text belongs to a first geographical region, which can be set according to actual conditions. It should be noted that the address description text may include multiple categories of addresses, such as province, city, district / county, building, street, or neighborhood; for example, when the address description text is "I am on Fuqiang Road at the entrance of Hefei Sports Park," it is considered that the address description text includes addresses of different categories such as "Hefei City," "Sports Park," and "Fuqiang Road," and all of these addresses are located within the first geographical region, which can be Hefei City or Anhui Province, etc.
[0023] Optionally, the address description text can be obtained through the internet or manual input, or by scanning the address information in the image and converting it into text.
[0024] S102: Input the address description text into the recognition model to obtain all the recognized addresses in the address description text and the address categories corresponding to the recognized addresses. The recognition model is trained based on the initial training text and its corresponding reference training text. The reference training text is obtained based on the initial training text and its corresponding initial labels. The address categories are related to the range included in the recognized addresses.
[0025] In one embodiment, step S102 specifically includes: inputting the address description text into the constructed recognition model, so that the recognition model analyzes the address description text to obtain all the recognized addresses in the address description text, as well as the address category matched by each recognized address. The ranges corresponding to different address categories are different; for example, when the address category includes "city" and "street", the range of "city" is larger than that of "street".
[0026] In another implementation, please refer to Figure 2 , Figure 2 This is a structural schematic diagram of one embodiment of the identification model of this application. For example... Figure 2 As shown, the recognition model 100 includes a vector generation network 10 and a vector parsing network 20. Based on the recognition model 100, the above step S102 specifically includes: inputting the obtained address description text into the vector generation network 10 to obtain the description text vector corresponding to the address description text.
[0027] Furthermore, the descriptive text vector is input into the vector parsing network 20 to obtain the recognition result corresponding to the address description text. The recognition result includes all recognized addresses in the address description text and the address categories that the recognized addresses match.
[0028] Specifically, in this embodiment, the recognition model 100 is a BERT model, and the vector generation network 10 and the vector parsing network 20 include a preset number of Transformer Encoder blocks. The number of Transformer Encoder blocks corresponding to the vector generation network 10 and the vector parsing network 20 can be different, and the specific number can be set according to actual needs.
[0029] In addition, the vector parsing network 20 obtains the parsed vector by parsing the description text vector, and then obtains the recognition result corresponding to the address description text through the CRF (Conditional Random Field) algorithm.
[0030] It should be noted that the above recognition model is trained based on initial training text and reference training text. The reference training text is generated based on the initial training text and its corresponding initial labels; that is, the remaining samples used for model training are constructed using the obtained initial training text, reducing the cost of obtaining samples. Furthermore, the specific training process of the recognition model will be described in detail in subsequent implementation methods.
[0031] This application achieves accurate identification of all addresses and their corresponding address categories by inputting address description text into a trained recognition model. Specifically, before inputting the address description text into the recognition model, reference training text is generated using initial training text and its corresponding initial labels. This initial and reference training texts are then used to train the recognition model, resulting in a highly accurate model trained with only a limited amount of initial training text resources, significantly improving the efficiency of recognition model training.
[0032] Optionally, please refer to Figure 3 , Figure 3This is a flowchart illustrating an implementation method following step S102. Step S102 specifically includes:
[0033] S201: Obtain the field vector corresponding to the identified address from the address description text. Based on the similarity between the field vector and the comparison vector, obtain the confidence score of the address category matched by the identified address. The comparison vector is obtained based on the comparison address, and the comparison address matches the identified address in the same address category.
[0034] In one embodiment, step S201 includes: in response to obtaining all the identified addresses in the address description text and the address category matched by each identified address through step S102 above, obtaining the field vector corresponding to each identified address.
[0035] Specifically, semantic feature extraction can be performed on each identified address to obtain a field vector corresponding to each address. Alternatively, after obtaining the identified addresses, they can be input into a vector generation network in the recognition model to obtain the field vector corresponding to each address. Another option is to extract the field vector corresponding to each identified address from the parsed vector output by the vector parsing network based on the position information of the identified address in the corresponding address description text. It should be noted that semantic feature extraction of text information can be achieved through various existing methods, which will not be elaborated upon here.
[0036] Furthermore, for each identified address, the similarity between its corresponding field vector and comparison vector is calculated, and a confidence score for the address category matched by the identified address is obtained based on this similarity. This similarity can be determined by calculating the cosine distance between the vectors, and the similarity and the corresponding confidence score are positively correlated; that is, the higher the similarity, the higher the corresponding confidence score.
[0037] Specifically, the address categories for matching identified addresses in the address description text are pre-set with corresponding comparison vectors. The process of obtaining these comparison vectors includes: for each address category in the address description text, obtaining multiple comparison addresses corresponding to that address category; obtaining first vectors corresponding to at least some of the comparison addresses, and calculating the average of all first vectors to obtain the comparison vector. The method for obtaining the first vectors can be referenced to the method for obtaining the field vectors mentioned above, and will not be elaborated upon here.
[0038] Optionally, in other embodiments, the comparison address belongs to a first geographical region, meaning the comparison address and the corresponding identification address in the address description text belong to the same region. By using comparison addresses within the same region to calculate the comparison vector, the confidence score obtained based on the comparison vector becomes more accurate. The first geographical region can be defined according to different address categories; for example, when the identified address matches a city, the first geographical region can be the province where the city is located, or include the city and its surrounding cities; when the identified address matches a cell, the first geographical region can be an area within a preset distance centered on the cell.
[0039] In addition, the above comparison addresses can be obtained from the POI (Point of Information) database; the specific process will not be described in detail.
[0040] For example, when address category A is "cell", the process of obtaining the comparison vector a corresponding to address category A includes: obtaining multiple comparison addresses within a first geographical area, each comparison address matching the address category "cell", obtaining the first vector corresponding to at least some of the comparison addresses, and using the average of all the first vectors as the comparison vector a corresponding to address category A.
[0041] S202: Obtain the scoring threshold, and use the recognition address with a confidence score higher than the scoring threshold as the target address, and use the recognition address with a confidence score less than or equal to the scoring threshold as the reference address.
[0042] In one embodiment, step S202 includes setting a corresponding scoring threshold and comparing the confidence score corresponding to each identified address with the scoring threshold. If the confidence score is higher than the scoring threshold, the identification model is considered to have high accuracy, and the corresponding identified address is used as the target address. If the confidence score is less than or equal to the scoring threshold, the identification model is considered to have insufficient accuracy, and the corresponding identified address is used as a reference address. By comparing the confidence score corresponding to the identified address with the scoring threshold, the reliability of the identification model's output is determined, thereby improving the accuracy of address identification.
[0043] Preferably, in this embodiment, the scoring threshold is set to 0.8. Of course, in other embodiments, the scoring threshold may be obtained through multiple experiments or other values estimated by those skilled in the art.
[0044] Optionally, in other embodiments, after obtaining the confidence scores corresponding to all identified addresses in the address description text, the confidence average of all confidence scores corresponding to the address description text is calculated. If the confidence average is greater than a first threshold, the recognition accuracy is considered to be high, and all identified addresses are used as the corresponding target addresses; otherwise, all identified addresses are used as candidate addresses.
[0045] In response to the address recognition method proposed in this application, a recognition model needs to be pre-trained before recognizing the address description text. The training process of the recognition model is described in detail below. Please refer to... Figure 4 , Figure 4 This is a flowchart illustrating one implementation method of the training method for the recognition model of this application. The training method specifically includes:
[0046] S301: Obtain multiple initial training texts and their corresponding initial labels. Each initial training text contains at least one training address, and each initial label contains the address category corresponding to that training address. The training addresses belong to a second geographic region.
[0047] In one embodiment, step S301 specifically includes: acquiring multiple initial training texts, each initial training text corresponding to an initial label. The initial label includes all training addresses in the corresponding initial training text, and the address category corresponding to each training address.
[0048] The second geographical area can be defined based on the address category of different training addresses. For example, when the address category matched by the training address is a city, the second geographical area can be the province where the city is located, or include the city and its surrounding cities. When the address category matched by the training address is a cell, the second geographical area can be the area within a preset distance centered on the cell.
[0049] S302: Based on the initial training text and its corresponding initial label, obtain at least one reference training text. The reference training text has a reference label, and the reference label is the same as the initial label matched by the initial training text corresponding to the reference training text.
[0050] In one implementation, please refer to Figure 5 , Figure 5 This is a flowchart illustrating step S302 in one embodiment. Step S302 specifically includes:
[0051] S3021: Use the address category corresponding to the training address to replace the training address in the initial training text to obtain the initial template text corresponding to the initial training text.
[0052] In one embodiment, step S3021 specifically includes: in response to the fact that each training address in the initial training text corresponds to an address category, replacing the training addresses in the initial training text with the corresponding address categories to obtain the initial template text corresponding to the initial training text. Obtaining the initial template text helps to generate reference training text based on the semantic information and / or word and sentence information of the initial template text, thereby reducing the cost of training the recognition model.
[0053] For example, if the initial training text is "I am on Fuqiang Road at the entrance of Hefei Sports Park", the training addresses in the initial training text include "Hefei City", "Sports Park" and "Fuqiang Road". By replacing the training addresses with the corresponding address categories, the initial template text "I am on [road] at the entrance of [city] [building]" can be obtained.
[0054] S3022: Based on the semantic information and / or the word and sentence information of the initial template text, the initial template text is transformed to obtain at least one transformed template text.
[0055] In one embodiment, step S3022 specifically includes: transforming the initial template text based on the semantic information of the initial template text to obtain at least one transformed template text.
[0056] Specifically, in response to the initial template text being in the initial language, the initial template is translated at least once to obtain a translated template text. The translated template text is a preset language distinct from the initial language.
[0057] For example, if the initial template text is in Chinese, it is first translated into English to obtain the English template text; then, the English template text is translated into another language different from Chinese and English to obtain the translated template text. The number of times the initial template text is translated and the preset language can be set according to the actual situation.
[0058] Furthermore, the translated template text is translated back into the original language to obtain the corresponding converted template text. This method fully leverages the differences in expression between different languages, generating corresponding converted templates without altering the semantics of the original template text, thus helping to reduce the cost of obtaining training samples.
[0059] In another embodiment, step S3022 specifically includes: transforming the initial template text based on the word and sentence information of the initial template text to obtain at least one transformed template text.
[0060] Specifically, the initial template text is segmented to obtain its corresponding keywords. Multiple synonyms for each keyword are then obtained, and these synonyms are used to replace the keywords, resulting in the converted template text. The keywords are phrases in the initial template text that distinguish it from address categories.
[0061] For example, if the initial template text is "I am at the southeast corner of the intersection of [road] and [road]", the word "intersection" in the initial template text can be replaced with the synonym "crossroads" to obtain the corresponding converted template text.
[0062] Alternatively, in other implementations, keywords in the initial template text can be replaced using related words. For example, the directional word "southeast corner" can be replaced with related words such as "southwest corner".
[0063] Additionally, it should be noted that in step S3022, at least one corresponding conversion template text can be obtained based solely on the semantic information or solely on the word and sentence information of the initial template text. Alternatively, a first conversion template text corresponding to the initial template text can be obtained first based on the semantic information, and then a second conversion template text can be obtained based on the word and sentence information of the first conversion template text, and the second conversion template text can be used as the conversion template text corresponding to the initial template text. Of course, it is also possible to first obtain the first conversion template text based on the word and sentence information, and then obtain the second conversion template text based on the semantic information of the first conversion template text.
[0064] By utilizing at least one of word and phrase information, semantic information, and synonym information to generate the transformed template text corresponding to the initial template text, it is helpful to obtain more samples for training the recognition model and save the cost of obtaining training samples.
[0065] S3023: Obtain a candidate address library corresponding to each address category in the initial label. Use the candidate addresses in the candidate address library to replace the address categories in the initial template text and / or transformed template text to obtain at least one reference training text. Each candidate address library includes candidate addresses belonging to the same address category, and all candidate addresses belong to the second geographical region.
[0066] In one embodiment, step S3023 specifically includes: obtaining a candidate address library corresponding to each address category in the initial labels, where each candidate address in the candidate address library belongs to its corresponding address category. Furthermore, similar to the corresponding training address belonging to a second geographical region, all candidate addresses in the candidate address library also belong to a second geographical region. By ensuring that the training address and the corresponding candidate address belong to the same region, the correlation between the candidate address and the training address is improved, thereby enhancing the training effect of the recognition model. Additionally, the aforementioned candidate addresses can be obtained from a POI database; the specific process is not described in detail here.
[0067] Furthermore, by using any candidate address from the corresponding candidate address library, the address categories in the initial template text and / or transformed template text corresponding to the initial training text are replaced to obtain at least one reference training text corresponding to the initial training text.
[0068] In one specific implementation, when the initial training text contains the training address "Fuqiang Community", whose corresponding address category is "Community", a second geographical area corresponding to the address category "Fuqiang Community" is defined based on "Fuqiang Community". Specifically, the area within a preset distance centered on "Fuqiang Community" is taken as the second geographical area.
[0069] Furthermore, candidate addresses within the second geographical area with the address category "community" are obtained from the POI database, such as "Peace Community" and "Anju Community", to form a candidate address database.
[0070] S303: Use the initial training text and its corresponding initial label, as well as the reference training text and its corresponding reference label, to train the recognition model until the convergence condition is met, and obtain the trained recognition model.
[0071] In one embodiment, step S303 includes: inputting at least a portion of the initial training text and the reference training text into the recognition model, so that the recognition model outputs a prediction result corresponding to the initial training text or the reference training text. The prediction result includes a predicted address and the predicted category corresponding to the predicted address.
[0072] Furthermore, based on the initial labels and prediction results corresponding to the initial training text input to the recognition model, and the reference labels and prediction results corresponding to the reference training text input to the recognition model, the total loss corresponding to the recognition model is obtained, and the parameters of the recognition model are adjusted according to the total loss until the recognition model meets the convergence condition, thus obtaining the trained recognition model.
[0073] In another implementation, please refer to Figure 6 , Figure 6 This is a flowchart illustrating step S303 in one embodiment. In this embodiment, the identification model is... Figure 2 The model structure shown includes a vector generation network and a vector parsing network. The specific implementation process of step S303 includes:
[0074] S3031: Input the initial training text and the reference training text into the network to obtain the initial vector corresponding to the initial training text and the reference vector corresponding to the reference training text.
[0075] In one embodiment, step S3031 includes: using a vector generation network in the recognition model to extract semantic features from the initial training text and the reference training text, so as to obtain the initial vector corresponding to the initial training text and the reference vector corresponding to the reference training text.
[0076] S3032: Based on a vector pair consisting of any initial vector and any reference vector, obtain the target vector corresponding to the vector pair.
[0077] In one embodiment, step S3032 includes: in response to obtaining a plurality of initial vectors and a plurality of reference vectors through step S3031, selecting any initial vector and any reference vector to form a vector pair.
[0078] Furthermore, the first weight corresponding to the initial vector in the above vector pair and the second weight corresponding to the reference vector are obtained. The sum of the first weight and the second weight is a first numerical value, and the specific values of the first and second weights can be determined according to actual needs. Preferably, the first numerical value is 1.
[0079] Furthermore, using the first and second weights, the initial vector and reference vector in the vector pair are weighted and summed to obtain the target vector corresponding to the vector pair.
[0080] Specifically, the initial vector is multiplied by the first weight to obtain the first product, and the reference vector is multiplied by the second weight to obtain the second product. The sum of the first and second products is used as the corresponding target vector. Since the reference training text is constructed based on the initial training text, and the training value of the reference training text is lower than that of the initial training text, the target vector is obtained by combining the initial vector corresponding to the initial training text and the reference vector corresponding to the reference training text. This saves training costs while ensuring the effectiveness of model training.
[0081] Preferably, in step S3032, an initial vector and a corresponding reference vector are selected to form a vector pair. That is, the reference training text corresponding to the reference vector in the same vector pair is obtained based on the initial training text corresponding to the initial vector.
[0082] S3033: Based on the initial label corresponding to the initial vector in the vector pair and the reference label corresponding to the reference vector, obtain the target label of the target vector corresponding to the vector pair.
[0083] In one embodiment, step S3033 specifically includes: in response to obtaining the target vector, this step generates a target label corresponding to the target vector based on the initial label corresponding to the initial vector in the vector pair and the reference label corresponding to the reference vector in the same vector pair.
[0084] In one implementation scenario, in response to the fact that the initial label and reference label corresponding to the vector pair are the same, the initial label or reference label is used as the target label of the target vector.
[0085] Alternatively, in another implementation scenario, in response to the difference between the initial label and the reference label corresponding to the vector pair, the target label of the target vector is obtained based on the initial label, the reference label, the first weight of the initial vector corresponding to the initial label, and the second weight of the reference vector corresponding to the reference label.
[0086] Specifically, the initial label corresponding to the vector pair is multiplied by the first weight, and the reference label corresponding to the same vector pair is multiplied by the second weight. The sum of the products is used as the target label of the target vector.
[0087] S3034: Input the target vector into the vector parsing network to obtain the prediction result corresponding to the target vector. The prediction result includes the predicted address and the predicted category corresponding to the predicted address.
[0088] In one embodiment, step S3034 includes: in response to obtaining multiple target vectors and target labels corresponding to each target vector through the above-described corresponding steps, inputting the target vectors into the vector parsing network in the recognition model, so that the recognition model analyzes the target vectors to obtain prediction results corresponding to the target vectors. The prediction results include a predicted address and a predicted category corresponding to the predicted address.
[0089] S3035: Based on the prediction results and target labels, adjust the parameters of the recognition model until the recognition model meets the convergence condition, and obtain the trained recognition model.
[0090] In one embodiment, step S3035 specifically includes: in response to obtaining the prediction result corresponding to the target vector in step S3034 above, calculating the total loss corresponding to the recognition model based on the prediction result, the target label and the preset loss function, and adjusting the parameters of the recognition model using the total loss until the recognition model meets the convergence condition, thereby obtaining the trained recognition model.
[0091] Specifically, the prediction loss function mentioned above includes a cross-entropy loss function and a divergence loss function. For each target vector's prediction result and corresponding target label, the cross-entropy loss and divergence loss of that target vector are calculated respectively, and the total loss of the target vector is obtained based on the cross-entropy loss and divergence loss. The formula for calculating the total loss L of the target vector is as follows:
[0092] L = l1 + l2
[0093] Where l1 represents the cross-entropy loss of the target vector, l2 represents the divergence loss of the target vector, and λ represents the third weight, the value of which can be set according to actual needs. The specific calculation process of cross-entropy loss and divergence loss can be referred to the prior art, and will not be described in detail in this application.
[0094] Please see Figure 7 , Figure 7 This is a schematic diagram of one embodiment of the address recognition system of this application. The system specifically includes: an acquisition module 30 and an identification module 40.
[0095] Specifically, the acquisition module 30 is used to acquire address description text. The address corresponding to the address description text belongs to the first geographical region.
[0096] The recognition module 40 is used to input the address description text into the recognition model to obtain all the recognized addresses in the address description text and the address categories corresponding to the recognized addresses; wherein, the recognition model is trained based on the initial training text and its corresponding reference training text, the reference training text is obtained based on the initial training text and the initial label corresponding to the initial training text, and the address category is related to the range included by the recognized address.
[0097] Please continue reading. Figure 7 The address recognition system of this application also includes a training module 41 coupled to the recognition module 40. The training module 41 is used to train the recognition model. The training method includes: obtaining multiple initial training texts and corresponding initial labels; wherein the initial training texts contain at least one training address, the initial labels contain the address category corresponding to each training address, and the training addresses belong to a second geographical region; obtaining at least one reference training text based on the initial training texts and their corresponding initial labels. The reference training text has a reference label, and the reference label is the same as the initial label matched by the initial training text corresponding to the reference training text; training the recognition model using the initial training texts and their corresponding initial labels, as well as the reference training texts and their corresponding reference labels, until the convergence condition is met, thus obtaining the trained recognition model.
[0098] The process involves obtaining at least one reference training text based on the initial training text and its corresponding initial labels, including: replacing the training address in the initial training text with the address category corresponding to the training address to obtain the initial template text corresponding to the initial training text; converting the initial template text based on the semantic information and / or the word and sentence information of the initial template text to obtain at least one converted template text; obtaining a candidate address library corresponding to each address category in the initial labels, and replacing the address categories in the initial template text and the converted template text with the candidate addresses in the candidate address library to obtain at least one reference training text; wherein each candidate address library includes candidate addresses belonging to the same address category, and all candidate address libraries belong to the second geographical area.
[0099] The process involves converting the initial template text based on its semantic information to obtain at least one converted template text. This includes: translating the initial template text at least once in response to the initial template text being the initial language to obtain a translated template text; wherein the translated template text is a preset language; and translating the translated template text back into the initial language to obtain the converted template text corresponding to the initial template text.
[0100] Specifically, based on the word and sentence information of the initial template text, the initial template text is transformed to obtain at least one transformed template text, including: performing word segmentation on the initial template text to obtain the keywords corresponding to the initial template text; obtaining multiple synonyms corresponding to the keywords, and replacing the keywords with synonyms to obtain the transformed template text corresponding to the initial template text.
[0101] The recognition model comprises a vector generation network and a vector resolution network. It is trained using initial training text and its corresponding initial labels, as well as reference training text and its corresponding reference labels, until convergence is achieved. The process includes: inputting the initial and reference training texts into the vector generation network to obtain initial vectors for the initial training texts and reference vectors for the reference training texts; obtaining the target vector corresponding to a vector pair composed of any initial vector and any reference vector; obtaining the target label for the target vector corresponding to the vector pair based on the initial label of the initial vector and the reference label of the reference vector; inputting the target vector into the vector resolution network to obtain the prediction result corresponding to the target vector, where the prediction result includes the predicted address and the predicted category corresponding to the predicted address; and adjusting the parameters of the recognition model based on the prediction result and the target label until convergence is achieved, thus obtaining the trained recognition model.
[0102] The method of obtaining the target vector corresponding to the vector pair based on the vector pair consisting of any initial vector and any reference vector includes: obtaining the first weight corresponding to the initial vector in the vector pair and the second weight corresponding to the reference vector; wherein the sum of the first weight and the second weight is a first value; and using the first weight and the second weight, performing a weighted summation on the initial vector and the reference vector in the vector pair to obtain the target vector corresponding to the vector pair.
[0103] Specifically, obtaining the target label of the target vector corresponding to the vector pair based on the initial label corresponding to the initial vector in the vector pair and the reference label corresponding to the reference vector includes: in response to the initial label and the reference label being the same, using the initial label or the reference label as the target label of the target vector; or, in response to the initial label and the reference label being different, obtaining the target label of the target vector based on the initial label, the reference label, the first weight of the initial vector corresponding to the initial label, and the second weight of the reference vector corresponding to the reference label.
[0104] The recognition model includes a vector generation network and a vector parsing network. The address description text is input into the recognition model to obtain all the recognized addresses in the address description text and the address categories corresponding to the recognized addresses. This includes: inputting the address description text into the vector generation network to obtain the description text vector corresponding to the address description text; inputting the description text vector into the vector parsing network to obtain the recognition result corresponding to the address description text; wherein the recognition result includes all the recognized addresses and the address categories matched by the recognized addresses.
[0105] Please continue reading. Figure 7 The address recognition system of this application also includes a verification module 43 coupled to the recognition module 40. The verification module 43 is used to obtain the field vector corresponding to the recognition address, and obtain the confidence score of the address category matched by the recognition address based on the similarity between the field vector and the comparison vector. The comparison vector is obtained based on the comparison address, and the comparison address matches the recognition address in the same address category. The system obtains a score threshold, and uses the recognition address with a confidence score higher than the score threshold as the target address, and uses the recognition address with a confidence score less than or equal to the score threshold as the reference address.
[0106] Please see Figure 8 , Figure 8This is a schematic diagram of one embodiment of the address identification device of this application. The address identification device includes a memory 50 and a processor 60 coupled to each other. The processor 60 stores program instructions and is used to execute the program instructions to implement the methods mentioned in any of the above embodiments. Specifically, the processor 60 can also be called a CPU (Central Processing Unit). The processor 60 may be an integrated circuit chip with signal processing capabilities. The processor 60 can also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The general-purpose processor can be a microprocessor or any conventional processor. In addition, the processor 60 can be implemented by an integrated circuit chip.
[0107] It should be noted that the units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0108] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0109] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) or processor to execute all or part of the steps of the methods of various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0110] The above description is merely an embodiment of this application and does not limit the patent scope of this application. Any equivalent structural or procedural transformations made using the content of this application's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this application.
Claims
1. An address identification method, characterized in that, include: Obtain the address description text; wherein the address corresponding to the address description text belongs to the first geographical region. The address description text is input into the recognition model to obtain all the recognized addresses in the address description text and the address categories corresponding to the recognized addresses; wherein, the recognition model is trained based on the initial training text and its corresponding reference training text, the reference training text is obtained based on the initial training text and the initial label corresponding to the initial training text, and the address category is related to the range included by the recognized address; The training method for the recognition model includes: acquiring multiple initial training texts and initial labels corresponding to the initial training texts; wherein, the initial training texts contain at least one training address, and the initial labels contain address categories corresponding to each training address; based on the initial training texts and their corresponding initial labels, obtaining at least one reference training text; wherein, the reference training text is obtained by replacing the address categories in the converted template text with candidate addresses, and the converted template text is obtained by replacing the training addresses in the initial training text with address categories, the training addresses and the candidate addresses belong to a second geographical region, the reference training text has a reference label, and the reference label is the same as the initial label matched by the initial training text corresponding to the reference training text; using the initial training texts and their corresponding initial labels, and the reference training texts and their corresponding reference labels, the recognition model is trained until the convergence condition is met, thereby obtaining the trained recognition model; Specifically, the recognition model includes a vector generation network and a vector parsing network. The initial training text and the reference training text are input into the vector generation network to obtain an initial vector corresponding to the initial training text and a reference vector corresponding to the reference training text. Based on a vector pair composed of any initial vector and any reference vector, a target vector corresponding to the vector pair is obtained. Based on the initial label corresponding to the initial vector in the vector pair and the reference label corresponding to the reference vector, a target label corresponding to the target vector is obtained. The target vector is input into the vector parsing network to obtain a prediction result corresponding to the target vector. The prediction result includes a predicted address and a predicted category corresponding to the predicted address. Based on the prediction result and the target label, the parameters of the recognition model are adjusted until the recognition model satisfies the convergence condition, thus obtaining the trained recognition model.
2. The method according to claim 1, characterized in that, The step of obtaining at least one reference training text based on the initial training text and its corresponding initial label includes: By using the address category corresponding to the training address, the training address in the initial training text is replaced, and the initial template text corresponding to the initial training text is obtained. Based on the semantic information and / or the word and sentence information of the initial template text, the initial template text is transformed to obtain at least one transformed template text; Obtain a candidate address library corresponding to each address category in the initial label, and use the candidate addresses in the candidate address library to replace the address categories in the conversion template text to obtain at least one reference training text; Each of the candidate address databases includes candidate addresses belonging to the same address category, and all of the candidate address databases belong to the second geographical area.
3. The method according to claim 2, characterized in that, Based on the semantic information of the initial template text, the initial template text is transformed to obtain at least one transformed template text, including: In response to the initial template text being an initial language, the initial template text is translated at least once to obtain translated template text; wherein, the translated template text is a preset language; The translation template text is translated back into the initial language to obtain the converted template text corresponding to the initial template text; Based on the word and phrase information of the initial template text, the initial template text is transformed to obtain at least one transformed template text, including: The initial template text is segmented to obtain the keywords corresponding to the initial template text; Obtain multiple synonyms corresponding to the keyword, replace the keyword with the synonyms, and obtain the converted template text corresponding to the initial template text.
4. The method according to claim 1, characterized in that, The step of obtaining the target vector corresponding to the vector pair based on the vector pair composed of any of the initial vectors and any of the reference vectors includes: Obtain the first weight corresponding to the initial vector in the vector pair, and the second weight corresponding to the reference vector; wherein the sum of the first weight and the second weight is a first value; Using the first weight and the second weight, the initial vector and the reference vector in the vector pair are weighted and summed to obtain the target vector corresponding to the vector pair; The step of obtaining the target label of the target vector corresponding to the vector pair based on the initial label corresponding to the initial vector in the vector pair and the reference label corresponding to the reference vector includes: In response to the initial label and the reference label being the same, the initial label or the reference label is used as the target label of the target vector; Alternatively, in response to the initial label and the reference label being different, the target label of the target vector is obtained based on the initial label, the reference label, the first weight of the initial vector corresponding to the initial label, and the second weight of the reference vector corresponding to the reference label.
5. The method according to claim 1, characterized in that, The recognition model includes a vector generation network and a vector parsing network. The step of inputting the address description text into the recognition model to obtain all recognized addresses in the address description text and the address categories corresponding to those addresses includes: The address description text is input into the vector generation network to obtain the description text vector corresponding to the address description text. The descriptive text vector is input into the vector parsing network to obtain the recognition result corresponding to the address descriptive text; wherein, the recognition result includes all the recognized addresses and the address categories that the recognized addresses match.
6. The method according to claim 5, characterized in that, After inputting the descriptive text vector into the vector parsing network to obtain the recognition result corresponding to the address description text, the process includes: Obtain the field vector corresponding to the identified address, and based on the similarity between the field vector and the comparison vector, obtain the confidence score of the address category matched by the identified address; wherein, the comparison vector is obtained based on the comparison address, and the comparison address matches the identified address in the same address category; Obtain a score threshold, and use the identification address with a confidence score higher than the score threshold as the target address, and use the identification address with a confidence score less than or equal to the score threshold as the reference address.
7. An address identification system, characterized in that, include: The acquisition module is used to acquire address description text; wherein the address corresponding to the address description text belongs to a first geographical region. The recognition module is used to input the address description text into the recognition model to obtain all the recognized addresses in the address description text and the address categories corresponding to the recognized addresses; wherein, the recognition model is obtained by training based on the initial training text and its corresponding reference training text, the reference training text is obtained based on the initial training text and the initial label corresponding to the initial training text, and the address category is related to the range included by the recognized address; The training method for the recognition model includes: acquiring multiple initial training texts and initial labels corresponding to the initial training texts; wherein, the initial training texts contain at least one training address, the initial labels contain an address category corresponding to each training address, and the training address belongs to a second geographical region; based on the initial training texts and their corresponding initial labels, obtaining at least one reference training text; wherein, the reference training text is obtained by replacing the address category in the conversion template text with a candidate address, the conversion template text is obtained by replacing the training address in the initial training text with the address category, the candidate address belongs to the second geographical region, the reference training text has a reference label, and the reference label is the same as the initial label matched by the initial training text corresponding to the reference training text; using the initial training texts and their corresponding initial labels, and the reference training texts and their corresponding reference labels, the recognition model is trained until a convergence condition is met, resulting in the trained recognition model; Specifically, the recognition model includes a vector generation network and a vector parsing network. The initial training text and the reference training text are input into the vector generation network to obtain an initial vector corresponding to the initial training text and a reference vector corresponding to the reference training text. Based on a vector pair composed of any initial vector and any reference vector, a target vector corresponding to the vector pair is obtained. Based on the initial label corresponding to the initial vector in the vector pair and the reference label corresponding to the reference vector, a target label corresponding to the target vector is obtained. The target vector is input into the vector parsing network to obtain a prediction result corresponding to the target vector. The prediction result includes a predicted address and a predicted category corresponding to the predicted address. Based on the prediction result and the target label, the parameters of the recognition model are adjusted until the recognition model satisfies the convergence condition, thus obtaining the trained recognition model.
8. An address identification device, characterized in that, The apparatus includes a memory and a processor coupled to each other, the processor storing program instructions for executing the program instructions to implement the method of any one of claims 1-6.
Citation Information
Patent Citations
Statement annotation method and device based on similar entity replacement
CN110851597A
Address recognition method and device, electronic equipment and storage medium
CN112329467A
Small sample text data hybrid enhancement method
CN113779959A