Logistics address feature extraction method, system, device and storage medium
By concatenating the attribute information of logistics addresses and extracting features using a pre-trained text representation method, the problems of inconsistent address processing and sparse feature representation in the existing technology are solved, achieving unified representation of logistics address features and more efficient data utilization.
Patent Information
- Application Number
- CN202011376047.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-30
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2040-11-30
AI Technical Summary
In the existing technology, the address processing steps are different, resulting in inconsistent data usage, and the address feature representation relies on preprocessing rules, which can easily lead to error accumulation and vector sparseness, affecting subsequent model operations.
A unified text representation method based on pre-training is used to concatenate the attribute information of the logistics address into a text string, map it into an ID sequence through a text mapping dictionary, then use the embedding layer to map the ID sequence into a vector sequence, and input the interactive feature extraction model to extract Unified address characteristics.
It achieves a unified representation of logistics address features, reduces waste in data usage, and improves the density of features, making it easy to apply to downstream business models.
Smart Images

Figure CN112488200B_ABST
Abstract
Description
Background Art
[0002] In logistics business scenarios, addresses are used everywhere, including address conversion to longitude and latitude, intelligent order splitting, and collection point recommendation. Since each business scenario is relatively independent of each other, there are often differences in the processing and use of address texts.
[0003] The existing address processing steps mainly include text preprocessing, feature extraction and specific downstream business models. The text preprocessing methods are mostly different, which makes it impossible to unify the use of data. Different processing logic may need to be designed for different data, which will also cause waste of data use. In addition, the existing address feature representation is strongly dependent on the preprocessing rules, which is easy to cause error accumulation and the representation vector is extremely sparse, which is not conducive to the operation when applied to subsequent models. Summary of the invention
[0004] In view of the problems in the prior art, the purpose of the present invention is to provide a logistics address feature extraction method, system, device and storage medium, and propose a unified text representation method based on pre-training to achieve unified representation after address feature extraction.
[0005] The embodiment of the present invention provides a method for extracting features of a logistics address, comprising the following steps:
[0006] Concatenate the information corresponding to each attribute of the logistics address to obtain a text string;
[0007] Mapping the text string into an ID sequence based on a text mapping dictionary, wherein the text mapping dictionary includes mapping relationships between various attribute values of various preset attributes and IDs;
[0008] Mapping the ID sequence into a vector sequence using an embedding layer;
[0009] The vector sequence is input into an interactive feature extraction model, and address features are extracted from output data of the interactive feature extraction model.
[0010] In this embodiment, the process of concatenating the information corresponding to each attribute of the logistics address to obtain a text string includes the following steps:
[0011] The information corresponding to each attribute of the logistics address is concatenated, and the first identification character is added between every two attribute information to obtain a text string.
[0012] In this embodiment, after the information of the logistics address corresponding to each attribute is concatenated to obtain a text string, the method further includes adding a second identification character to the text string.
[0013] In this embodiment, extracting address features from the output data of the interactive feature extraction model includes the following steps:
[0014] Obtaining interactive features output by the interactive feature extraction model;
[0015] A feature vector corresponding to the second identification character is extracted from the interaction feature as an extracted address feature.
[0016] In this embodiment, the interactive feature extraction model is a transformer model, including a position encoding layer, a self-attention layer and a feedforward network layer.
[0017] In this embodiment, before the information of the logistics address corresponding to each attribute is concatenated to obtain a text string, the following steps are also included:
[0018] Collect logistics address data to be processed;
[0019] Cleaning the logistics address data according to preset cleaning rules;
[0020] The logistics address data after data cleaning is classified to obtain information corresponding to each attribute of the logistics address data.
[0021] In this embodiment, after extracting the address features from the output data of the interactive feature extraction model, the following steps are also included:
[0022] Collecting the delivery information corresponding to the address feature and adding a delivery task allocation tag to the address feature;
[0023] A delivery task allocation model is trained based on the address features, wherein input data of the delivery task allocation model includes address features, and output data includes delivery task allocation objects.
[0024] In this embodiment, the delivery task allocation model includes a first delivery task allocation model and / or a second delivery task allocation model, the output data of the first delivery task allocation model includes delivery outlets, and the second delivery task allocation model includes delivery personnel.
[0025] In this embodiment, after extracting the address features from the output data of the interactive feature extraction model, the following steps are also included:
[0026] Constructing a training sample set of a language model based on the address features;
[0027] The language model is trained using the training sample set, wherein input data of the language model includes a first address local feature, and output data includes a second address local feature associated with the first address local feature.
[0028] In this embodiment, the attributes of the logistics address include provincial level, city level, district level and detailed address;
[0029] The information corresponding to each attribute of the logistics address is concatenated to obtain a text string, including concatenating the information corresponding to each attribute of the logistics address in the order of provincial level, municipal level, district level and detailed address.
[0030] In this embodiment, it also includes collecting multiple logistics address data, segmenting the logistics address data, and building a text mapping dictionary.
[0031] The embodiment of the present invention further provides a logistics address feature extraction system, which is applied to the logistics address feature extraction method, and the system includes:
[0032] A character acquisition module, used to concatenate the information corresponding to each attribute of the logistics address to obtain a text string;
[0033] An ID mapping module, used for mapping the text string into an ID sequence based on a text mapping dictionary, wherein the text mapping dictionary includes a mapping relationship between various attribute values of various preset attributes and IDs;
[0034] A vector mapping module, used to map the ID sequence into a vector sequence using an embedding layer;
[0035] The feature extraction module is used to input the vector sequence into the interactive feature extraction model and extract address features from the output data of the interactive feature extraction model.
[0036] In this embodiment, the character acquisition module concatenates the information corresponding to each attribute of the logistics address to obtain a text string, including: concatenating the information corresponding to each attribute of the logistics address, adding a first identification character between every two attribute information to obtain a text string, and adding a second identification character to the text string;
[0037] The feature extraction module extracts address features from the output data of the interactive feature extraction model, including: acquiring interactive features output by the interactive feature extraction model, and extracting a feature vector corresponding to the second identification character from the interactive features as the extracted address feature.
[0038] The embodiment of the present invention further provides a logistics address feature extraction device, including:
[0039] processor;
[0040] a memory storing executable instructions of the processor;
[0041] Wherein, the processor is configured to perform the steps of the logistics address feature extraction method by executing the executable instructions.
[0042] An embodiment of the present invention also provides a computer-readable storage medium for storing a program, which, when executed, implements the steps of the logistics address feature extraction method.
[0043] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure.
[0044] The present invention proposes a unified text representation method based on pre-training. First, the text is mapped to an ID sequence based on a preprocessed text mapping dictionary, and then the ID sequence is mapped to a vector sequence through an embedding layer. Then, feature extraction is performed in the vector sequence to extract logistics address features in a unified form, thereby realizing a unified representation after address feature extraction. The extracted logistics address features can be more conveniently applied to downstream business models without causing waste in data usage. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] Other features, objectives and advantages of the present invention will become more apparent from a reading of the detailed description of non-limiting embodiments made with reference to the following accompanying drawings.
[0046] Figure 1 is a flow chart of a method for extracting features of a logistics address according to an embodiment of the present invention;
[0047] Figure 2 It is a schematic diagram of text changes during the process of the logistics address feature extraction method according to one embodiment of the present invention;
[0048] Figure 3 This is a flow chart of extracting logistics address features and applying them to the training of the distribution task allocation model according to an embodiment of the present invention;
[0049] Figure 4 This is a flow chart of extracting flow address features and applying them to language model training according to an embodiment of the present invention;
[0050] Figure 5 It is a structural schematic diagram of a logistics address feature extraction system according to an embodiment of the present invention;
[0051] Figure 6 It is a structural schematic diagram of a logistics address feature extraction device according to an embodiment of the present invention;
[0052] Figure 7 It is a schematic diagram of the structure of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0053] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present invention will be more comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0054] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0055] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the steps. For example, some steps may be decomposed, while some steps may be combined or partially combined. Therefore, the actual execution order may be changed according to the actual situation.
[0056] like Figure 1 As shown, an embodiment of the present invention provides a method for extracting features of a logistics address, comprising the following steps:
[0057] S100: Concatenate the information corresponding to each attribute of the logistics address to obtain a text string, wherein the attributes include province, city, district, detailed address, etc., and the detailed address may be further differentiated to include attributes such as street, building number, house number, etc.;
[0058] S200: Mapping the text string into an ID sequence based on a text mapping dictionary, wherein the text mapping dictionary includes mapping relationships between various attribute values of various preset attributes and IDs;
[0059] S300: Mapping the ID sequence into a vector sequence using an embedding layer;
[0060] S400: Inputting the vector sequence into an interactive feature extraction model, and extracting address features from output data of the interactive feature extraction model.
[0061] The present invention proposes a unified text representation method based on pre-training. First, in step S100, the information corresponding to each attribute of the logistics address is concatenated to obtain a text string, and then in step S200, the text is mapped to an ID sequence based on a pre-processed text mapping dictionary, and then in step S300, the ID sequence is mapped to a vector sequence using an embedding layer, and then in step S400, feature extraction is performed in the vector sequence to extract logistics address features in a unified form, thereby realizing a unified representation after address feature extraction, and the extracted logistics address features can be more conveniently applied to downstream business models without causing waste in data use.
[0062] In various embodiments of the present invention, the present invention is applied to logistics scenarios. Specifically, the logistics address feature extraction method provided by the present invention can be deployed on the server of the e-commerce platform or the server of the logistics management center, so as to provide users with logistics address feature extraction services, but the present invention is not limited thereto. When the logistics address feature extraction method is deployed on the server of the e-commerce platform, it can communicate with the server of the logistics management center to obtain historical receipt data or the current newly added logistics data, extract logistics address data from the historical receipt data or the newly added logistics data, for training the interactive feature extraction model, and can also collect the logistics address data filled in by the user when placing an order on the e-commerce platform. When the logistics address feature extraction method is deployed on the server of the logistics management center, it can collect the historical receipt data or the newly added logistics data recorded by itself, extract logistics address data from the historical receipt data or the newly added logistics data, and can also communicate with the server of the e-commerce platform to collect the logistics address data filled in by the user when placing an order on the e-commerce platform. In addition, the logistics address feature extraction system can be deployed on a separate server, and the separate server can communicate with the server of the e-commerce platform and / or the server of the logistics management center.
[0063] Combine the following Figure 2 and one The logistics address feature extraction method of this embodiment is specifically introduced in detail with a specific implementation method.
[0064] The step S100: before concatenating the information corresponding to each attribute of the logistics address to obtain a text string, further includes the following steps:
[0065] Collecting logistics address data to be processed. The logistics address data collected here may include the receiving addresses in the historical receiving data, and may also include the receiving addresses entered by the user when placing an order. For example, when the extracted logistics address features are subsequently applied to the training process of the downstream business model (such as the distribution task allocation model, etc.), the logistics address feature extraction method of the present invention may be used to extract the address features of the logistics addresses in the historical receiving data, that is, the logistics address data to be processed is the receiving address data in the historical receiving data. When the extracted logistics address features are subsequently input into the trained downstream business model for classification prediction, the collected address data to be processed may include the logistics address data entered by the user when placing an order, but the present invention is not limited thereto.
[0066] The logistics address data is cleaned according to preset cleaning rules. The preset cleaning rules may include, for example: converting full-width characters to half-width characters, converting traditional Chinese characters to simplified Chinese characters, deleting special characters (such as emoticons, Japanese characters, etc.), and retaining only Chinese characters, numbers, and English characters;
[0067] The logistics address data after data cleaning is classified to obtain information corresponding to various attributes of the logistics address data, that is, the logistics address data is divided to obtain attribute values corresponding to various attributes such as province, city, district, detailed address, etc.
[0068] In this embodiment, the step S100: concatenating the information corresponding to each attribute of the logistics address to obtain a text string includes the following steps:
[0069] The information of the logistics address corresponding to each attribute is connected in series, and the first identification character is added between the information of each two attributes to obtain a text string. In this embodiment, the various attributes of the logistics address include provincial, municipal, district and detailed address. The information of the logistics address corresponding to each attribute is connected in series to obtain a text string, including connecting the information of the logistics address corresponding to each attribute in the order of provincial, municipal, district and detailed address. Here, the first identification character can be, for example, [SEP], and [SEP] is a special symbol used to separate non-continuous sequences. That is, the information of the province, city, district and detailed address is connected in series using the special character [SEP] to obtain a string: province + [SEP] + city + [SEP] + district + [SEP] + detailed address. Through the separation effect of [SEP], it is easier to map the text string to an ID sequence in the subsequent step S200.
[0070] In this embodiment, in step S100, after the information corresponding to each attribute of the logistics address is concatenated to obtain a text string, the second identification character is added to the text string. Here, the second identification character can be, for example, [CLS], which is a special symbol used for classification output, such as Figure 2As shown, the format of the text string is: [CLS]+province+[SEP]+city+[SEP]+district+[SEP]+detailed address. By adding the [CLS] character, when extracting address features later, the corresponding feature vector can be extracted based on the placeholder [CLS] as the address text representation.
[0071] like Figure 2 As shown, step S200: mapping the text string to an ID sequence based on a text mapping dictionary, including mapping the text string to an ID sequence based on a text mapping dictionary in a preprocessing stage: [1,2,3,4,3,5,3,6], the length of the ID sequence can be set as needed, and each position in the ID sequence corresponds to a specific attribute, for example, the first position in the ID sequence is set to correspond to the province, the second position corresponds to the city, etc. The text mapping dictionary includes the mapping relationship between various attribute values of various attributes and IDs of preset attributes, for example, corresponding to the attribute "province", all provincial regions are numbered in advance, if an address includes Shandong Province, then the value of the first position of its ID sequence is the number of Shandong Province. Then for each province, the prefecture-level cities therein are numbered, if an address includes Qingdao City, Shandong Province, then the value of the second position of its ID sequence is the number of Qingdao City, and so on. The text mapping dictionary includes the corresponding relationship between the attribute values of all known attributes and IDs, if an address includes attribute values not in the text mapping dictionary, it can be marked as other categories, or manually marked by humans.
[0072] In this embodiment, the logistics address feature extraction method may also include a step of pre-building a text mapping dictionary. Specifically, pre-building a text mapping dictionary includes collecting multiple logistics address data, segmenting the logistics address data, and adding a mapping relationship with an ID value to each word, and building a text mapping dictionary to be applied to the text mapping ID sequence process in step S200 when extracting logistics address features.
[0073] like Figure 2As shown, the step S300: the ID sequence is mapped into a vector sequence using an embedding layer. The embedding layer can be used to map the above ID sequence into a vector sequence [v1, v2, v3, v4, v5, v6, v7, v8]. The embedding layer is actually also a function mapping, which maps the ID into a vector sequence. The mapping logic in the embedding layer can be pre-trained using a sample ID sequence and a corresponding sample vector sequence. The mapping relationship between the ID sequence and the vector sequence can be pre-trained in the embedding layer. In step S300, after the ID sequence is input into the embedding layer, the embedding layer performs embedding to map the ID sequence into a vector sequence. Since the feature dimension represented by the ID is relatively high, the mapped vector sequence can be better applied to the interactive feature extraction in the interactive feature extraction model in step S400.
[0074] The interactive feature extraction model is used to extract the interactive features of the input vector sequence as the feature representation of the logistics address. In this embodiment, the interactive feature extraction model is a transformer model. The transformer model is a seq2seq model, which includes an encoding layer and a decoding layer. Specifically, in this embodiment, the encoding layer of the transformer model includes a position encoding layer, a self-attention layer and a feedforward network layer, and the decoding layer may also include the same structure as the encoding layer, that is, including a position encoding layer, a self-attention layer and a feedforward network layer. Only one implementation method of the interactive feature extraction model is listed here, but the present invention is not limited to this. In other embodiments, other types of interactive feature extraction models may also be selected, such as using convolutional neural networks for feature extraction, etc., which are all within the scope of protection of the present invention.
[0075] Text sequence is a kind of time-series data, and the order relationship between words often affects the meaning of the entire sentence. If the self-attention layer in the Transformer model is not clear about the position information between words, it cannot learn the order information of words in the sequence, so a position encoding layer is added to the Transformer model. The position encoding layer in the Transformer model can use absolute position encoding, that is, an absolute value is given to each dimension of each word, and the model can obtain the encoding information without learning. In the encoding layer, the self-attention layer performs an embedding operation on the input data and then sends the data to the feedforward network layer. The calculation of the feedforward network layer can be parallel, and the output obtained will be input to the next encoding layer.
[0076] Before the interactive feature extraction model is put into use, it can also be trained using a pre-collected sample training set. For example, a public data set can be used to pre-train the interactive feature extraction model, and then historical receipt data can be collected, from which logistics address data can be extracted and input into the pre-trained interactive feature extraction model to obtain pre-annotated address features. The pre-annotated address features can be manually fine-tuned and corrected, and then the interactive feature extraction model can be fine-tuned based on the fine-tuned and corrected address features to obtain an interactive feature extraction model with accurate feature extraction that can be put into use.
[0077] Since in step S100, after the information corresponding to each attribute of the logistics address is concatenated to obtain a text string, the second identification character is added to the text string. In step S400, the address feature is extracted from the output data of the interactive feature extraction model, including the following steps:
[0078] Obtaining interactive features output by the interactive feature extraction model;
[0079] The feature vector corresponding to the second identification character is extracted from the interaction feature as the extracted address feature. For example, when the second identification character is a placeholder character [CLS], in step S400, the vector corresponding to the placeholder [CLS] is extracted as the extracted address feature, that is, the logistics address representation.
[0080] In this embodiment, after the logistics address feature extraction is realized by adopting the above steps S100 to S400, the extracted logistics address feature can also be applied to the downstream business model, for example, it can be applied to the distribution task allocation model. Today, as the logistics and transportation industry develops faster and faster, the transportation pressure of the logistics industry is also increasing. How to conveniently and quickly allocate distribution tasks to corresponding distribution outlets and delivery personnel during distribution has also become a very concerned issue. The present invention extracts the logistics address features in the historical receipt data based on the above steps S100 to S400, and then inputs them into the constructed distribution task allocation model for model training, so as to obtain a distribution task allocation model based on machine learning. The input of the distribution task allocation model is the address feature, and the output is the predicted distribution outlet or delivery personnel. It can realize the rapid allocation of distribution tasks based on machine learning, which greatly reduces the pressure of logistics data processing.
[0081] Specifically, when applied to the training of the delivery task allocation model, the address data collected in step S100 is the address data in the historical receipt data, and the historical receipt data also includes the name of the delivery outlet and / or the name of the delivery person, which is used to add sample labels to the address data features.
[0082] like Figure 3As shown, after the step S400: extracting address features from the output data of the interactive feature extraction model, the following steps are also included:
[0083] S510: adding logistics address features extracted from historical delivery data to a training set;
[0084] S520: collecting the delivery information corresponding to the address feature, adding a delivery task allocation tag to the address feature, when the delivery task allocation model is applied to the allocation of delivery outlets, the delivery task allocation tag added here includes the allocated delivery outlets, and when the delivery task allocation model is applied to the allocation of delivery personnel, the delivery task allocation tag added here includes the allocated delivery personnel;
[0085] S530: training a delivery task allocation model based on the address features in the training set, wherein the input data of the delivery task allocation model includes address features, and the output data includes delivery task allocation objects. Specifically, after the address features are extracted from the collected historical receipt data through steps S100 to S400, the data is input into the delivery task allocation model to obtain the delivery objects (including delivery outlets and / or delivery personnel) predicted by the delivery task allocation model, and then a loss function is constructed based on the delivery objects predicted by the delivery task allocation model and the delivery task allocation labels, and the delivery task allocation model is iteratively trained based on the loss function until the loss function is less than a preset threshold.
[0086] In this embodiment, the delivery task allocation model may be one or more delivery task allocation models, for example, a first delivery task allocation model and / or a second delivery task allocation model, the output data of the first delivery task allocation model includes delivery outlets, and the second delivery task allocation model includes delivery personnel. In another alternative implementation, the delivery task allocation model may also be combined with the information of delivery personnel of multiple delivery outlets to achieve joint training, and the same delivery task allocation model may be used to allocate delivery tasks among delivery personnel of multiple delivery outlets.
[0087] Furthermore, the address features extracted in steps S100 to S400 can also be applied to task allocation after the delivery task allocation model is trained. At this time, the address data extracted in step S100 is the logistics address data corresponding to the delivery task to be allocated. After extracting the address features through steps S100 to S400, continue to step S540: input the logistics address features corresponding to the delivery task to be allocated into the trained delivery task allocation model, and then S550: obtain the output of the delivery task model, thereby obtaining the delivery task allocation object predicted by the delivery task allocation model, such as the delivery outlet and / or delivery person who undertakes this delivery task.
[0088] In another embodiment, the address features extracted in step S400 can also be applied to the training and application of a language model. The language model can be used to predict the language text for a detailed address, and predict the next word based on the previous word input, so as to achieve accurate processing of ambiguous addresses. When the logistics address is filled in incorrectly or unclearly, the language model can be used to predict a complete and accurate logistics address, further reducing the burden of logistics data processing.
[0089] When the features extracted in steps S100 to S400 are applied to the training of the language model, the logistics address data collected in step S100 is the logistics address data in the historical receipt data. Figure 4 As shown, after the step S400: extracting address features from the output data of the interactive feature extraction model, the following steps are also included:
[0090] S610: constructing a training sample set of a language model based on the address features;
[0091] S620: The language model is trained using the training sample set, wherein the input data of the language model includes a first address local feature, and the output data includes a second address local feature associated with the first address local feature. A loss function is constructed based on the output data of the language model and the complete address feature, and the language model is iteratively trained based on the constructed loss function until the loss function of the language model is less than a preset threshold, thereby obtaining a trained language model that can be put into use.
[0092] When the features extracted in steps S100 to S400 are applied to the prediction of the language model, the logistics address data collected in step S100 is the logistics address data to be processed, for example, logistics address data that may have some missing information. After the logistics address features are extracted from the logistics address data through steps S100 to S400, step S630 is continued: the logistics address features to be processed are input into the language model, and the logistics address features are improved according to the output of the language module to obtain the logistics address features including the original logistics address features and the predicted completed logistics address features.
[0093] like Figure 5 As shown, an embodiment of the present invention further provides a logistics address feature extraction system, which is applied to the logistics address feature extraction method, and the system includes:
[0094] The character acquisition module M100 is used to concatenate the information corresponding to each attribute of the logistics address to obtain a text string, wherein the attributes include province, city, district, detailed address, etc., and the detailed address may be further distinguished to include attributes such as street, building number, house number, etc.;
[0095] An ID mapping module M200, used for mapping the text string into an ID sequence based on a text mapping dictionary, wherein the text mapping dictionary includes a mapping relationship between various attribute values of various preset attributes and IDs;
[0096] A vector mapping module M300, used to map the ID sequence into a vector sequence using an embedding layer;
[0097] The feature extraction module M400 is used to input the vector sequence into the interactive feature extraction model, and extract address features from the output data of the interactive feature extraction model.
[0098] The logistics address feature extraction system of the present invention adopts a unified text representation method based on pre-training. First, the information corresponding to each attribute of the logistics address is concatenated through the character acquisition module M100 to obtain a text string, and then the text is mapped to an ID sequence based on the pre-processed text mapping dictionary through the ID mapping module M200, and then the ID sequence is mapped to a vector sequence through the vector mapping module M300 using an embedding layer, and then the feature extraction module M400 performs feature extraction in the vector sequence to extract the logistics address features in a unified form, thereby realizing a unified representation after the address features are extracted, and the extracted logistics address features can be more conveniently applied to the downstream business model without causing waste in data use.
[0099] Similarly, the logistics address feature extraction system provided by the present invention can be deployed on the server of the e-commerce platform or the server of the logistics management center, or it can be deployed on a separate server. The separate server can communicate with the server of the e-commerce platform and / or the server of the logistics management center to realize logistics address feature extraction to provide data support for the application of downstream business models, but the present invention is not limited to this. Figure 5 The logistics address feature extraction system provided by the present invention is only schematically shown. Without violating the concept of the present invention, the splitting, merging and adding of modules are all within the protection scope of the present invention. The logistics address feature extraction system provided by the present invention can be implemented by software, hardware, firmware, plug-ins and any combination thereof, and the present invention is not limited thereto.
[0100] In this embodiment, the character acquisition module M100 can adopt the specific implementation of the above step S100 to obtain a text string. Specifically, the character acquisition module M100 concatenates the information corresponding to each attribute of the logistics address to obtain a text string, including: concatenating the information corresponding to each attribute of the logistics address, adding a first identification character between every two attribute information to obtain a text string, and adding a second identification character to the text string. For example, the first identification character can be [SEP], the second identification character can be [CLS], and the obtained text string can be: [CLS]+province+[SEP]+city+[SEP]+district+[SEP]+detailed address.
[0101] The ID mapping module M200 can adopt the specific implementation of the above step S200 to obtain the ID sequence. Specifically, the ID mapping module M200 maps the text string to an ID sequence based on a text mapping dictionary, including mapping the text string to an ID sequence based on the text mapping dictionary in the preprocessing stage: [1,2,3,4,3,5,3,6]. The length of the ID sequence can be set as needed, and each position in the ID sequence corresponds to a specific attribute, for example, the first position in the ID sequence corresponds to a province, the second position corresponds to a city, etc.
[0102] The vector mapping module M300 can adopt the specific implementation of the above step S300 to obtain the vector sequence. Specifically, the vector mapping module M300 maps the ID sequence to a vector sequence using an embedding layer, and can use the embedding layer to map the above ID sequence to a vector sequence [v1, v2, v3, v4, v5, v6, v7, v8]. The embedding layer is actually also a function mapping, which maps the ID into a vector sequence. The mapping logic in the embedding layer can be pre-trained using a sample ID sequence and a corresponding sample vector sequence.
[0103] The feature extraction module M400 can extract address features using the specific implementation of the above-mentioned step S400. Specifically, the feature extraction module M400 extracts address features from the output data of the interactive feature extraction model, including: the feature extraction module M400 obtains the interactive features output by the interactive feature extraction model, and extracts the feature vector corresponding to the second identification character from the interactive features as the extracted address features. In this embodiment, the interactive feature extraction model is a transformer model, and the transformer model includes a position encoding layer, a self-attention layer, and a feedforward network layer, but the present invention is not limited to this. In other implementations, other types of interactive feature extraction models can also be selected, such as using convolutional neural networks for feature extraction, etc., which are all within the protection scope of the present invention.
[0104] An embodiment of the present invention also provides a logistics address feature extraction device, comprising a processor; a memory, in which executable instructions of the processor are stored; wherein the processor is configured to execute the steps of the logistics address feature extraction method by executing the executable instructions.
[0105] It will be appreciated by those skilled in the art that various aspects of the present invention may be implemented as systems, methods or program products. Therefore, various aspects of the present invention may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software implementations, which may be collectively referred to herein as "circuits", "modules" or "platforms".
[0106] Refer to the following Figure 6 The electronic device 600 according to this embodiment of the present invention is described. Figure 6 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0107] like Figure 6 As shown, the electronic device 600 is in the form of a general computing device. The components of the electronic device 600 may include, but are not limited to: at least one processing unit 610, at least one storage unit 620, a bus 630 connecting different system components (including the storage unit 620 and the processing unit 610), a display unit 640, etc.
[0108] The storage unit stores program codes, which can be executed by the processing unit 610, so that the processing unit 610 performs the steps of various exemplary embodiments of the present invention described in the logistics address feature extraction method section of this specification. For example, the processing unit 610 can perform the following steps: Figure 1 Follow the steps shown in .
[0109] The storage unit 620 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 6201 and / or a cache memory unit 6202 , and may further include a read-only memory unit (ROM) 6203 .
[0110] The storage unit 620 may also include a program / utility 6204 having a set (at least one) of program modules 6205, such program modules 6205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include the implementation of a network environment.
[0111] Bus 630 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0112] The electronic device 600 may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 600, and / or communicate with any device that enables the electronic device 600 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 650. Furthermore, the electronic device 600 may also communicate with one or more networks (e.g., a local area network (LAN), a wide area network (WAN), and / or a public network, such as the Internet) via a network adapter 660. The network adapter 660 may communicate with other modules of the electronic device 600 via a bus 630. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 600, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0113] In the logistics address feature extraction device, the program in the memory implements the steps of the logistics address feature extraction method when executed by the processor. Therefore, the computer storage medium can also obtain the technical effect of the above-mentioned logistics address feature extraction method.
[0114] The embodiment of the present invention also provides a computer-readable storage medium for storing a program, which implements the steps of the logistics address feature extraction method when executed. In some possible implementations, various aspects of the present invention can also be implemented in the form of a program product, which includes a program code. When the program product is executed on a terminal device, the program code is used to enable the terminal device to execute the steps of various exemplary embodiments of the present invention described in the above-mentioned logistics address feature extraction method section of this specification.
[0115] refer to Figure 7 As shown, a program product 800 for implementing the above method according to an embodiment of the present invention is described, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be executed on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, an apparatus or a device.
[0116] The program product may use any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples (non-exhaustive list) of readable storage media 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.
[0117] The computer readable storage medium may include a data signal propagated in a baseband or as part of a carrier wave, wherein a readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The readable storage medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by an instruction execution system, an apparatus, or a device or used in combination with it. The program code contained on the readable storage medium may be transmitted with any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the above.
[0118] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., through the Internet using an Internet service provider).
[0119] When the program in the computer storage medium is executed by the processor, the steps of the logistics address feature extraction method are implemented. Therefore, the computer storage medium can also obtain the technical effect of the above-mentioned logistics address feature extraction.
[0120] The above contents are further detailed descriptions of the present invention in combination with specific preferred embodiments, and it cannot be determined that the specific implementation of the present invention is limited to these descriptions. For ordinary technicians in the technical field to which the present invention belongs, several simple deductions or substitutions can be made without departing from the concept of the present invention, which should be regarded as falling within the protection scope of the present invention.
Claims
1. A method for extracting features of a logistics address, characterized in that: The method comprises: Concatenate the information corresponding to each attribute of the logistics address to obtain a text string, wherein each attribute of the logistics address includes provincial level, municipal level, district level and detailed address; Mapping the text string into an ID sequence based on a text mapping dictionary, wherein the text mapping dictionary includes mapping relationships between various attribute values of various preset attributes and IDs; Mapping the ID sequence into a vector sequence using an embedding layer; Inputting the vector sequence into an interactive feature extraction model, and extracting address features from output data of the interactive feature extraction model; The step of concatenating the information corresponding to each attribute of the logistics address to obtain a text string includes: sequentially concatenating the information corresponding to each attribute of the logistics address in the order of provincial level, municipal level, district level and detailed address, and adding a first identification character between each two attribute information to obtain a text string; After the information of the logistics address corresponding to each attribute is concatenated to obtain a text string, the method further includes adding a second identification character to the text string; Extracting address features from the output data of the interactive feature extraction model comprises the following steps: Obtaining interactive features output by the interactive feature extraction model; A feature vector corresponding to the second identification character is extracted from the interaction feature as an extracted address feature.
2. The method for extracting features of a logistics address according to claim 1, characterized in that: The interactive feature extraction model is a transformer model, including a position encoding layer, a self-attention layer and a feedforward network layer.
3. The method for extracting features of a logistics address according to claim 1, characterized in that: Before the information of the logistics address corresponding to each attribute is concatenated to obtain a text string, the following steps are also included: Collect logistics address data to be processed; Cleaning the logistics address data according to preset cleaning rules; The logistics address data after data cleaning is classified to obtain information corresponding to each attribute of the logistics address data.
4. The method for extracting features of a logistics address according to claim 1, characterized in that: After extracting the address features from the output data of the interactive feature extraction model, the following steps are also included: Collecting the delivery information corresponding to the address feature and adding a delivery task allocation tag to the address feature; A delivery task allocation model is trained based on the address features, wherein input data of the delivery task allocation model includes address features, and output data includes delivery task allocation objects.
5. The method for extracting features of a logistics address according to claim 4, characterized in that: The delivery task allocation model includes a first delivery task allocation model and / or a second delivery task allocation model, the output data of the first delivery task allocation model includes delivery outlets, and the second delivery task allocation model includes delivery personnel.
6. The method for extracting features of a logistics address according to claim 1, characterized in that: After extracting the address features from the output data of the interactive feature extraction model, the following steps are also included: Constructing a training sample set of a language model based on the address features; The language model is trained using the training sample set, wherein input data of the language model includes a first address local feature, and output data includes a second address local feature associated with the first address local feature.
7. The method for extracting features of a logistics address according to claim 1, characterized in that: It also includes collecting multiple logistics address data, segmenting the logistics address data, and building a text mapping dictionary.
8. A logistics address feature extraction system, characterized in that: The method for extracting features of a logistics address applied to any one of claims 1 to 7, the system comprising: A character acquisition module, used to concatenate information corresponding to various attributes of the logistics address to obtain a text string, wherein the various attributes of the logistics address include provincial level, municipal level, district level and detailed address; An ID mapping module, used for mapping the text string into an ID sequence based on a text mapping dictionary, wherein the text mapping dictionary includes a mapping relationship between various attribute values of various preset attributes and IDs; A vector mapping module, used to map the ID sequence into a vector sequence using an embedding layer; A feature extraction module, used for inputting the vector sequence into an interactive feature extraction model, and extracting address features from output data of the interactive feature extraction model; The step of concatenating the information corresponding to each attribute of the logistics address to obtain a text string includes: sequentially concatenating the information corresponding to each attribute of the logistics address in the order of provincial level, municipal level, district level and detailed address, and adding a first identification character between each two attribute information to obtain a text string; After the information of the logistics address corresponding to each attribute is concatenated to obtain a text string, the method further includes adding a second identification character to the text string; Extracting address features from the output data of the interactive feature extraction model comprises the following steps: Obtaining interactive features output by the interactive feature extraction model; A feature vector corresponding to the second identification character is extracted from the interaction feature as an extracted address feature.
9. An electronic device, characterized in that: The electronic device comprises: processor; A memory having a computer program stored thereon, wherein the computer program, when executed by the processor, executes the logistics address feature extraction method according to any one of claims 1 to 7.
10. A computer storage medium, characterized in that: A computer program is stored, and when the computer program is run by a processor, the logistics address feature extraction method according to any one of claims 1 to 7 is executed.
Citation Information
Patent Citations
Method and device for automatically classifying and distributing city events based on depth learning
CN109325116A
A method, apparatus and machine-readable medium for determine logistics object
CN109389270A
A mailing address coding method based on administrative division
CN109408781A
Text data processing method, device and equipment
CN110032730A
Address information feature extraction method based on deep neural network model
CN110377686A
