Address processing model training method and device, address processing method and device and storage medium
By training an address processing model that includes preprocessing, hyperbolic mapping and classification models, the problem of difficulty in dealing with address abbreviation, typos and alias in the prior art is solved, and the accuracy of address participle and geographical division categories is achieved.
Patent Information
- Application Number
- CN202411933838.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-04-08
AI Technical Summary
The existing address placement technology is difficult to deal with abbreviations, typos, alias, etc. that appear when address input, resulting in low accuracy of address participle and geographical division categories.
A training method for address processing models is adopted, including preprocessing models, hyperbolic mapping models and classification models. By obtaining training samples, using the preprocessing model to obtain the address vector, the hyperbolic mapping model performs hyperbolic spatial mapping, and using the classification model to predict, and finally training the address processing model based on the annotation information and prediction results.
The geographical hierarchical characteristics of the address are enhanced, so that the address processing model can more accurately handle abbreviations, typos, alias, etc. in address input, improve the accuracy of address participle and geographical division categories, and improve the accuracy of address placement technology.
Smart Images

Figure CN119782964A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to a training of an address processing model, an address processing method, an apparatus, a storage medium, an electronic device, and a computer program product. Background Art
[0002] The geographical level can be divided into multiple levels from high to low, such as province, city, district, street, community, neighborhood, building, unit door, etc. The upper level and the lower level have an administrative affiliation relationship, and there is also a spatial inclusion relationship between the upper level and the lower level. Address location technology refers to determining the address segmentation of each geographical level corresponding to the address text, and the geographical division category corresponding to each address segmentation for a given address text; the address segmentation can include at least one of the information such as province, city, district, street, community, neighborhood, building, unit door, etc.; the geographical division category can include at least one of the categories such as province, city, district, street, community, neighborhood, building, unit door, etc. corresponding to the address segmentation. The application of address location technology is relatively wide. For example, in logistics and express delivery services, the address location technology is used to process the delivery address, obtain the address segmentation and corresponding geographical division category of the delivery address, and transfer and distribute the goods to sites and warehouses located in various geographical areas. At present, the commonly used address location technology is: segment the address text to obtain the address segmentation, match the address segmentation with the names of each geographical level preset in the geographical level information, and obtain the geographical division category of the address segmentation based on the matching result. However, the commonly used address location method cannot deal with abbreviations, typos, aliases, etc. that appear when the address is input. When there are abbreviations, typos, aliases, etc. in the address text, the accuracy of the determined address segmentation and geographical division category is not high. Summary of the invention
[0003] The present disclosure provides a training of an address processing model, an address processing method, an apparatus, a storage medium, an electronic device, and a computer program product.
[0004] According to a first aspect of the present disclosure, a training method for an address processing model is provided, wherein the address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model, and the training method includes: obtaining a training sample, wherein the training sample includes an address sample and labeling information corresponding to the address sample; obtaining a first address vector based on the address sample using the preprocessing model; performing hyperbolic mapping on the first address vector using the hyperbolic mapping model to obtain a first hyperbolic vector in a hyperbolic space; obtaining a prediction result based on the first hyperbolic vector using the classification model; and training the address processing model based on the labeling information and the prediction result.
[0005] Optionally, training the address processing model according to the annotation information and the prediction result includes: determining a first loss function according to the annotation information and the prediction result; and training the address processing model using the first loss function.
[0006] Optionally, the annotation information includes address segmentation and geographic division category labels, the prediction results include predicted segmentation corresponding to the address segmentation, geographic division prediction categories and prediction probabilities corresponding to the predicted segmentation, and determining the first loss function based on the annotation information and the prediction results includes: determining a value of a sign function according to the geographic division category label and the geographic division prediction category; and determining the first loss function according to the value of the sign function and the prediction probability.
[0007] Optionally, based on multiple address information, multiple second address vectors are obtained using the preprocessing model; the multiple second address vectors are hyperbolic mapped using the hyperbolic mapping model to obtain multiple second hyperbolic vectors in the hyperbolic space; based on the multiple second hyperbolic vectors, a second loss function is determined; and the address processing model is trained using the second loss function.
[0008] Optionally, the multiple address information includes first address information, second address information and third address information, wherein the first address information is partially identical to the second address information, and the first address information is completely different from the third address information.
[0009] Optionally, determining the second loss function based on the multiple second hyperbolic vectors includes: determining a first distance between a second hyperbolic vector corresponding to the first address information and a second hyperbolic vector corresponding to the second address information; determining a second distance between a second hyperbolic vector corresponding to the first address information and a second hyperbolic vector corresponding to the third address information; and determining the second loss function based on the first distance and the second distance.
[0010] Optionally, first address information, second address information and third address information are generated based on a first geographical hierarchy tree, wherein each node in the first geographical hierarchy tree is provided with an address text, and each node in the first geographical hierarchy tree has a geographical affiliation relationship with its parent node.
[0011] Optionally, the generation of the first address information, the second address information and the third address information based on the first geographic hierarchy tree includes: in the first geographic hierarchy tree, determining the first node, the second node and the third node located at the lowest level, wherein the parent node of the first node is the same as the parent node of the second node, and the parent node of the first node is different from the parent node of the third node; determining the first path, the second path and the third path respectively from the first node, the second node and the third node to the highest level node of the first geographic hierarchy tree; generating the first address information, the second address information and the third address information based on the address texts of all nodes in the first path, the second path and the third path respectively.
[0012] Optionally, when the first loss function converges to a first numerical range and the second loss function converges to a second numerical range, the trained address processing model is obtained.
[0013] Optionally, the address processing model includes a feature enhancement model, and the training method includes: before performing hyperbolic mapping on the first address vector and the second address vector, using the feature enhancement model to perform feature enhancement processing on the first address vector and the second address vector.
[0014] Optionally, in the second geographic hierarchy tree, a fourth path is selected, wherein each node in the second geographic hierarchy tree is provided with an address text, and each node in the second geographic hierarchy tree has a geographical affiliation with its parent node; and the address sample is generated according to the address text of the node in the fourth path.
[0015] Optionally, generating the address sample based on the address text of the node in the fourth path includes: performing noise adding processing on the address text of at least one node in the fourth path, wherein the noise adding processing includes performing at least one of text abbreviation replacement processing, text addition processing, text deletion processing, and text replacement processing on the address text of the node.
[0016] Optionally, generating the address sample according to the address text of the node in the fourth path includes: shielding at least one node in the fourth path; and generating the address sample based on the address text of the unshielded node in the fourth path.
[0017] Optionally, the preprocessing model includes a Bert model; and the classification model includes a Head layer.
[0018] According to a second aspect of the present disclosure, there is provided an address processing method, comprising: obtaining a trained address processing model, wherein the address processing model is trained by the training method as described above, and the address processing model comprises a preprocessing model, a hyperbolic mapping model and a classification model; obtaining a third address vector according to address information to be processed by using the preprocessing model; performing hyperbolic mapping on the third address vector by using the hyperbolic mapping model to obtain a third hyperbolic vector in a hyperbolic space; and obtaining a processing result according to the third hyperbolic vector by using the classification model.
[0019] Optionally, the address processing model includes a feature enhancement model, and the address processing method includes: before performing hyperbolic mapping on the third address vector, using the feature enhancement model to perform feature enhancement processing on the third address vector.
[0020] Optionally, the processing result includes an address segmentation word and a geographical division category corresponding to the address segmentation word.
[0021] According to a third aspect of the present disclosure, a training device for an address processing model is provided, wherein the address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model, and the training device includes: a sample acquisition module, used to acquire training samples, wherein the training samples include address samples and labeling information corresponding to the address samples; a first preprocessing module, used to obtain a first address vector based on the address sample using the preprocessing model; a first mapping processing module, used to perform hyperbolic mapping on the first address vector using the hyperbolic mapping model to obtain a first hyperbolic vector in a hyperbolic space; a prediction processing module, used to obtain a prediction result based on the first hyperbolic vector using the classification model; and a training processing module, used to train the address processing model based on the labeling information and the prediction result.
[0022] According to a fourth aspect of the present disclosure, an address processing module is provided, comprising: a model acquisition module, used to acquire a trained address processing model, wherein the address processing model is trained by the training method as described above, and the address processing model comprises a preprocessing model, a hyperbolic mapping model and a classification model; a second preprocessing module, used to obtain a third address vector using the preprocessing model according to address information to be processed; a second mapping processing module, used to perform hyperbolic mapping on the third address vector using the hyperbolic mapping model to obtain a third hyperbolic vector in a hyperbolic space; and a classification processing module, used to obtain a processing result using the classification model according to the third hyperbolic vector.
[0023] According to a fifth aspect of the present disclosure, an electronic device is provided, comprising: a memory; and a processor coupled to the memory, the processor being configured to execute the training method of the address processing model as described above or the address processing method as described above based on instructions stored in the memory.
[0024] According to a sixth aspect of the present disclosure, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and when the instructions are executed by a processor, the training method of the address processing model as described above or the address processing method as described above is implemented.
[0025] According to a seventh aspect of the present disclosure, a computer program product is provided, wherein the computer program product stores computer instructions, and when the computer instructions are executed by a processor, the training method of the address processing model as described above or the address processing method as described above is implemented.
[0026] The training of the address processing model, address processing method, device, storage medium, electronic device and computer program product disclosed in the present invention can enhance the geographical hierarchical characteristics of the address, enable the address processing model to cope with various situations such as abbreviations, typos, aliases, etc. that appear when the address is input, and can improve the accuracy of the determined address segmentation and geographical division categories, thereby improving the accuracy of the address location technology and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] By describing the embodiments of the present disclosure in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present disclosure will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present disclosure and constitute a part of the specification. Together with the embodiments of the present disclosure, they are used to explain the present disclosure and do not constitute a limitation of the present disclosure. The above and other purposes and advantages of the present disclosure will be further described below in conjunction with specific embodiments and with reference to the accompanying drawings. In the accompanying drawings, the same or corresponding technical features or components will be represented by the same or corresponding figure marks.
[0028] Figure 1 A flowchart of some embodiments of a method for training an address processing model according to the present disclosure;
[0029] Figure 2 Schematic diagram of the flow chart of other embodiments of the training method of the address processing model according to the present disclosure;
[0030] Figure 3A is a data processing diagram of some embodiments of the address processing model, Figure 3B Schematic diagrams of data processing for other embodiments of the address processing model;
[0031] Figure 4is a schematic diagram of the first geographical level tree;
[0032] Figure 5 is a flowchart of some embodiments of the address processing method according to the present disclosure;
[0033] Fig. 6A Schematic diagram of modules of some embodiments of the training device of the address processing model disclosed in the present invention; Figure 6B Schematic diagrams of modules of other embodiments of the training device for the address processing model disclosed in the present invention;
[0034] Fig. 7A Schematic diagram of modules of some embodiments of the address processing device disclosed in the present invention; Figure 7B Schematic diagrams of modules of other embodiments of the address processing device disclosed in the present invention;
[0035] Figure 8 Schematic diagram of modules of some embodiments of the electronic device according to the present disclosure. DETAILED DESCRIPTION
[0036] Exemplary embodiments of the present disclosure will be described below in conjunction with the accompanying drawings. For the sake of clarity and conciseness, not all features of the embodiments are described in the specification. However, it should be understood that many implementation-specific settings must be made in the process of implementing the embodiments in order to achieve the specific goals of the developer, for example, to meet those restrictions related to the device and the service, and these restrictions may vary depending on the implementation. In addition, it should be understood that although the development work may be very complex and time-consuming, it is only a routine task for those skilled in the art who benefit from the content of this disclosure.
[0037] It should be noted that the relative arrangement of components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
[0038] Those skilled in the art can understand that the terms "first" and "second" in the embodiments of the present disclosure are only used to distinguish different steps, devices or modules, etc., and neither represent any specific technical meaning nor indicate the necessary logical order between them.
[0039] It should also be understood that in the embodiments of the present disclosure, “plurality” may refer to two or more than two, and “at least one” may refer to one, two, or more than two.
[0040] It should also be understood that any component, data or structure mentioned in the embodiments of the present disclosure can generally be understood as one or more, unless explicitly limited or otherwise indicated in the context.
[0041] In addition, the term "and / or" in the present disclosure is only a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in the present disclosure generally indicates that the associated objects before and after are in an "or" relationship.
[0042] It should also be understood that the description of the various embodiments in the present disclosure focuses on the differences between the various embodiments, and the same or similar aspects thereof can be referenced to each other, and for the sake of brevity, they will not be described one by one.
[0043] At the same time, it should be understood that for the convenience of description, the sizes of the various parts shown in the drawings are not drawn according to the actual proportional relationship.
[0044] The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the present disclosure, its application, or uses.
[0045] Technologies, methods, and equipment known to ordinary technicians in the relevant art may not be discussed in detail, but where appropriate, the technologies, methods, and equipment should be considered as part of the specification.
[0046] It should be noted that like reference numerals and letters refer to similar items in the following figures, and therefore, once an item is defined in one figure, it need not be further discussed in subsequent figures.
[0047] In addition, in order to avoid obscuring the present disclosure due to unnecessary details, only the processing steps and / or device structures closely related to at least the scheme according to the present disclosure are shown in the drawings, and other details that are not closely related to the present disclosure are omitted. It should also be noted that similar reference numerals and letters in the drawings indicate similar items, and therefore once an item is defined in one drawing, it does not need to be discussed again for subsequent drawings.
[0048] Figure 1 FIG. 1 is a flowchart of some embodiments of the method for training the address processing model according to the present disclosure. Figure 1 As shown, the training method of the address processing model includes steps S101-S105.
[0049] Step S101: obtaining training samples, wherein the training samples include address samples and annotation information corresponding to the address samples.
[0050] The address processing model includes a preprocessing model, a hyperbolic mapping model, a classification model, and other models. The preprocessing model can be a variety of models such as the Bert model; the hyperbolic mapping model can be a variety of models for hyperbolic space mapping; the classification model can be a variety of models such as a convolutional neural network model, and the classification model can include a Head layer, and the Head layer can include a variety of convolution kernels.
[0051] The training samples include address samples, and the address samples include one or more information of province, city, district, street, community, neighborhood, building, unit door, etc.; the annotation information includes the address segmentation corresponding to the address sample, and the geographical division category label corresponding to the address segmentation. The address sample includes multiple address segmentations, and the multiple address segmentations are respectively address information corresponding to one or more geographical levels of province, city, district, street, community, neighborhood, building, unit door, etc.; the geographical division analogy label includes a label corresponding to one or more categories of province, city, district, street, community, neighborhood, building, unit door, etc.
[0052] Step S102: Obtain a first address vector based on the address sample using a preprocessing model.
[0053] The address samples in the training samples may be input into a preprocessing module to obtain a first address vector of the address samples. The first address vector may be a vector having preliminary geographic level features.
[0054] Step S103: using a hyperbolic mapping model, perform hyperbolic mapping on the first address vector to obtain a first hyperbolic vector in a hyperbolic space.
[0055] The first address vector may be input into a hyperbolic mapping model, and the hyperbolic mapping model performs hyperbolic mapping on the first address vector to obtain a first hyperbolic vector in a hyperbolic space, which can enhance geographic hierarchical features.
[0056] Hyperbolic mapping, also known as hyperbolic mapping, is a reversible linear mapping that expands in one direction and contracts in another direction. The hyperbolic mapping model can map the Euclidean space representation v to the hyperbolic space. The formula is as follows:
[0057] (1);
[0058] (2);
[0059] (3);
[0060] Among them, x is the reference point in the hyperbolic space, which can be set to 0; y is the vector for hyperbolic mapping; c is the hyperbolic space curvature parameter, which is a constant; is the inner product operation; v is the Euclidean space representation.
[0061] Step 104: Obtain a prediction result based on the first hyperbolic vector using a classification model.
[0062] The first hyperbolic vector can be input into the classification model, the classification model includes a Head layer, and the prediction result is obtained through the Head layer. The prediction result includes the predicted segmentation corresponding to the address segmentation, the geographical division prediction category and the prediction probability corresponding to the predicted segmentation; the predicted segmentation is the segmentation corresponding to the geographical level such as province, city, district, street, community, and community, and the geographical division prediction category includes categories such as province, city, district, street, community, and community.
[0063] For example, the address sample is "Room 101, Building 1, SS Community, JJ Street, Haidian District, Beijing". The prediction result obtained after processing by the address processing model includes the predicted segmentation, the geographical division prediction category and prediction probability corresponding to the predicted segmentation; the predicted segmentation is {Beijing, Haidian District, JJ Street, SS Community, Building 1, Room 101}, the geographical division prediction category is {province, district, street, community, building, unit door}, and the prediction probability is {95, 98, 89, 85, 88, 85}.
[0064] Step 105: train the address processing model based on the annotation information and the prediction results.
[0065] The training method of the address processing model in the above embodiment uses a preprocessing model to obtain a first address vector of an address sample, uses a hyperbolic mapping model to obtain a first hyperbolic vector of the first address vector in a hyperbolic space, obtains a prediction result based on the first hyperbolic vector and uses a classification model, and trains the address processing model based on the annotation information and prediction results of the training sample; it can enhance the geographic hierarchical features of the address, improve the accuracy of predicted word segmentation and geographic division prediction categories, enable the address processing model to cope with a variety of situations such as abbreviations, typos, aliases, etc. that occur when the address is input, and can improve the accuracy of the determined address word segmentation and geographic division categories, and obtain accurate word segmentation and geographic division category classification results.
[0066] A variety of methods can be used to train the address processing model. For example, a first loss function can be determined based on the annotation information and the prediction results; the address processing model can be trained using the first loss function. The value of the sign function can be determined based on the geographic division category label and the geographic division prediction category; the first loss function can be determined based on the sign function value and the prediction probability.
[0067] The first loss function can be a variety of functions. For example, the first loss function can be a cross-entropy loss function, which is used to measure the difference between the model output and the true label. The formula of the first loss function is as follows:
[0068] (4);
[0069] in, is the geographic region category label, is the predicted category of the geographical division corresponding to the predicted word segmentation; N is the number of samples, L is the label dimension, is the number of geographic classification categories for each label dimension; is the value of the sign function, if the sample The corresponding geographic division category label is the same as the geographic division prediction category, and the value of the sign function ( ) takes 1, otherwise, the value of the sign function ( ) takes 0; is the predicted probability (the probability that the sample’s geographic region predicted category belongs to the geographic region category label).
[0070] The address processing model is trained using the first loss function. For example, the address processing model can be trained using training samples and existing iterative training methods, and the parameters of the address processing model can be adjusted until the first loss function converges to a preset first numerical interval to obtain a trained address processing model.
[0071] Figure 2 FIG. 1 is a flow chart of other embodiments of the method for training the address processing model according to the present disclosure. Figure 2 As shown, the training method of the address processing model includes steps S201-S204.
[0072] Step S201, obtaining a plurality of second address vectors according to a plurality of address information using a preprocessing model.
[0073] Step S202: using a hyperbolic mapping model, perform hyperbolic mapping on the plurality of second address vectors to obtain a plurality of second hyperbolic vectors in a hyperbolic space.
[0074] Step S203: determining a second loss function based on the plurality of second hyperbolic vectors.
[0075] Step S204: train the address processing model using the second loss function.
[0076] By using multiple address information, self-supervision assisted training of the address processing model can be achieved, and the parameters of the address processing model can be adjusted until the second loss function converges to a preset second numerical interval to obtain a trained address processing model.
[0077] The trained address processing model can be obtained when the first loss function converges to the first numerical range; the trained address processing model can be obtained when the second loss function converges to the second numerical range. The trained address processing model can also be obtained when the first loss function converges to the first numerical range and the second loss function converges to the second numerical range. The first numerical range and the second numerical range can be set according to the training requirements of the model.
[0078] When using the first loss function and the second loss function to train the address processing model, the existing joint training method can be used and the first loss function and the second loss function can be used for training to obtain a trained address processing model; the address processing model can also be trained alternately using the first loss function and the second loss function; or the address processing model can be trained using the first loss function or the second loss function alone.
[0079] In some embodiments, the number of the multiple address information is three, the three address information includes the first address information, the second address information and the third address information, the first address information, the second address information and the third address information form a triplet; the first address information is partially the same as the second address information, and the first address information is completely different from the third address information. Multiple triples can be constructed for model training.
[0080] The second loss function can be multiple, and multiple methods can be used to determine the second loss function. For example, determine the first distance between the second hyperbolic vector corresponding to the first address information and the second hyperbolic vector corresponding to the second address information; determine the second distance between the second hyperbolic vector corresponding to the first address information and the second hyperbolic vector corresponding to the third address information; determine the second loss function based on the first distance and the second distance. The formula of the second loss function is as follows:
[0081] (5);
[0082] (6);
[0083] in, are second hyperbolic vectors corresponding to the first address information, the second address information and the third address information respectively; is the preset parameter; () is the distance function adapted to the hyperbolic space; c is the curvature parameter of the hyperbolic space.
[0084] like Figure 3AAs shown, the address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model. The address sample is input into the preprocessing model, and the first address vector is obtained by using the preprocessing model and input into the hyperbolic mapping model; the first address vector is hyperbolicly mapped by using the hyperbolic mapping model to obtain the first hyperbolic vector in the hyperbolic space; according to the first hyperbolic vector, the classification model is used to obtain the prediction result.
[0085] Multiple address information is input into a preprocessing model, and multiple second address vectors are obtained by using the preprocessing model and input into a hyperbolic mapping model; the multiple second address vectors are hyperbolicly mapped by using the hyperbolic mapping model to obtain multiple second hyperbolic vectors in a hyperbolic space.
[0086] like Figure 3B As shown, the address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model, and the address processing model also includes a feature enhancement model. The feature enhancement model can be a variety of models, such as an MLP (Multilayer Perceptron) model. The MLP model is a feedforward artificial neural network model composed of multiple layers of nodes (or neurons), and each layer of nodes is fully connected to the next layer of nodes. Before the first address vector and the second address vector are hyperbolic mapped, the feature enhancement model is used to perform feature enhancement processing on the first address vector and the second address vector.
[0087] Construct an address processing model. Use the preprocessing model to obtain a preliminary address embedding representation and obtain geographic hierarchical characteristics. Use the MLP model to enhance the geographic hierarchical characteristics. Use the hyperbolic mapping model to map the geographic hierarchical characteristics to the hyperbolic space to better determine the hierarchical structure characteristics of the address. The classification model is used to obtain the address segmentation and the corresponding geographic division category.
[0088] In some embodiments, a geographical hierarchical tree is constructed, each node in the geographical hierarchical tree is provided with an address text, and a node in the geographical hierarchical tree has a geographical belonging relationship with the parent node of the node. The address hierarchical tree can have multiple levels, and the number of levels of the address hierarchical tree can be three, six, nine, etc.
[0089] The first address information, the second address information and the third address information can be generated based on the first geographical hierarchy tree. In the first geographical hierarchy tree, a first node, a second node and a third node located at the lowest level are determined, wherein the parent node of the first node is the same as the parent node of the second node, and the parent node of the first node is different from the parent node of the third node.
[0090] Determine a first path, a second path and a third path from a first node, a second node and a third node respectively to the highest level node of a first geographical hierarchy tree; generate first address information, second address information and third address information based on the address texts of all nodes in the first path, the second path and the third path respectively.
[0091] For example, Figure 4 As shown, the first geographical hierarchy tree has three levels, namely province, city and district. Each AH node in the first geographical hierarchy tree is provided with an address text, and a node in the first geographical hierarchy tree has a geographical belonging relationship with the parent node of the node.
[0092] In the first geographic hierarchy tree, a first node D, a second node E and a third node G located at the lowest level are determined, wherein the parent node of the first node D is the same as the parent node of the second node E, and the parent node of the first node D is different from the parent node of the third node G.
[0093] Determine a first path DBA, a second path EBA and a third path GCA reaching the highest node A of the first geographical hierarchy tree from the first node D, the second node E and the third node G respectively; generate first address information, second address information and third address information based on the address texts of all nodes in the first path DBA, the second path EBA and the third path GCA respectively (generate address information based on the address texts of all nodes in the path in descending order of the levels of all nodes in the path).
[0094] According to the characteristics of the geographic hierarchy, the distance between two paths with the same parent node is closer than that between two paths with non-parent nodes; a triplet (first address information, second address information, third address information) is constructed, with the last layer of nodes as the base layer, and the two address information corresponding to the two paths with the same parent node constitute a positive sample pair, and the address information corresponding to the path of the non-parent node is used as a negative sample; for example, the first address information and the second address information are a positive sample pair, and the third address information is a negative sample, so that the hierarchical characteristics of the geographic hierarchy tree can be obtained, thereby improving the performance of the model.
[0095] There are many methods for generating address samples. For example, a second geographic hierarchy tree is constructed. The second geographic hierarchy tree can be the same as the first geographic hierarchy tree or different from the first geographic hierarchy tree. For example, the second geographic hierarchy tree has six levels, namely, province, city, district, street, community, and neighborhood.
[0096] In the second geographical hierarchy tree, the fourth path is selected, and address samples are generated according to the address texts of the nodes in the fourth path. For example, according to the address texts of the nodes in the fourth path in the second geographical hierarchy tree, the address samples generated are: A Province B City C District D Street E Community F District.
[0097] The address text of at least one node in the fourth path may be subjected to noise adding processing, and the noise adding processing includes at least one of text abbreviation replacement processing, text addition processing, text deletion processing, and text replacement processing on the address text of the node.
[0098] For example, the address text of one or more nodes in the fourth path is randomly subjected to at least one of text abbreviation replacement, text addition, text deletion, and text replacement. Different noise addition probabilities can be set for different levels. For example, at the community and neighborhood levels, there are often omissions, typos, and aliases. A larger noise addition probability can be set to improve the adaptability of the model.
[0099] At least one node in the fourth path may be masked, and an address sample may be generated based on the address text of the unmasked node in the fourth path. One or more nodes in the fourth path may be randomly masked, and the address text of the unmasked node may be generated to generate an address sample. Different mask probabilities may be set for different levels, for example, a larger mask probability may be set for the community level.
[0100] For example, after the community level in the fourth path is shielded, based on the address text of the unshielded nodes in the fourth path, the address sample generated is: A Province B City C District D Street F Community.
[0101] After generating the address sample, an address participle corresponding to the address sample is generated according to the address text of each node in the fourth path, a geographic division category label is generated based on the geographic level corresponding to each node (including a geographic division category label corresponding to at least one level such as province, city, district, street, community, and neighborhood), and annotation information of the address sample is generated based on the address participle and the corresponding geographic division category label.
[0102] Generate training samples based on address samples and corresponding annotation information. Generate multiple training samples to obtain a training sample set. Based on the same method as the training samples, test samples, verification samples, etc. can be obtained.
[0103] Based on the geographic hierarchy tree and after noise addition and shielding, training samples are obtained without manual labeling, saving a lot of labor costs.
[0104] Figure 51 is a flowchart of some embodiments of the address processing method according to the present disclosure. Figure 5 As shown, the address processing method includes steps S501-S504.
[0105] Step S501, obtaining a trained address processing model.
[0106] The address processing model is obtained by training using the training method in any of the above embodiments, and the address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model.
[0107] Step S502: Obtain a third address vector using a preprocessing model according to the address information to be processed.
[0108] Step S503: perform hyperbolic mapping on the third address vector using a hyperbolic mapping model to obtain a third hyperbolic vector in the hyperbolic space.
[0109] Step S504: Obtain processing results using a classification model based on the third hyperbolic vector, including address segmentation words and geographic division categories corresponding to the address segmentation words.
[0110] The address processing model includes a feature enhancement model. Before performing hyperbolic mapping on the third address vector, the feature enhancement model is used to perform feature enhancement processing on the third address vector.
[0111] The training of the address processing model and the address processing method in the above-mentioned embodiments can enhance the geographical hierarchical features of the address, can realize self-supervision assisted training of the address processing model, improve the accuracy of predicted word segmentation and geographical division prediction categories, enable the address processing model to cope with abbreviations, typos, aliases and other situations that appear when the address is input, can improve the accuracy of the determined address word segmentation and geographical division categories, and improve the accuracy of the address location technology; training samples can be obtained based on the geographical hierarchy tree without manual labeling, saving a lot of manpower costs.
[0112] In some embodiments, Fig. 6A As shown, the present disclosure provides a training device 60 for an address processing model, including a sample acquisition module 61 , a first preprocessing module 62 , a first mapping processing module 63 , a prediction processing module 64 and a training processing module 65 .
[0113] The sample acquisition module 61 acquires training samples, which include address samples and labeling information corresponding to the address samples. The first preprocessing module 62 obtains a first address vector based on the address samples using a preprocessing model.
[0114] The first mapping processing module 63 uses the hyperbolic mapping model to perform hyperbolic mapping on the first address vector to obtain a first hyperbolic vector in the hyperbolic space. The prediction processing module 64 uses the classification model to obtain a prediction result based on the first hyperbolic vector. The training processing module 65 trains the address processing model based on the labeling information and the prediction result.
[0115] In some embodiments, the training processing module 65 determines a first loss function based on the annotation information and the prediction results; the training processing module 65 uses the first loss function to train the address processing model.
[0116] For example, the annotation information includes an address segmentation and a geographic division category label, and the prediction result includes a predicted segmentation corresponding to the address segmentation, a geographic division prediction category corresponding to the predicted segmentation, and a prediction probability. The training processing module 65 determines the value of the symbol function according to the geographic division category label and the geographic division prediction category; the training processing module 65 determines the first loss function according to the value of the symbol function and the prediction probability.
[0117] The first preprocessing module 62 obtains a plurality of second address vectors using a preprocessing model according to the plurality of address information. The first mapping processing module 63 uses a hyperbolic mapping model to perform hyperbolic mapping on the plurality of second address vectors to obtain a plurality of second hyperbolic vectors in a hyperbolic space. The training processing module 65 determines a second loss function based on the plurality of second hyperbolic vectors; the training processing module 65 uses the second loss function to train the address processing model.
[0118] For example, the plurality of address information includes first address information, second address information, and third address information; the first address information is partially identical to the second address information, and the first address information is completely different from the third address information. The training processing module 65 determines a first distance between a second hyperbolic vector corresponding to the first address information and a second hyperbolic vector corresponding to the second address information; the training processing module 65 determines a second distance between a second hyperbolic vector corresponding to the first address information and a second hyperbolic vector corresponding to the third address information; the training processing module 65 determines a second loss function based on the first distance and the second distance.
[0119] The training processing module 65 obtains a trained address processing model when the first loss function converges to a first numerical range and the second loss function converges to a second numerical range.
[0120] like Figure 6B As shown, the training device 60 ′ of the address processing model disclosed herein includes, in addition to all the modules in the training device 60 of the address processing model, an address information acquisition module 66 and a first enhanced processing module 67 .
[0121] The address information acquisition module 66 generates first address information, second address information and third address information based on the first geographic hierarchy tree, wherein each node in the first geographic hierarchy tree is provided with an address text, and each node in the first geographic hierarchy tree has a geographic affiliation relationship with its parent node.
[0122] The address information acquisition module 66 determines the first node, the second node and the third node located at the lowest level in the first geographical hierarchy tree, wherein the parent node of the first node is the same as the parent node of the second node, and the parent node of the first node is different from the parent node of the third node.
[0123] The address information acquisition module 66 determines a first path, a second path, and a third path from the first node, the second node, and the third node to the highest node of the first geographical hierarchy tree, respectively. The address information acquisition module 66 generates the first address information, the second address information, and the third address information based on the address texts of all nodes in the first path, the second path, and the third path, respectively.
[0124] The first enhancement processing module 67 performs feature enhancement processing on the first address vector and the second address vector using a feature enhancement model before performing hyperbolic mapping on the first address vector and the second address vector.
[0125] In some embodiments, the sample acquisition module 61 selects a fourth path in the second geographical hierarchy tree; the sample acquisition module 61 generates an address sample according to the address text of the node in the fourth path.
[0126] The sample acquisition module 61 performs noise addition processing on the address text of at least one node in the fourth path, and the noise addition processing includes performing at least one of text abbreviation replacement processing, text addition processing, text deletion processing, and text replacement processing on the address text of the node. The sample acquisition module 61 can also perform shielding processing on at least one node in the fourth path, and generate address samples based on the address texts of the unshielded nodes in the fourth path.
[0127] In some embodiments, Fig. 7A As shown, the present disclosure provides an address processing module 70 , including a model acquisition module 71 , a second preprocessing module 72 , a second mapping processing module 73 and a classification processing module 74 .
[0128] The model acquisition module 71 acquires a trained address processing model, wherein the address processing model is trained by the training method in any of the above embodiments, and the address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model.
[0129] The second preprocessing module 72 obtains the third address vector by using the preprocessing model according to the address information to be processed. The second mapping processing module 73 uses the hyperbolic mapping model to perform hyperbolic mapping on the third address vector to obtain a third hyperbolic vector in the hyperbolic space. The classification processing module 74 obtains the processing result by using the classification model according to the third hyperbolic vector. The processing result includes the address segmentation, the geographical division category corresponding to the address segmentation, etc.
[0130] like Figure 7B As shown, the address processing device 70' includes all the modules in the address processing device 70 and further includes a second enhancement processing module 75. The second enhancement processing module 75 performs feature enhancement processing on the third address vector using a feature enhancement model before performing hyperbolic mapping on the third address vector.
[0131] In some embodiments, Figure 8 As shown, the electronic device may include a memory 81, a processor 82, a communication interface 83 and a bus 84. The memory 81 is used to store instructions, the processor 82 is coupled to the memory 81, and the processor 82 is configured to execute the training method or address processing method of the above-mentioned address processing model based on the instructions stored in the memory 81.
[0132] The memory 81 may be a high-speed RAM memory, a non-volatile memory, etc. The memory 81 may also be a memory array. The memory 81 may also be divided into blocks, and the blocks may be combined into virtual volumes according to certain rules. The processor 82 may be a central processing unit CPU, or an application specific integrated circuit ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the training method of the address processing model or the address processing method of the present disclosure.
[0133] In some embodiments, the present disclosure provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, implement a training method for an address processing model or an address processing method as in any of the above embodiments.
[0134] Computer readable storage media can adopt any combination of one or more readable media. The readable medium can be a readable signal medium or a readable storage medium. The readable storage medium can include, for example, but is not limited to, a system, device or device of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination of the above. More specific examples (non-exhaustive enumeration) of readable storage media can include: an electrical connection with one or more wires, a portable 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.
[0135] The embodiments of the present disclosure may also be a computer program product, which includes computer program instructions. When the computer program instructions are executed by a processor, the processor executes the steps of the method according to various embodiments of the present disclosure described in the above “Exemplary Method” section of this specification.
[0136] The training of the address processing model, the address processing method, the device, the storage medium, the electronic device and the computer program product in the above-mentioned embodiments use a preprocessing model to obtain the first address vector of the address sample, use a hyperbolic mapping model to obtain the first hyperbolic vector of the first address vector in the hyperbolic space, obtain the prediction result according to the first hyperbolic vector and use the classification model, and train the address processing model according to the annotation information and prediction result of the training sample; it can enhance the geographical hierarchical characteristics of the address, realize self-supervision to assist in the training of the address processing model, improve the accuracy of the predicted word segmentation and geographical division prediction category, enable the address processing model to cope with abbreviations, typos, aliases and other situations that occur when the address is input, improve the accuracy of the determined address word segmentation and geographical division category, obtain accurate word segmentation and geographical division category classification results, and improve the accuracy of the address location technology; the training sample can be obtained based on the geographical hierarchy tree without manual labeling, saving a lot of manpower costs and improving the user experience.
[0137] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0138] Each embodiment in this specification is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0139] The block diagrams of the devices, apparatuses, equipment, and systems involved in this disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagrams. As will be appreciated by those skilled in the art, these devices, apparatuses, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including," "comprising," "having," and the like are open words, referring to "including but not limited to," and can be used interchangeably therewith. The words "or" and "and" used herein refer to the words "and / or," and can be used interchangeably therewith, unless the context clearly indicates otherwise. The word "such as" used herein refers to the phrase "such as but not limited to," and can be used interchangeably therewith.
[0140] It should also be noted that in the apparatus, device and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0141] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0142] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, it will be appreciated by those skilled in the art that the above embodiments are merely illustrative and do not limit the scope of the present disclosure. It will be appreciated by those skilled in the art that the above embodiments may be combined, modified or replaced without departing from the scope and essence of the present disclosure.
Claims
1. A training method for an address processing model, wherein: The address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model, and the training method includes: Acquire a training sample, wherein the training sample includes an address sample and annotation information corresponding to the address sample; According to the address sample, using the preprocessing model, obtaining a first address vector; Using the hyperbolic mapping model, performing hyperbolic mapping on the first address vector to obtain a first hyperbolic vector in a hyperbolic space; Obtaining a prediction result using the classification model according to the first hyperbolic vector; The address processing model is trained according to the annotation information and the prediction result.
2. The training method according to claim 1, wherein: The training of the address processing model according to the annotation information and the prediction result comprises: Determining a first loss function according to the labeling information and the prediction result; The address processing model is trained using the first loss function.
3. The training method according to claim 2, wherein: The annotation information includes an address segmentation word and a geographic region category label, the prediction result includes a predicted segmentation word corresponding to the address segmentation word, a geographic region prediction category and a prediction probability corresponding to the predicted segmentation word, and determining the first loss function based on the annotation information and the prediction result includes: Determining a value of a sign function according to the geographic division category label and the geographic division prediction category; The first loss function is determined according to the value of the sign function and the predicted probability.
4. The training method according to claim 2, comprising: According to the plurality of address information, using the preprocessing model, a plurality of second address vectors are obtained; Using the hyperbolic mapping model, performing hyperbolic mapping on the plurality of second address vectors to obtain a plurality of second hyperbolic vectors in a hyperbolic space; Determining a second loss function based on the plurality of second hyperbolic vectors; The address processing model is trained using the second loss function.
5. The training method according to claim 4, wherein: The plurality of address information includes first address information, second address information and third address information, wherein the first address information is partially identical to the second address information, and the first address information is completely different from the third address information.
6. The training method according to claim 5, wherein: The determining of the second loss function based on the plurality of second hyperbolic vectors comprises: Determine a first distance between a second hyperbolic vector corresponding to the first address information and a second hyperbolic vector corresponding to the second address information; Determine a second distance between a second hyperbolic vector corresponding to the first address information and a second hyperbolic vector corresponding to the third address information; The second loss function is determined according to the first distance and the second distance.
7. The training method according to claim 5, comprising: Based on the first geographical hierarchy tree, first address information, second address information and third address information are generated, wherein each node in the first geographical hierarchy tree is provided with an address text, and each node in the first geographical hierarchy tree has a geographical affiliation relationship with its parent node.
8. The training method according to claim 7, wherein: The generating of the first address information, the second address information and the third address information based on the first geographical hierarchy tree includes: In the first geographical hierarchy tree, determining a first node, a second node, and a third node located at the lowest level, wherein the parent node of the first node is the same as the parent node of the second node, and the parent node of the first node is different from the parent node of the third node; determining a first path, a second path, and a third path from the first node, the second node, and the third node, respectively, to a highest level node of the first geographical hierarchy tree; The first address information, the second address information, and the third address information are generated based on the address texts of all nodes in the first path, the second path, and the third path, respectively.
9. The training method according to claim 4, comprising: When the first loss function converges to a first numerical range and the second loss function converges to a second numerical range, the trained address processing model is obtained.
10. The training method according to claim 4, wherein: The address processing model includes a feature enhancement model, and the training method includes: Before performing hyperbolic mapping on the first address vector and the second address vector, feature enhancement processing is performed on the first address vector and the second address vector using the feature enhancement model.
11. The training method according to claim 1, comprising: In the second geographical hierarchical tree, a fourth path is selected, wherein each node in the second geographical hierarchical tree is provided with an address text, and each node in the second geographical hierarchical tree has a geographical belonging relationship with its parent node; The address sample is generated according to the address text of the node in the fourth path.
12. The training method according to claim 11, wherein: Generating the address sample according to the address text of the node in the fourth path includes: Performing noise adding processing on the address text of at least one node in the fourth path, wherein the noise adding processing includes At least one of text abbreviation replacement processing, text addition processing, text deletion processing, and text replacement processing is performed on the address text of the node.
13. The training method according to claim 11, wherein: Generating the address sample according to the address text of the node in the fourth path includes: shielding at least one node in the fourth path; The address sample is generated based on the address text of the unshielded node in the fourth path.
14. The training method according to any one of claims 1 to 13, wherein: The preprocessing model includes a Bert model; The classification model includes a Head layer.
15. An address processing method, comprising: Obtaining a trained address processing model, wherein the address processing model is trained by the training method described in any one of claims 1 to 14, and the address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model; According to the address information to be processed, using the preprocessing model, obtaining a third address vector; Using the hyperbolic mapping model, performing hyperbolic mapping on the third address vector to obtain a third hyperbolic vector in the hyperbolic space; According to the third hyperbolic vector, the classification model is used to obtain a processing result.
16. The address processing method according to claim 15, wherein: The address processing model includes a feature enhancement model, and the address processing method includes: Before performing hyperbolic mapping on the third address vector, the feature enhancement model is used to perform feature enhancement processing on the third address vector.
17. The address processing method according to claim 15 or 16, wherein: The processing result includes an address segmentation word and a geographical division category corresponding to the address segmentation word.
18. A training device for an address processing model, wherein: The address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model, and the training device includes: A sample acquisition module, used to acquire training samples, wherein the training samples include address samples and annotation information corresponding to the address samples; A first preprocessing module, configured to obtain a first address vector according to the address sample and using the preprocessing model; A first mapping processing module, configured to perform hyperbolic mapping on the first address vector using the hyperbolic mapping model to obtain a first hyperbolic vector in a hyperbolic space; A prediction processing module, used to obtain a prediction result based on the first hyperbolic vector and the classification model; A training processing module is used to train the address processing model according to the annotation information and the prediction result.
19. An address processing module, comprising: A model acquisition module, used to acquire a trained address processing model, wherein the address processing model is trained by the training method described in any one of claims 1 to 14, and the address processing model includes a preprocessing model, a hyperbolic mapping model and a classification model; A second preprocessing module, configured to obtain a third address vector using the preprocessing model according to the address information to be processed; A second mapping processing module, configured to perform hyperbolic mapping on the third address vector by using the hyperbolic mapping model to obtain a third hyperbolic vector in the hyperbolic space; A classification processing module is used to obtain a processing result based on the third hyperbolic vector using the classification model.
20. An electronic device comprising: Memory; as well as A processor coupled to the memory, the processor being configured to execute the training method of the address processing model according to any one of claims 1 to 14 or the address processing method according to any one of claims 15 to 17 based on instructions stored in the memory.
21. A computer-readable storage medium storing computer instructions, which, when executed by a processor, implement the training method of the address processing model as described in any one of claims 1 to 14 or the address processing method as described in any one of claims 15 to 17.
22. A computer program product storing computer instructions, wherein the computer instructions, when executed by a processor, implement the training method of the address processing model as described in any one of claims 1 to 14 or the address processing method as described in any one of claims 15 to 17.