A method for identifying address elements by integrating sentence information
By acquiring and modeling the sentence pattern information of addresses, the problem of insufficient accuracy of address element recognition caused by ignoring sentence pattern characteristics in the prior art is solved, and higher recognition accuracy is achieved.
Patent Information
- Application Number
- CN202210298091.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-24
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2042-03-24
AI Technical Summary
The prior art ignores the sentence pattern characteristics of the address in address element recognition, resulting in insufficient recognition accuracy.
By obtaining the address fragment sequence and sentence pattern of the address text to be identified, it is input to the feature representation layer to obtain the feature vector sequence, and then input it to the address element recognition model for encoding and decoding, and finally obtain the identification result of the address element in the post-processing module.
By acquiring and modeling the sentence structure information of the address, the accuracy of address element recognition is improved.
Smart Images

Figure CN115048931B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information recognition, and in particular to an address element recognition method integrating sentence information. Background Art
[0002] In the public security industry, address is an important industry element. Address data generally exists in an unstructured form, which poses a challenge to our effective use of the fine-grained information contained in the address. At the same time, we usually use addresses to associate business data, and address element recognition, as an important link in address association, plays a vital role in subsequent address standardization, address correlation calculation and other tasks. Therefore, we need to perform address element recognition, that is, correctly identify the boundaries of elements in the address text and predict the category of the elements.
[0003] At present, address element recognition is often converted into a named entity recognition problem. Therefore, all technical solutions for named entity recognition are applicable to address element recognition. At the same time, addresses also have some characteristics of their own, such as: missing context information. Therefore, the existing patent CN201810627403.7 improves accuracy by introducing domain information, attribute information and structural information. CN202011211412.1 improves accuracy by introducing basic information, identification information of address words and feature information of characters. The above method improves the accuracy of address element recognition to a certain extent, but ignores that addresses often have some specific sentence characteristics. The specific form of this sentence is: "province|city|administrative district|road name|point of interest". Intuitively, if two address elements "province" and "administrative district" appear in an address, the text fragment between them is likely to be in the "city" category. Therefore, how to obtain the sentence information of the address and how to model the sentence information to improve the accuracy of address element recognition have become urgent problems to be solved. Summary of the invention
[0004] In view of the above problems, the present invention is proposed to provide an address element recognition method integrating sentence information to overcome the above problems or at least partially solve the above problems.
[0005] In order to solve the above technical problems, the embodiments of the present application disclose the following technical solutions:
[0006] A method for identifying address elements integrating sentence information, comprising:
[0007] S100. Obtaining the address fragment sequence and sentence pattern of the address text to be recognized;
[0008] S200. Input each address fragment and the sentence pattern of the address in the address fragment sequence into the feature representation layer to obtain a feature vector sequence of the address fragment sequence; wherein the address fragment representation and the address sentence representation are obtained through model training as parameters of the address element recognition model.
[0009] S300. Inputting the feature vector sequence of the address fragment sequence into the address element recognition model for encoding and decoding to obtain the label sequence of the address fragment sequence;
[0010] S400. Input the tag sequence of the address fragment sequence into the address element post-processing module to obtain the recognition result of the address element.
[0011] Furthermore, in S100, the method for obtaining the address fragment sequence of the address text to be recognized includes: extracting predefined address elements from the address text to be recognized; these predefined address elements include: province, city, district, street, neighborhood committee, road, house number, point of interest, building, unit and floor number.
[0012] Furthermore, in S100, the method for obtaining the sentence pattern of the address text to be identified is: the sentence pattern of the address text is obtained by merging the address element labels obtained by matching the dictionary tree, and after the entire address is matched, the sentence pattern is obtained as "administrative district|point of interest|building".
[0013] Furthermore, in S200, the feature fusion of the feature representation layer at least includes directly concatenating various features or concatenating them and then mapping them using a fully connected layer.
[0014] Furthermore, in S300, the encoding layer of the address element recognition model includes at least a bidirectional long short-term memory network and BERT.
[0015] Furthermore, in S300, the decoding layer of the address element recognition model includes at least a conditional random field and a pointer network.
[0016] Furthermore, in S300, the method for training the address element recognition model is: using a stochastic gradient descent algorithm to minimize the loss function to train the labeled data; the decoder of the address element recognition model uses Softmax and uses cross entropy as the error function.
[0017] Furthermore, in S300, the loss function of the address element recognition model training is as follows:
[0018]
[0019] Among them, n represents the length of the sequence after the address text is segmented, k represents the number of labels of the address elements, and y i ,j represents the true label of the address segment, Represents the probability distribution of address fragments predicted by the model; the loss function actually calculates the cross entropy for each fragment in the address fragment sequence, and then averages the cross entropy of the entire sequence to obtain the loss value of the entire address text.
[0020] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least:
[0021] The present invention discloses an address element recognition method integrating sentence information, comprising: obtaining an address fragment sequence and a sentence pattern of an address text to be recognized; inputting each address fragment in the address fragment sequence and the sentence pattern of the address into a feature representation layer to obtain a feature vector sequence of the address fragment sequence; inputting the feature vector sequence of the address fragment sequence into an address element recognition model for encoding and decoding to obtain a label sequence of the address fragment sequence; inputting the label sequence of the address fragment sequence into an address element post-processing module to obtain a recognition result of the address element. The present invention improves the accuracy of address element recognition by obtaining the sentence information of the address and modeling the sentence information.
[0022] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The accompanying drawings are used to provide further understanding of the present invention and constitute a part of the specification. They are used to explain the present invention together with the embodiments of the present invention and do not constitute a limitation of the present invention.
[0024] In the attached picture:
[0025] Figure 1 This is a flow chart of an address element recognition method integrating sentence information in Embodiment 1 of the present invention;
[0026] Figure 2 This is a schematic diagram of address element identification in Embodiment 1 of the present invention;
[0027] Figure 3 This is a schematic diagram of sentence information fusion in Example 1 of the present invention. DETAILED DESCRIPTION
[0028] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
[0029] In order to solve the problems existing in the prior art, an embodiment of the present invention provides an address element recognition method integrating sentence information.
[0030] Example 1
[0031] This embodiment discloses a method for identifying address elements by integrating sentence information. Figure 1 ,include:
[0032] S100. Obtain the address fragment sequence and sentence pattern of the address text to be recognized; Specifically, in this embodiment, the purpose of address element recognition is to extract predefined address elements from the address text to be recognized. These predefined address elements generally include: province, city, district (county), street (township, town), neighborhood committee (village), road, house number, point of interest, building, unit, floor number, etc.
[0033] like Figure 2 and 3 Now let's assume that there is an address text to be identified in the business data, "Hongshan District, Xiangzhou Community, Building $". After segmentation, the address fragment sequence is "Hong, Shan, District, Xiang, Zhou, Community, District, $, Number, Building". The sentence pattern of the address text is merged by matching the address element labels obtained by the dictionary tree (TrieTree). For example: "Hongshan District" in the address text to be identified exists in the dictionary tree, so we return its label "Administrative District". After the entire address is matched, we get its sentence pattern as "Administrative District|Point of Interest|Building".
[0034] The construction of the dictionary tree depends on the address feature dictionary, and its specific form is as follows: {"Administrative District": ["Hongshan District"], "Point of Interest": ["Xiangzhou Community"], "Building": ["Building $"]}.
[0035] In this embodiment, it should be noted that:
[0036] Construction of address element dictionary. Assume that the training data set for address element recognition contains 2 training data, each of which consists of an address and a label. The label system adopts BIEO (where "B" represents the beginning of the element, "E" represents the end of the element, "I" represents the part of the element excluding the beginning and the end, and "O" represents others). The specific form is as follows:
[0037] Training Data 1:
[0038] Address: Floor $, Woniu Creative Building, Wenxiang Road, Hongshan District
[0039] Tags: B-Administrative District I-Administrative District E-Administrative District B-Road Name I-Road Name E-Road Name B-Point of Interest I-Point of Interest I-Point of Interest I-Point of Interest E-Point of Interest B-Floor E-Floor
[0040] Training Data 2:
[0041] Address: Building $, Building $, Ideal Industrial Park, Jinhua Road
[0042] Tags: B-Road Name I-Road Name E-Road Name B-Point of Interest I-Point of Interest I-Point of Interest E-Point of Interest B-Building E-Building B-Floor E-Floor
[0043] By merging the BIEO labels (B-road name I-road name E-road name) in all training data, a dictionary with address element labels as keys and address element sets as values is constructed. The address element dictionary obtained from the above training data set is as follows:
[0044] {"Administrative District":["Hongshan District"],
[0045] "Road Name": ["Wenxiang Road", "Jinhua Road"],
[0046] "Points of interest": ["Woniu Creative Building", "Ideal Industrial Park"],
[0047] "Building": ["$building"],
[0048] "Floor": ["$floor"]}
[0049] S200. Input each address fragment and the sentence pattern of the address in the address fragment sequence into the feature representation layer to obtain a feature vector sequence of the address fragment sequence; wherein the address fragment representation and the address sentence representation are obtained through model training as parameters of the address element recognition model. In S200 of this embodiment, the feature fusion of the feature representation layer at least includes directly splicing various features or splicing them and then mapping them using a fully connected layer.
[0050] S300. Input the feature vector sequence of the address fragment sequence into the address element recognition model for encoding and decoding to obtain the label sequence of the address fragment sequence; in S300 of this embodiment, the encoding layer of the address element recognition model includes but is not limited to a bidirectional long short-term memory network (BiLSTM), BERT, etc. The decoding layer of the address element recognition model includes but is not limited to a conditional random field (CRF), a pointer network, etc.
[0051] In S300 of this embodiment, the method for training the address element recognition model is: using the stochastic gradient descent algorithm to minimize the loss function to train the labeled data; the decoder of the address element recognition model uses Softmax and uses cross entropy as the error function. The loss function for training the address element recognition model is as follows:
[0052]
[0053] Among them, n represents the length of the sequence after the address text is segmented, k represents the number of labels of the address elements, and y i, j represents the true label of the address segment, Represents the probability distribution of address fragments predicted by the model; the loss function actually calculates the cross entropy for each fragment in the address fragment sequence, and then averages the cross entropy of the entire sequence to obtain the loss value of the entire address text.
[0054] S400. Input the tag sequence of the address fragment sequence into the address element post-processing module to obtain the recognition result of the address element. Post-process the tag sequence of the address fragment sequence and merge the address fragments into address elements according to the BIEO tag system.
[0055] Specifically, after obtaining the address fragment sequence and sentence pattern, they are input into the feature representation layer. Each address fragment is vectorized and the sentence pattern is vectorized, and then the vectorized representation of the address fragment and the vectorized representation of the sentence pattern are fused to obtain the final feature vector of the address fragment. Repeating the above operation for each address fragment in the sequence will obtain the feature vector sequence of the address fragment sequence. See the sentence information fusion diagram for details.
[0056] After obtaining the feature vector sequence of the address fragment sequence, the label sequence of the address fragment can be obtained through encoding and decoding of the address element recognition model. The label sequence is post-processed to obtain the final output of address element recognition. See the address element recognition diagram for details.
[0057] The present embodiment discloses an address element recognition method integrating sentence information, including: obtaining an address fragment sequence and a sentence pattern of an address text to be recognized; inputting each address fragment in the address fragment sequence and the sentence pattern of the address into a feature representation layer to obtain a feature vector sequence of the address fragment sequence; inputting the feature vector sequence of the address fragment sequence into an address element recognition model for encoding and decoding to obtain a label sequence of the address fragment sequence; inputting the label sequence of the address fragment sequence into an address element post-processing module to obtain a recognition result of the address element. The present invention improves the accuracy of address element recognition by obtaining the sentence information of the address and modeling the sentence information.
[0058] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.
[0059] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.
[0060] Those skilled in the art will also appreciate that the various illustrative logic blocks, modules, circuits, and algorithmic steps described in conjunction with the embodiments herein can all be implemented as electronic hardware, computer software, or a combination thereof. In order to clearly illustrate the interchangeability between hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above around their functions. Whether such functions are implemented as hardware or software depends on specific applications and the design constraints imposed on the entire system. A skilled person can implement the described functions in an alternative manner for each specific application, but such implementation decisions should not be interpreted as departing from the scope of protection of the present disclosure.
[0061] The steps of the method or algorithm described in conjunction with the embodiments herein may be directly embodied as hardware, a software module executed by a processor, or a combination thereof. The software module may be located in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a mobile disk, a CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in an ASIC. The ASIC may be located in a user terminal. Of course, the processor and the storage medium may also be present in a user terminal as discrete components.
[0062] For software implementation, the techniques described in this application can be implemented with modules (e.g., procedures, functions, etc.) that perform the functions described in this application. These software codes can be stored in a memory unit and executed by a processor. The memory unit can be implemented within the processor or outside the processor. In the latter case, it is coupled to the processor in a communication manner via various means, which are well known in the art.
[0063] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".
Claims
1. A method for identifying address elements by integrating sentence information, characterized in that: include: S100. Obtain the address fragment sequence and sentence pattern of the address text to be identified; in S100, the method for obtaining the address fragment sequence of the address text to be identified includes: segmenting the address text to be identified character by character to obtain the address fragment sequence; the method for obtaining the sentence pattern of the address text to be identified is: the sentence pattern of the address text is obtained by merging the address element labels obtained by matching the dictionary tree, and if the address text to be identified exists in the dictionary tree, the address element label corresponding to the matched address text is returned; after the entire address is matched, the sentence pattern is obtained as the result of splicing all the matching labels; wherein the address elements include: province, city, district, street, neighborhood committee, road, house number, point of interest, building, unit and floor number; S200. Input each address fragment and the sentence pattern of the address in the address fragment sequence into the feature representation layer to obtain a feature vector sequence of the address fragment sequence; wherein the address fragment representation and the address sentence representation are obtained as parameters of the address element recognition model through model training; S300. Inputting the feature vector sequence of the address fragment sequence into the address element recognition model for encoding and decoding to obtain a label sequence of the address fragment sequence; S400. Input the tag sequence of the address fragment sequence into the address element post-processing module to obtain the recognition result of the address element.
2. The method for identifying address elements by integrating sentence information according to claim 1, characterized in that: In S200, the feature fusion of the feature representation layer at least includes directly concatenating various features or concatenating them and then mapping them using a fully connected layer.
3. The method for identifying address elements by integrating sentence information according to claim 1, characterized in that: In S300, the encoding layer of the address element recognition model includes at least a bidirectional long short-term memory network and BERT.
4. The method for identifying address elements by integrating sentence information according to claim 1, characterized in that: In S300, the decoding layer of the address element recognition model includes at least a conditional random field and a pointer network.
5. The method for identifying address elements by integrating sentence information according to claim 1, characterized in that: In S300, the method for training the address element recognition model is: using a stochastic gradient descent algorithm to minimize the loss function to train the labeled data; the decoder of the address element recognition model uses Softmax and uses cross entropy as the error function.
6. The method for identifying address elements by integrating sentence information according to claim 1, characterized in that: In S300, the loss function of the address element recognition model training is as follows: Among them, n represents the length of the sequence after the address text is segmented, k represents the number of labels of the address elements, and y i , j represents the true label of the address segment, Represents the probability distribution of address fragments predicted by the model; the loss function actually calculates the cross entropy for each fragment in the address fragment sequence, and then averages the cross entropy of the entire sequence to obtain the loss value of the entire address text.
Citation Information
Patent Citations
Address recognition method and device, electronic equipment and storage medium
CN112329467A
Address identification method and device and storage medium
CN108920457A
Chinese address identification method and device
CN110275940A